www in docker support

This commit is contained in:
MaddoScientisto 2026-04-22 18:41:37 +02:00
commit c227fce036
2145 changed files with 399596 additions and 58 deletions

View file

@ -0,0 +1,297 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class Accessorio extends _ArtAdapter implements Serializable {
private static final long serialVersionUID = 805633752521639067L;
private long id_accessorio;
private long id_articoloAssociato;
private Articolo articoloAssociato;
private TipoAccessorio tipoAccessorioAssociato;
private ArticoloVariante articoloVariante;
private long id_articolo;
private long id_articoloVariante;
private long id_articoloVarianteAssociato;
private Articolo articolo;
private ArticoloVariante articoloVarianteAssociato;
private long flgEstendiVariante;
public Accessorio(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Accessorio() {}
public void setId_accessorio(long newId_accessorio) {
this.id_accessorio = newId_accessorio;
setTipoAccessorioAssociato(null);
}
public void setId_articoloAssociato(long newId_articolo) {
this.id_articoloAssociato = newId_articolo;
setArticoloAssociato(null);
}
public long getId_articoloAssociato() {
return this.id_articoloAssociato;
}
public void setArticoloAssociato(Articolo newArticolo) {
this.articoloAssociato = newArticolo;
}
public Articolo getArticoloAssociato() {
this.articoloAssociato = (Articolo)getSecondaryObject(this.articoloAssociato, Articolo.class,
getId_articoloAssociato());
return this.articoloAssociato;
}
protected void deleteCascade() {}
public Vectumerator<Accessorio> findByCR(AccessorioCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ACCESSORIO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public long getId_accessorio() {
return this.id_accessorio;
}
public TipoAccessorio getTipoAccessorioAssociato(long l_id) {
if (this.tipoAccessorioAssociato == null && getId_accessorio() != 0L)
this
.tipoAccessorioAssociato = getArticoloAssociato(l_id).getTipoAccessorio();
return (this.tipoAccessorioAssociato == null) ? new TipoAccessorio(getApFull()) :
this.tipoAccessorioAssociato;
}
public void setTipoAccessorioAssociato(TipoAccessorio newTipoAccessorio) {
this.tipoAccessorioAssociato = newTipoAccessorio;
}
public Vectumerator<Accessorio> findById_articolo(long l_id_articolo, long l_id_tipoAccessorio, long l_id_tipoAcc, long l_flgEscludiWeb, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* , B.nome from ACCESSORIO AS A, ARTICOLO AS B, TIPO_ACCESSORIO AS T";
String s_Sql_Order = " order by B.nome";
WcString wc = new WcString();
wc.addWc("A.id_articolo=B.id_articolo");
wc.addWc("((A.id_articolo=" + l_id_articolo + " and (T.flgDirezione=0 or T.flgDirezione is null or T.flgDirezione=1 )) or (id_articoloAssociato=" + l_id_articolo + " and (T.flgDirezione=0 or T.flgDirezione is null )))");
if (l_id_tipoAccessorio > 0L)
wc.addWc("B.id_tipoAccessorio=" + l_id_tipoAccessorio);
if (l_id_tipoAcc > 0L) {
s_Sql_Find = s_Sql_Find + ", TIPO AS C";
wc.addWc("B.id_tipo=C.id_tipo");
wc.addWc("(B.id_tipo=" + l_id_tipoAcc + " or C.indici like'%:" + l_id_tipoAcc + ":%')");
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
Vectumerator<Accessorio> vec = findRows(stmt, pageNumber, pageRows);
if (l_flgEscludiWeb >= 0L) {
Vectumerator<Accessorio> res = new Vectumerator();
while (vec.hasMoreElements()) {
Accessorio row = (Accessorio)vec.nextElement();
System.out.println(row.getArticoloAssociato(l_id_articolo)
.getNome());
if (row.getArticoloAssociato(l_id_articolo)
.getFlgEscludiWeb() == l_flgEscludiWeb)
res.add(row);
}
return res;
}
return vec;
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator<Accessorio> findById_articoloVariante(long l_id_articoloVariante, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ACCESSORIO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("(id_articoloVariante=" + l_id_articoloVariante + " or id_articoloVarianteAssociato=" + l_id_articoloVariante + ")");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator<Accessorio> findById_articoloVarianteDisponibile(long l_id_articoloVariante, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ACCESSORIO AS A, DISPONIBILITA AS C";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_articoloVarianteAssociato=C.id_articoloVarianteD");
wc.addWc("A.id_articoloVariante=" + l_id_articoloVariante);
wc.addWc("C.quantitaD>0");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public String getDirezione(long l_id) {
if (getDBState() == 0)
return TipoAccessorio.getDirezione(99L);
if (getTipoAccessorioAssociato(l_id).getFlgDirezione() == 0L)
return getTipoAccessorioAssociato(l_id).getDirezione();
if (l_id == getId_articolo() || l_id ==
getId_articoloVariante())
return getTipoAccessorioAssociato(l_id).getDirezione();
if (l_id == getId_articoloAssociato() || l_id ==
getId_articoloVarianteAssociato())
return
TipoAccessorio.getDirezione(
-getTipoAccessorioAssociato(l_id).getFlgDirezione());
return "???";
}
public void setArticolo(Articolo articolo) {
this.articolo = articolo;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setId_articolo(long id_articolo) {
this.id_articolo = id_articolo;
setArticolo(null);
}
public ArticoloVariante getArticoloVariante() {
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class,
getId_articoloVariante());
return this.articoloVariante;
}
public void setArticoloVariante(ArticoloVariante articoloVariante) {
this.articoloVariante = articoloVariante;
}
public ArticoloVariante getArticoloVarianteAssociato() {
this.articoloVarianteAssociato = (ArticoloVariante)getSecondaryObject(this.articoloVarianteAssociato, ArticoloVariante.class,
getId_articoloVarianteAssociato());
return this.articoloVarianteAssociato;
}
public void setArticoloVarianteAssociato(ArticoloVariante articoloVarianteAssociato) {
this.articoloVarianteAssociato = articoloVarianteAssociato;
}
public long getId_articoloVariante() {
return this.id_articoloVariante;
}
public void setId_articoloVariante(long id_articoloVariante) {
this.id_articoloVariante = id_articoloVariante;
setArticoloVariante(null);
}
public long getId_articoloVarianteAssociato() {
return this.id_articoloVarianteAssociato;
}
public void setId_articoloVarianteAssociato(long id_articoloVarianteAssociato) {
this.id_articoloVarianteAssociato = id_articoloVarianteAssociato;
setArticoloVarianteAssociato(null);
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
public long getId_articoloAssociato(long l_id) {
if (l_id == getId_articoloAssociato())
return getId_articolo();
if (l_id == getId_articolo())
return getId_articoloAssociato();
return 0L;
}
public void findById_articoloId_associato(long l_id_articolo, long l_id_articoloAssociato) {
String s_Sql_Find = "select A.* from ACCESSORIO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("((id_articolo=" + l_id_articolo + " and id_articoloAssociato=" + l_id_articoloAssociato + ") or(id_articolo=" + l_id_articoloAssociato + " and id_articoloAssociato=" + l_id_articolo + "))");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public Articolo getArticoloAssociato(long l_id) {
if (l_id == getId_articoloAssociato())
return getArticolo();
if (l_id == getId_articolo())
return getArticoloAssociato();
return new Articolo(getApFull());
}
public Vectumerator<Accessorio> findById_articoloAssociati(long l_id_articolo, boolean flgDisponibile, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ACCESSORIO AS A, TIPO_ACCESSORIO AS B";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("((A.id_articolo=" + l_id_articolo + " and (B.flgDirezione=0 or B.flgDirezione is null or B.flgDirezione=1 )) or (id_articoloAssociato=" + l_id_articolo + " and (B.flgDirezione=0 or B.flgDirezione is null )))");
if (flgDisponibile) {
s_Sql_Find = s_Sql_Find + ", ARTICOLO AS C";
wc.addWc("A.id_articolo=C.id_articolo or A.id_articoloAssocioato=C.id_articolo");
wc.addWc("C.nColliArt>0");
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public long getFlgEstendiVariante() {
return this.flgEstendiVariante;
}
public void setFlgEstendiVariante(long flgEstendiVariante) {
this.flgEstendiVariante = flgEstendiVariante;
}
}

View file

@ -0,0 +1,56 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class AccessorioCR extends CRAdapter {
private long id_accessorio;
private long id_articolo;
private long flgTipo;
private Articolo articolo;
public AccessorioCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public AccessorioCR() {}
public void setId_accessorio(long newId_accessorio) {
this.id_accessorio = newId_accessorio;
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public void setFlgTipo(long newFlgTipo) {
this.flgTipo = newFlgTipo;
}
public long getId_accessorio() {
return this.id_accessorio;
}
public long getId_articolo() {
return this.id_articolo;
}
public long getFlgTipo() {
return this.flgTipo;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
}

View file

@ -0,0 +1,168 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.File;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class AllegatoArticolo extends _ArtAdapter implements Serializable {
private long id_allegatoArticolo;
private String nomeFile;
private long id_articolo;
private Articolo articolo;
private long id_tipoAllegatoArticolo;
private TipoAllegatoArticolo tipoAllegatoArticolo;
private String descrizioneAllegato;
public AllegatoArticolo(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public AllegatoArticolo() {}
public void setId_allegatoArticolo(long newId_allegato) {
this.id_allegatoArticolo = newId_allegato;
}
public void setNomeFile(String newNomeFile) {
this.nomeFile = newNomeFile;
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public long getId_allegatoArticolo() {
return this.id_allegatoArticolo;
}
public String getNomeFile() {
return (this.nomeFile == null) ? "" : this.nomeFile;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
return this.articolo;
}
protected void deleteCascade() {
new File(getNomeFileCompleto()).delete();
}
public Vectumerator findByCR(AllegatoArticoloCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ALLEGATO_ARTICOLO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator findByArticoloTipo(long l_id_articolo, long l_id_tipoAllegatoDocumento, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ALLEGATO_ARTICOLO AS A";
String s_Sql_Order = " order by A.nomeFile";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
if (l_id_tipoAllegatoDocumento > 0L)
wc.addWc("A.id_tipoAllegatoDocumento=" + l_id_tipoAllegatoDocumento);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByArticoloNomeFile(long l_id_articolo, String l_id_nomeFile) {
String s_Sql_Find = "select A.* from ALLEGATO_ARTICOLO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
wc.addWc("A.nomeFile='" + l_id_nomeFile + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public String getNomeFileCompleto() {
return getNomeFileCompleto(getArticolo().getPathAllegato());
}
public String getNomeFileCompleto(String l_path) {
return l_path + l_path + "_" + getId_articolo();
}
public long getId_tipoAllegatoArticolo() {
return this.id_tipoAllegatoArticolo;
}
public TipoAllegatoArticolo getTipoAllegatoArticolo() {
this.tipoAllegatoArticolo = (TipoAllegatoArticolo)getSecondaryObject(this.tipoAllegatoArticolo, TipoAllegatoArticolo.class,
getId_tipoAllegatoArticolo());
return this.tipoAllegatoArticolo;
}
public void setId_tipoAllegatoArticolo(long newId_tipoAllegatoArticolo) {
this.id_tipoAllegatoArticolo = newId_tipoAllegatoArticolo;
setTipoAllegatoArticolo(null);
}
public void setTipoAllegatoArticolo(TipoAllegatoArticolo newTipoAllegatoArticolo) {
this.tipoAllegatoArticolo = newTipoAllegatoArticolo;
}
public String getNomeFileSuDisco() {
return "" + getId_articolo() + "_" + getId_articolo();
}
public String getDescrizioneAllegato() {
return (this.descrizioneAllegato == null) ? "" : this.descrizioneAllegato;
}
public void setDescrizioneAllegato(String descrizioneAllegato) {
this.descrizioneAllegato = descrizioneAllegato;
}
protected int getStringValueCase(String l_colomnName) {
return 0;
}
}

View file

@ -0,0 +1,80 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class AllegatoArticoloCR extends CRAdapter {
private long id_allegato;
private String nomeFile;
private long id_articolo;
private Articolo articolo;
private long id_tipoAllegatoArticolo;
private TipoAllegatoArticolo tipoAllegatoArticolo;
public AllegatoArticoloCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public AllegatoArticoloCR() {}
public void setId_allegato(long newId_allegato) {
this.id_allegato = newId_allegato;
}
public void setNomeFile(String newNomeFile) {
this.nomeFile = newNomeFile;
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public long getId_allegato() {
return this.id_allegato;
}
public String getNomeFile() {
return (this.nomeFile == null) ? "" : this.nomeFile;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
public long getId_tipoAllegatoArticolo() {
return this.id_tipoAllegatoArticolo;
}
public TipoAllegatoArticolo getTipoAllegatoArticolo() {
this.tipoAllegatoArticolo = (TipoAllegatoArticolo)getSecondaryObject(this.tipoAllegatoArticolo, TipoAllegatoArticolo.class,
getId_tipoAllegatoArticolo());
return this.tipoAllegatoArticolo;
}
public void setId_tipoAllegatoArticolo(long newId_tipoAllegatoArticolo) {
this.id_tipoAllegatoArticolo = newId_tipoAllegatoArticolo;
setTipoAllegatoArticolo(null);
}
public void setTipoAllegatoArticolo(TipoAllegatoArticolo newTipoAllegatoArticolo) {
this.tipoAllegatoArticolo = newTipoAllegatoArticolo;
}
}

View file

@ -0,0 +1,228 @@
package it.acxent.art;
import it.acxent.anag.Nazione;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.DoubleOperator;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class AmzFeaturedPrice extends DBAdapter implements Serializable {
private static final long serialVersionUID = 1681244662207L;
private long id_amzFeaturedPrice;
private long id_articolo;
private String lang;
private double featuredOEPriceAmz;
private double competingFOPriceAmz;
private double currentFOPriceAmz;
private double currentPriceAmz;
private Date dataPriceAmz;
private long flgPrezzoCompetitivoAmz;
private long flgPrezzoCompetitivo;
private Articolo articolo;
public AmzFeaturedPrice(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public AmzFeaturedPrice() {}
public void setId_amzFeaturedPrice(long newId_amzFeaturedPrice) {
this.id_amzFeaturedPrice = newId_amzFeaturedPrice;
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public void setLang(String newLang) {
this.lang = newLang;
}
public void setFeaturedOEPriceAmz(double newFeaturedOEPriceAmz) {
this.featuredOEPriceAmz = newFeaturedOEPriceAmz;
}
public void setCompetingFOPriceAmz(double newCompetingFOPriceAmz) {
this.competingFOPriceAmz = newCompetingFOPriceAmz;
}
public void setCurrentFOPriceAmz(double newCurrentFOPriceAmz) {
this.currentFOPriceAmz = newCurrentFOPriceAmz;
}
public void setCurrentPriceAmz(double newCurrentPriceAmz) {
this.currentPriceAmz = newCurrentPriceAmz;
}
public long getId_amzFeaturedPrice() {
return this.id_amzFeaturedPrice;
}
public long getId_articolo() {
return this.id_articolo;
}
public String getLang() {
return (this.lang == null) ? "" : this.lang.trim();
}
public double getFeaturedOEPriceAmz() {
return this.featuredOEPriceAmz;
}
public double getCompetingFOPriceAmz() {
return this.competingFOPriceAmz;
}
public double getCurrentFOPriceAmz() {
return this.currentFOPriceAmz;
}
public double getCurrentPriceAmz() {
return this.currentPriceAmz;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
return this.articolo;
}
protected ResParm checkDeleteCascade() {
return new ResParm(true);
}
protected void deleteCascade() {}
public Vectumerator<AmzFeaturedPrice> findByCR(AmzFeaturedPriceCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from AMZ_FEATURED_PRICE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByArticoloLang(Articolo articolo, String lang) {
String s_Sql_Find = "select A.* from AMZ_FEATURED_PRICE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + articolo.getId_articolo());
wc.addWc("A.lang='" + lang + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
}
}
public boolean isMyPriceBetter(double thePrice) {
Double betterPrice = Double.MAX_VALUE;
if (getFeaturedOEPriceAmz() > 0.0D)
betterPrice = getFeaturedOEPriceAmz();
if (getCompetingFOPriceAmz() > 0.0D)
betterPrice = Math.min(betterPrice.doubleValue(), getCompetingFOPriceAmz());
if (getCurrentFOPriceAmz() > 0.0D)
betterPrice = Math.min(betterPrice.doubleValue(), getCurrentFOPriceAmz());
if (betterPrice == Double.MAX_VALUE)
return false;
if (thePrice <= betterPrice)
return true;
return false;
}
public boolean isMyPriceBetter() {
return isMyPriceBetter(getCurrentPriceAmz());
}
public boolean isCompetitivo() {
return (getFlgPrezzoCompetitivo() == 1L);
}
public boolean isCompetitivoAmz() {
return (getFlgPrezzoCompetitivoAmz() == 1L);
}
public Date getDataPriceAmz() {
return this.dataPriceAmz;
}
public void setDataPriceAmz(Date dataPriceAmz) {
this.dataPriceAmz = dataPriceAmz;
}
public long getFlgPrezzoCompetitivoAmz() {
return this.flgPrezzoCompetitivoAmz;
}
public void setFlgPrezzoCompetitivoAmz(long flgPrezzoCompetitivoAmz) {
this.flgPrezzoCompetitivoAmz = flgPrezzoCompetitivoAmz;
}
public long getFlgPrezzoCompetitivo() {
return this.flgPrezzoCompetitivo;
}
public void setFlgPrezzoCompetitivo(long flgPrezzoCompetitivo) {
this.flgPrezzoCompetitivo = flgPrezzoCompetitivo;
}
protected void prepareSave(PreparedStatement ps) throws SQLException {
setCurrentPriceAmz(getArticolo().getPrezzoArticoloAmazonSpedIva(getLang(), true, 1L));
setFlgPrezzoCompetitivoAmz(isMyPriceBetter(getCurrentPriceAmz()) ? 1L : 0L);
DoubleOperator prezzoPubblico = new DoubleOperator(getArticolo().getPrezzoPubblicoIva());
prezzoPubblico.setScale(2, 5);
Nazione nazione = new Nazione(getApFull());
String l_lang = getCurrentLang();
if (l_lang.isEmpty())
l_lang = "it";
nazione.findByCodice(l_lang);
prezzoPubblico.add(getArticolo().getDeliveryCost(nazione.getId_nazione()));
System.out.println("AMZFP Articolo:" + getArticolo().getCodiceEan() + " " + getCurrentPriceAmz() + " " +
getArticolo().getPrezzoArticoloAmazonSpedIva(getLang(), true, 1L) + " \n" + prezzoPubblico.getResult());
System.out.println("AMZFP comp cpmpamz:" + isCompetitivoAmz() + " " + isCompetitivoAmz());
setFlgPrezzoCompetitivo(isMyPriceBetter(prezzoPubblico.getResult()) ? 1L : 0L);
super.prepareSave(ps);
}
}

View file

@ -0,0 +1,96 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class AmzFeaturedPriceCR extends CRAdapter {
private long id_amzFeaturedPrice;
private long id_articolo;
private String lang;
private double featuredOEPriceAmz;
private double competingFOPriceAmz;
private double currentFOPriceAmz;
private double currentPriceAmz;
private Articolo articolo;
public AmzFeaturedPriceCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public AmzFeaturedPriceCR() {}
public void setId_amzFeaturedPrice(long newId_amzFeaturedPrice) {
this.id_amzFeaturedPrice = newId_amzFeaturedPrice;
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public void setLang(String newLang) {
this.lang = newLang;
}
public void setFeaturedOEPriceAmz(double newFeaturedOEPriceAmz) {
this.featuredOEPriceAmz = newFeaturedOEPriceAmz;
}
public void setCompetingFOPriceAmz(double newCompetingFOPriceAmz) {
this.competingFOPriceAmz = newCompetingFOPriceAmz;
}
public void setCurrentFOPriceAmz(double newCurrentFOPriceAmz) {
this.currentFOPriceAmz = newCurrentFOPriceAmz;
}
public void setCurrentPriceAmz(double newCurrentPriceAmz) {
this.currentPriceAmz = newCurrentPriceAmz;
}
public long getId_amzFeaturedPrice() {
return this.id_amzFeaturedPrice;
}
public long getId_articolo() {
return this.id_articolo;
}
public String getLang() {
return (this.lang == null) ? "" : this.lang.trim();
}
public double getFeaturedOEPriceAmz() {
return this.featuredOEPriceAmz;
}
public double getCompetingFOPriceAmz() {
return this.competingFOPriceAmz;
}
public double getCurrentFOPriceAmz() {
return this.currentFOPriceAmz;
}
public double getCurrentPriceAmz() {
return this.currentPriceAmz;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,121 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class ArticoloArticoloComponente extends _ArtAdapter implements Serializable {
private long id_articoloArticoloComponente;
private long id_articoloComponente;
private Articolo articolo;
private Articolo articoloComponente;
private long id_articolo;
public ArticoloArticoloComponente(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloArticoloComponente() {}
public long getId_articoloArticoloComponente() {
return this.id_articoloArticoloComponente;
}
public void setId_articoloArticoloComponente(long id_articoloComponente) {
this.id_articoloArticoloComponente = id_articoloComponente;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setId_articolo(long id_articolo) {
this.id_articolo = id_articolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
return this.articolo;
}
public Vectumerator findByArticolo(long id_articolo) {
String s_Sql_Find = "select A.* from ARTICOLO_ARTICOLO_COMPONENTE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("id_articolo = " + id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, 0, 0);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByArticoloArticoloComponente(long id_articolo, long id_articoloComponente) {
String s_Sql_Find = "select A.* from ARTICOLO_ARTICOLO_COMPONENTE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("id_articolo = " + id_articolo);
wc.addWc("id_articoloComponente = " + id_articoloComponente);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public double getPercTotale(long id_articolo) {
String s_Sql_Find = "select SUM(A.perc) AS _sum from ARTICOLO_COMPONENTE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("id_articolo = " + id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return getSum(stmt);
} catch (SQLException e) {
handleDebug(e);
return 0.0D;
}
}
public long getId_articoloComponente() {
return this.id_articoloComponente;
}
public void setId_articoloComponente(long id_articoloComponente) {
this.id_articoloComponente = id_articoloComponente;
setArticoloComponente(null);
}
public Articolo getArticoloComponente() {
this.articoloComponente = (Articolo)getSecondaryObject(this.articoloComponente, Articolo.class, getId_articoloComponente());
return this.articoloComponente;
}
public void setArticoloComponente(Articolo articoloComponente) {
this.articoloComponente = articoloComponente;
}
public Vectumerator findByArticoloComponente(long l_id_articoloComponente) {
String s_Sql_Find = "select A.* from ARTICOLO_ARTICOLO_COMPONENTE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("id_articoloComponente = " + l_id_articoloComponente);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, 0, 0);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
}

View file

@ -0,0 +1,40 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class ArticoloArticoloComponenteCR extends CRAdapter {
private long id_articoloComponente;
private long id_articolo;
private Articolo articolo;
public ArticoloArticoloComponenteCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloArticoloComponenteCR() {}
public long getId_articoloComponente() {
return this.id_articoloComponente;
}
public void setId_articoloComponente(long id_articoloComponente) {
this.id_articoloComponente = id_articoloComponente;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setId_articolo(long id_articolo) {
this.id_articolo = id_articolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,213 @@
package it.acxent.art;
import it.acxent.anag.Clifor;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class ArticoloCliente extends DBAdapter implements Serializable {
private static final long serialVersionUID = 1607681273276L;
private long id_articoloCliente;
private long id_clifor;
private long id_articolo;
private long id_articoloVariante;
private long id_tipo;
private String indiciTipo;
private Clifor clifor;
private Articolo articolo;
private ArticoloVariante articoloVariante;
private Tipo tipo;
public ArticoloCliente(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloCliente() {}
public void setId_articoloCliente(long newId_articoloCliente) {
this.id_articoloCliente = newId_articoloCliente;
}
public void setId_clifor(long newId_clifor) {
this.id_clifor = newId_clifor;
setClifor(null);
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public void setId_articoloVariante(long newId_articoloVariante) {
this.id_articoloVariante = newId_articoloVariante;
setArticoloVariante(null);
}
public void setId_tipo(long newId_tipo) {
this.id_tipo = newId_tipo;
setTipo(null);
}
public long getId_articoloCliente() {
return this.id_articoloCliente;
}
public long getId_clifor() {
return this.id_clifor;
}
public long getId_articolo() {
return this.id_articolo;
}
public long getId_articoloVariante() {
return this.id_articoloVariante;
}
public long getId_tipo() {
return this.id_tipo;
}
public void setClifor(Clifor newClifor) {
this.clifor = newClifor;
}
public Clifor getClifor() {
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class, getId_clifor());
return this.clifor;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
return this.articolo;
}
public void setArticoloVariante(ArticoloVariante newArticoloVariante) {
this.articoloVariante = newArticoloVariante;
}
public ArticoloVariante getArticoloVariante() {
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class, getId_articoloVariante());
return this.articoloVariante;
}
public void setTipo(Tipo newTipo) {
this.tipo = newTipo;
}
public Tipo getTipo() {
this.tipo = (Tipo)getSecondaryObject(this.tipo, Tipo.class, getId_tipo());
return this.tipo;
}
protected ResParm checkDeleteCascade() {
return new ResParm(true);
}
protected void deleteCascade() {}
public Vectumerator<ArticoloCliente> findByCR(ArticoloClienteCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ARTICOLO_CLIENTE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public String getDescrizioneCompleta() {
if (getId_tipo() > 0L)
return "Tipo: " + getTipo().getDescrizioneCompletaSpaces("it");
if (getId_articolo() > 0L)
return "Articolo: " + getArticolo().getDescrizioneCompleta();
if (getId_articoloVariante() > 0L)
return "Variante: " + getArticoloVariante().getDescrizioneCompleta();
return "Errore!!";
}
public Vectumerator<ArticoloCliente> findByClifor(long l_id_clifor) {
String s_Sql_Find = "select A.* from ARTICOLO_CLIENTE AS A LEFT JOIN TIPO AS T ON A.id_tipo=T.id_tipo left join ARTICOLO as AR on A.id_articolo=AR.id_articolo left join ARTICOLO_VARIANTE as AV on A.id_articoloVariante=AV.id_articoloVariante";
String s_Sql_Order = " order by T.descrizione, AR.nome, AV.nomeV\t";
WcString wc = new WcString();
wc.addWc("A.id_clifor=" + l_id_clifor);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public ResParm save() {
ResParm rp = super.save();
if (rp.getStatus())
if (getId_tipo() > 0L && !getTipo().isFoglia()) {
Vectumerator<Tipo> vec = getTipo().findFigli(0, 0);
while (vec.hasMoreElements()) {
Tipo row = (Tipo)vec.nextElement();
ArticoloCliente ac = new ArticoloCliente(getApFull());
ac.setId_clifor(getId_clifor());
ac.setId_tipo(row.getId_tipo());
ac.save();
}
}
return rp;
}
protected void prepareSave(PreparedStatement ps) throws SQLException {
if (getId_tipo() > 0L) {
setId_articolo(0L);
setId_articoloVariante(0L);
setIndiciTipo(getTipo().getIndici());
} else if (getId_articolo() > 0L) {
setId_articoloVariante(0L);
}
super.prepareSave(ps);
}
public String getIndiciTipo() {
return (this.indiciTipo == null) ? "" : this.indiciTipo;
}
public void setIndiciTipo(String indiciTipo) {
this.indiciTipo = indiciTipo;
}
}

View file

@ -0,0 +1,119 @@
package it.acxent.art;
import it.acxent.anag.Clifor;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class ArticoloClienteCR extends CRAdapter {
private long id_articoloCliente;
private long id_clifor;
private long id_articolo;
private long id_articoloVariante;
private long id_tipo;
private Clifor clifor;
private Articolo articolo;
private ArticoloVariante articoloVariante;
private Tipo tipo;
public ArticoloClienteCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloClienteCR() {}
public void setId_articoloCliente(long newId_articoloCliente) {
this.id_articoloCliente = newId_articoloCliente;
}
public void setId_clifor(long newId_clifor) {
this.id_clifor = newId_clifor;
setClifor(null);
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public void setId_articoloVariante(long newId_articoloVariante) {
this.id_articoloVariante = newId_articoloVariante;
setArticoloVariante(null);
}
public void setId_tipo(long newId_tipo) {
this.id_tipo = newId_tipo;
setTipo(null);
}
public long getId_articoloCliente() {
return this.id_articoloCliente;
}
public long getId_clifor() {
return this.id_clifor;
}
public long getId_articolo() {
return this.id_articolo;
}
public long getId_articoloVariante() {
return this.id_articoloVariante;
}
public long getId_tipo() {
return this.id_tipo;
}
public void setClifor(Clifor newClifor) {
this.clifor = newClifor;
}
public Clifor getClifor() {
this.clifor = (Clifor)getSecondaryObject(this.clifor, Clifor.class,
getId_clifor());
return this.clifor;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
public void setArticoloVariante(ArticoloVariante newArticoloVariante) {
this.articoloVariante = newArticoloVariante;
}
public ArticoloVariante getArticoloVariante() {
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class,
getId_articoloVariante());
return this.articoloVariante;
}
public void setTipo(Tipo newTipo) {
this.tipo = newTipo;
}
public Tipo getTipo() {
this.tipo = (Tipo)getSecondaryObject(this.tipo, Tipo.class,
getId_tipo());
return this.tipo;
}
}

View file

@ -0,0 +1,117 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class ArticoloComponente extends _ArtAdapter implements Serializable {
private long id_articoloComponente;
private long id_componente;
private long id_articolo;
private double perc;
private Articolo articolo;
private Componente componente;
public ArticoloComponente(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloComponente() {}
public long getId_articoloComponente() {
return this.id_articoloComponente;
}
public void setId_articoloComponente(long id_articoloComponente) {
this.id_articoloComponente = id_articoloComponente;
}
public long getId_componente() {
return this.id_componente;
}
public void setId_componente(long id_componente) {
this.id_componente = id_componente;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setId_articolo(long id_articolo) {
this.id_articolo = id_articolo;
}
public double getPerc() {
return this.perc;
}
public void setPerc(double perc) {
this.perc = perc;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
public Componente getComponente() {
this.componente = (Componente)getSecondaryObject(this.componente, Componente.class,
getId_componente());
return this.componente;
}
public Vectumerator findByArticolo(long id_articolo) {
String s_Sql_Find = "select A.* from ARTICOLO_COMPONENTE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("id_articolo = " + id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
return findRows(stmt, 0, 0);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByArticoloComponente(long id_articolo, long id_componente) {
String s_Sql_Find = "select A.* from ARTICOLO_COMPONENTE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("id_articolo = " + id_articolo);
wc.addWc("id_componente = " + id_componente);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public double getPercTotale(long id_articolo) {
String s_Sql_Find = "select SUM(A.perc) AS _sum from ARTICOLO_COMPONENTE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("id_articolo = " + id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
return getSum(stmt);
} catch (SQLException e) {
handleDebug(e);
return 0.0D;
}
}
}

View file

@ -0,0 +1,68 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class ArticoloComponenteCR extends CRAdapter {
private long id_articoloComponente;
private long id_componente;
private long id_articolo;
private double perc;
private Articolo articolo;
private Componente componente;
public ArticoloComponenteCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloComponenteCR() {}
public long getId_articoloComponente() {
return this.id_articoloComponente;
}
public void setId_articoloComponente(long id_articoloComponente) {
this.id_articoloComponente = id_articoloComponente;
}
public long getId_componente() {
return this.id_componente;
}
public void setId_componente(long id_componente) {
this.id_componente = id_componente;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setId_articolo(long id_articolo) {
this.id_articolo = id_articolo;
}
public double getPerc() {
return this.perc;
}
public void setPerc(double perc) {
this.perc = perc;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
public Componente getComponente() {
this.componente = (Componente)getSecondaryObject(this.componente, Componente.class,
getId_componente());
return this.componente;
}
}

View file

@ -0,0 +1,641 @@
package it.acxent.art;
import it.acxent.anag.Fornitore;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.tex.anag.ArticoloTessuto;
import it.acxent.tex.anag.ArticoloTessutoColore;
import it.acxent.util.DoubleOperator;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
public class ArticoloFornitore extends _ArtAdapter implements Serializable {
private static final long serialVersionUID = -3626607279516810249L;
private long id_clifor;
private String codiceFornitore;
private long id_articolo;
private double costo;
private double costoAggiuntivo;
private Articolo articolo;
private Fornitore fornitore;
private Date dataUltimoPrezzo;
private double costoVecchio;
private double costoSconto;
private long costoScontoQta;
private long dispCash;
private long dispSede;
private long flgPromo;
private long id_articoloTessuto;
private long id_articoloVariante;
private long id_articoloTessutoColore;
private ArticoloTessuto articoloTessuto;
private ArticoloTessutoColore articoloTessutoColore;
private ArticoloVariante articoloVariante;
private long id_articoloFornitore;
private long flgAbituale;
private double streetPrice;
private long dispTotR;
private long flgFuoriListino;
private Date dataInizioPromo;
private Date dataFinePromo;
private long flgControlloCostoAggAF;
private long flgEscludi;
public ArticoloFornitore(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloFornitore() {}
public void setId_clifor(long newId_fornitore) {
this.id_clifor = newId_fornitore;
setFornitore(null);
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public void setCosto(double newCosto) {
this.costo = newCosto;
}
public void setDataUltimoPrezzo(Date newDataUltimoPrezzo) {
this.dataUltimoPrezzo = newDataUltimoPrezzo;
}
public void setCostoVecchio(double newCostoVecchio) {
this.costoVecchio = newCostoVecchio;
}
public long getId_clifor() {
return this.id_clifor;
}
public long getId_fornitore() {
return this.id_clifor;
}
public long getId_articolo() {
return this.id_articolo;
}
public double getCosto() {
return this.costo;
}
public double getCostoTotale() {
if (getCostoAggiuntivo() == 0.0D)
return this.costo;
DoubleOperator dop = new DoubleOperator(getCosto());
dop.add(getCostoAggiuntivo());
return dop.getResult();
}
public Date getDataUltimoPrezzo() {
return this.dataUltimoPrezzo;
}
public double getCostoVecchio() {
return this.costoVecchio;
}
protected void deleteCascade() {}
public Vectumerator findByCR(ArticoloFornitoreCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from articolo_fornitore AS A";
String s_Sql_Order = "";
String wc = "";
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc);
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public String getCodiceFornitore() {
return (this.codiceFornitore == null) ? "" : this.codiceFornitore;
}
public void setCodiceFornitore(String string) {
this.codiceFornitore = string;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
return this.articolo;
}
public void setArticolo(Articolo articolo) {
this.articolo = articolo;
}
public Fornitore getFornitore() {
this.fornitore = (Fornitore)getSecondaryObject(this.fornitore, Fornitore.class, getId_clifor());
return this.fornitore;
}
public void setFornitore(Fornitore fornitore) {
this.fornitore = fornitore;
}
public Vectumerator findById_articolo(long l_id_articolo, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ARTICOLO_FORNITORE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public long getFlgFuoriListino() {
return this.flgFuoriListino;
}
public void setFlgFuoriListino(long flgFuoriListino) {
this.flgFuoriListino = flgFuoriListino;
}
private void updateArticoloFornitoreFuoriListino(long l_id_fornitore, Timestamp ts) {
String sql_String = "update ARTICOLO_FORNITORE set flgFuoriListino=1 ";
String wc = "";
wc = buildWc(wc, "id_fornitore=" + l_id_fornitore);
wc = buildWc(wc, "lastUpdTmst=?");
try {
PreparedStatement ps = getConn().prepareStatement(sql_String + sql_String);
ps.setTimestamp(1, ts);
update(ps);
} catch (SQLException e) {
handleDebug(e);
}
}
public void aggiornaCostiNuovi(ArticoloCR CR) {}
public double getCostoSconto() {
return this.costoSconto;
}
public void setCostoSconto(double costoSconto) {
this.costoSconto = costoSconto;
}
public long getCostoScontoQta() {
return this.costoScontoQta;
}
public void setCostoScontoQta(long costoScontoQta) {
this.costoScontoQta = costoScontoQta;
}
public long getDispCash() {
return this.dispCash;
}
public void setDispCash(long dispCash) {
this.dispCash = dispCash;
}
public long getDispSede() {
return this.dispSede;
}
public void setDispSede(long dispSede) {
this.dispSede = dispSede;
}
public double getRicarico() {
if (getCostoTotale() != 0.0D) {
DoubleOperator temp = new DoubleOperator(getArticolo().getPrezzoPubblico());
temp.setScale(4, 1);
temp.divide(getCostoTotale());
temp.subtract(1);
temp.multiply(100);
temp.setScale(4, 1);
return temp.getResult();
}
return 0.0D;
}
public double getCostoIvato() {
DoubleOperator temp = new DoubleOperator((float)getArticolo().getIva().getAliquota());
temp.setScale(4, 5);
temp.divide(100.0F);
temp.add(1);
temp.multiply(getCosto());
temp.setScale(2, 5);
return temp.getResult();
}
public double getCostoTotaleIvato() {
DoubleOperator temp = new DoubleOperator((float)getArticolo().getIva().getAliquota());
temp.setScale(4, 5);
temp.divide(100.0F);
temp.add(1);
temp.multiply(getCostoTotale());
temp.setScale(2, 5);
return temp.getResult();
}
public Vectumerator findById_articoloFornitore(long l_id_articolo, long l_id_fornitore, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ARTICOLO_FORNITORE AS A";
String s_Sql_Order = " order by A.lastUpdTmst desc";
WcString wc = new WcString();
wc.addWc("id_articolo=" + l_id_articolo);
if (l_id_fornitore != 0L)
wc.addWc("id_clifor=" + l_id_fornitore);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public long getFlgAbituale() {
return this.flgAbituale;
}
public void setFlgAbituale(long flgAbituale) {
this.flgAbituale = flgAbituale;
}
public ResParm deleteFlgAbitualeArticolo(long l_id_articolo) {
return update("UPDATE ARTICOLO_FORNITORE SET flgAbituale = 0 WHERE id_articolo = " + l_id_articolo);
}
public ResParm deleteFlgAbitualeArticoloTessuto(long l_id_articoloTessuto) {
return update("UPDATE ARTICOLO_FORNITORE SET flgAbituale = 0 WHERE id_articoloTessuto = " + l_id_articoloTessuto);
}
public void findByArticoloFornitoreAbituale(long l_id_articolo) {
String s_Sql_Find = "select A.* from ARTICOLO_FORNITORE AS A";
String s_Sql_Order = " order by A.lastUpdTmst desc";
WcString wc = new WcString();
wc.addWc("id_articolo=" + l_id_articolo);
wc.addWc("flgAbituale=1");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public long getId_articoloTessuto() {
return this.id_articoloTessuto;
}
public void setId_articoloTessuto(long id_articoloTessuto) {
this.id_articoloTessuto = id_articoloTessuto;
setArticoloTessuto(null);
}
public long getId_articoloVariante() {
return this.id_articoloVariante;
}
public void setId_articoloVariante(long id_articoloVariante) {
this.id_articoloVariante = id_articoloVariante;
setArticoloVariante(null);
}
public long getId_articoloTessutoColore() {
return this.id_articoloTessutoColore;
}
public void setId_articoloTessutoColore(long id_articoloTessutoColore) {
this.id_articoloTessutoColore = id_articoloTessutoColore;
setArticoloTessutoColore(null);
}
public ArticoloTessuto getArticoloTessuto() {
this.articoloTessuto = (ArticoloTessuto)getSecondaryObject(this.articoloTessuto, ArticoloTessuto.class, getId_articoloTessuto());
return this.articoloTessuto;
}
public void setArticoloTessuto(ArticoloTessuto articoloTessuto) {
this.articoloTessuto = articoloTessuto;
}
public ArticoloTessutoColore getArticoloTessutoColore() {
this.articoloTessutoColore = (ArticoloTessutoColore)getSecondaryObject(this.articoloTessutoColore, ArticoloTessutoColore.class,
getId_articoloTessutoColore());
return this.articoloTessutoColore;
}
public void setArticoloTessutoColore(ArticoloTessutoColore articoloTessutoColore) {
this.articoloTessutoColore = articoloTessutoColore;
}
public ArticoloVariante getArticoloVariante() {
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class, getId_articoloVariante());
return this.articoloVariante;
}
public void setArticoloVariante(ArticoloVariante articoloVariante) {
this.articoloVariante = articoloVariante;
}
public long getId_articoloFornitore() {
return this.id_articoloFornitore;
}
public void setId_articoloFornitore(long id_articoloFornitore) {
this.id_articoloFornitore = id_articoloFornitore;
}
public void findByCodiceFornitore(long l_id_clifor, String l_codiceFornitore) {
String s_Sql_Find = "select A.* from ARTICOLO_FORNITORE AS A";
String s_Sql_Order = " order by A.lastUpdTmst desc";
WcString wc = new WcString();
wc.addWc("codiceFornitore='" + l_codiceFornitore.trim() + "'");
wc.addWc("id_clifor=" + l_id_clifor);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public void findByArticoloTessutoFornitore(long l_id_clifor, long l_id_articoloTessuto) {
String s_Sql_Find = "select A.* from ARTICOLO_FORNITORE AS A";
String s_Sql_Order = " order by A.lastUpdTmst desc";
WcString wc = new WcString();
wc.addWc("id_articoloTessuto=" + l_id_articoloTessuto);
wc.addWc("id_clifor=" + l_id_clifor);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public Vectumerator findById_articoloTessuto(long l_id_articoloTessuto, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ARTICOLO_FORNITORE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("id_articoloTessuto=" + l_id_articoloTessuto);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByArticoloTessutoFornitoreAbituale(long l_id_articoloTessuto) {
String s_Sql_Find = "select A.* from ARTICOLO_FORNITORE AS A";
String s_Sql_Order = " order by A.lastUpdTmst desc";
WcString wc = new WcString();
wc.addWc("id_articoloTessuto=" + l_id_articoloTessuto);
wc.addWc("flgAbituale=1");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public long getFlgPromo() {
return this.flgPromo;
}
public void setFlgPromo(long flgPromo) {
this.flgPromo = flgPromo;
}
public double getDispoFornitoriByArticolo(long l_id_articolo) {
String s_Sql_Find = "select SUM(A.dispSede+A.dispCash) AS _sum from ARTICOLO_FORNITORE AS A";
String s_Sql_Order = " order by A.lastUpdTmst desc";
WcString wc = new WcString();
wc.addWc("id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return getSum(stmt);
} catch (SQLException e) {
handleDebug(e);
return 0.0D;
}
}
public void findPiuConvenienteByArticolo(long l_id_articolo) {
String s_Sql_Find2 = "select * from ARTICOLO_FORNITORE AS A";
String s_Sql_Order = " order by A.lastUpdTmst desc";
WcString wc2 = new WcString();
wc2.addWc("(dispSede+dispCash)>0");
wc2.addWc("(flgEscludi is null or flgEscludi=0)");
wc2.addWc("id_articolo=" + l_id_articolo);
wc2.addWc("costo>0");
wc2.addWc("dataUltimoPrezzo>=?");
String s_Sql_Find1 = "select id_clifor, id_articolo,costo, costoAggiuntivo, (costo+costoAggiuntivo) as costoTot, (dispSede+dispCash) as dispTotR , dataInizioPromo, dataFinePromo from(" + s_Sql_Find2 +
wc2.toString() + ") as A group by costoTot, id_articolo order by costoTot ";
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find1);
stmt.setDate(1, DBAdapter.getToday(-7));
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public double getStreetPrice() {
return this.streetPrice;
}
public void setStreetPrice(double streetPrice) {
this.streetPrice = streetPrice;
}
public long getDispTotR() {
return this.dispTotR;
}
public long getDispoTot() {
return getDispCash() + getDispSede();
}
public void setDispTotR(long dispTotR) {
this.dispTotR = dispTotR;
}
protected void fillFields(ResultSet rst) {
super.fillFields(rst);
try {
if (isColumnInResultSet(rst, "dispTotR"))
setDispTotR(rst.getLong("dispTotR"));
} catch (Exception e) {
e.printStackTrace();
}
}
protected void initFields() {
super.initFields();
setDispTotR(0L);
}
public double getCostoAggiuntivo() {
return this.costoAggiuntivo;
}
public void setCostoAggiuntivo(double costoAggiuntivo) {
this.costoAggiuntivo = costoAggiuntivo;
}
public void findByFornitoreArticolo(long l_id_clifor, long l_id_articolo, long l_flgAbilitaAF) {
String s_Sql_Find = "select A.* from ARTICOLO_FORNITORE AS A";
if (l_flgAbilitaAF >= 0L)
s_Sql_Find = s_Sql_Find + " inner join CLIFOR AS B on A.id_clifor=B.id_clifor";
String s_Sql_Order = " order by A.lastUpdTmst desc";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
wc.addWc("A.id_clifor=" + l_id_clifor);
if (l_flgAbilitaAF == 0L) {
wc.addWc("(B.flgAbilitaAF is null or B.flgAbilitaAF =0)");
} else if (l_flgAbilitaAF > 0L) {
wc.addWc("B.flgAbilitaAF=" + l_flgAbilitaAF);
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public Date getDataInizioPromo() {
return this.dataInizioPromo;
}
public void setDataInizioPromo(Date dataInizioPromo) {
this.dataInizioPromo = dataInizioPromo;
}
public Date getDataFinePromo() {
return this.dataFinePromo;
}
public void setDataFinePromo(Date dataFinePromo) {
this.dataFinePromo = dataFinePromo;
}
public boolean isPromoAttiva() {
if (getId_articolo() == 0L)
return false;
if (getDataInizioPromo() == null && getDataFinePromo() == null)
return false;
if (getDataFinePromo() == null)
return false;
if (DBAdapter.getDateDiff(getDataInizioPromo(), getToday()) >= 0L &&
DBAdapter.getDateDiff(getToday(), getDataFinePromo()) >= 0L)
return true;
return false;
}
public long getFlgControlloCostoAggAF() {
return this.flgControlloCostoAggAF;
}
public void setFlgControlloCostoAggAF(long flgControlloCostoAggAF) {
this.flgControlloCostoAggAF = flgControlloCostoAggAF;
}
public ResParm save() {
if (getCostoAggiuntivo() > 0.0D)
setFlgControlloCostoAggAF(1L);
return super.save();
}
public boolean checkControlloAggiuntivoByArticolo(long l_id_articolo) {
String s_Sql_Find = "select A.* from ARTICOLO_FORNITORE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("id_articolo=" + l_id_articolo);
wc.addWc("(A.flgControlloCostoAggAF is null or A.flgControlloCostoAggAF=0)");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
if (getId_articoloFornitore() > 0L)
return false;
return true;
} catch (SQLException e) {
handleDebug(e);
return false;
}
}
public ResParm aggiornaCodiciAlternativiByArticolo(Articolo l_articolo, boolean salva) {
Vectumerator<ArticoloFornitore> vec = findById_articolo(l_articolo.getId_articolo(), 0, 0);
StringBuilder sb = new StringBuilder();
if (vec.hasMoreElements())
sb.append(",");
while (vec.hasMoreElements()) {
ArticoloFornitore row = (ArticoloFornitore)vec.nextElement();
sb.append(row.getFornitore().getImportPrefissoCodice());
sb.append("_");
sb.append(row.getCodiceFornitore());
sb.append(",");
}
l_articolo.setCodiciAlternativi(sb.toString());
if (salva)
return l_articolo.superSave();
return new ResParm(true);
}
public long getFlgEscludi() {
return this.flgEscludi;
}
public void setFlgEscludi(long flgEscludi) {
this.flgEscludi = flgEscludi;
}
}

View file

@ -0,0 +1,123 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import java.sql.Date;
public class ArticoloFornitoreCR extends CRAdapter {
private long id_fornitore;
private long id_articolo;
private double costo;
private Date dataUltimoPrezzo;
private double costoNuovo;
private long flgAbituale;
private long id_articoloFornitore;
private long id_articoloTessuto;
private long id_articoloTessutoColore;
private long id_articoloVariante;
private long flgControlloCostoAggAF = -1L;
public ArticoloFornitoreCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloFornitoreCR() {}
public void setId_fornitore(long newId_fornitore) {
this.id_fornitore = newId_fornitore;
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
}
public void setCosto(double newCosto) {
this.costo = newCosto;
}
public void setDataUltimoPrezzo(Date newDataUltimoPrezzo) {
this.dataUltimoPrezzo = newDataUltimoPrezzo;
}
public void setCostoNuovo(double newCostoNuovo) {
this.costoNuovo = newCostoNuovo;
}
public long getId_fornitore() {
return this.id_fornitore;
}
public long getId_articolo() {
return this.id_articolo;
}
public double getCosto() {
return this.costo;
}
public Date getDataUltimoPrezzo() {
return this.dataUltimoPrezzo;
}
public double getCostoNuovo() {
return this.costoNuovo;
}
public long getFlgAbituale() {
return this.flgAbituale;
}
public void setFlgAbituale(long flgAbituale) {
this.flgAbituale = flgAbituale;
}
public long getId_articoloFornitore() {
return this.id_articoloFornitore;
}
public void setId_articoloFornitore(long id_articoloFornitore) {
this.id_articoloFornitore = id_articoloFornitore;
}
public long getId_articoloTessuto() {
return this.id_articoloTessuto;
}
public void setId_articoloTessuto(long id_articoloTessuto) {
this.id_articoloTessuto = id_articoloTessuto;
}
public long getId_articoloTessutoColore() {
return this.id_articoloTessutoColore;
}
public void setId_articoloTessutoColore(long id_articoloTessutoColore) {
this.id_articoloTessutoColore = id_articoloTessutoColore;
}
public long getId_articoloVariante() {
return this.id_articoloVariante;
}
public void setId_articoloVariante(long id_articoloVariante) {
this.id_articoloVariante = id_articoloVariante;
}
public long getFlgControlloCostoAggAF() {
return this.flgControlloCostoAggAF;
}
public void setFlgControlloCostoAggAF(long flgControlloCostoAggAF) {
this.flgControlloCostoAggAF = flgControlloCostoAggAF;
}
}

View file

@ -0,0 +1,132 @@
package it.acxent.art;
import it.acxent.anag.Clifor;
import it.acxent.anag.PrezzoArticolo;
import it.acxent.anag.Users;
import java.sql.Date;
public interface ArticoloInterface {
public static final long TIPO_ARTICOLO = 0L;
public static final long TIPO_ARTICOLO_VARIANTE = 1L;
double getAbbuonoPrezzoPubblico();
Date getDataCambiamentoPrezzo();
Date getDataScadenzaOffertaWeb();
String getDescrizione();
String getDescrizione(String paramString);
String getNome(String paramString);
String getDescrizioneUrl();
String getDescrizioneVetrina();
String getDescrizioneVetrina(String paramString);
long getId();
long getId_articolo();
long getId_articoloVariante();
long getId_tipo();
Tipo getTipo();
Marca getMarca();
long getId_tipoPadre();
String getImgFileName(int paramInt);
double getPercSconto();
double getPrezzoBase();
double getPrezzoBaseIva();
double getPrezzoBaseIva(Users paramUsers);
double getPrezzoBaseIvaConAbbuono();
double getPrezzoOfferta();
double getPercScontoOfferta();
double getPrezzoIvatoBarrato();
long getFlgNoleggio();
double getPrezzoNoleggioIva();
double getPrezzoOffertaIva();
double getPercScontoRispettoAlPrezzoBarrato();
double getPercScontoRispettoAOfferta();
double getPrezzoPubblico();
double getPrezzoPubblico(Clifor paramClifor);
double getPrezzoPubblicoIva();
double getPrezzoPubblicoIva(Clifor paramClifor);
PrezzoArticolo getPrezzoArticolo(Clifor paramClifor);
PrezzoArticolo getPrezzoArticoloIva(Clifor paramClifor);
long getTipoArticoloVetrina();
boolean isOffertaValida();
String getDescrizioneNomeUrl();
String getCodicePromozione();
boolean isPrezzoBarratoValido();
String getCCLinkDettaglio(ArticoloCR paramArticoloCR);
String getCCLinkDettaglio();
String getCCLinkDettaglioA(ArticoloCR paramArticoloCR);
String getCCMetaDescriptionWeb(String paramString);
String getCCTagH1(String paramString);
String getCCTagH2Web(String paramString);
String getCCKeyword(String paramString);
String getCCLinkDettaglioTK(ArticoloCR paramArticoloCR);
String getCCLinkDettaglioT(ArticoloCR paramArticoloCR);
String getCCLinkInfo(ArticoloCR paramArticoloCR);
String getCCTagH1Web(String paramString);
String getDatoStrutturato(String paramString);
String getCCNome(String paramString);
StatoUsato getStatoUsato();
boolean isNuovo();
boolean isUsato();
int getDispoLevel();
String getDispoLevelDesc();
String getPathIdStepDir();
}

View file

@ -0,0 +1,70 @@
package it.acxent.art;
import it.acxent.anag.Clifor;
import java.sql.Date;
public interface ArticoloInterface2 {
public static final long TIPO_ARTICOLO = 0L;
public static final long TIPO_ARTICOLO_VARIANTE = 1L;
double getAbbuonoPrezzoPubblico();
Date getDataCambiamentoPrezzo();
Date getDataScadenzaOfferta();
String getDescrizione();
String getDescrizione(String paramString);
String getDescrizioneUrl();
String getDescrizioneVetrina();
String getDescrizioneVetrina(String paramString);
long getId();
long getId_articolo();
long getId_articoloVariante();
long getId_tipo();
long getId_tipoPadre();
String getImgFileName(int paramInt);
double getPercSconto();
double getPercSconto(Clifor paramClifor);
double getPrezzoOfferta();
double getPrezzoOffertaIva();
double getPrezzoPubblico();
double getPrezzoPubblicoFinale(Clifor paramClifor);
double getPrezzoPubblicoIva();
double getPrezzoPubblicoFinaleIva(Clifor paramClifor);
double getPrezzoPubblicoIvaAbbuono();
double getPrezzoPubblicoIvaAbbuono(Clifor paramClifor);
double getPrezzoPubblicoScontato();
double getPrezzoPubblicoScontato(Clifor paramClifor);
double getPrezzoPubblicoScontatoIva();
double getPrezzoPubblicoScontatoIva(Clifor paramClifor);
long getTipoArticoloVetrina();
boolean isOffertaValida();
}

View file

@ -0,0 +1,163 @@
package it.acxent.art;
import it.acxent.anag.Nazione;
import it.acxent.cart.Cart;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class ArticoloNazione extends DBAdapter implements Serializable {
private static final long serialVersionUID = 1622308001596L;
private long id_articoloNazione;
private String id_nazione;
private long id_articolo;
private long flgPreventivoWwwAN;
private double costoSpedizioneAN;
private Nazione nazione;
private Articolo articolo;
public ArticoloNazione(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloNazione() {}
public void setId_articoloNazione(long newId_articoloNazione) {
this.id_articoloNazione = newId_articoloNazione;
}
public void setId_nazione(String newId_nazione) {
this.id_nazione = newId_nazione;
setNazione(null);
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public void setFlgPreventivoWwwAN(long newFlgPreventivoWwwAN) {
this.flgPreventivoWwwAN = newFlgPreventivoWwwAN;
}
public void setCostoSpedizioneAN(double newCostoSpedizioneAN) {
this.costoSpedizioneAN = newCostoSpedizioneAN;
}
public long getId_articoloNazione() {
return this.id_articoloNazione;
}
public String getId_nazione() {
return (this.id_nazione == null) ? "" : this.id_nazione.trim();
}
public long getId_articolo() {
return this.id_articolo;
}
public long getFlgPreventivoWwwAN() {
return this.flgPreventivoWwwAN;
}
public double getCostoSpedizioneAN() {
return this.costoSpedizioneAN;
}
public void setNazione(Nazione newNazione) {
this.nazione = newNazione;
}
public Nazione getNazione() {
this.nazione = (Nazione)getSecondaryObject(this.nazione, Nazione.class, getId_nazione());
return this.nazione;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
return this.articolo;
}
protected ResParm checkDeleteCascade() {
return new ResParm(true);
}
protected void deleteCascade() {}
public Vectumerator<ArticoloNazione> findByCR(ArticoloNazioneCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ARTICOLO_NAZIONE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator<ArticoloNazione> findByArticolo(long l_id_articolo) {
String s_Sql_Find = "select A.* from ARTICOLO_NAZIONE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public double getCostoSpedizioneANConIva() {
return conIva(getCostoSpedizioneAN(), getParm(Cart.P_DELIVERY_IVA_ALIQUOTA).getNumeroDouble());
}
public void findByArticoloNazione(long l_id_articolo, String l_id_nazione) {
String s_Sql_Find = "select A.* from ARTICOLO_NAZIONE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
wc.addWc("A.id_nazione='" + l_id_nazione + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
}
}
}

View file

@ -0,0 +1,91 @@
package it.acxent.art;
import it.acxent.anag.Nazione;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class ArticoloNazioneCR extends CRAdapter {
private long id_articoloNazione;
private String id_nazione;
private long id_articolo;
private long flgPreventivoWwwAN;
private double costoSpedizioneAN;
private Nazione nazione;
private Articolo articolo;
public ArticoloNazioneCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloNazioneCR() {}
public void setId_articoloNazione(long newId_articoloNazione) {
this.id_articoloNazione = newId_articoloNazione;
}
public void setId_nazione(String newId_nazione) {
this.id_nazione = newId_nazione;
setNazione(null);
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public void setFlgPreventivoWwwAN(long newFlgPreventivoWwwAN) {
this.flgPreventivoWwwAN = newFlgPreventivoWwwAN;
}
public void setCostoSpedizioneAN(double newCostoSpedizioneAN) {
this.costoSpedizioneAN = newCostoSpedizioneAN;
}
public long getId_articoloNazione() {
return this.id_articoloNazione;
}
public String getId_nazione() {
return (this.id_nazione == null) ? "" : this.id_nazione.trim();
}
public long getId_articolo() {
return this.id_articolo;
}
public long getFlgPreventivoWwwAN() {
return this.flgPreventivoWwwAN;
}
public double getCostoSpedizioneAN() {
return this.costoSpedizioneAN;
}
public void setNazione(Nazione newNazione) {
this.nazione = newNazione;
}
public Nazione getNazione() {
this.nazione = (Nazione)getSecondaryObject(this.nazione, Nazione.class,
getId_nazione());
return this.nazione;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
}

View file

@ -0,0 +1,152 @@
package it.acxent.art;
import it.acxent.anag.Clifor;
import it.acxent.anag._AnagAdapter;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class ArticoloProgettista extends _AnagAdapter implements Serializable {
private static final long serialVersionUID = 463336863212137063L;
private long id_articoloProgettista;
private double percProvvigione;
private long id_progettista;
private long id_articolo;
private String nota;
private Clifor progettista;
private Articolo articolo;
public ArticoloProgettista(ApplParmFull newApplParm) {
super(newApplParm);
}
public ArticoloProgettista() {}
public long getId_articoloProgettista() {
return this.id_articoloProgettista;
}
public void setId_articoloProgettista(long id_cliforArticolo) {
this.id_articoloProgettista = id_cliforArticolo;
}
public double getPercProvvigione() {
return this.percProvvigione;
}
public void setPercProvvigione(double percArticolo) {
this.percProvvigione = percArticolo;
}
public long getId_progettista() {
return this.id_progettista;
}
public void setId_progettista(long id_clifor) {
this.id_progettista = id_clifor;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setId_articolo(long id_articolo) {
this.id_articolo = id_articolo;
}
public Clifor getProgettista() {
this.progettista = new Clifor(getApFull());
this.progettista.findByPrimaryKey(getId_progettista());
return this.progettista;
}
public void setProgettista(Clifor clifor) {
this.progettista = clifor;
}
public Articolo getArticolo() {
this.articolo = new Articolo(getApFull());
this.articolo.findByPrimaryKey(getId_articolo());
return this.articolo;
}
public void setArticolo(Articolo articolo) {
this.articolo = articolo;
}
public Vectumerator findByCR(ArticoloProgettistaCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ARTICOLO_PROGETTISTA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.descrizione like '%" + token + "%' or A.descrizione like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
if (CR.getId_articolo() != 0L)
wc.addWc(" A.id_articolo = " + CR.getId_articolo());
if (CR.getId_progettista() != 0L)
wc.addWc(" A.id_clifor = " + CR.getId_progettista());
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByProgettistaArticolo(long id_clifor, long id_articolo) {
String s_Sql_Find = "select A.* from ARTICOLO_PROGETTISTA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc(" A.id_articolo = " + id_articolo);
wc.addWc(" A.id_progettista= " + id_clifor);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public Vectumerator findByArticolo(long id_articolo) {
String s_Sql_Find = "select A.* from ARTICOLO_PROGETTISTA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc(" A.id_articolo = " + id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public String getNota() {
return (this.nota == null) ? "" : this.nota.trim();
}
public void setNota(String nota) {
this.nota = nota;
}
}

View file

@ -0,0 +1,78 @@
package it.acxent.art;
import it.acxent.anag.Clifor;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import java.io.Serializable;
public class ArticoloProgettistaCR extends CRAdapter implements Serializable {
private long id_articoloProgettista;
private double percProvvigione;
private long id_progettista;
private long id_articolo;
private Clifor progettista;
private Articolo articolo;
public ArticoloProgettistaCR(ApplParmFull newApplParm) {
super(newApplParm);
}
public ArticoloProgettistaCR() {}
public long getId_articoloProgettista() {
return this.id_articoloProgettista;
}
public void setId_articoloProgettista(long id_cliforArticolo) {
this.id_articoloProgettista = id_cliforArticolo;
}
public double getPercProvvigione() {
return this.percProvvigione;
}
public void setPercProvvigione(double percArticolo) {
this.percProvvigione = percArticolo;
}
public long getId_progettista() {
return this.id_progettista;
}
public void setId_progettista(long id_clifor) {
this.id_progettista = id_clifor;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setId_articolo(long id_articolo) {
this.id_articolo = id_articolo;
}
public Clifor getProgettista() {
this.progettista = new Clifor(getApFull());
this.progettista.findByPrimaryKey(getId_progettista());
return this.progettista;
}
public void setProgettista(Clifor clifor) {
this.progettista = clifor;
}
public Articolo getArticolo() {
this.articolo = new Articolo(getApFull());
this.articolo.findByPrimaryKey(getId_articolo());
return this.articolo;
}
public void setArticolo(Articolo articolo) {
this.articolo = articolo;
}
}

View file

@ -0,0 +1,102 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class ArticoloTabellaTaglia extends _ArtAdapter implements Serializable {
private long id_articoloTabellaTaglia;
private long id_tabellaTaglia;
private long id_articolo;
private TabellaTaglia tabellaTaglia;
private Articolo articolo;
public ArticoloTabellaTaglia(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloTabellaTaglia() {}
public void setId_articoloTabellaTaglia(long newId_articoloTabellaTaglia) {
this.id_articoloTabellaTaglia = newId_articoloTabellaTaglia;
}
public void setId_tabellaTaglia(long newId_tabellaTaglia) {
this.id_tabellaTaglia = newId_tabellaTaglia;
setTabellaTaglia(null);
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public long getId_articoloTabellaTaglia() {
return this.id_articoloTabellaTaglia;
}
public long getId_tabellaTaglia() {
return this.id_tabellaTaglia;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setTabellaTaglia(TabellaTaglia newTabellaTaglia) {
this.tabellaTaglia = newTabellaTaglia;
}
public TabellaTaglia getTabellaTaglia() {
this.tabellaTaglia = (TabellaTaglia)getSecondaryObject(this.tabellaTaglia, TabellaTaglia.class,
getId_tabellaTaglia());
return this.tabellaTaglia;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
protected void deleteCascade() {}
public Vectumerator findByCR(ArticoloTabellaTagliaCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ARTICOLO_TABELLA_TAGLIA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
}

View file

@ -0,0 +1,70 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class ArticoloTabellaTagliaCR extends CRAdapter {
private long id_articoloTabellaTaglia;
private long id_tabellaTaglia;
private long id_articolo;
private TabellaTaglia tabellaTaglia;
private Articolo articolo;
public ArticoloTabellaTagliaCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloTabellaTagliaCR() {}
public void setId_articoloTabellaTaglia(long newId_articoloTabellaTaglia) {
this.id_articoloTabellaTaglia = newId_articoloTabellaTaglia;
}
public void setId_tabellaTaglia(long newId_tabellaTaglia) {
this.id_tabellaTaglia = newId_tabellaTaglia;
setTabellaTaglia(null);
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public long getId_articoloTabellaTaglia() {
return this.id_articoloTabellaTaglia;
}
public long getId_tabellaTaglia() {
return this.id_tabellaTaglia;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setTabellaTaglia(TabellaTaglia newTabellaTaglia) {
this.tabellaTaglia = newTabellaTaglia;
}
public TabellaTaglia getTabellaTaglia() {
this.tabellaTaglia = (TabellaTaglia)getSecondaryObject(this.tabellaTaglia, TabellaTaglia.class,
getId_tabellaTaglia());
return this.tabellaTaglia;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
}

View file

@ -0,0 +1,532 @@
package it.acxent.art;
import it.acxent.cart.CartItemId;
import it.acxent.cart.CartItemIterface;
import it.acxent.contab.Movimento;
import it.acxent.contab.RigaDocumento;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.DoubleOperator;
import it.acxent.util.Vectumerator;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class ArticoloTaglia extends _ArtAdapter implements CartItemIterface {
private long id_articoloTaglia;
private long id_articolo;
private long id_articoloVariante;
private long id_taglia;
private String codiceAT;
private Taglia taglia;
private Articolo articolo;
private ArticoloVariante articoloVariante;
private long flgDispo;
private long flgUdmAv;
private double qtaAttribuitaT;
private double qtaInProduzioneT;
private double quantitaAt;
private double quantitaAtW;
private boolean quantitaCalcolateAt;
private double quantitaEffettivaAt;
private double quantitaImpegnataAt;
private double quantitaInArrivoAt;
private String quantitaMagazzinoMovimentoHtml;
private String codiciMagazzino;
public ArticoloTaglia() {}
public ArticoloTaglia(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public long getId_articoloTaglia() {
return this.id_articoloTaglia;
}
public void setId_articoloTaglia(long id_articolotaglia) {
this.id_articoloTaglia = id_articolotaglia;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setId_articolo(long id_articolo) {
this.id_articolo = id_articolo;
}
public long getId_articoloVariante() {
return this.id_articoloVariante;
}
public void setId_articoloVariante(long id_articoloVariante) {
this.id_articoloVariante = id_articoloVariante;
}
public long getId_taglia() {
return this.id_taglia;
}
public void setId_taglia(long id_taglia) {
this.id_taglia = id_taglia;
}
public String getCodiceAT() {
return (this.codiceAT == null) ? "" : this.codiceAT;
}
public void setCodiceAT(String codiceAT) {
this.codiceAT = codiceAT;
}
public void findByArticoloTaglia(long l_id_articolo, long l_id_articoloVariante, long l_id_taglia) {
String s_Sql_Find = "select A.* from ARTICOLO_TAGLIA AS A ";
WcString wc = new WcString();
wc.addWc("id_articolo=" + l_id_articolo);
if (l_id_articoloVariante == 0L) {
wc.addWc("(id_articoloVariante=0 OR id_articoloVariante IS NULL)");
} else {
wc.addWc("id_articoloVariante=" + l_id_articoloVariante);
}
wc.addWc("id_taglia=" + l_id_taglia);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find);
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public void findByCartitemId(CartItemId cii) {
getArticolo().findByCartitemId(cii);
}
public Vectumerator findByArticoloVariante(long l_id_articoloVariante) {
return findByArticoloVariante(l_id_articoloVariante, 0, 0);
}
public Vectumerator<ArticoloTaglia> findByArticoloVariante(long l_id_articoloVariante, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ARTICOLO_TAGLIA AS A, TAGLIA AS B ";
String s_Sql_Order = " order by B.ordine ";
WcString wc = new WcString();
wc.addWc("A.id_taglia=B.id_taglia");
wc.addWc("A.id_articoloVariante=" + l_id_articoloVariante);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Taglia getTaglia() {
this.taglia = (Taglia)getSecondaryObject(this.taglia, Taglia.class, getId_taglia());
return this.taglia;
}
public void setTaglia(Taglia taglia) {
this.taglia = taglia;
}
public Vectumerator findByArticolo(long l_id_articolo) {
String s_Sql_Find = "select A.* from ARTICOLO_TAGLIA AS A, TAGLIA AS B ";
String s_Sql_Order = " order by B.ordine ";
WcString wc = new WcString();
wc.addWc("A.id_taglia=B.id_taglia");
wc.addWc("A.id_articolo=" + l_id_articolo);
wc.addWc("(A.id_articoloVariante=0 or A.id_articoloVariante is null)");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public double getQuantitaT() {
if (!getArticolo().usaMagazzino())
return 0.0D;
if (getParm("USA_MAGAZZINO").getNumeroLong() == 0L) {
Movimento mov = new Movimento(getApFull());
mov.findDisponibilita(getId_articolo(), getId_articoloVariante(), getId_articoloTaglia(), null, 1L, 0L, null);
return mov.getQuantita();
}
return -99.0D;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
return this.articolo;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Object getItemId() {
return new Long(getId_articoloTaglia());
}
public double getPrice() {
return getArticolo().getPrice();
}
public double getPriceWVat() {
return getArticolo().getPriceWVat();
}
public boolean isSale() {
return getArticolo().isSale();
}
public boolean isRM() {
return getArticolo().isRM();
}
public double getDiscount() {
return getArticolo().getDiscount();
}
public double getCost() {
return getArticolo().getCost();
}
public String getCartItemDescriptionUrl() {
if (getId_articoloVariante() != 0L)
return getArticoloVariante().getCartItemDescriptionUrl();
return getArticolo().getCartItemDescriptionUrl();
}
public String getCartItemDescription2(String lang) {
return getTaglia().getDescrizione(lang);
}
public String getCartItemDescription3(String lang) {
if (getId_articoloVariante() != 0L)
return getArticoloVariante().getCartItemDescription3(lang);
return getArticolo().getCartItemDescription3(lang);
}
public long getCartItemUdm() {
if (getId_articoloVariante() != 0L)
return getArticoloVariante().getCartItemUdm();
return getArticolo().getCartItemUdm();
}
public double getAvail() {
return getQuantitaAtByMagFisico(1L);
}
public double getIvaAliquota(long l_id_users) {
return getArticolo().getIvaAliquota(l_id_users);
}
public long getIvaItemId(long l_id_users) {
return getArticolo().getIvaItemId(l_id_users);
}
public String getCartItemImage() {
if (getId_articoloVariante() != 0L)
return getArticoloVariante().getCartItemImage();
return getArticolo().getCartItemImage();
}
public String getCartItemDescription(String lang) {
if (getId_articoloVariante() != 0L)
return getArticoloVariante().getCartItemDescription(lang) + " " + getArticoloVariante().getCartItemDescription(lang) + " " + translate("taglia", lang);
return getArticolo().getNome() + " " + getArticolo().getNome() + " " + translate("taglia", lang);
}
public double getPrice(long l_id_users) {
return getArticolo().getPrice(l_id_users);
}
public String getCartItemTag() {
if (getId_articoloVariante() != 0L)
return getArticoloVariante().getCartItemTag();
return getArticolo().getCartItemTag();
}
public ArticoloVariante getArticoloVariante() {
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class, getId_articoloVariante());
return this.articoloVariante;
}
public void setArticoloVariante(ArticoloVariante articoloVariante) {
this.articoloVariante = articoloVariante;
}
public Vectumerator findArticoloTagliaDisponibile(long l_id_articolo, long l_id_articoloVariante) {
String s_Sql_Find = "select A.* from ARTICOLO_TAGLIA AS A ";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
if (l_id_articoloVariante == 0L) {
wc.addWc("(A.id_articoloVariante=0 OR A.id_articoloVariante IS NULL)");
} else {
wc.addWc("A.id_articoloVariante=" + l_id_articoloVariante);
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find);
return findRows(stmt);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public String getCodicePromozione() {
if (getId_articoloVariante() > 0L)
return getArticoloVariante().getCodicePromozione();
if (getId_articolo() > 0L)
return getArticolo().getCodicePromozioneA();
return "";
}
public String getDescrizioneCompleta(String lang) {
if (getId_articoloVariante() != 0L)
return getArticoloVariante().getDescrizione(lang) + " [" + getArticoloVariante().getDescrizione(lang) + "] ";
return getArticolo().getDescrizione(lang) + " [" + getArticolo().getDescrizione(lang) + "] ";
}
public long getFlgDispo() {
return this.flgDispo;
}
public void setFlgDispo(long flgDispo) {
this.flgDispo = flgDispo;
}
public double getPriceWVat(long l_id_users) {
return getArticolo().getPriceWVat(l_id_users);
}
public long getFlgUdmAv() {
return this.flgUdmAv;
}
public void setFlgUdmAv(long flgUdmAv) {
this.flgUdmAv = flgUdmAv;
}
public double getQtaAttribuitaT() {
return this.qtaAttribuitaT;
}
public void setQtaAttribuitaT(double qtaAttribuitaT) {
this.qtaAttribuitaT = qtaAttribuitaT;
}
public double getQtaInProduzioneT() {
return this.qtaInProduzioneT;
}
public void setQtaInProduzioneT(double qtaInProduzioneT) {
this.qtaInProduzioneT = qtaInProduzioneT;
}
public double getQuantitaAt() {
return getQuantitaAt(null);
}
public double getQuantitaAt(Date dataA) {
if (getParm("USA_MAGAZZINO").isFalse()) {
RigaDocumento mov = new RigaDocumento(getApFull());
mov.findMagDisponibilita(getId_articolo(), getId_articoloVariante(), getId_articoloTaglia(), null, 1L, 0L, dataA);
return mov.getQuantita();
}
return this.quantitaAt;
}
public double getQuantitaAtByMagFisico(long l_id_magFisico) {
if (getParm("USA_MAGAZZINO").isFalse()) {
RigaDocumento mov = new RigaDocumento(getApFull());
mov.findMagFisicoDisponibilita(getId_articolo(), getId_articoloVariante(), getId_articoloTaglia(), null, l_id_magFisico, 0L, null);
return mov.getQuantita();
}
return this.quantitaAt;
}
public void setQuantitaAt(double quantitaAt) {
this.quantitaAt = quantitaAt;
}
public double getQuantitaAtW() {
return this.quantitaAtW;
}
public void setQuantitaAtW(double quantitaAtW) {
this.quantitaAtW = quantitaAtW;
}
public boolean isQuantitaCalcolateAt() {
return this.quantitaCalcolateAt;
}
public void setQuantitaCalcolateAt(boolean quantitaCalcolateAt) {
this.quantitaCalcolateAt = quantitaCalcolateAt;
}
public double getQuantitaEffettivaAt() {
if (!isQuantitaCalcolateAt())
calcolaQuantita();
return this.quantitaEffettivaAt;
}
public void setQuantitaEffettivaAt(double quantitaEffettivaAt) {
this.quantitaEffettivaAt = quantitaEffettivaAt;
}
public double getQuantitaImpegnataAt() {
if (!isQuantitaCalcolateAt())
calcolaQuantita();
return this.quantitaImpegnataAt;
}
public void setQuantitaImpegnataAt(double quantitaImpegnataAt) {
this.quantitaImpegnataAt = quantitaImpegnataAt;
}
public double getQuantitaInArrivoAt() {
return this.quantitaInArrivoAt;
}
public void setQuantitaInArrivoAt(double quantitaInArrivoAt) {
this.quantitaInArrivoAt = quantitaInArrivoAt;
}
public String getQuantitaMagazzinoMovimentoHtml() {
if (getParm("USA_MAGAZZINO").isTrue())
return getNf().format(getQuantitaAt());
if (!isQuantitaCalcolateAt() && this.id_articoloTaglia != 0L)
calcolaQuantita();
return (this.quantitaMagazzinoMovimentoHtml == null) ? "" : this.quantitaMagazzinoMovimentoHtml;
}
public void setQuantitaMagazzinoMovimentoHtml(String quantitaMagazzinoMovimentoHtml) {
this.quantitaMagazzinoMovimentoHtml = quantitaMagazzinoMovimentoHtml;
}
private synchronized void calcolaQuantita() {
if ((!isQuantitaCalcolateAt() ? true : false) & ((getId_articoloTaglia() != 0L) ? true : false)) {
RigaDocumento rd = new RigaDocumento(getApFull());
rd.findMagDisponibilita(getId_articolo(), getId_articoloVariante(), getId_articoloTaglia(), null, 1L, 0L, null);
double q = rd.getQuantita();
double nr = rd.getNr();
double kg = rd.getKg();
double mt = rd.getMt();
setQuantitaAtW(q);
setQuantitaAt(rd.getQuantita());
setQuantitaImpegnataAt(new RigaDocumento(getApFull()).getQuantitaImpegnataByArticoloTaglia(getId_articoloTaglia()));
double q1 = new RigaDocumento(getApFull()).getQuantitaInArrivoByArticoloTaglia(this);
setQuantitaInArrivoAt(q1);
if (!getArticolo().usaMagazzino()) {
setQuantitaEffettivaAt(0.0D);
} else {
DoubleOperator dop = new DoubleOperator(rd.getQuantita());
dop.add(this.quantitaInArrivoAt);
dop.subtract(this.quantitaImpegnataAt);
setQuantitaEffettivaAt(dop.getResult());
}
this.quantitaMagazzinoMovimentoHtml = Articolo.getMovimentoHtmlDesc(getArticolo().getTipologiaArticolo(), q, nr, kg, mt, this.quantitaInArrivoAt, this.quantitaImpegnataAt, this.quantitaEffettivaAt,
getArticolo().usaMagazzino(),
getParm("USA_MAGAZZINO").isTrue(), getNf());
}
String temp = "update ARTICOLO_TAGLIA set quantitaMagazzinoMovimentoHtml='" + this.quantitaMagazzinoMovimentoHtml + "', quantitaInArrivoAt=" + this.quantitaInArrivoAt + ", quantitaImpegnataAt=" + this.quantitaImpegnataAt + ", quantitaAt=" + this.quantitaAt + ", quantitaEffettivaAt=" + this.quantitaEffettivaAt + ",quantitaCalcolateAt=true where id_articoloTaglia=" +
getId_articoloTaglia();
update(temp);
setQuantitaCalcolateAt(true);
}
public void resetCalcoloQuantita() {
if (getId_articoloTaglia() > 0L) {
update("update ARTICOLO_TAGLIA set quantitaCalcolateAt=false where id_articoloTaglia=" + getId_articoloTaglia());
setQuantitaCalcolateAt(false);
}
}
public String getCodiciMagazzino() {
return (this.codiciMagazzino == null) ? "" : this.codiciMagazzino.trim();
}
public void setCodiciMagazzino(String codiciMagazzino) {
this.codiciMagazzino = codiciMagazzino;
}
public String getDescrizioneCompleta() {
if (getId_articoloVariante() != 0L)
return getArticoloVariante().getDescrizione() + " [" + getArticoloVariante().getDescrizione() + "] ";
return getArticolo().getDescrizione() + " [" + getArticolo().getDescrizione() + "] ";
}
public int getDispoLevel() {
double qt = getQuantitaEffettivaAt();
double dispoLevelScarsa = getParm("CC_QTA_LOW").getNumero();
if (qt <= 0.0D)
return 0;
if (qt > 0.0D && qt < dispoLevelScarsa)
return 1;
if (qt >= dispoLevelScarsa)
return 2;
return 0;
}
public String getCCLinkDettaglioTK(ArticoloCR CR) {
getArticolo().setId_articoloVariante(getId_articoloVariante());
long l_id_taglia = CR.getId_taglia();
CR.setId_taglia(getId_taglia());
getArticolo().setId_articoloVarianteKit(CR.getId_articoloVarianteKit());
String temp = getArticolo().getCCLinkDettaglioTK(CR);
CR.setId_taglia(l_id_taglia);
return temp;
}
public String getCartItemDescriptionCC(String lang) {
return getCCNome(lang);
}
public String getCCNome(String lang) {
if (getId_articoloVariante() != 0L)
return getArticoloVariante().getCCNome(lang) + " " + getArticoloVariante().getCCNome(lang) + " " + translate("taglia", lang);
return getArticolo().getCCNome(lang) + " " + getArticolo().getCCNome(lang) + " " + translate("taglia", lang);
}
public boolean isCostoSpedizionePreventivo(String l_id_nazione) {
return getArticolo().isCostoSpedizionePreventivo(l_id_nazione);
}
public double getDeliveryCost(String l_id_nazione) {
return getArticolo().getDeliveryCost(l_id_nazione);
}
public long getPercentileSpedizione() {
return getArticolo().getPercentileSpedizione();
}
public boolean isScontoTroppoAlto() {
return getArticolo().isScontoTroppoAlto();
}
}

View file

@ -0,0 +1,413 @@
package it.acxent.art;
import it.acxent.anag.Clifor;
import it.acxent.contab.RigaDocumento;
import it.acxent.db.ApplParmFull;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class ArticoloUsato extends _ArtAdapter implements Serializable {
private static final long serialVersionUID = 7574534452131775388L;
private long id_articoloUsato;
private long id_articolo;
private Articolo articolo;
private Date dataDocumento;
private String numeroDocumento;
private long flgTipoDocumento;
private double importo;
private long id_fornitore;
private Clifor fornitore;
private long id_cliente;
private Clifor cliente;
private long id_rigaDocumento;
private RigaDocumento rigaDocumento;
private String descrizioneRigaDocumento;
private String tmstStampa;
private long codiceAlt;
public static final long USATO_TIPO_DOCUMENTO_ACQUISTO = 1L;
public static final long USATO_TIPO_DOCUMENTO_VENDITA = 2L;
public static final long USATO_TIPO_DOCUMENTO_RESO = 3L;
public ArticoloUsato(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloUsato() {}
protected void deleteCascade() {}
public static final String getTipoDocumento(long l_flgTipoDocumento) {
switch ((int)l_flgTipoDocumento) {
case 1:
return "ACQUISTO";
case 2:
return "VENDITA";
case 3:
return "RESO";
}
return "";
}
public final String getTipoDocumento() {
return getTipoDocumento(getFlgTipoDocumento());
}
public Vectumerator findByCR(ArticoloUsatoCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ARTICOLO_USATO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator findByArticolo(long l_id_articolo, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from ARTICOLO_USATO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator findByArticoloOrdineManuale(long l_id_articolo) {
String s_Sql_Find = "select A.* from ARTICOLO_USATO AS A";
String s_Sql_Order = " order by A.dataDocumento asc,A.flgTipoDocumento asc";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Clifor getFornitoreByArticolo(long l_id_articolo) {
if (l_id_articolo == 0L)
return new Clifor(getApFull());
String s_Sql_Find = "select A.* from ARTICOLO_USATO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
wc.addWc("A.flgTipoDocumento=1");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
return getFornitore();
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return new Clifor(getApFull());
}
}
public boolean isArticoloAcquistato(long l_id_articolo) {
String s_Sql_Find = "select COUNT(*) as _count from ARTICOLO_USATO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
wc.addWc("A.flgTipoDocumento=1");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
long tot = getCount(stmt, "_count");
if (tot != 0L)
return true;
return false;
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return false;
}
}
public boolean isArticoloVenduto(long l_id_articolo) {
String s_Sql_Find = "select A.* from ARTICOLO_USATO AS A";
String s_Sql_Order = " ORDER BY A.id_articoloUsato DESC ";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
if (getFlgTipoDocumento() == 2L)
return true;
return false;
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return false;
}
}
public boolean isArticoloReso(long l_id_articolo) {
String s_Sql_Find = "select A.* from ARTICOLO_USATO AS A";
String s_Sql_Order = " ORDER BY A.id_articoloUsato DESC ";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
if (getFlgTipoDocumento() == 3L)
return true;
return false;
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return false;
}
}
public long getId_articoloUsato() {
return this.id_articoloUsato;
}
public void setId_articoloUsato(long id_articoloUsato) {
this.id_articoloUsato = id_articoloUsato;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setId_articolo(long id_articolo) {
this.id_articolo = id_articolo;
setArticolo(null);
}
public Date getDataDocumento() {
if (getId_rigaDocumento() == 0L)
return this.dataDocumento;
return getRigaDocumento().getDocumento().getDataDocumento();
}
public void setDataDocumento(Date dataDocumento) {
this.dataDocumento = dataDocumento;
}
public String getIntestazione() {
if (getFlgTipoDocumento() == 1L)
return getFornitore().getCognomeNome().trim();
if (getFlgTipoDocumento() == 2L)
return getCliente().getCognomeNome().trim();
if (getFlgTipoDocumento() == 3L)
return getCliente().getCognomeNome().trim();
return "??";
}
public void setNumeroDocumento(String numeroDocumento) {
this.numeroDocumento = numeroDocumento;
}
public long getFlgTipoDocumento() {
return this.flgTipoDocumento;
}
public void setFlgTipoDocumento(long flgTipoDocumento) {
this.flgTipoDocumento = flgTipoDocumento;
}
public double getImporto() {
return this.importo;
}
public void setImporto(double importo) {
this.importo = importo;
}
public long getId_fornitore() {
return this.id_fornitore;
}
public Clifor getFornitore() {
this.fornitore = (Clifor)getSecondaryObject(this.fornitore, Clifor.class, getId_fornitore());
return this.fornitore;
}
public long getId_cliente() {
return this.id_cliente;
}
public Clifor getCliente() {
this.cliente = (Clifor)getSecondaryObject(this.cliente, Clifor.class, getId_cliente());
return this.cliente;
}
public long getId_rigaDocumento() {
return this.id_rigaDocumento;
}
public void setId_rigaDocumento(long id_rigaDocumento) {
this.id_rigaDocumento = id_rigaDocumento;
}
public RigaDocumento getRigaDocumento() {
this.rigaDocumento = (RigaDocumento)getSecondaryObject(this.rigaDocumento, RigaDocumento.class, new Long(getId_rigaDocumento()));
return this.rigaDocumento;
}
public void setRigaDocumento(RigaDocumento rigaDocumento) {
this.rigaDocumento = rigaDocumento;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
return this.articolo;
}
public void setArticolo(Articolo articolo) {
this.articolo = articolo;
}
public Vectumerator findByRigaDocumento(long l_id_rigaDocumento) {
String s_Sql_Find = "select A.* from ARTICOLO_USATO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_rigaDocumento=" + l_id_rigaDocumento);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Date getDataUltimoMovimento(long l_id_articolo) {
String s_Sql_Find = "select A.* from ARTICOLO_USATO AS A";
String s_Sql_Order = " order by dataDocumento desc";
WcString wc = new WcString();
wc.addWc("A.id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
Vectumerator vec = findRows(stmt, 1, 1);
if (vec.hasMoreElements()) {
ArticoloUsato row = (ArticoloUsato)vec.nextElement();
return row.getDataDocumento();
}
return null;
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return null;
}
}
public String getTmstStampa() {
return this.tmstStampa;
}
public void setTmstStampa(String tmstStampa) {
this.tmstStampa = tmstStampa;
}
public ResParm save() {
if (getArticolo().getFlgUsato() == 0L)
return new ResParm(false, "ERRORE! non posso registrare un acquisto o vendita usato su articoli non usati!!!");
return super.save();
}
public String getNumeroDocumento() {
if (getId_rigaDocumento() == 0L)
return (this.numeroDocumento == null) ? "" : this.numeroDocumento.trim();
return getRigaDocumento().getDocumento().getNumeroDocumento();
}
public void setId_fornitore(long id_fornitore) {
this.id_fornitore = id_fornitore;
setFornitore(null);
}
public void setFornitore(Clifor fornitore) {
this.fornitore = fornitore;
}
public void setId_cliente(long id_cliente) {
this.id_cliente = id_cliente;
setCliente(null);
}
public void setCliente(Clifor cliente) {
this.cliente = cliente;
}
public String getDescrizioneRigaDocumento() {
return (this.descrizioneRigaDocumento == null) ? "" : this.descrizioneRigaDocumento.trim();
}
public void setDescrizioneRigaDocumento(String descrizioneRigaDocumento) {
this.descrizioneRigaDocumento = descrizioneRigaDocumento;
}
public long getCodiceAlt() {
return this.codiceAlt;
}
public void setCodiceAlt(long codiceAlt) {
this.codiceAlt = codiceAlt;
}
public void findByCodiceAlt(long l_codiceAlt) {
String s_Sql_Find = "select A.* from ARTICOLO_USATO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.codiceAlt=" + l_codiceAlt);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
}
}
}

View file

@ -0,0 +1,115 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import java.sql.Date;
public class ArticoloUsatoCR extends CRAdapter {
private long id_articoloUsato;
private Articolo articolo;
private Date dataDocumento;
private String numeroDocumento;
private long flgTipoDocumento;
private double importo;
private long id_fornitore;
private long id_rigaFattura;
private long id_articolo;
private long id_cliente;
public ArticoloUsatoCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloUsatoCR() {}
public long getId_articoloUsato() {
return this.id_articoloUsato;
}
public void setId_articoloUsato(long id_articoloUsato) {
this.id_articoloUsato = id_articoloUsato;
}
public Date getDataDocumento() {
return this.dataDocumento;
}
public void setDataDocumento(Date dataDocumento) {
this.dataDocumento = dataDocumento;
}
public String getNumeroDocumento() {
return (this.numeroDocumento == null) ? AB_EMPTY_STRING : this.numeroDocumento.trim();
}
public void setNumeroDocumento(String numeroDocumento) {
this.numeroDocumento = numeroDocumento;
}
public long getFlgTipoDocumento() {
return this.flgTipoDocumento;
}
public void setFlgTipoDocumento(long flgTipoDocumento) {
this.flgTipoDocumento = flgTipoDocumento;
}
public double getImporto() {
return this.importo;
}
public void setImporto(double importo) {
this.importo = importo;
}
public long getId_fornitore() {
return this.id_fornitore;
}
public void setId_fornitore(long id_fornitore) {
this.id_fornitore = id_fornitore;
}
public long getId_rigaFattura() {
return this.id_rigaFattura;
}
public void setId_rigaFattura(long id_rigaFattura) {
this.id_rigaFattura = id_rigaFattura;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
return this.articolo;
}
public void setArticolo(Articolo articolo) {
this.articolo = articolo;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setId_articolo(long id_articolo) {
this.id_articolo = id_articolo;
setArticolo(null);
}
public long getId_cliente() {
return this.id_cliente;
}
public void setId_cliente(long id_cliente) {
this.id_cliente = id_cliente;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,224 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class ArticoloVarianteCR extends CRAdapter {
private long id_articoloVariante;
private long id_articolo;
private Articolo articolo;
private String codiceVariante;
private long flgDisponibile;
private long id_tipoSel;
private long flgNascondi = -1L;
private long flgOrdinaArticolo = 0L;
private long id_clifor;
private double qtaAttribuitaV;
private double qtaInProduzioneV;
private String codiceSerieV;
private long flgStockV;
private String nomeV;
private String descrizioneArticolo;
private long flgInMagazzino;
private String searchTxtWeb;
public ArticoloVarianteCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ArticoloVarianteCR() {}
public void setId_articoloVariante(long newId_articoloVariante) {
this.id_articoloVariante = newId_articoloVariante;
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public long getId_articoloVariante() {
return this.id_articoloVariante;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
return this.articolo;
}
public String getCodiceVariante() {
return (this.codiceVariante == null) ? AB_EMPTY_STRING : this.codiceVariante;
}
public void setCodiceVariante(String codiceVariante) {
this.codiceVariante = codiceVariante;
}
public long getFlgDisponibile() {
return this.flgDisponibile;
}
public void setFlgDisponibile(long flgDisponibile) {
this.flgDisponibile = flgDisponibile;
}
public long getId_tipoSel() {
return this.id_tipoSel;
}
public void setId_tipoSel(long id_tipoSel) {
this.id_tipoSel = id_tipoSel;
}
public long getFlgNascondi() {
return this.flgNascondi;
}
public void setFlgNascondi(long flgNascondi) {
this.flgNascondi = flgNascondi;
}
public long getFlgOrdinaArticolo() {
return this.flgOrdinaArticolo;
}
public void setFlgOrdinaArticolo(long flgOrdinaArticolo) {
this.flgOrdinaArticolo = flgOrdinaArticolo;
}
public long getId_clifor() {
return this.id_clifor;
}
public void setId_clifor(long id_clifor) {
this.id_clifor = id_clifor;
}
private long flgEscludiWeb = -1L;
private long flgQta;
private long qtaA = 9999L;
private long qtaDa = 1L;
public double getQtaAttribuitaV() {
return this.qtaAttribuitaV;
}
public void setQtaAttribuitaV(double qtaAttribuitaV) {
this.qtaAttribuitaV = qtaAttribuitaV;
}
public double getQtaInProduzioneV() {
return this.qtaInProduzioneV;
}
public void setQtaInProduzioneV(double qtaInProduzioneV) {
this.qtaInProduzioneV = qtaInProduzioneV;
}
public String getCodiceSerieV() {
return (this.codiceSerieV == null) ? AB_EMPTY_STRING : this.codiceSerieV;
}
public void setCodiceSerieV(String codiceSerieV) {
this.codiceSerieV = codiceSerieV;
}
public long getFlgStockV() {
return this.flgStockV;
}
public void setFlgStockV(long flgStockV) {
this.flgStockV = flgStockV;
}
public String getNomeV() {
return (this.nomeV == null) ? AB_EMPTY_STRING : this.nomeV;
}
public void setNomeV(String nomeV) {
this.nomeV = nomeV;
}
public String getDescrizioneArticolo() {
return (this.descrizioneArticolo == null) ? AB_EMPTY_STRING : this.descrizioneArticolo;
}
public void setDescrizioneArticolo(String descrizioneArticolo) {
this.descrizioneArticolo = descrizioneArticolo;
}
public long getFlgInMagazzino() {
return this.flgInMagazzino;
}
public void setFlgInMagazzino(long flgInMagazzino) {
this.flgInMagazzino = flgInMagazzino;
}
public String getSearchTxtWeb() {
return (this.searchTxtWeb == null) ? AB_EMPTY_STRING : this.searchTxtWeb.trim();
}
public void setSearchTxtWeb(String searchTxtWeb) {
this.searchTxtWeb = searchTxtWeb;
}
public long getFlgEscludiWeb() {
return this.flgEscludiWeb;
}
public void setFlgEscludiWeb(long flgEscludiWeb) {
this.flgEscludiWeb = flgEscludiWeb;
}
public long getFlgQta() {
return this.flgQta;
}
public void setFlgQta(long flgQta) {
this.flgQta = flgQta;
}
public long getQtaA() {
return this.qtaA;
}
public void setQtaA(long qtaA) {
this.qtaA = qtaA;
}
public long getQtaDa() {
return this.qtaDa;
}
public void setQtaDa(long qtaDa) {
this.qtaDa = qtaDa;
}
}

View file

@ -0,0 +1,114 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class CTipo extends _ArtAdapter implements Serializable {
private long id_tipo;
private long id_caratteristica;
private Tipo tipo;
private Caratteristica caratteristica;
public CTipo(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public CTipo() {}
public void setId_tipo(long newId_tipo) {
this.id_tipo = newId_tipo;
setTipo(null);
}
public void setId_caratteristica(long newId_caratteristica) {
this.id_caratteristica = newId_caratteristica;
setCaratteristica(null);
}
public long getId_tipo() {
return this.id_tipo;
}
public long getId_caratteristica() {
return this.id_caratteristica;
}
protected void deleteCascade() {}
public Vectumerator<CTipo> findByCR(CTipoCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from C_TIPO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (CR.getId_caratteristica() != 0L)
wc.addWc("A.id_caratteristica=" + CR.getId_caratteristica());
if (CR.getId_tipo() != 0L)
wc.addWc("A.id_tipo=" + CR.getId_tipo());
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator<CTipo> findCaratteristicheByTipo(long l_id_tipo, boolean soloWeb, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from C_TIPO AS A, TIPO as B";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_tipo=B.id_tipo");
if (l_id_tipo != 0L) {
StringBuffer tipoWc = new StringBuffer("(");
Tipo tipo = new Tipo(getApFull());
tipo.findByPrimaryKey(l_id_tipo);
StringTokenizer st = new StringTokenizer("" + l_id_tipo + l_id_tipo, ":");
while (st.hasMoreTokens()) {
String currentId = st.nextToken();
if (tipoWc.length() > 1)
tipoWc.append(" or ");
tipoWc.append("A.id_tipo=" + currentId);
}
tipoWc.append(" )");
wc.addWc(tipoWc.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator<CTipo> findTipiByCaratteristica(long l_id_caratteristica, int pageNumber, int pageRows) {
CTipoCR CR = new CTipoCR();
CR.setId_caratteristica(l_id_caratteristica);
return findByCR(CR, pageNumber, pageRows);
}
public Tipo getTipo() {
this.tipo = (Tipo)getSecondaryObject(this.tipo, Tipo.class, getId_tipo());
return this.tipo;
}
public void setTipo(Tipo tipo) {
this.tipo = tipo;
}
public Caratteristica getCaratteristica() {
this.caratteristica = (Caratteristica)getSecondaryObject(this.caratteristica, Caratteristica.class, new Long(getId_caratteristica()));
return this.caratteristica;
}
public void setCaratteristica(Caratteristica caratteristica) {
this.caratteristica = caratteristica;
}
}

View file

@ -0,0 +1,32 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class CTipoCR extends CRAdapter {
private long id_tipo;
private long id_caratteristica;
public CTipoCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public CTipoCR() {}
public void setId_tipo(long newId_tipo) {
this.id_tipo = newId_tipo;
}
public void setId_caratteristica(long newId_caratteristica) {
this.id_caratteristica = newId_caratteristica;
}
public long getId_tipo() {
return this.id_tipo;
}
public long getId_caratteristica() {
return this.id_caratteristica;
}
}

View file

@ -0,0 +1,32 @@
package it.acxent.art;
import java.io.Serializable;
public class CTipoKey implements Serializable {
private static final long serialVersionUID = 4927534830271711826L;
private long id_tipo;
private long id_caratteristica;
public CTipoKey(long newId_tipo, long newId_caratteristica) {
setId_tipo(newId_tipo);
setId_caratteristica(newId_caratteristica);
}
public void setId_tipo(long newId_tipo) {
this.id_tipo = newId_tipo;
}
public void setId_caratteristica(long newId_caratteristica) {
this.id_caratteristica = newId_caratteristica;
}
public long getId_tipo() {
return this.id_tipo;
}
public long getId_caratteristica() {
return this.id_caratteristica;
}
}

View file

@ -0,0 +1,316 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.DbInterface;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class Caratteristica extends _ArtAdapter implements Serializable {
private static final long serialVersionUID = -3717919132443402126L;
private long id_caratteristica;
private long flgCR;
private String descrizione_it;
private String icecatDescs;
private long flgTipoVal;
private long ordine;
private long flgRicercaWeb;
private String descrizioneAggiuntiva;
public static final int TIPO_VAL_BOOLEANO = 4;
public static final int TIPO_VAL_DATA = 5;
public static final int TIPO_VAL_DOUBLE = 2;
public static final int TIPO_VAL_INTERO = 1;
public static final int TIPO_VAL_LISTA = 6;
public static final int TIPO_VAL_STRINGA = 3;
public ResParm addTipo(long l_id_tipo) {
CTipo bean = new CTipo(getApFull());
bean.findByPrimaryKey(new CTipoKey(l_id_tipo, getId_caratteristica()));
bean.setId_tipo(l_id_tipo);
bean.setId_caratteristica(getId_caratteristica());
return bean.save();
}
public ResParm delTipo(long l_id_tipo) {
CTipo bean = new CTipo(getApFull());
bean.findByPrimaryKey(new CTipoKey(l_id_tipo, getId_caratteristica()));
return bean.delete();
}
public Caratteristica(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Caratteristica() {}
public void setId_caratteristica(long newId_caratteristica) {
this.id_caratteristica = newId_caratteristica;
}
public void setFlgTipoVal(long newFlgTipoVal) {
this.flgTipoVal = newFlgTipoVal;
}
public long getId_caratteristica() {
return this.id_caratteristica;
}
public String getTipoVal() {
return getTipoVal(getFlgTipoVal());
}
public long getFlgTipoVal() {
return this.flgTipoVal;
}
protected void deleteCascade() {
Vectumerator<Lista> vec = new Lista(getApFull()).findLista(getId_caratteristica(), 0, 0);
while (vec.hasMoreElements())
((DbInterface)vec.nextElement()).delete();
}
public Vectumerator findByCR(CaratteristicaCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from CARATTERISTICA AS A";
String s_Sql_Order = " order by A.ordine, A.descrizione_it";
WcString wc = new WcString();
if (!CR.getDescrizione().isEmpty())
wc.addWc("A.descrizione_it like'%" + CR.getDescrizione() + "%'");
if (CR.getFlgTipoVal() > 0L)
wc.addWc("A.flgTipoVal=" + CR.getFlgTipoVal());
if (CR.getId_tipo() != 0L) {
s_Sql_Find = s_Sql_Find + ", C_TIPO as B";
wc.addWc("A.id_caratteristica=B.id_caratteristica");
wc.addWc("B.id_tipo=" + CR.getId_tipo());
}
if (CR.getFlgRicercaWeb() == 0L) {
wc.addWc("(A.flgRicercaWeb is null or A.flgRicercaWeb=0)");
} else if (CR.getFlgRicercaWeb() > 0L) {
wc.addWc("A.flgRicercaWeb =" + CR.getFlgRicercaWeb());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByDescrizione(String l_Descrizione) {
String s_Sql_Find = "select A.* from CARATTERISTICA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.descrizione ='" + prepareSqlString(l_Descrizione) + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public Vectumerator findCaratteristicheByTipo(long l_id_tipo, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from CARATTERISTICA AS A, C_TIPO as B, TIPO as C";
String s_Sql_Order = " order by A.ordine";
WcString wc = new WcString();
wc.addWc("A.id_caratteristica=B.id_caratteristica");
wc.addWc("B.id_tipo=C.id_tipo");
StringBuffer tipoWc = new StringBuffer("(");
Tipo tipo = new Tipo(getApFull());
tipo.findByPrimaryKey(l_id_tipo);
StringTokenizer st = new StringTokenizer("" + l_id_tipo + l_id_tipo, ":");
while (st.hasMoreTokens()) {
String currentId = st.nextToken();
if (tipoWc.length() > 1)
tipoWc.append(" or ");
tipoWc.append("B.id_tipo=" + currentId);
}
tipoWc.append(" )");
wc.addWc(tipoWc.toString());
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator findListe(int pageNumber, int pageRows) {
CaratteristicaCR CR = new CaratteristicaCR();
CR.setFlgTipoVal(6L);
return findByCR(CR, pageNumber, pageRows);
}
public long getFlgCR() {
return this.flgCR;
}
public void setFlgCR(long flgCR) {
this.flgCR = flgCR;
}
public long getOrdine() {
return this.ordine;
}
public void setOrdine(long ordine) {
this.ordine = ordine;
}
private long calcolaOrdine() {
try {
PreparedStatement ps = getConn()
.prepareStatement("select max(ordine) as _max from CARATTERISTICA WHERE id_caratteristica!=" + getId_caratteristica());
long res = (long)getMax(ps, true) + 1L;
long decine = res / 10L;
return (decine + 1L) * 10L;
} catch (Exception e) {
handleDebug(e);
return 0L;
}
}
protected void prepareSave(PreparedStatement ps) throws SQLException {
if (getOrdine() == 0L)
setOrdine(calcolaOrdine());
super.prepareSave(ps);
}
public String getDescrizioneAggiuntiva() {
return (this.descrizioneAggiuntiva == null) ? "" : this.descrizioneAggiuntiva;
}
public void setDescrizioneAggiuntiva(String descrizione_en) {
this.descrizioneAggiuntiva = descrizione_en;
}
public String getDescrizione_it() {
return getDescrizione("it");
}
public void setDescrizione_it(String descrizione) {
this.descrizione_it = descrizione;
}
public String getDescrizione() {
return getDescrizione("it");
}
public static final String getTipoVal(long l_flgTipoVal) {
if (l_flgTipoVal == 1L)
return "Intero";
if (l_flgTipoVal == 2L)
return "Double";
if (l_flgTipoVal == 3L)
return "Stringa";
if (l_flgTipoVal == 4L)
return "Booleano";
if (l_flgTipoVal == 5L)
return "Data";
if (l_flgTipoVal == 6L)
return "Lista";
return "??";
}
public long getFlgRicercaWeb() {
return this.flgRicercaWeb;
}
public void setFlgRicercaWeb(long flgRicercaWeb) {
this.flgRicercaWeb = flgRicercaWeb;
}
public boolean useDescLangTables() {
return true;
}
public String getDescrizione(String lang) {
if (lang.isEmpty())
lang = "it";
return getDescTxtLang("descrizione", lang);
}
public String getDescrizioneAggiuntiva(String lang) {
if (lang.isEmpty())
lang = "it";
return getDescTxtLang("descrizioneAggiuntiva", lang);
}
public String getDescrizioneTipoAssociati() {
if (getId_caratteristica() == 0L)
return "";
StringBuilder sb = new StringBuilder();
Vectumerator<CTipo> vec = new CTipo(getApFull()).findTipiByCaratteristica(getId_caratteristica(), 0, 0);
while (vec.hasMoreElements()) {
CTipo row = (CTipo)vec.nextElement();
sb.append(row.getTipo().getDescrizioneCompleta());
if (vec.hasMoreElements())
sb.append("\n");
}
return sb.toString();
}
public String getDescrizioneTipoAssociatiHtml() {
return DBAdapter.convertStringToHtml(getDescrizioneTipoAssociati(), true);
}
public String getOptionListaHtml(String lang) {
if (getFlgTipoVal() == 6L) {
if (lang == null || lang.isEmpty())
lang = "it";
Vectumerator<Lista> vec = new Lista(getApFull()).findLista(getId_caratteristica(), 0, 0);
StringBuilder sb = new StringBuilder();
while (vec.hasMoreElements()) {
Lista option = (Lista)vec.nextElement();
sb.append("<option value='");
sb.append(option.getId_lista());
sb.append("'>");
sb.append(option.getValore(lang));
sb.append("</option>");
}
return sb.toString();
}
return "";
}
public String getIcecatDescs() {
return (this.icecatDescs == null) ? "" : this.icecatDescs.trim();
}
public void setIcecatDescs(String icecatDescs) {
this.icecatDescs = icecatDescs;
}
public void findByIcecatDesc(String l_icecatDesc) {
String s_Sql_Find = "select A.* from CARATTERISTICA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.icecatDescs ='" + prepareSqlString(l_icecatDesc) + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
}

View file

@ -0,0 +1,201 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class CaratteristicaArticolo extends _ArtAdapter implements Serializable {
private Caratteristica caratteristica;
private long id_caratteristica;
private long id_lista;
private Lista lista;
private Date valD;
private long valI;
private double valDouble;
private String valS;
private long valSN;
private long id_articolo;
public CaratteristicaArticolo() {}
public CaratteristicaArticolo(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
protected void deleteCascade() {}
public Vectumerator findByCR(CaratteristicaArticoloCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from caratteristica_articolo AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator<CaratteristicaArticolo> findById_articolo(long l_id_articolo, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.*, B.ordine from CARATTERISTICA_ARTICOLO AS A, CARATTERISTICA AS B";
String s_Sql_Order = " order by B.ordine";
WcString wc = new WcString();
wc.addWc("A.id_caratteristica=B.id_caratteristica");
wc.addWc("id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findById_articoloId_caratteristica(long l_id_articolo, long l_id_caratteristica) {
String s_Sql_Find = "select A.* from CARATTERISTICA_ARTICOLO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("id_articolo=" + l_id_articolo);
wc.addWc("id_caratteristica=" + l_id_caratteristica);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public Caratteristica getCaratteristica() {
this.caratteristica = (Caratteristica)getSecondaryObject(this.caratteristica, Caratteristica.class, new Long(getId_caratteristica()));
return this.caratteristica;
}
public long getId_articolo() {
return this.id_articolo;
}
public long getId_caratteristica() {
return this.id_caratteristica;
}
public long getId_lista() {
return this.id_lista;
}
public Lista getLista() {
this.lista = (Lista)getSecondaryObject(this.lista, Lista.class, new Long(getId_lista()));
return this.lista;
}
public String getVal() {
if (getId_articolo() == 0L)
return "";
if (getCaratteristica().getFlgTipoVal() == 3L)
return getValS();
if (getCaratteristica().getFlgTipoVal() == 1L)
return getNf().format(getValI());
if (getCaratteristica().getFlgTipoVal() == 2L)
return getNf().format(getValDouble());
if (getCaratteristica().getFlgTipoVal() == 5L)
return getDataFormat().format(getValD());
if (getCaratteristica().getFlgTipoVal() == 4L)
return (getValSN() == 0L) ? "No" : "Si";
if (getCaratteristica().getFlgTipoVal() == 6L)
return getLista().getValore();
return "??";
}
public Date getValD() {
return this.valD;
}
public long getValI() {
return this.valI;
}
public String getValS() {
return (this.valS == null) ? "" : this.valS;
}
public long getValSN() {
return this.valSN;
}
public void setCaratteristica(Caratteristica caratteristica) {
this.caratteristica = caratteristica;
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
}
public void setId_caratteristica(long newId_caratteristica) {
this.id_caratteristica = newId_caratteristica;
setCaratteristica(null);
}
public void setId_lista(long newId_lista) {
this.id_lista = newId_lista;
setLista(null);
}
public void setLista(Lista newLista) {
this.lista = newLista;
}
public void setValD(Date newValD) {
this.valD = newValD;
}
public void setValI(long newValI) {
this.valI = newValI;
}
public void setValS(String newValS) {
this.valS = newValS;
}
public void setValSN(long newValSN) {
this.valSN = newValSN;
}
public double getValDouble() {
return this.valDouble;
}
public void setValDouble(double d) {
this.valDouble = d;
}
public String getVal(String lang) {
if (getId_articolo() == 0L)
return "";
if (getCaratteristica().getFlgTipoVal() == 3L)
return getValS();
if (getCaratteristica().getFlgTipoVal() == 1L)
return getNf().format(getValI());
if (getCaratteristica().getFlgTipoVal() == 2L)
return getNf().format(getValDouble());
if (getCaratteristica().getFlgTipoVal() == 5L)
return getDataFormat().format(getValD());
if (getCaratteristica().getFlgTipoVal() == 4L)
return (getValSN() == 0L) ? "No" : "Si";
if (getCaratteristica().getFlgTipoVal() == 6L)
return getLista().getValore(lang);
return "??";
}
}

View file

@ -0,0 +1,95 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import java.sql.Date;
public class CaratteristicaArticoloCR extends CRAdapter {
private long id_articolo;
private long id_caratteristica;
private long valI;
private String valS;
private long valSN;
private Date valD;
private long id_lista;
private Lista lista;
public CaratteristicaArticoloCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public CaratteristicaArticoloCR() {}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
}
public void setId_caratteristica(long newId_caratteristica) {
this.id_caratteristica = newId_caratteristica;
}
public void setValI(long newValI) {
this.valI = newValI;
}
public void setValS(String newValS) {
this.valS = newValS;
}
public void setValSN(long newValSN) {
this.valSN = newValSN;
}
public void setValD(Date newValD) {
this.valD = newValD;
}
public void setId_lista(long newId_lista) {
this.id_lista = newId_lista;
setLista(null);
}
public long getId_articolo() {
return this.id_articolo;
}
public long getId_caratteristica() {
return this.id_caratteristica;
}
public long getValI() {
return this.valI;
}
public String getValS() {
return (this.valS == null) ? "" : this.valS;
}
public long getValSN() {
return this.valSN;
}
public Date getValD() {
return this.valD;
}
public long getId_lista() {
return this.id_lista;
}
public void setLista(Lista newLista) {
this.lista = newLista;
}
public Lista getLista() {
return (Lista)getSecondaryObject(this.lista, Lista.class, new Long(
getId_lista()));
}
}

View file

@ -0,0 +1,32 @@
package it.acxent.art;
import java.io.Serializable;
public class CaratteristicaArticoloKey implements Serializable {
private static final long serialVersionUID = -8061445306807842473L;
private long id_articolo;
private long id_caratteristica;
public CaratteristicaArticoloKey(long newId_articolo, long newId_caratteristica) {
setId_articolo(newId_articolo);
setId_caratteristica(newId_caratteristica);
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
}
public void setId_caratteristica(long newId_caratteristica) {
this.id_caratteristica = newId_caratteristica;
}
public long getId_articolo() {
return this.id_articolo;
}
public long getId_caratteristica() {
return this.id_caratteristica;
}
}

View file

@ -0,0 +1,88 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class CaratteristicaCR extends CRAdapter {
private long id_caratteristica;
private String descrizione;
private long flgTipoVal;
private long id_tipo;
private Tipo tipo;
private long flgCR;
public static final String getTipoVal(long l_flgTipoVal) {
return Caratteristica.getTipoVal(l_flgTipoVal);
}
private long flgRicercaWeb = -1L;
public CaratteristicaCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public CaratteristicaCR() {}
public void setId_caratteristica(long newId_caratteristica) {
this.id_caratteristica = newId_caratteristica;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public void setFlgTipoVal(long newFlgTipoVal) {
this.flgTipoVal = newFlgTipoVal;
}
public long getId_caratteristica() {
return this.id_caratteristica;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione;
}
public long getFlgTipoVal() {
return this.flgTipoVal;
}
public long getId_tipo() {
return this.id_tipo;
}
public Tipo getTipo() {
this.tipo = (Tipo)getSecondaryObject(this.tipo, Tipo.class, getId_tipo());
return this.tipo;
}
public void setId_tipo(long id_tipo) {
this.id_tipo = id_tipo;
setTipo(null);
}
public void setTipo(Tipo tipo) {
this.tipo = tipo;
}
public long getFlgCR() {
return this.flgCR;
}
public void setFlgCR(long flgCR) {
this.flgCR = flgCR;
}
public long getFlgRicercaWeb() {
return this.flgRicercaWeb;
}
public void setFlgRicercaWeb(long flgRicercaWeb) {
this.flgRicercaWeb = flgRicercaWeb;
}
}

View file

@ -0,0 +1,174 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Locale;
public class Colore extends _ArtAdapter implements Serializable {
public static final String DESC_COLORE_ND = "N.D.";
private long id_colore;
private String descrizione;
private String codiceColore;
public Colore(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Colore() {}
public void setId_colore(long newId_colore) {
this.id_colore = newId_colore;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public long getId_colore() {
return this.id_colore;
}
public String getDescrizione() {
return getDescrizione("it");
}
protected void deleteCascade() {}
public Vectumerator findByCR(ColoreCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from COLORE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
String wcLang = "";
if (!CR.getLang().isEmpty())
wcLang = " and LL.lang='" + CR.getLang() + "'";
if (!CR.getLang().isEmpty()) {
s_Sql_Find = s_Sql_Find + " LEFT join (SELECT LL.* FROM DESC_TXT_LANG AS LL where LL.tabella='COLORE' AND LL.campo='descrizione' " + s_Sql_Find + " ) AS L ON A.id_colore=L.idTabella";
if (CR.getFlgOrderBy() == 1L) {
s_Sql_Order = " ORDER BY CAST(codiceColore as SIGNED INTEGER)";
} else if (CR.getFlgOrderBy() == 0L) {
s_Sql_Order = " order by L.descrizione, A.descrizione";
}
}
if (!CR.getSearchTxt().isEmpty() && !CR.getSearchTxt().equals("*")) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken().trim();
txt.append("(A.codiceColore = '" + token + "' or L.descrizione254 like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
if (txt.length() > 2)
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator findById_articolo(long l_id_articolo, String l_lang) {
String s_Sql_Find = "select A.* from COLORE AS A INNER JOIN ARTICOLO_VARIANTE AS B ON A.id_colore=B.id_colore ";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!l_lang.isEmpty()) {
s_Sql_Find = s_Sql_Find + " LEFT join (SELECT LL.* FROM DESC_TXT_LANG AS LL where LL.tabella='COLORE' AND LL.campo='descrizione' and LL.lang='" + s_Sql_Find + "' ) AS L ON A.id_colore=L.idTabella";
s_Sql_Order = " order by L.descrizione, A.descrizione";
}
wc.addWc("B.id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByDescrizione(String l_descrizione) {
String s_Sql_Find = "select A.* from COLORE AS A";
String s_Sql_Order = " order by A.descrizione";
WcString wc = new WcString();
wc.addWc("A.descrizione ='" + l_descrizione + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
findFirstRecord(stmt);
} catch (Exception e) {
handleDebug(e, 2);
}
}
public boolean useDescLangTables() {
return true;
}
public ResParm save() {
setDescrizione(getDescrizione(Locale.ITALIAN.getLanguage()));
if (getCodiceColore().isEmpty())
setCodiceColore(calcolaProgCodice());
return super.save();
}
private String calcolaProgCodice() {
try {
String s_sql = "select *, CONVERT(codiceColore,UNSIGNED INTEGER) as codice from COLORE as A";
WcString wc = new WcString();
wc.addWc("id_colore !=" + getId_colore());
s_sql = " select B.codice as codiceColore from (" + s_sql + wc.toString() + ") as B order by codiceColore desc limit 1";
PreparedStatement ps = getConn().prepareStatement(s_sql);
Vectumerator<Colore> vec = findRows(ps);
if (!vec.hasMoreElements())
return "1";
Colore colore = (Colore)vec.nextElement();
return String.valueOf(Long.valueOf(colore.getCodiceColore()) + 1L);
} catch (Exception e) {
return "";
}
}
public String getCodiceColore() {
return (this.codiceColore == null) ? "" : this.codiceColore.trim();
}
public void setCodiceColore(String codiceColore) {
this.codiceColore = codiceColore;
}
public String getDescrizioneCompleta(String lang) {
StringBuilder sb = new StringBuilder();
String temp = getDescrizionePS(lang);
if (getCodiceColore().isEmpty() && getCodiceColore().equals(temp)) {
sb.append(temp);
} else {
sb.append(getCodiceColore());
sb.append(" ");
sb.append(temp);
}
return sb.toString();
}
public String getDescrizioneCompleta() {
StringBuilder sb = new StringBuilder();
if (getCodiceColore().isEmpty() && getCodiceColore().equals(getDescrizione())) {
sb.append(getDescrizione());
} else {
sb.append(getCodiceColore());
sb.append(" ");
sb.append(getDescrizione());
}
return sb.toString();
}
}

View file

@ -0,0 +1,36 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class ColoreCR extends CRAdapter {
public static final long ORDER_BY_DESCRIZIONE = 0L;
public static final long ORDER_BY_CODICE = 1L;
private long id_colore;
private String descrizione;
public ColoreCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ColoreCR() {}
public void setId_colore(long newId_colore) {
this.id_colore = newId_colore;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public long getId_colore() {
return this.id_colore;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
}

View file

@ -0,0 +1,76 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class Componente extends _ArtAdapter implements Serializable {
private static final long serialVersionUID = -4818220967606343494L;
private long id_componente;
private String sigla;
public Componente(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Componente() {}
public long getId_componente() {
return this.id_componente;
}
public void setId_componente(long id_componente) {
this.id_componente = id_componente;
}
public String getDescrizione() {
return getDescrizione("");
}
public String getSigla() {
return (this.sigla == null) ? "" : this.sigla;
}
public void setSigla(String sigla) {
this.sigla = sigla;
}
public boolean useDescLangTables() {
return true;
}
public Vectumerator<Componente> findByCR(ComponenteCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from COMPONENTE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findBySigla(String l_sigla) {
String s_Sql_Find = "select A.* from COMPONENTE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.sigla='" + l_sigla + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public String getDescrizioneCompleta(String lang) {
return getSigla() + " " + getSigla();
}
}

View file

@ -0,0 +1,32 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class ComponenteCR extends CRAdapter {
private long id_componente;
private String sigla;
public ComponenteCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ComponenteCR() {}
public long getId_componente() {
return this.id_componente;
}
public void setId_componente(long id_componente) {
this.id_componente = id_componente;
}
public String getSigla() {
return this.sigla;
}
public void setSigla(String sigla) {
this.sigla = sigla;
}
}

View file

@ -0,0 +1,89 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class GoogleCategory extends DBAdapter implements Serializable {
private static final long serialVersionUID = 1617360550628L;
private long id_googleCategory;
private long codice;
private String descrizione;
public GoogleCategory(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public GoogleCategory() {}
public void setId_googleCategory(long newId_googleCategory) {
this.id_googleCategory = newId_googleCategory;
}
public void setCodice(long newCodice) {
this.codice = newCodice;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public long getId_googleCategory() {
return this.id_googleCategory;
}
public long getCodice() {
return this.codice;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
protected ResParm checkDeleteCascade() {
return new ResParm(true);
}
protected void deleteCascade() {}
public Vectumerator<GoogleCategory> findByCR(GoogleCategoryCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from GOOGLE_CATEGORY AS A";
String s_Sql_Order = " order by A.descrizione";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.descrizione like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public String getDescrizioneCompleta() {
if (getId_googleCategory() == 0L)
return "";
return "" + getCodice() + " - " + getCodice();
}
}

View file

@ -0,0 +1,42 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class GoogleCategoryCR extends CRAdapter {
private long id_googleCategory;
private long codice;
private String descrizione;
public GoogleCategoryCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public GoogleCategoryCR() {}
public void setId_googleCategory(long newId_googleCategory) {
this.id_googleCategory = newId_googleCategory;
}
public void setCodice(long newCodice) {
this.codice = newCodice;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public long getId_googleCategory() {
return this.id_googleCategory;
}
public long getCodice() {
return this.codice;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
}

View file

@ -0,0 +1,218 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class Kit extends _ArtAdapter implements Serializable {
private static final long serialVersionUID = 805638952521639067L;
private long id_kit;
private long id_articoloSecondario;
private Articolo articoloSecondario;
private ArticoloVariante articoloVariante;
private long id_articolo;
private long id_articoloVariante;
private long id_articoloVarianteSecondario;
private Articolo articolo;
private ArticoloVariante articoloVarianteSecondario;
private long flgEstendiVarianteKit;
public Kit(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Kit() {}
public void setId_kit(long newId_kit) {
this.id_kit = newId_kit;
}
public void setId_articoloSecondario(long newId_articolo) {
this.id_articoloSecondario = newId_articolo;
setArticoloSecondario(null);
}
public long getId_articoloSecondario() {
return this.id_articoloSecondario;
}
public void setArticoloSecondario(Articolo newArticolo) {
this.articoloSecondario = newArticolo;
}
public Articolo getArticoloSecondario() {
this.articoloSecondario = (Articolo)getSecondaryObject(this.articoloSecondario, Articolo.class, getId_articoloSecondario());
return this.articoloSecondario;
}
protected void deleteCascade() {}
public Vectumerator<Kit> findByCR(KitCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from KIT AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public long getId_kit() {
return this.id_kit;
}
public Vectumerator<Kit> findByArticoloPrimario(long l_id_articoloPrimario, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* , B.nome from KIT AS A, ARTICOLO AS B";
String s_Sql_Order = " order by B.nome";
WcString wc = new WcString();
wc.addWc("A.id_articolo=B.id_articolo");
wc.addWc("A.id_articolo=" + l_id_articoloPrimario);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
Vectumerator<Kit> vec = findRows(stmt, pageNumber, pageRows);
return vec;
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator<Kit> findById_articoloVariante(long l_id_articoloVariante, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from KIT AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("(id_articoloVariante=" + l_id_articoloVariante + " or id_articoloVarianteSecondario=" + l_id_articoloVariante + ")");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator<Kit> findById_articoloVarianteDisponibile(long l_id_articoloVariante, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from KIT AS A, DISPONIBILITA AS C";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_articoloVarianteSecondario=C.id_articoloVarianteD");
wc.addWc("A.id_articoloVariante=" + l_id_articoloVariante);
wc.addWc("C.quantitaD>0");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void setArticolo(Articolo articoloPrimario) {
this.articolo = articoloPrimario;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setId_articolo(long id_articolo) {
this.id_articolo = id_articolo;
setArticolo(null);
}
public ArticoloVariante getArticoloVariante() {
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class,
getId_articoloVariante());
return this.articoloVariante;
}
public void setArticoloVariante(ArticoloVariante articoloVariantePrimario) {
this.articoloVariante = articoloVariantePrimario;
}
public ArticoloVariante getArticoloVarianteSecondario() {
this.articoloVarianteSecondario = (ArticoloVariante)getSecondaryObject(this.articoloVarianteSecondario, ArticoloVariante.class,
getId_articoloVarianteSecondario());
return this.articoloVarianteSecondario;
}
public void setArticoloVarianteSecondario(ArticoloVariante articoloVarianteSecondario) {
this.articoloVarianteSecondario = articoloVarianteSecondario;
}
public long getId_articoloVariante() {
return this.id_articoloVariante;
}
public void setId_articoloVariante(long id_articoloVariante) {
this.id_articoloVariante = id_articoloVariante;
setArticoloVariante(null);
}
public long getId_articoloVarianteSecondario() {
return this.id_articoloVarianteSecondario;
}
public void setId_articoloVarianteSecondario(long id_articoloVarianteSecondario) {
this.id_articoloVarianteSecondario = id_articoloVarianteSecondario;
setArticoloVarianteSecondario(null);
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
return this.articolo;
}
public long getId_articoloAssociato(long l_id) {
if (l_id == getId_articoloSecondario())
return getId_articolo();
if (l_id == getId_articolo())
return getId_articoloSecondario();
return 0L;
}
public void findById_articoloPrimarioId_articoloSecondario(long l_id_articoloPrimario, long l_id_articoloSecondario) {
String s_Sql_Find = "select A.* from KIT AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("((id_articolo=" + l_id_articoloPrimario + " and id_articoloSecondario=" + l_id_articoloSecondario + ") or(id_articolo=" + l_id_articoloSecondario + " and id_articoloSecondario=" + l_id_articoloPrimario + "))");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public Articolo getArticoloAssociato(long l_id) {
if (l_id == getId_articoloSecondario())
return getArticolo();
if (l_id == getId_articolo())
return getArticoloSecondario();
return new Articolo(getApFull());
}
public long getFlgEstendiVarianteKit() {
return this.flgEstendiVarianteKit;
}
public void setFlgEstendiVarianteKit(long flgEstendiVariante) {
this.flgEstendiVarianteKit = flgEstendiVariante;
}
}

View file

@ -0,0 +1,12 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class KitCR extends CRAdapter {
public KitCR() {}
public KitCR(ApplParmFull newAp) {
super(newAp);
}
}

View file

@ -0,0 +1,191 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class Lista extends _ArtAdapter implements Serializable {
private Caratteristica caratteristica;
private long id_caratteristica;
private long id_lista;
private String valore;
private String icecatValues;
public Caratteristica getCaratteristica() {
this.caratteristica = (Caratteristica)getSecondaryObject(this.caratteristica, Caratteristica.class, new Long(getId_caratteristica()));
return this.caratteristica;
}
public long getId_caratteristica() {
return this.id_caratteristica;
}
public void setCaratteristica(Caratteristica caratteristica) {
this.caratteristica = caratteristica;
}
public void setId_caratteristica(long newId_caratteristica) {
this.id_caratteristica = newId_caratteristica;
setCaratteristica(null);
}
public Lista(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Lista() {}
public void setId_lista(long newId_lista) {
this.id_lista = newId_lista;
}
public void setValore(String newValore) {
this.valore = newValore;
}
public long getId_lista() {
return this.id_lista;
}
public String getValore() {
if (this.valore == null || this.valore.isEmpty())
return getValore("it");
return (this.valore == null) ? "" : this.valore;
}
protected void deleteCascade() {}
public Vectumerator<Lista> findLista(long l_id_caratteristica, int pageNumber, int pageRows) {
ListaCR CR = new ListaCR();
CR.setId_caratteristicaR(l_id_caratteristica);
return findByCR(CR, pageNumber, pageRows);
}
public Vectumerator<Lista> findByCR(ListaCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.id_lista, A.id_caratteristica, C.descrizione AS valore, A.icecatValues from LISTA AS A inner join CARATTERISTICA as B on B.id_caratteristica=A.id_caratteristica INNER JOIN DESC_TXT_LANG AS C ON C.tabella = 'LISTA' AND C.lang = '" + CR.getLang() + "' INNER JOIN DESC_TXT_LANG AS D ON D.tabella = 'CARATTERISTICA' AND D.lang = '" +
CR.getLang() + "' ";
String s_Sql_Order = " order by D.descrizione, A.valore";
WcString wc = new WcString();
wc.addWc("A.id_caratteristica=B.id_caratteristica");
wc.addWc("C.idTabella = A.id_lista");
wc.addWc("D.idTabella = B.id_caratteristica");
if (CR.getId_caratteristicaR() > 0L)
wc.addWc("A.id_caratteristica=" + CR.getId_caratteristicaR());
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByCaratteristicaIcecatvalue(long l_id_caratteristica, String l_icecatValue) {
String s_Sql_Find = "select A.* from LISTA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_caratteristica=" + l_id_caratteristica);
wc.addWc("A.icecatValues ='" + l_icecatValue + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public boolean useDescLangTables() {
return true;
}
public String getValore(String lang) {
if (lang.isEmpty())
lang = "it";
return getDescTxtLang("valore", lang);
}
public Vectumerator findByTipoCheNonFunziona(long l_id_tipo, String lang) {
String s_Sql_Find = "select A.id_lista, A.id_caratteristica, C.descrizione AS valore from LISTA AS A inner join CARATTERISTICA as B on B.id_caratteristica=A.id_caratteristica inner join C_TIPO AS CT ON CT.id_caratteristica=A.id_caratteristica inner join TIPO AS T ON T.id_tipo=CT.id_tipo INNER JOIN DESC_TXT_LANG AS C ON C.tabella = 'LISTA' AND C.lang = '" + lang + "' INNER JOIN DESC_TXT_LANG AS D ON D.tabella = 'CARATTERISTICA' AND D.lang = '" + lang + "' ";
String s_Sql_Order = " order by D.descrizione, A.valore";
WcString wc = new WcString();
wc.addWc("A.id_caratteristica=B.id_caratteristica");
wc.addWc("C.idTabella = A.id_lista");
wc.addWc("D.idTabella = B.id_caratteristica");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
return findRows(stmt);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator<Lista> findByTipo(long l_id_tipo, String lang) {
if (l_id_tipo == 0L)
return AB_EMPTY_VECTUMERATOR;
String s_Sql_FindC = "select A.id_caratteristica from C_TIPO AS A, TIPO as B";
String s_Sql_OrderC = "";
WcString wcC = new WcString();
wcC.addWc("A.id_tipo=B.id_tipo");
if (l_id_tipo != 0L) {
StringBuffer tipoWc = new StringBuffer("(");
Tipo tipo = new Tipo(getApFull());
tipo.findByPrimaryKey(l_id_tipo);
StringTokenizer st = new StringTokenizer(tipo.getIndici(), ":");
while (st.hasMoreTokens()) {
String currentId = st.nextToken();
if (!currentId.isEmpty()) {
if (tipoWc.length() > 1)
tipoWc.append(" or ");
tipoWc.append("A.id_tipo=" + currentId);
}
}
tipoWc.append(")");
if (tipoWc.length() > 2)
wcC.addWc(tipoWc.toString());
}
String s_Sql_Find = "select A.id_lista, A.id_caratteristica, C.descrizione AS valore from LISTA AS A inner join CARATTERISTICA as B on B.id_caratteristica=A.id_caratteristica INNER JOIN DESC_TXT_LANG AS C ON C.tabella = 'LISTA' AND C.lang = '" + lang + "' INNER JOIN DESC_TXT_LANG AS D ON D.tabella = 'CARATTERISTICA' AND D.lang = '" + lang + "' ";
String s_Sql_Order = " order by D.descrizione, A.valore";
WcString wc = new WcString();
wc.addWc("A.id_caratteristica=B.id_caratteristica");
wc.addWc("C.idTabella = A.id_lista");
wc.addWc("D.idTabella = B.id_caratteristica");
wc.addWc("A.id_caratteristica in (" + s_Sql_FindC + wcC.toString() + ")");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
return findRows(stmt);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public String getIcecatValues() {
return (this.icecatValues == null) ? "" : this.icecatValues.trim();
}
public void setIcecatValues(String icecatValues) {
this.icecatValues = icecatValues;
}
public void findByValore(String l_valore) {
String s_Sql_Find = "select A.* from LISTA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.valore ='" + l_valore + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
}

View file

@ -0,0 +1,42 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class ListaCR extends CRAdapter {
private long id_caratteristicaR;
private long id_lista;
private String valore;
public ListaCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ListaCR() {}
public void setId_lista(long newId_lista) {
this.id_lista = newId_lista;
}
public void setValore(String newValore) {
this.valore = newValore;
}
public long getId_lista() {
return this.id_lista;
}
public String getValore() {
return (this.valore == null) ? "" : this.valore;
}
public long getId_caratteristicaR() {
return this.id_caratteristicaR;
}
public void setId_caratteristicaR(long l) {
this.id_caratteristicaR = l;
}
}

View file

@ -0,0 +1,692 @@
package it.acxent.art;
import it.acxent.common.StatusMsg;
import it.acxent.db.AddImgInterface;
import it.acxent.db.ApplParmFull;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.ScaleImage;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Timer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
public class Marca extends _ArtAdapter implements Serializable, AddImgInterface {
private long id_marca;
private String descrizioniImport;
private String articoliTrattati;
private String link;
private String indiciTipo;
private String tag;
private String descrizione;
private String tagOfferta;
private long flgIcecatAuto;
private long flgIncludiMainSitemap;
private String nomeSeo;
class ThreadIndicizzoMarche extends Thread {
private long id_marca;
public ThreadIndicizzoMarche(long l_id_marca) {
this.id_marca = l_id_marca;
if (!Marca.isThreadAttivo()) {
Marca.threadindicizzoMarche = true;
start();
}
}
public void run() {
boolean debug = false;
String TAG_THREAD_MSG = "INDICIZZAZIONE MARCHE ";
Timer timer = new Timer();
timer.start();
ResParm rp = new ResParm(true);
Marca bean = new Marca(Marca.this.getApFull());
if (this.id_marca > 0L) {
bean.findByPrimaryKey(this.id_marca);
rp = bean.aggiornaIndiciTipo("INDICIZZAZIONE MARCHE ");
} else {
rp = bean.aggiornaIndiciTipoAll("INDICIZZAZIONE MARCHE ");
if (rp.getStatus())
rp = bean.aggiornaIndiciMarcheSuTipo("INDICIZZAZIONE MARCHE ");
}
rp.append(bean.aggiornaTagAll("INDICIZZAZIONE MARCHE "));
timer.stop();
StatusMsg.updateMsgByTag(Marca.this.getApFull(), "INDICIZZAZIONE MARCHE ", " FINE " + rp.getMsg() + " " + timer.getDurataHourMin());
try {
sleep(10000L);
} catch (Exception e) {}
StatusMsg.deleteMsgByTag(Marca.this.getApFull(), "INDICIZZAZIONE MARCHE ");
Marca.threadindicizzoMarche = false;
}
}
public static boolean threadindicizzoMarche = false;
public Marca(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Marca() {}
public void setId_marca(long newId_marca) {
this.id_marca = newId_marca;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public long getId_marca() {
return this.id_marca;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.toUpperCase().trim();
}
protected void deleteCascade() {}
public Vectumerator<Marca> findByCR(MarcaCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from MARCA AS A";
String s_Sql_Order = " order by A.descrizione";
WcString wc = new WcString();
if (!CR.getDescrizioneS().isEmpty())
wc.addWc("A.descrizione like'" + CR.getDescrizioneS() + "%'");
if (!CR.getDescrizione().isEmpty())
wc.addWc("A.descrizione like'" + CR.getDescrizione() + "%'");
if (!CR.getTag().isEmpty())
wc.addWc("A.tag like'" + CR.getTag() + "%'");
if (!CR.getTagOfferta().isEmpty())
wc.addWc("A.tagOfferta like'" + CR.getTagOfferta() + "%'");
if (CR.getFlgIcecatAuto() == 0L) {
wc.addWc("(A.flgIcecatAuto =0 or A.flgIcecatAuto is null)");
} else if (CR.getFlgIcecatAuto() > 0L) {
wc.addWc("A.flgIcecatAuto=" + CR.getFlgIcecatAuto());
}
if (CR.getFlgIncludiMainSitemap() == 0L) {
wc.addWc("(A.flgIncludiMainSitemap =0 or A.flgIncludiMainSitemap is null)");
} else if (CR.getFlgIncludiMainSitemap() > 0L) {
wc.addWc("A.flgIncludiMainSitemap=" + CR.getFlgIncludiMainSitemap());
}
String l_letteraIniziale = CR.getLetteraIniziale();
if (l_letteraIniziale.equals("AF")) {
wc.addWc("A.descrizione >= 'A%'");
wc.addWc("A.descrizione <= 'G%'");
} else if (l_letteraIniziale.equals("GM")) {
wc.addWc("A.descrizione >= 'G%'");
wc.addWc("A.descrizione <= 'N%'");
} else if (l_letteraIniziale.equals("NR")) {
wc.addWc("A.descrizione >= 'N%'");
wc.addWc("A.descrizione <= 'S%'");
} else if (l_letteraIniziale.equals("SZ")) {
wc.addWc("A.descrizione >= 'S%'");
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByDescrizione(String l_desc) {
String s_Sql_Find = "select A.* from MARCA AS A";
String s_Sql_Order = "";
String wc = "";
wc = buildWc(wc, "A.descrizione like'" + l_desc + "%'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc);
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public Vectumerator<Marca> findMarchePresentiByTipoTag(long l_id_tipo, String l_tag) {
String s_Sql_Find = "select distinct A.* from MARCA as A inner join ARTICOLO as B on A.id_marca=B.id_marca";
String s_Sql_Order = " order by A.descrizione ";
WcString wc = new WcString();
if (l_id_tipo > 0L) {
wc.addWc("A.indiciTipo like '%:" + l_id_tipo + ":%'");
} else {
wc.addWc("A.indiciTipo is not null");
}
if (l_tag != null && !l_tag.isEmpty())
wc.addWc("A.tag like '%," + l_tag + ",%'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
return findRows(stmt);
} catch (Exception e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public String getArticoliTrattati() {
return (this.articoliTrattati == null) ? "" : this.articoliTrattati.trim();
}
public void setArticoliTrattati(String articoliTrattati) {
this.articoliTrattati = articoliTrattati;
}
public String getLink() {
return (this.link == null) ? "" : this.link.trim();
}
public void setLink(String link) {
this.link = link;
}
public String getIndiciTipo() {
return (this.indiciTipo == null) ? "" : this.indiciTipo.trim();
}
public void setIndiciTipo(String indiciTipo) {
this.indiciTipo = indiciTipo;
}
public ResParm aggiornaIndiciTipoAll(String TAG_THREAD_MSG) {
Vectumerator<Marca> vec = findAll();
ResParm rp = new ResParm();
while (vec.hasMoreElements()) {
Marca row = (Marca)vec.nextElement();
rp = row.aggiornaIndiciTipo(TAG_THREAD_MSG);
if (!rp.getStatus())
break;
}
return rp;
}
public ResParm aggiornaTagAll(String TAG_THREAD_MSG) {
StatusMsg.updateMsgByTag(getApFull(), TAG_THREAD_MSG, "Aggiorna Tag Marche....");
String SEP = ",";
int num = 0, numTot = 0;
Vectumerator<Marca> vec = findAll();
numTot = vec.getTotNumberOfRecords();
ResParm rp = new ResParm();
Articolo art = new Articolo(getApFull());
ArticoloCR CRArt = new ArticoloCR();
CRArt.setFlgEscludiWeb(0L);
CRArt.setFlgNascondi(0L);
while (vec.hasMoreElements()) {
Marca row = (Marca)vec.nextElement();
StringBuilder newTag = new StringBuilder();
num++;
StatusMsg.updateMsgByTag(getApFull(), TAG_THREAD_MSG, "Aggiorna Tag Marche: " + num + "/" + numTot + " " + row.getDescrizione());
CRArt.setId_marca(row.getId_marca());
CRArt.setFlgNoleggio(0L);
CRArt.setFlgStockOfferte(1L);
Vectumerator<Articolo> vecArt = art.findByCR(CRArt, 1, 1);
if (vecArt.getTotNumberOfRecords() > 0) {
newTag.append(",");
newTag.append("OFFERTA");
}
CRArt.setFlgStockOfferte(2L);
vecArt = art.findByCR(CRArt, 1, 1);
if (vecArt.getTotNumberOfRecords() > 0) {
newTag.append(",");
newTag.append("STOCK");
}
CRArt.setFlgStockOfferte(3L);
vecArt = art.findByCR(CRArt, 1, 1);
if (vecArt.getTotNumberOfRecords() > 0) {
newTag.append(",");
newTag.append("USATO");
}
CRArt.setFlgStockOfferte(4L);
vecArt = art.findByCR(CRArt, 1, 1);
if (vecArt.getTotNumberOfRecords() > 0) {
newTag.append(",");
newTag.append("NOVITA");
}
CRArt.setFlgStockOfferte(0L);
CRArt.setFlgNoleggio(20L);
vecArt = art.findByCR(CRArt, 1, 1);
if (vecArt.getTotNumberOfRecords() > 0) {
newTag.append(",");
newTag.append("NOLEGGIO");
}
row.setTag(newTag.toString());
rp = row.save();
if (!rp.getStatus())
break;
}
return rp;
}
public ResParm aggiornaIndiciTipo(String TAG_THREAD_MSG) {
ResParm rp = new ResParm();
if (getId_marca() > 0L) {
StatusMsg.updateMsgByTag(getApFull(), TAG_THREAD_MSG, getDescrizione());
String DELIM = ":";
Vectumerator<Tipo> vec = new Tipo(getApFull()).findTipiArticoliWebByMarca(getId_marca());
HashSet<String> hsIDT = new HashSet<>();
while (vec.hasMoreElements()) {
Tipo row = (Tipo)vec.nextElement();
StringTokenizer st = new StringTokenizer(row.getIndici(), ":");
while (st.hasMoreTokens()) {
String currentId = st.nextToken();
if (!currentId.isEmpty() && !hsIDT.contains(currentId))
hsIDT.add(currentId);
}
}
vec = new Tipo(getApFull()).findTipiAggiuntiviArticoliWebByMarca(getId_marca());
while (vec.hasMoreElements()) {
Tipo row = (Tipo)vec.nextElement();
StringTokenizer st = new StringTokenizer(row.getIndici(), ":");
while (st.hasMoreTokens()) {
String currentId = st.nextToken();
if (!currentId.isEmpty() && !hsIDT.contains(currentId))
hsIDT.add(currentId);
}
}
Iterator<String> iteHsIDT = hsIDT.iterator();
StringBuilder sb = new StringBuilder();
if (iteHsIDT.hasNext())
sb.append(":");
while (iteHsIDT.hasNext()) {
sb.append(iteHsIDT.next());
sb.append(":");
}
setIndiciTipo(sb.toString());
rp = save();
StatusMsg.updateMsgByTag(getApFull(), TAG_THREAD_MSG, getDescrizione() + " " + getDescrizione() + " " + getIndiciTipo());
return rp;
}
return rp;
}
public ResParm aggiornaIndiciMarcheSuTipo(String TAG_THREAD_MSG) {
ResParm rp = new ResParm();
StatusMsg.updateMsgByTag(getApFull(), TAG_THREAD_MSG, "INIZIO INDICIZZAZIONE MARCHE SUI TIPI...");
Vectumerator<Marca> vec = findAll();
HashMap<Long, String> hmTipo = new HashMap<>();
StringBuilder sbErr = new StringBuilder();
while (vec.hasMoreElements()) {
Marca row = (Marca)vec.nextElement();
StatusMsg.updateMsgByTag(getApFull(), TAG_THREAD_MSG, "INDICIZZAZIONE MARCHE SUI TIPI..." + row.getDescrizione());
if (!row.getIndiciTipo().isEmpty()) {
StringTokenizer st = new StringTokenizer(row.getIndiciTipo(), ":");
while (st.hasMoreTokens()) {
String currentToken = st.nextToken();
if (!currentToken.isEmpty()) {
long currentId_tipo = Long.parseLong(currentToken);
if (currentId_tipo > 0L) {
String id_marche;
if (hmTipo.containsKey(Long.valueOf(currentId_tipo))) {
id_marche = hmTipo.get(Long.valueOf(currentId_tipo));
} else {
id_marche = "";
}
if (!id_marche.contains(":" + row.getId_marca() + ":")) {
if (id_marche.isEmpty()) {
id_marche = ":" + id_marche + row.getId_marca() + ":";
} else {
id_marche = id_marche + id_marche + ":";
}
hmTipo.put(Long.valueOf(currentId_tipo), id_marche);
}
}
}
}
}
}
StatusMsg.updateMsgByTag(getApFull(), TAG_THREAD_MSG, "INDICIZZAZIONE MARCHE SUI TIPI... salvo marche su tipo");
Tipo tipo = new Tipo(getApFull());
for (Map.Entry<Long, String> entry : hmTipo.entrySet()) {
System.out.println("Key = " + String.valueOf(entry.getKey()) + ", Value = " + (String)entry.getValue());
tipo.findByPrimaryKey(entry.getKey().longValue());
if (tipo.getId_tipo() > 0L) {
tipo.setId_marche(entry.getValue());
rp = tipo.save();
} else {
rp.setStatus(false);
rp.setMsg("Errore! Tipo su marche non trovato tra i tipi. Indicizzare nuovamente le Marche");
}
if (!rp.getStatus()) {
sbErr.append(rp.getMsg());
sbErr.append("\n");
}
}
if (sbErr.length() > 0) {
rp.setStatus(false);
rp.setMsg(sbErr.toString());
StatusMsg.updateMsgByTag(getApFull(), TAG_THREAD_MSG, "INDICIZZAZIONE MARCHE SUI TIPI ERRORE!! " + rp.getMsg());
} else {
rp.setMsg("Indici marche su Tipo creati correttamente.");
StatusMsg.updateMsgByTag(getApFull(), TAG_THREAD_MSG, "INDICIZZAZIONE MARCHE SUI TIPI. Indici marche su Tipo creati correttamente");
}
return rp;
}
public static boolean isThreadAttivo() {
return threadindicizzoMarche;
}
public final ResParm startIndicizzoMarche(long l_id_marca) {
if (!isThreadAttivo()) {
new ThreadIndicizzoMarche(l_id_marca);
return new ResParm(true, "Thread Indicizzazione Marche Avviato");
}
return new ResParm(false, "ATTENZIONE!! Thread Indicizzazione Marche gia' in esecuzione!!!");
}
public Vectumerator findWebByArticoloCR(ArticoloCR CR, int pageNumber, int pageRows) {
String occurrenceFind;
StringBuilder sb = new StringBuilder();
boolean debug = false;
Timer timer = new Timer();
if (debug) {
timer.start();
sb.append(">>>>>>>>>>>>>>>>>>>>>>\nMARCA findWebByArticoloCR: ");
Date d = new Date(System.currentTimeMillis());
sb.append(getApFull().getReqUrl());
sb.append("\n");
sb.append(d.toString());
sb.append(" ip: ");
sb.append(getApFull().getReqIpAddress());
}
Articolo articolo = new Articolo(getApFull());
String occurrence = articolo.findWebByArticoloCRCreateSmartSearchOccurrence(CR.getSearchTxtWeb().toLowerCase(), "A.descrizioneSearch");
if (!occurrence.isEmpty()) {
occurrenceFind = occurrence + ", ";
} else {
occurrenceFind = "";
}
StringBuffer s_Sql_Find = new StringBuffer("select distinct " + occurrenceFind + " M.* from ARTICOLO AS A inner join TIPO AS C on C.id_tipo=A.id_tipo inner join MARCA as M on M.id_marca=A.id_marca");
String s_sqlOrderBy = " order by M.descrizione";
if (CR.getSearchTxtWeb().isEmpty() || !CR.getSearchTxtWeb().equals("*"));
WcString wc = new WcString();
CR.setId_marche("");
CR.setFlgOrderBy(0L);
articolo.findWebByArticoloCRCreateWC(CR, s_Sql_Find, wc);
try {
if (debug) {
sb.append("\n");
sb.append(String.valueOf(s_Sql_Find) + String.valueOf(s_Sql_Find) + wc.toString());
}
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + String.valueOf(s_Sql_Find) + wc.toString());
Vectumerator vec = findRows(stmt, pageNumber, pageRows);
if (debug) {
timer.stop();
sb.append("\nDurata query: ms ");
sb.append(timer.getDurataMilliSec());
sb.append("\n");
sb.append("\n<<<<<<<<<<<<");
System.out.println(sb.toString());
}
return vec;
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public String getTag() {
if (this.tag == null)
return "";
if (!this.tag.isEmpty()) {
this.tag = this.tag.trim();
if (!this.tag.startsWith(","))
this.tag = "," + this.tag;
if (!this.tag.endsWith(","))
this.tag += ",";
}
return this.tag;
}
public void setTag(String tag) {
this.tag = tag;
}
public String getImgFileName(int imgNumber) {
return getImgFileName(imgNumber, getImgTmst());
}
public String getImgFileName(int imgNumber, int scaledWidth) {
String targetDir = getDocBase() + getDocBase();
String newImageName = "" + scaledWidth + "/" + scaledWidth;
String srcFileName = targetDir + targetDir;
String targetFileName = targetDir + targetDir;
ResParm rp = ScaleImage.scaleImageToFile(srcFileName, targetFileName, getPathTmpFull(), scaledWidth, 75);
if (rp.getStatus())
return newImageName;
return getImgFileName(imgNumber, getImgTmst());
}
public String getImgFileName(int imgNumber, String l_Tmst) {
return "" + getId_marca() + "_" + getId_marca() + "_" + l_Tmst + ".jpg";
}
public String getImgFileName(long imgNumber) {
return getImgFileName((int)imgNumber);
}
public String getDescrizioniImport() {
return (this.descrizioniImport == null) ? "" : this.descrizioniImport.trim();
}
public void setDescrizioniImport(String descrizioniImport) {
this.descrizioniImport = descrizioniImport;
}
protected void prepareSave(PreparedStatement ps) throws SQLException {
String temp = getDescrizioniImport();
if (!temp.isEmpty()) {
if (!temp.startsWith(","))
temp = "," + temp;
if (!temp.endsWith(","))
temp = temp + ",";
setDescrizioniImport(temp.replace(", ", ","));
} else {
setDescrizioniImport("," + getDescrizione() + ",");
}
super.prepareSave(ps);
}
public void findByDescrizioneImport(String l_desc) {
String s_Sql_Find = "select A.* from MARCA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc(" A.descrizioniImport LIKE '%," + prepareInputMySqlString(l_desc, false) + ",%'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public String getCCLinkSearchOld(String lang) {
return "search+cerca---M," + getId_marca() + "--1-48-" + lang + ".html";
}
public String getCCLinkSearch(String lang) {
boolean usePageNumberTag = false;
boolean isCanonical = false;
StringBuilder sb = new StringBuilder();
if (!getNomeSeo().isEmpty()) {
sb.append(convertStringToLink(getNomeSeo()).toLowerCase());
} else {
sb.append(convertStringToLink(getDescrizione()).toLowerCase());
}
sb.append("+");
if (usePageNumberTag) {
sb.append("s");
} else {
sb.append("l");
}
sb.append("-");
sb.append("-");
sb.append("-");
sb.append("m,");
sb.append(getId_marca());
sb.append("-");
if (!usePageNumberTag) {
if (!isCanonical);
sb.append("-");
}
sb.append("-");
if (usePageNumberTag) {
sb.append("#");
} else {
sb.append(1);
}
sb.append("-");
sb.append(48);
sb.append("-");
sb.append(lang);
sb.append(".html");
if (usePageNumberTag);
return sb.toString().replaceAll("-0", "-").toLowerCase();
}
public Vectumerator<Marca> findMarcheConTagOfferta() {
String s_Sql_Find = "select A.* from MARCA as A";
String s_Sql_Order = " order by A.descrizione ";
WcString wc = new WcString();
wc.addWc("A.tagOfferta is not null and A.tagOfferta <>''");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + String.valueOf(wc));
return findRows(stmt);
} catch (Exception e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public String getTagOfferta() {
return (this.tagOfferta == null) ? "" : this.tagOfferta.trim();
}
public void setTagOfferta(String tagOfferta) {
this.tagOfferta = tagOfferta;
}
public long getFlgIcecatAuto() {
return this.flgIcecatAuto;
}
public void setFlgIcecatAuto(long flgIcecatAuto) {
this.flgIcecatAuto = flgIcecatAuto;
}
public long getFlgIncludiMainSitemap() {
return this.flgIncludiMainSitemap;
}
public void setFlgIncludiMainSitemap(long flgIncludiMainSitemap) {
this.flgIncludiMainSitemap = flgIncludiMainSitemap;
}
public String getCCSeoTitle(String lang) {
if (!getSeoTitle(lang).isEmpty())
return getSeoTitle(lang);
return getDescrizione();
}
public String getSeoTitle(String lang) {
if (lang.isEmpty())
lang = "it";
return getDescTxtLang("seoTitle", lang);
}
public String getCCMetaDescriptionWeb(String lang) {
if (!getMetaDescription(lang).isEmpty())
return convertStringToHtml(getMetaDescription(lang));
return getDescrizione();
}
public String getMetaDescription(String lang) {
if (lang.isEmpty())
lang = "it";
return getDescTxtLang("metaDescription", lang);
}
public String getCCTagH1(String lang) {
if (lang.isEmpty())
lang = "it";
return getDescTxtLang("tagH1", lang);
}
public String getCCTagH2(String lang) {
if (lang.isEmpty())
lang = "it";
return getDescTxtLang("tagH2", lang);
}
public String getCCTagH1Web(String lang) {
if (getCCTagH1(lang).isEmpty())
return convertStringToHtml(getDescrizione());
return convertStringToHtml(getCCTagH1(lang));
}
public String getCCTagH2Web(String lang) {
if (getCCTagH2(lang).isEmpty())
return "";
return convertStringToHtml(getCCTagH2(lang));
}
public String getNomeSeo() {
return (this.nomeSeo == null) ? "" : this.nomeSeo.trim();
}
public void setNomeSeo(String nomeSeo) {
this.nomeSeo = nomeSeo;
}
public boolean useDescLangTables() {
return true;
}
public String getPathImg() {
return "_img/_imgMarca/";
}
public Vectumerator<Marca> findMarcheConLink(String l_letteraIniziale, int pageNumber, int pageRows) {
String s_Sql_Find = "select DISTINCT A.* from MARCA AS A";
String s_Sql_Order = " order by A.descrizione";
WcString wc = new WcString();
wc.addWc("A.link is not null");
wc.addWc(" A.link<>''");
if (l_letteraIniziale.equals("AF")) {
wc.addWc("A.descrizione >= 'A%'");
wc.addWc("A.descrizione <= 'G%'");
} else if (l_letteraIniziale.equals("GM")) {
wc.addWc("A.descrizione >= 'G%'");
wc.addWc("A.descrizione <= 'N%'");
} else if (l_letteraIniziale.equals("NR")) {
wc.addWc("A.descrizione >= 'N%'");
wc.addWc("A.descrizione <= 'S%'");
} else if (l_letteraIniziale.equals("SZ")) {
wc.addWc("A.descrizione >= 'S%'");
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
}

View file

@ -0,0 +1,92 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class MarcaCR extends CRAdapter {
private long id_marca;
private String descrizioneS;
private String tag;
private String descrizione;
private String tagOfferta;
private long flgIcecatAuto = -1L;
private long flgIncludiMainSitemap = -1L;
private String letteraIniziale;
public MarcaCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public MarcaCR() {}
public void setId_marca(long newId_marca) {
this.id_marca = newId_marca;
}
public void setDescrizioneS(String newDescrizione) {
this.descrizioneS = newDescrizione;
}
public long getId_marca() {
return this.id_marca;
}
public String getDescrizioneS() {
return (this.descrizioneS == null) ? "" : this.descrizioneS;
}
public String getTag() {
return (this.tag == null) ? AB_EMPTY_STRING : this.tag.trim();
}
public void setTag(String tag) {
this.tag = tag;
}
public String getDescrizione() {
return (this.descrizione == null) ? AB_EMPTY_STRING : this.descrizione.trim();
}
public void setDescrizione(String descrizione) {
this.descrizione = descrizione;
}
public String getTagOfferta() {
return (this.tagOfferta == null) ? AB_EMPTY_STRING : this.tagOfferta.trim();
}
public void setTagOfferta(String tagOfferta) {
this.tagOfferta = tagOfferta;
}
public long getFlgIcecatAuto() {
return this.flgIcecatAuto;
}
public void setFlgIcecatAuto(long flgIcecatAuto) {
this.flgIcecatAuto = flgIcecatAuto;
}
public long getFlgIncludiMainSitemap() {
return this.flgIncludiMainSitemap;
}
public void setFlgIncludiMainSitemap(long flgIncludiMainSitemap) {
this.flgIncludiMainSitemap = flgIncludiMainSitemap;
}
public String getLetteraIniziale() {
return (this.letteraIniziale == null) ? AB_EMPTY_STRING : this.letteraIniziale.trim();
}
public void setLetteraIniziale(String letteraIniziale) {
this.letteraIniziale = letteraIniziale;
}
}

View file

@ -0,0 +1,88 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class Modello extends _ArtAdapter implements Serializable {
private long id_modello;
private String descrizione;
private long id_marca;
private Marca marca;
public Modello(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Modello() {}
public void setId_modello(long newId_modello) {
this.id_modello = newId_modello;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public void setId_marca(long newId_marca) {
this.id_marca = newId_marca;
setMarca(null);
}
public long getId_modello() {
return this.id_modello;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
public long getId_marca() {
return this.id_marca;
}
public void setMarca(Marca newMarca) {
this.marca = newMarca;
}
public Marca getMarca() {
this.marca = (Marca)getSecondaryObject(this.marca, Marca.class,
getId_marca());
return this.marca;
}
protected void deleteCascade() {}
public Vectumerator findByCR(ModelloCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from MODELLO AS A";
String s_Sql_Order = " order by A.descrizione";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
}

View file

@ -0,0 +1,56 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class ModelloCR extends CRAdapter {
private long id_modello;
private String descrizione;
private long id_marca;
private Marca marca;
public ModelloCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public ModelloCR() {}
public void setId_modello(long newId_modello) {
this.id_modello = newId_modello;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public void setId_marca(long newId_marca) {
this.id_marca = newId_marca;
setMarca(null);
}
public long getId_modello() {
return this.id_modello;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
public long getId_marca() {
return this.id_marca;
}
public void setMarca(Marca newMarca) {
this.marca = newMarca;
}
public Marca getMarca() {
this.marca = (Marca)getSecondaryObject(this.marca, Marca.class,
getId_marca());
return this.marca;
}
}

View file

@ -0,0 +1,212 @@
package it.acxent.art;
import it.acxent.anag.Users;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
public class QuotazioneArticolo extends DBAdapter implements Serializable {
private static final long serialVersionUID = 1595583012215L;
private long id_quotazioneArticolo;
private long id_users;
private long id_articolo;
private long id_articoloVariante;
private long id_articoloTaglia;
private long flgAbilitaAvviso;
private double prezzoQA;
private Date dataQA;
private Date dataFineQA;
private Timestamp tmstUltimoAvviso;
private Users users;
private Articolo articolo;
private ArticoloVariante articoloVariante;
private ArticoloTaglia articoloTaglia;
public QuotazioneArticolo(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public QuotazioneArticolo() {}
public void setId_quotazioneArticolo(long newId_quotazioneArticolo) {
this.id_quotazioneArticolo = newId_quotazioneArticolo;
}
public void setId_users(long newId_users) {
this.id_users = newId_users;
setUsers(null);
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public void setId_articoloVariante(long newId_articoloVariante) {
this.id_articoloVariante = newId_articoloVariante;
setArticoloVariante(null);
}
public void setId_articoloTaglia(long newId_articoloTaglia) {
this.id_articoloTaglia = newId_articoloTaglia;
setArticoloTaglia(null);
}
public void setFlgAbilitaAvviso(long newFlgAbilitaAvviso) {
this.flgAbilitaAvviso = newFlgAbilitaAvviso;
}
public void setPrezzoQA(double newPrezzoQA) {
this.prezzoQA = newPrezzoQA;
}
public void setDataQA(Date newDataQA) {
this.dataQA = newDataQA;
}
public void setDataFineQA(Date newDataFineQA) {
this.dataFineQA = newDataFineQA;
}
public void setTmstUltimoAvviso(Timestamp newTmstUltimoAvviso) {
this.tmstUltimoAvviso = newTmstUltimoAvviso;
}
public long getId_quotazioneArticolo() {
return this.id_quotazioneArticolo;
}
public long getId_users() {
return this.id_users;
}
public long getId_articolo() {
return this.id_articolo;
}
public long getId_articoloVariante() {
return this.id_articoloVariante;
}
public long getId_articoloTaglia() {
return this.id_articoloTaglia;
}
public long getFlgAbilitaAvviso() {
return this.flgAbilitaAvviso;
}
public double getPrezzoQA() {
return this.prezzoQA;
}
public Date getDataQA() {
return this.dataQA;
}
public Date getDataFineQA() {
return this.dataFineQA;
}
public Timestamp getTmstUltimoAvviso() {
return this.tmstUltimoAvviso;
}
public void setUsers(Users newUsers) {
this.users = newUsers;
}
public Users getUsers() {
this.users = (Users)getSecondaryObject((DBAdapter)this.users, Users.class,
getId_users());
return this.users;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
public void setArticoloVariante(ArticoloVariante newArticoloVariante) {
this.articoloVariante = newArticoloVariante;
}
public ArticoloVariante getArticoloVariante() {
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class,
getId_articoloVariante());
return this.articoloVariante;
}
public void setArticoloTaglia(ArticoloTaglia newArticoloTaglia) {
this.articoloTaglia = newArticoloTaglia;
}
public ArticoloTaglia getArticoloTaglia() {
this.articoloTaglia = (ArticoloTaglia)getSecondaryObject(this.articoloTaglia, ArticoloTaglia.class,
getId_articoloTaglia());
return this.articoloTaglia;
}
protected ResParm checkDeleteCascade() {
return new ResParm(true);
}
protected void deleteCascade() {}
public Vectumerator<QuotazioneArticolo> findByCR(QuotazioneArticoloCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from QUOTAZIONE_ARTICOLO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
}

View file

@ -0,0 +1,172 @@
package it.acxent.art;
import it.acxent.anag.Users;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import java.sql.Date;
import java.sql.Timestamp;
public class QuotazioneArticoloCR extends CRAdapter {
private long id_quotazioneArticolo;
private long id_users;
private long id_articolo;
private long id_articoloVariante;
private long id_articoloTaglia;
private long flgAbilitaAvviso;
private double prezzoQA;
private Date dataQA;
private Date dataFineQA;
private Timestamp tmstUltimoAvviso;
private Users users;
private Articolo articolo;
private ArticoloVariante articoloVariante;
private ArticoloTaglia articoloTaglia;
public QuotazioneArticoloCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public QuotazioneArticoloCR() {}
public void setId_quotazioneArticolo(long newId_quotazioneArticolo) {
this.id_quotazioneArticolo = newId_quotazioneArticolo;
}
public void setId_users(long newId_users) {
this.id_users = newId_users;
setUsers(null);
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public void setId_articoloVariante(long newId_articoloVariante) {
this.id_articoloVariante = newId_articoloVariante;
setArticoloVariante(null);
}
public void setId_articoloTaglia(long newId_articoloTaglia) {
this.id_articoloTaglia = newId_articoloTaglia;
setArticoloTaglia(null);
}
public void setFlgAbilitaAvviso(long newFlgAbilitaAvviso) {
this.flgAbilitaAvviso = newFlgAbilitaAvviso;
}
public void setPrezzoQA(double newPrezzoQA) {
this.prezzoQA = newPrezzoQA;
}
public void setDataQA(Date newDataQA) {
this.dataQA = newDataQA;
}
public void setDataFineQA(Date newDataFineQA) {
this.dataFineQA = newDataFineQA;
}
public void setTmstUltimoAvviso(Timestamp newTmstUltimoAvviso) {
this.tmstUltimoAvviso = newTmstUltimoAvviso;
}
public long getId_quotazioneArticolo() {
return this.id_quotazioneArticolo;
}
public long getId_users() {
return this.id_users;
}
public long getId_articolo() {
return this.id_articolo;
}
public long getId_articoloVariante() {
return this.id_articoloVariante;
}
public long getId_articoloTaglia() {
return this.id_articoloTaglia;
}
public long getFlgAbilitaAvviso() {
return this.flgAbilitaAvviso;
}
public double getPrezzoQA() {
return this.prezzoQA;
}
public Date getDataQA() {
return this.dataQA;
}
public Date getDataFineQA() {
return this.dataFineQA;
}
public Timestamp getTmstUltimoAvviso() {
return this.tmstUltimoAvviso;
}
public void setUsers(Users newUsers) {
this.users = newUsers;
}
public Users getUsers() {
this.users = (Users)getSecondaryObject((DBAdapter)this.users, Users.class,
getId_users());
return this.users;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
public void setArticoloVariante(ArticoloVariante newArticoloVariante) {
this.articoloVariante = newArticoloVariante;
}
public ArticoloVariante getArticoloVariante() {
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class,
getId_articoloVariante());
return this.articoloVariante;
}
public void setArticoloTaglia(ArticoloTaglia newArticoloTaglia) {
this.articoloTaglia = newArticoloTaglia;
}
public ArticoloTaglia getArticoloTaglia() {
this.articoloTaglia = (ArticoloTaglia)getSecondaryObject(this.articoloTaglia, ArticoloTaglia.class,
getId_articoloTaglia());
return this.articoloTaglia;
}
}

View file

@ -0,0 +1,45 @@
package it.acxent.art;
import it.acxent.db.ResParm;
public class RegistroUsato {
private long paginaInizio;
private long paginaFine;
private String fileName;
private ResParm resParm;
public long getPaginaInizio() {
return this.paginaInizio;
}
public void setPaginaInizio(long paginaInizio) {
this.paginaInizio = paginaInizio;
}
public long getPaginaFine() {
return this.paginaFine;
}
public void setPaginaFine(long paginaFine) {
this.paginaFine = paginaFine;
}
public String getFileName() {
return (this.fileName == null) ? "" : this.fileName.trim();
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public ResParm getResParm() {
return this.resParm;
}
public void setResParm(ResParm resParm) {
this.resParm = resParm;
}
}

View file

@ -0,0 +1,109 @@
package it.acxent.art;
import it.acxent.anag.Iva;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class Reparto extends _ArtAdapter implements Serializable {
private long id_reparto;
private String descrizione;
private String sigla;
private long id_iva;
private Iva iva;
private long siglaEpson;
public Reparto(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Reparto() {}
public void setId_reparto(long newId_reparto) {
this.id_reparto = newId_reparto;
}
public void setDescrizione(String newDescrizione_it) {
this.descrizione = newDescrizione_it;
}
public long getId_reparto() {
return this.id_reparto;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" :
this.descrizione.trim();
}
protected void deleteCascade() {}
public Vectumerator findByCR(RepartoCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from REPARTO AS A";
String s_Sql_Order = " order by A.descrizione";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public String getSigla() {
return (this.sigla == null) ? "" : this.sigla.trim();
}
public void setSigla(String sigla) {
this.sigla = sigla;
}
public Iva getIva() {
this.iva = (Iva)getSecondaryObject(this.iva, Iva.class, new Long(getId_iva()));
return this.iva;
}
public void setId_iva(long newId_iva) {
this.id_iva = newId_iva;
setIva(null);
}
public long getId_iva() {
return this.id_iva;
}
public void setIva(Iva iva) {
this.iva = iva;
}
public long getSiglaEpson() {
return this.siglaEpson;
}
public void setSiglaEpson(long siglaEpson) {
this.siglaEpson = siglaEpson;
}
}

View file

@ -0,0 +1,53 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import java.sql.Timestamp;
public class RepartoCR extends CRAdapter {
private long id_reparto;
private String descrizione;
private long lastUpdId_user;
private Timestamp lastUpdTmst;
public RepartoCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public RepartoCR() {}
public void setId_reparto(long newId_reparto) {
this.id_reparto = newId_reparto;
}
public void setDescrizione(String newDescrizione_it) {
this.descrizione = newDescrizione_it;
}
public void setLastUpdId_user(long newLastUpdId_user) {
this.lastUpdId_user = newLastUpdId_user;
}
public void setLastUpdTmst(Timestamp newLastUpdTmst) {
this.lastUpdTmst = newLastUpdTmst;
}
public long getId_reparto() {
return this.id_reparto;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
public long getLastUpdId_user() {
return this.lastUpdId_user;
}
public Timestamp getLastUpdTmst() {
return this.lastUpdTmst;
}
}

View file

@ -0,0 +1,139 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class Rivalutazione extends _ArtAdapter implements Serializable {
private long id_rivalutazione;
private Date dataRivalutazione;
private double imponibileRivalutazione;
private long id_articolo;
private Articolo articolo;
public Rivalutazione(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Rivalutazione() {}
public void setId_rivalutazione(long newId_rivalutazione) {
this.id_rivalutazione = newId_rivalutazione;
}
public void setDataRivalutazione(Date newDataRivalutazione) {
this.dataRivalutazione = newDataRivalutazione;
}
public void setImponibileRivalutazione(double newImponibile) {
this.imponibileRivalutazione = newImponibile;
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public long getId_rivalutazione() {
return this.id_rivalutazione;
}
public Date getDataRivalutazione() {
return this.dataRivalutazione;
}
public double getImponibileRivalutazione() {
return this.imponibileRivalutazione;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
protected void deleteCascade() {}
public Vectumerator findByCR(RivalutazioneCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from RIVALUTAZIONE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator findById_articolo(long l_id_articolo, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from RIVALUTAZIONE AS A";
String s_Sql_Order = " order by A.dataRivalutazione desc";
WcString wc = new WcString();
wc.addWc("id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public ResParm save() {
ResParm rp = super.save();
if (rp.getStatus())
rp.append(getArticolo().aggiornaCostoRivalutazione(
getRivalutazioneUltimoById_articolo(getId_articolo())
.getImponibileRivalutazione()));
return rp;
}
public Rivalutazione getRivalutazioneUltimoById_articolo(long l_id_articolo) {
String s_Sql_Find = "select A.* from RIVALUTAZIONE AS A";
String s_Sql_Order = " order by A.dataRivalutazione desc";
WcString wc = new WcString();
wc.addWc("id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
return (Rivalutazione)getFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
return new Rivalutazione(getApFull());
}
}
}

View file

@ -0,0 +1,67 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import java.sql.Date;
public class RivalutazioneCR extends CRAdapter {
private long id_rivalutazione;
private Date dataRivalutazione;
private double imponibileRivalutazione;
private long id_articolo;
private Articolo articolo;
public RivalutazioneCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public RivalutazioneCR() {}
public void setId_rivalutazione(long newId_rivalutazione) {
this.id_rivalutazione = newId_rivalutazione;
}
public void setDataRivalutazione(Date newDataRivalutazione) {
this.dataRivalutazione = newDataRivalutazione;
}
public void setImponibileRivalutazione(double newImponibile) {
this.imponibileRivalutazione = newImponibile;
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public long getId_rivalutazione() {
return this.id_rivalutazione;
}
public Date getDataRivalutazione() {
return this.dataRivalutazione;
}
public double getImponibileRivalutazione() {
return this.imponibileRivalutazione;
}
public long getId_articolo() {
return this.id_articolo;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
}

View file

@ -0,0 +1,206 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class StatoUsato extends DBAdapter implements Serializable {
private static final String GARANZIA = "garanzia";
private static final String DESCRIZIONE_WWW = "descrizioneWww";
private static final long serialVersionUID = 1620541224365L;
public static final long LIVELLO_USATO_NUOVO = 0L;
public static final long LIVELLO_USATO_NUOVO_APERTO = 1L;
public static final long LIVELLO_USATO_DEMO = 2L;
public static final long LIVELLO_USATO_RICONDIZIONATO_VENDOR = 3L;
public static final long LIVELLO_USATO_RICONDIZIONATO_OTTIMO = 4L;
public static final long LIVELLO_USATO_RICONDIZIONATO_BUONO = 5L;
public static final long LIVELLO_USATO_RICONDIZIONATO_TESTATO = 6L;
private long flgLivello;
private String sigla;
private long id_statoUsato;
public StatoUsato(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public StatoUsato() {}
public static final String getLivello(long l_livello) {
switch ((int)l_livello) {
case 0:
return "Nuovo";
case 1:
return "Nuovo Aperto";
case 2:
return "Demo";
case 3:
return "Ricondizionato dal vendor";
case 4:
return "Ricondizionato Ottimo";
case 5:
return "Ricondizionato Buono";
case 6:
return "Ricondizionato Testato";
}
return "??";
}
public static final String getEbayCondition(long l_livello) {
switch ((int)l_livello) {
case 0:
return "NEW";
case 1:
return "NEW_OTHER";
case 2:
return "SELLER_REFURBISHED";
case 3:
return "CERTIFIED_REFURBISHED";
case 4:
return "SELLER_REFURBISHED";
case 5:
return "SELLER_REFURBISHED";
case 6:
return "SELLER_REFURBISHED";
}
return "??";
}
public String getLivello() {
return getLivello(getFlgLivello());
}
public String getEbayCondition() {
return getEbayCondition(getFlgLivello());
}
public void setId_statoUsato(long newId_statoUsato) {
this.id_statoUsato = newId_statoUsato;
}
public void setSigla(String newSigla) {
this.sigla = newSigla;
}
public long getId_statoUsato() {
return this.id_statoUsato;
}
public String getSigla() {
return (this.sigla == null) ? "" : this.sigla.trim();
}
protected ResParm checkDeleteCascade() {
return new ResParm(true);
}
protected void deleteCascade() {}
public Vectumerator<StatoUsato> findByCR(StatoUsatoCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from STATO_USATO AS A";
String s_Sql_Order = " order by A.sigla";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public String getGaranzia(String lang) {
if (lang.isEmpty())
lang = "it";
return getDescTxtLang("garanzia", lang);
}
public String getDescrizioneWww(String lang) {
if (lang.isEmpty())
lang = "it";
return getDescTxtLang("descrizioneWww", lang);
}
public boolean useDescLangTables() {
return true;
}
public String getDescrizioneCompleta() {
return getSigla() + " " + getSigla();
}
public void findBySigla(String l_sigla) {
String s_Sql_Find = "select A.* from STATO_USATO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.sigla='" + l_sigla + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
}
}
public long getFlgLivello() {
return this.flgLivello;
}
public boolean isNuovo() {
return (getFlgLivello() == 0L);
}
public boolean isUsato() {
return !isNuovo();
}
public void setFlgLivello(long flgNuovo) {
this.flgLivello = flgNuovo;
}
public Vectumerator<StatoUsato> findSoloUsato() {
String s_Sql_Find = "select A.* from STATO_USATO AS A";
String s_Sql_Order = " order by A.sigla";
WcString wc = new WcString();
wc.addWc("A.flgLivello>0");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
}

View file

@ -0,0 +1,32 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class StatoUsatoCR extends CRAdapter {
private long id_statoUsato;
private String sigla;
public StatoUsatoCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public StatoUsatoCR() {}
public void setId_statoUsato(long newId_statoUsato) {
this.id_statoUsato = newId_statoUsato;
}
public void setSigla(String newSigla) {
this.sigla = newSigla;
}
public long getId_statoUsato() {
return this.id_statoUsato;
}
public String getSigla() {
return (this.sigla == null) ? "" : this.sigla.trim();
}
}

View file

@ -0,0 +1,419 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class TabellaTaglia extends _ArtAdapter implements Serializable {
private long id_tabellaTaglia;
private long id_tipoTaglia;
private String descrizione_it;
private String descrizioneImg_it;
private String descrizioneImg_en;
private String descrizione_en;
private long flgAltezzaCavallo;
private long flgColloCm;
private long flgColloPoll;
private long flgGiroCoscia;
private long flgLarghezzaFondoCm;
private long flgLunghezzaGamba;
private long flgLunghezzaTotale;
private long flgLunghezzaManica;
private long flgVitaCmTeso;
private long flgSpalleCm;
private long flgVitaCmNoTeso;
private long flgTagliaCollo;
private long flgTagliaLettere;
private long flgTagliaNum;
private long flgToraceCm;
private long flgVitaCm;
private TipoTaglia tipoTaglia;
private String imgTmst;
public TabellaTaglia(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TabellaTaglia() {}
public static final String getAltezzaCavallo() {
return "Altezza Cavallo";
}
public static final String getColloCm() {
return "Collo in cm";
}
public static final String getColloPoll() {
return "Collo in pollici";
}
public static final String getGiroCoscia() {
return "Giro Coscia";
}
public static final String getLarghezzaFondoCm() {
return "Larghezza Fondo in cm";
}
public static final String getLunghezzaGamba() {
return "Lunghezza Gamba";
}
public static final String getSpalleCm() {
return "Spalle in cm";
}
public static final String getTagliaCollo() {
return "Taglia collo";
}
public static final String getTagliaLettere() {
return "Taglia";
}
public static final String getTagliaNum() {
return "Taglia";
}
public static final String getToraceCm() {
return "Torace in cm";
}
public static final String getVitaCm() {
return "Via in cm";
}
public void setId_tabellaTaglia(long newId_tabellaTaglia) {
this.id_tabellaTaglia = newId_tabellaTaglia;
}
public void setId_tipoTaglia(long newId_tipoTaglia) {
this.id_tipoTaglia = newId_tipoTaglia;
setTipoTaglia(null);
}
public void setDescrizione_it(String newDescrizione) {
this.descrizione_it = newDescrizione;
}
public void setFlgAltezzaCavallo(long newFlgAltezzaCavallo) {
this.flgAltezzaCavallo = newFlgAltezzaCavallo;
}
public void setFlgColloCm(long newFlgColloCm) {
this.flgColloCm = newFlgColloCm;
}
public void setFlgColloPoll(long newFlgColloPoll) {
this.flgColloPoll = newFlgColloPoll;
}
public void setFlgGiroCoscia(long newFlgGiroCoscia) {
this.flgGiroCoscia = newFlgGiroCoscia;
}
public void setFlgLarghezzaFondoCm(long newFlgLarghezzaFondoCm) {
this.flgLarghezzaFondoCm = newFlgLarghezzaFondoCm;
}
public void setFlgLunghezzaGamba(long newFlgLunghezzaGamba) {
this.flgLunghezzaGamba = newFlgLunghezzaGamba;
}
public void setFlgSpalleCm(long newFlgSpalleCm) {
this.flgSpalleCm = newFlgSpalleCm;
}
public void setFlgTagliaCollo(long newFlgTagliaCollo) {
this.flgTagliaCollo = newFlgTagliaCollo;
}
public void setFlgTagliaLettere(long newFlgTagliaLettere) {
this.flgTagliaLettere = newFlgTagliaLettere;
}
public void setFlgTagliaNum(long newFlgTagliaNum) {
this.flgTagliaNum = newFlgTagliaNum;
}
public void setFlgToraceCm(long newFlgToraceCm) {
this.flgToraceCm = newFlgToraceCm;
}
public void setFlgVitaCm(long newFlgVitaCm) {
this.flgVitaCm = newFlgVitaCm;
}
public long getId_tabellaTaglia() {
return this.id_tabellaTaglia;
}
public long getId_tipoTaglia() {
return this.id_tipoTaglia;
}
public String getDescrizione_it() {
return (this.descrizione_it == null) ? "" :
this.descrizione_it.trim();
}
public String getDescrizioneArticoli(String lang) {
if (getDBState() == 1) {
StringBuffer temp = new StringBuffer();
Vectumerator vec = getArticoli();
while (vec.hasMoreElements()) {
Articolo row = (Articolo)vec.nextElement();
temp.append(row.getDescrizione(lang));
if (vec.hasMoreElements())
temp.append(", ");
}
return temp.toString();
}
return "";
}
public long getFlgAltezzaCavallo() {
return this.flgAltezzaCavallo;
}
public long getFlgColloCm() {
return this.flgColloCm;
}
public long getFlgColloPoll() {
return this.flgColloPoll;
}
public long getFlgGiroCoscia() {
return this.flgGiroCoscia;
}
public long getNumCol() {
long n = getFlgAltezzaCavallo() + getFlgColloCm() + getFlgColloPoll() +
getFlgGiroCoscia() + getFlgLarghezzaFondoCm() +
getFlgLunghezzaGamba() + getFlgLunghezzaTotale() +
getFlgSpalleCm() + getFlgSpalleCm() + getFlgTagliaCollo() +
getFlgTagliaLettere() + getFlgTagliaNum() + getFlgToraceCm() +
getFlgVitaCm() + getFlgLunghezzaManica() + getFlgVitaCmTeso() + getFlgVitaCmNoTeso();
return n;
}
public long getFlgLarghezzaFondoCm() {
return this.flgLarghezzaFondoCm;
}
public long getFlgLunghezzaGamba() {
return this.flgLunghezzaGamba;
}
public long getFlgSpalleCm() {
return this.flgSpalleCm;
}
public long getFlgTagliaCollo() {
return this.flgTagliaCollo;
}
public long getFlgTagliaLettere() {
return this.flgTagliaLettere;
}
public long getFlgTagliaNum() {
return this.flgTagliaNum;
}
public long getFlgToraceCm() {
return this.flgToraceCm;
}
public long getFlgVitaCm() {
return this.flgVitaCm;
}
public void setTipoTaglia(TipoTaglia newTipoTaglia) {
this.tipoTaglia = newTipoTaglia;
}
public TipoTaglia getTipoTaglia() {
this.tipoTaglia = (TipoTaglia)getSecondaryObject(this.tipoTaglia, TipoTaglia.class,
getId_tipoTaglia());
return this.tipoTaglia;
}
protected void deleteCascade() {}
public Vectumerator findByCR(TabellaTagliaCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from TABELLA_TAGLIA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public long getFlgLunghezzaTotale() {
return this.flgLunghezzaTotale;
}
public void setFlgLunghezzaTotale(long flgLunghezzaTotale) {
this.flgLunghezzaTotale = flgLunghezzaTotale;
}
public ResParm delTagliaMisure(TagliaMisure row) {
TagliaMisure bean = new TagliaMisure(getApFull());
bean.findByPrimaryKey(row.getId_tagliaMisure());
return bean.delete();
}
public Vectumerator getTagliaMisure() {
return new TagliaMisure(getApFull()).findById_tabellaTaglia(
getId_tabellaTaglia(), 0, 0);
}
public Vectumerator getArticoli() {
return new Articolo(getApFull()).findById_tabellaTaglia(
getId_tabellaTaglia(), 0, 0);
}
public ResParm addTagliaMisure(TagliaMisure row) {
TagliaMisure bean = new TagliaMisure(getApFull());
if (row.getId_tagliaMisure() != 0L)
bean.findByPrimaryKey(row.getId_tagliaMisure());
row.setDBState(bean.getDBState());
ResParm rp = row.save();
return rp;
}
public String getDescrizione_en() {
return (this.descrizione_en == null) ? "" : this.descrizione_en.trim();
}
public void setDescrizione_en(String descrizione_en) {
this.descrizione_en = descrizione_en;
}
public String getDescrizione(String lang) {
return getLangField("descrizione", lang);
}
public String getDescrizioneImg(String lang) {
return getLangField("descrizioneImg", lang);
}
public String getImgTmst() {
return (this.imgTmst == null) ? "" : this.imgTmst;
}
public void setImgTmst(String imgTmst) {
this.imgTmst = imgTmst;
}
public String getImgFileName(int imgNumber) {
return getImgFileName(imgNumber, getImgTmst());
}
public String getImgFileName(int imgNumber, String oldTmst) {
return "" + getId_tabellaTaglia() + "_" + getId_tabellaTaglia() + "_" + oldTmst + ".gif";
}
public String getPathImgTabellaTaglia() {
return getParm("PATH_IMG_TAB_TAG").getTesto();
}
public String getDescrizioneImg_it() {
return (this.descrizioneImg_it == null) ? "" :
this.descrizioneImg_it.trim();
}
public void setDescrizioneImg_it(String descrizioneImg_it) {
this.descrizioneImg_it = descrizioneImg_it;
}
public String getDescrizioneImg_en() {
return (this.descrizioneImg_en == null) ? "" :
this.descrizioneImg_en.trim();
}
public void setDescrizioneImg_en(String descrizioneImg_en) {
this.descrizioneImg_en = descrizioneImg_en;
}
public String getDescrizioneImg_enScript() {
return DBAdapter.prepareScriptString(getDescrizioneImg_en(), true, false);
}
public String getDescrizioneImg_itScript() {
return DBAdapter.prepareScriptString(getDescrizioneImg_it(), true, false);
}
public long getFlgLunghezzaManica() {
return this.flgLunghezzaManica;
}
public void setFlgLunghezzaManica(long flgLunghezzaManica) {
this.flgLunghezzaManica = flgLunghezzaManica;
}
public long getFlgVitaCmTeso() {
return this.flgVitaCmTeso;
}
public void setFlgVitaCmTeso(long flgVitaCmTeso) {
this.flgVitaCmTeso = flgVitaCmTeso;
}
public long getFlgVitaCmNoTeso() {
return this.flgVitaCmNoTeso;
}
public void setFlgVitaCmNoTeso(long flgVitaCmNoTeso) {
this.flgVitaCmNoTeso = flgVitaCmNoTeso;
}
}

View file

@ -0,0 +1,56 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class TabellaTagliaCR extends CRAdapter {
private long id_tabellaTaglia;
private long id_tipoTaglia;
private String descrizione;
private TipoTaglia tipoTaglia;
public TabellaTagliaCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TabellaTagliaCR() {}
public void setId_tabellaTaglia(long newId_tabellaTaglia) {
this.id_tabellaTaglia = newId_tabellaTaglia;
}
public void setId_tipoTaglia(long newId_tipoTaglia) {
this.id_tipoTaglia = newId_tipoTaglia;
setTipoTaglia(null);
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public long getId_tabellaTaglia() {
return this.id_tabellaTaglia;
}
public long getId_tipoTaglia() {
return this.id_tipoTaglia;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
public void setTipoTaglia(TipoTaglia newTipoTaglia) {
this.tipoTaglia = newTipoTaglia;
}
public TipoTaglia getTipoTaglia() {
this.tipoTaglia = (TipoTaglia)getSecondaryObject(this.tipoTaglia, TipoTaglia.class,
getId_tipoTaglia());
return this.tipoTaglia;
}
}

View file

@ -0,0 +1,256 @@
package it.acxent.art;
import it.acxent.common.DescTxtLang;
import it.acxent.db.ApplParmFull;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class Taglia extends _ArtAdapter implements Serializable {
private long id_taglia;
private long id_tipoTaglia;
private String codice;
private TipoTaglia tipoTaglia;
private long ordine;
public void setId_tipoTaglia(long newId_tipoTaglia) {
this.id_tipoTaglia = newId_tipoTaglia;
setTipoTaglia(null);
}
public void setTipoTaglia(TipoTaglia newTipoTaglia) {
this.tipoTaglia = newTipoTaglia;
}
public TipoTaglia getTipoTaglia() {
this.tipoTaglia = (TipoTaglia)getSecondaryObject(this.tipoTaglia, TipoTaglia.class, getId_tipoTaglia());
return this.tipoTaglia;
}
public void setCodice(String newCodice) {
this.codice = newCodice;
}
public Taglia(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Taglia() {}
public long getId_taglia() {
return this.id_taglia;
}
protected void deleteCascade() {}
public Vectumerator findByCR(TagliaCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from TAGLIA AS A, TIPO_TAGLIA AS B";
String s_Sql_Order = " order by B.descrizione, A.ordine";
WcString wc = new WcString();
wc.addWc("A.id_tipoTaglia=B.id_tipoTaglia");
if (CR.getId_tipoTagliaS() != 0L)
wc.addWc("A.id_tipoTaglia=" + CR.getId_tipoTagliaS());
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator findByTipoTaglia(long l_id_tipoTaglia) {
String s_Sql_Find = "select A.* from TAGLIA AS A";
String s_Sql_Order = " order by A.ordine";
WcString wc = new WcString();
wc.addWc("A.id_tipoTaglia=" + l_id_tipoTaglia);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByTipoGammaCodice(long l_id_tipoTaglia, long l_id_gammaTaglia, String l_codice) {
String s_Sql_Find = "select A.* from TAGLIA AS A";
String s_Sql_Order = " order by A.id_gammaTaglia, A.id_tipoTaglia, A.ordine, A.codice";
WcString wc = new WcString();
wc.addWc("A.id_tipoTaglia=" + l_id_tipoTaglia);
wc.addWc("A.id_gammaTaglia=" + l_id_gammaTaglia);
if (!l_codice.isEmpty())
wc.addWc("A.codice='" + l_codice + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public void findByTipoTagliaTaglia1(String l_tipoTaglia, String l_taglia) {
String s_Sql_Find = "select A.* from TAGLIA AS A, TIPO_TAGLIA AS B";
String s_Sql_Order = " order by A.codice";
WcString wc = new WcString();
wc.addWc("A.id_tipoTaglia=B.id_tipoTaglia");
wc.addWc("A.codice='" + l_taglia + "'");
wc.addWc("B.codice='" + l_tipoTaglia + "'");
wc.addWc("A.id_gammaTaglia=1");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public String getCodice() {
return (this.codice == null) ? "" : this.codice;
}
public long getId_tipoTaglia() {
return this.id_tipoTaglia;
}
public void setId_taglia(long id_taglia) {
this.id_taglia = id_taglia;
}
public Vectumerator findById_articolo(long l_id_articolo, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from TAGLIA AS A INNER JOIN ARTICOLO_TAGLIA AS B ON A.id_taglia=B.id_taglia ";
String s_Sql_Order = " ORDER BY A.ordine ";
WcString wc = new WcString();
wc.addWc("B.id_articolo=" + l_id_articolo);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public long getOrdine() {
return this.ordine;
}
public void setOrdine(long ordine) {
this.ordine = ordine;
}
private long calcolaOrdine() {
try {
String s_sqlFind = "select max(ordine) as _max from TAGLIA WHERE id_tipoTaglia=" + getId_tipoTaglia() + " and id_taglia!=" +
getId_taglia();
PreparedStatement ps = getConn().prepareStatement(s_sqlFind);
long res = (long)getMax(ps, false) + 1L;
long decine = res / 10L;
return (decine + 1L) * 10L;
} catch (Exception e) {
handleDebug(e);
return 0L;
}
}
protected void prepareSave(PreparedStatement ps) throws SQLException {
if (getOrdine() == 0L)
setOrdine(calcolaOrdine());
super.prepareSave(ps);
}
public String getDescrizioneByTagliaLingua(long l_id_taglia, String lang) {
DescTxtLang dtl = new DescTxtLang(getApFull());
dtl.findByIdtabellaLangTabellaCampo(l_id_taglia, lang, "TAGLIA", "descrizione");
return dtl.getDescrizione();
}
public boolean useDescLangTables() {
return true;
}
public ResParm spostaSu() {
ResParm rp = new ResParm();
if (getDBState() == 1) {
try {
long ordineBean = getOrdine();
String s_sqlFind = "select A.* from TAGLIA as A WHERE id_tipoTaglia=" + getId_tipoTaglia() + " and A.ordine< " + ordineBean + " order by A.ordine desc";
PreparedStatement ps = getConn().prepareStatement(s_sqlFind);
Vectumerator vec = findRows(ps);
if (vec.hasMoreElements()) {
Taglia tg = (Taglia)vec.nextElement();
long ordineTG = tg.getOrdine();
tg.setOrdine(-ordineBean);
rp = tg.save();
if (rp.getStatus()) {
setOrdine(ordineTG);
rp = save();
if (rp.getStatus()) {
tg.setOrdine(ordineBean);
rp = tg.save();
}
}
} else {
rp.setStatus(true);
rp.setMsg("Raggiunto valore minimo!");
}
} catch (Exception e) {
handleDebug(e);
}
} else {
rp.setStatus(false);
rp.setMsg("Errore!. Oggetto tagliaMisure non salvato");
}
return rp;
}
public ResParm spostaGiu() {
ResParm rp = new ResParm();
if (getDBState() == 1) {
try {
long ordineBean = getOrdine();
String s_sqlFind = "select A.* from TAGLIA as A WHERE id_tipoTaglia=" + getId_tipoTaglia() + " and A.ordine>" + ordineBean + " order by A.ordine asc";
PreparedStatement ps = getConn().prepareStatement(s_sqlFind);
Vectumerator vec = findRows(ps);
if (vec.hasMoreElements()) {
Taglia tg = (Taglia)vec.nextElement();
long ordineTG = tg.getOrdine();
tg.setOrdine(-ordineBean);
rp = tg.save();
if (rp.getStatus()) {
setOrdine(ordineTG);
rp = save();
if (rp.getStatus()) {
tg.setOrdine(ordineBean);
rp = tg.save();
}
}
} else {
rp.setStatus(true);
rp.setMsg("Raggiunto valore massimo!");
}
} catch (Exception e) {
handleDebug(e);
}
} else {
rp.setStatus(false);
rp.setMsg("Errore!. Oggetto tagliaMisure non salvato");
}
return rp;
}
public Vectumerator findTaglieByTipoTaglia(long l_id_tipoTaglia) {
return findByTipoTaglia(l_id_tipoTaglia);
}
public String getDescrizione() {
return getCodice();
}
}

View file

@ -0,0 +1,52 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class TagliaCR extends CRAdapter {
private String descrizione_it;
private String descrizione_en;
private long id_tipoTagliaS;
private String id_taglia;
public TagliaCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TagliaCR() {}
public void setId_taglia(String newId_taglia) {
this.id_taglia = newId_taglia;
}
public void setDescrizione_it(String newDescrizione_it) {
this.descrizione_it = newDescrizione_it;
}
public void setDescrizione_en(String newDescrizione_en) {
this.descrizione_en = newDescrizione_en;
}
public String getId_taglia() {
return (this.id_taglia == null) ? "" : this.id_taglia;
}
public String getDescrizione_it() {
return (this.descrizione_it == null) ? "" : this.descrizione_it;
}
public String getDescrizione_en() {
return (this.descrizione_en == null) ? "" : this.descrizione_en;
}
public long getId_tipoTagliaS() {
return this.id_tipoTagliaS;
}
public void setId_tipoTagliaS(long id_tipoTagliaS) {
this.id_tipoTagliaS = id_tipoTagliaS;
}
}

View file

@ -0,0 +1,351 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class TagliaMisure extends _ArtAdapter implements Serializable {
private long id_tagliaMisure;
private long id_tabellaTaglia;
private long ordine;
private String tagliaLettere;
private String tagliaNum;
private String tagliaCollo;
private String colloCm;
private String vitaCmTeso;
private String colloPoll;
private String vitaCmNoTeso;
private String lunghezzaManica;
private String vitaCm;
private String toraceCm;
private String lunghezzaTotale;
private String altezzaCavallo;
private String giroCoscia;
private String larghezzaFondoCm;
private String lunghezzaGamba;
private String spalleCm;
private TabellaTaglia tabellaTaglia;
public TagliaMisure(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TagliaMisure() {}
public void setId_tagliaMisure(long newId_tagliaMisure) {
this.id_tagliaMisure = newId_tagliaMisure;
}
public void setId_tabellaTaglia(long newId_tabellaTaglia) {
this.id_tabellaTaglia = newId_tabellaTaglia;
setTabellaTaglia(null);
}
public void setOrdine(long newOrdine) {
this.ordine = newOrdine;
}
public void setTagliaLettere(String newTagliaLettere) {
this.tagliaLettere = newTagliaLettere;
}
public void setTagliaNum(String newTagliaNum) {
this.tagliaNum = newTagliaNum;
}
public void setTagliaCollo(String newTagliaCollo) {
this.tagliaCollo = newTagliaCollo;
}
public void setColloCm(String newColloCm) {
this.colloCm = newColloCm;
}
public void setColloPoll(String newColloPoll) {
this.colloPoll = newColloPoll;
}
public void setVitaCm(String newVitaCm) {
this.vitaCm = newVitaCm;
}
public void setToraceCm(String newToraceCm) {
this.toraceCm = newToraceCm;
}
public void setLunghezzaTotale(String newLunghezzatotale) {
this.lunghezzaTotale = newLunghezzatotale;
}
public void setAltezzaCavallo(String newAltezzaCavallo) {
this.altezzaCavallo = newAltezzaCavallo;
}
public void setGiroCoscia(String newGiroCoscia) {
this.giroCoscia = newGiroCoscia;
}
public void setLarghezzaFondoCm(String newLarghezzaFondoCm) {
this.larghezzaFondoCm = newLarghezzaFondoCm;
}
public void setLunghezzaGamba(String newLunghezzaGamba) {
this.lunghezzaGamba = newLunghezzaGamba;
}
public void setSpalleCm(String newSpalleCm) {
this.spalleCm = newSpalleCm;
}
public long getId_tagliaMisure() {
return this.id_tagliaMisure;
}
public long getId_tabellaTaglia() {
return this.id_tabellaTaglia;
}
public long getOrdine() {
return this.ordine;
}
public String getTagliaLettere() {
return (this.tagliaLettere == null) ? "" : this.tagliaLettere.trim();
}
public String getTagliaNum() {
return (this.tagliaNum == null) ? "" : this.tagliaNum.trim();
}
public String getTagliaCollo() {
return (this.tagliaCollo == null) ? "" : this.tagliaCollo.trim();
}
public String getColloCm() {
return (this.colloCm == null) ? "" : this.colloCm.trim();
}
public String getColloPoll() {
return (this.colloPoll == null) ? "" : this.colloPoll.trim();
}
public String getVitaCm() {
return (this.vitaCm == null) ? "" : this.vitaCm.trim();
}
public String getToraceCm() {
return (this.toraceCm == null) ? "" : this.toraceCm.trim();
}
public String getLunghezzaTotale() {
return (this.lunghezzaTotale == null) ? "" : this.lunghezzaTotale.trim();
}
public String getAltezzaCavallo() {
return (this.altezzaCavallo == null) ? "" : this.altezzaCavallo.trim();
}
public String getGiroCoscia() {
return (this.giroCoscia == null) ? "" : this.giroCoscia.trim();
}
public String getLarghezzaFondoCm() {
return (this.larghezzaFondoCm == null) ? "" : this.larghezzaFondoCm.trim();
}
public String getLunghezzaGamba() {
return (this.lunghezzaGamba == null) ? "" : this.lunghezzaGamba.trim();
}
public String getSpalleCm() {
return (this.spalleCm == null) ? "" : this.spalleCm.trim();
}
public void setTabellaTaglia(TabellaTaglia newTabellaTaglia) {
this.tabellaTaglia = newTabellaTaglia;
}
public TabellaTaglia getTabellaTaglia() {
this.tabellaTaglia = (TabellaTaglia)getSecondaryObject(this.tabellaTaglia, TabellaTaglia.class, getId_tabellaTaglia());
return this.tabellaTaglia;
}
protected void deleteCascade() {}
public Vectumerator findByCR(TagliaMisureCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from TAGLIA_MISURE AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public Vectumerator findById_tabellaTaglia(long l_id, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from TAGLIA_MISURE AS A";
String s_Sql_Order = " order by A.ordine";
WcString wc = new WcString();
wc.addWc("A.id_tabellaTaglia=" + l_id);
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
protected void prepareSave(PreparedStatement ps) throws SQLException {
if (getOrdine() == 0L)
setOrdine(calcolaOrdine());
super.prepareSave(ps);
}
private long calcolaOrdine() {
try {
String s_sqlFind = "select max(ordine) as _max from TAGLIA_MISURE WHERE id_tabellaTaglia=" + getId_tabellaTaglia() + " and id_tagliaMisure!=" +
getId_tagliaMisure();
PreparedStatement ps = getConn().prepareStatement(s_sqlFind);
long res = (long)getMax(ps, true) + 1L;
long decine = res / 10L;
return (decine + 1L) * 10L;
} catch (Exception e) {
handleDebug(e);
return 0L;
}
}
public ResParm spostaSu() {
ResParm rp = new ResParm();
if (getDBState() == 1) {
try {
long ordineBean = getOrdine();
String s_sqlFind = "select A.* from TAGLIA_MISURE as A WHERE id_tabellaTaglia=" + getId_tabellaTaglia() + " and A.ordine<" + ordineBean + " order by A.ordine desc";
PreparedStatement ps = getConn().prepareStatement(s_sqlFind);
Vectumerator vec = findRows(ps);
if (vec.hasMoreElements()) {
TagliaMisure tm = (TagliaMisure)vec.nextElement();
long ordineTM = tm.getOrdine();
tm.setOrdine(-ordineBean);
rp = tm.save();
if (rp.getStatus()) {
setOrdine(ordineTM);
rp = save();
if (rp.getStatus()) {
tm.setOrdine(ordineBean);
rp = tm.save();
}
}
} else {
rp.setStatus(true);
rp.setMsg("Raggiunto valore minimo!");
}
} catch (Exception e) {
handleDebug(e);
}
} else {
rp.setStatus(false);
rp.setMsg("Errore!. Oggetto tagliaMisure non salvato");
}
return rp;
}
public ResParm spostaGiu() {
ResParm rp = new ResParm();
if (getDBState() == 1) {
try {
long ordineBean = getOrdine();
String s_sqlFind = "select A.* from TAGLIA_MISURE as A WHERE id_tabellaTaglia=" + getId_tabellaTaglia() + " and A.ordine>" + ordineBean + " order by A.ordine asc";
PreparedStatement ps = getConn().prepareStatement(s_sqlFind);
Vectumerator vec = findRows(ps);
if (vec.hasMoreElements()) {
TagliaMisure tm = (TagliaMisure)vec.nextElement();
long ordineTM = tm.getOrdine();
tm.setOrdine(-ordineBean);
rp = tm.save();
if (rp.getStatus()) {
setOrdine(ordineTM);
rp = save();
if (rp.getStatus()) {
tm.setOrdine(ordineBean);
rp = tm.save();
}
}
} else {
rp.setStatus(true);
rp.setMsg("Raggiunto valore massimo!");
}
} catch (Exception e) {
handleDebug(e);
}
} else {
rp.setStatus(false);
rp.setMsg("Errore!. Oggetto tagliaMisure non salvato");
}
return rp;
}
public String getVitaCmTeso() {
return (this.vitaCmTeso == null) ? "" : this.vitaCmTeso.trim();
}
public void setVitaCmTeso(String vitaCmTeso) {
this.vitaCmTeso = vitaCmTeso;
}
public String getVitaCmNoTeso() {
return (this.vitaCmNoTeso == null) ? "" : this.vitaCmNoTeso.trim();
}
public void setVitaCmNoTeso(String vitaCmNoTeso) {
this.vitaCmNoTeso = vitaCmNoTeso;
}
public String getLunghezzaManica() {
return (this.lunghezzaManica == null) ? "" : this.lunghezzaManica.trim();
}
public void setLunghezzaManica(String lunghezzaManica) {
this.lunghezzaManica = lunghezzaManica;
}
}

View file

@ -0,0 +1,186 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class TagliaMisureCR extends CRAdapter {
private long id_tagliaMisure;
private long id_tabellaTaglia;
private long ordine;
private String tagliaLettere;
private String tagliaNum;
private String tagliaCollo;
private String colloCm;
private String colloPoll;
private String vitaCm;
private String toraceCm;
private String lunghezzatotale;
private String altezzaCavallo;
private String giroCoscia;
private String larghezzaFondoCm;
private String lunghezzaGamba;
private String spalleCm;
private TabellaTaglia tabellaTaglia;
public TagliaMisureCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TagliaMisureCR() {}
public void setId_tagliaMisure(long newId_tagliaMisure) {
this.id_tagliaMisure = newId_tagliaMisure;
}
public void setId_tabellaTaglia(long newId_tabellaTaglia) {
this.id_tabellaTaglia = newId_tabellaTaglia;
setTabellaTaglia(null);
}
public void setOrdine(long newOrdine) {
this.ordine = newOrdine;
}
public void setTagliaLettere(String newTagliaLettere) {
this.tagliaLettere = newTagliaLettere;
}
public void setTagliaNum(String newTagliaNum) {
this.tagliaNum = newTagliaNum;
}
public void setTagliaCollo(String newTagliaCollo) {
this.tagliaCollo = newTagliaCollo;
}
public void setColloCm(String newColloCm) {
this.colloCm = newColloCm;
}
public void setColloPoll(String newColloPoll) {
this.colloPoll = newColloPoll;
}
public void setVitaCm(String newVitaCm) {
this.vitaCm = newVitaCm;
}
public void setToraceCm(String newToraceCm) {
this.toraceCm = newToraceCm;
}
public void setLunghezzatotale(String newLunghezzatotale) {
this.lunghezzatotale = newLunghezzatotale;
}
public void setAltezzaCavallo(String newAltezzaCavallo) {
this.altezzaCavallo = newAltezzaCavallo;
}
public void setGiroCoscia(String newGiroCoscia) {
this.giroCoscia = newGiroCoscia;
}
public void setLarghezzaFondoCm(String newLarghezzaFondoCm) {
this.larghezzaFondoCm = newLarghezzaFondoCm;
}
public void setLunghezzaGamba(String newLunghezzaGamba) {
this.lunghezzaGamba = newLunghezzaGamba;
}
public void setSpalleCm(String newSpalleCm) {
this.spalleCm = newSpalleCm;
}
public long getId_tagliaMisure() {
return this.id_tagliaMisure;
}
public long getId_tabellaTaglia() {
return this.id_tabellaTaglia;
}
public long getOrdine() {
return this.ordine;
}
public String getTagliaLettere() {
return (this.tagliaLettere == null) ? "" : this.tagliaLettere.trim();
}
public String getTagliaNum() {
return (this.tagliaNum == null) ? "" : this.tagliaNum.trim();
}
public String getTagliaCollo() {
return (this.tagliaCollo == null) ? "" : this.tagliaCollo.trim();
}
public String getColloCm() {
return (this.colloCm == null) ? "" : this.colloCm.trim();
}
public String getColloPoll() {
return (this.colloPoll == null) ? "" : this.colloPoll.trim();
}
public String getVitaCm() {
return (this.vitaCm == null) ? "" : this.vitaCm.trim();
}
public String getToraceCm() {
return (this.toraceCm == null) ? "" : this.toraceCm.trim();
}
public String getLunghezzatotale() {
return (this.lunghezzatotale == null) ? "" : this.lunghezzatotale.trim();
}
public String getAltezzaCavallo() {
return (this.altezzaCavallo == null) ? "" : this.altezzaCavallo.trim();
}
public String getGiroCoscia() {
return (this.giroCoscia == null) ? "" : this.giroCoscia.trim();
}
public String getLarghezzaFondoCm() {
return (this.larghezzaFondoCm == null) ? "" : this.larghezzaFondoCm.trim();
}
public String getLunghezzaGamba() {
return (this.lunghezzaGamba == null) ? "" : this.lunghezzaGamba.trim();
}
public String getSpalleCm() {
return (this.spalleCm == null) ? "" : this.spalleCm.trim();
}
public void setTabellaTaglia(TabellaTaglia newTabellaTaglia) {
this.tabellaTaglia = newTabellaTaglia;
}
public TabellaTaglia getTabellaTaglia() {
this.tabellaTaglia = (TabellaTaglia)getSecondaryObject(this.tabellaTaglia, TabellaTaglia.class,
getId_tabellaTaglia());
return this.tabellaTaglia;
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,83 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class TipoAccessorio extends _ArtAdapter implements Serializable {
private long flgDirezione;
private long id_tipoAccessorio;
public TipoAccessorio(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TipoAccessorio() {}
public void setId_tipoAccessorio(long newId_tipoAccessorio) {
this.id_tipoAccessorio = newId_tipoAccessorio;
}
public long getId_tipoAccessorio() {
return this.id_tipoAccessorio;
}
protected void deleteCascade() {}
public Vectumerator findByCR(TipoAccessorioCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from TIPO_ACCESSORIO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find +
wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public long getFlgDirezione() {
return this.flgDirezione;
}
public void setFlgDirezione(long flgDirezione) {
this.flgDirezione = flgDirezione;
}
public static final String getDirezione(long l_flgDirezione) {
if (l_flgDirezione == 0L)
return "1<-->2";
if (l_flgDirezione == 1L)
return "1|-->2";
if (l_flgDirezione == -1L)
return "1<--|2";
return "??";
}
public final String getDirezione() {
return getDirezione(getFlgDirezione());
}
public boolean useDescLangTables() {
return true;
}
}

View file

@ -0,0 +1,42 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class TipoAccessorioCR extends CRAdapter {
private long id_tipoAccessorio;
private String descrizione_it;
private String descrizione_en;
public TipoAccessorioCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TipoAccessorioCR() {}
public void setId_tipoAccessorio(long newId_tipoAccessorio) {
this.id_tipoAccessorio = newId_tipoAccessorio;
}
public void setDescrizione_it(String newDescrizione_it) {
this.descrizione_it = newDescrizione_it;
}
public void setDescrizione_en(String newDescrizione_en) {
this.descrizione_en = newDescrizione_en;
}
public long getId_tipoAccessorio() {
return this.id_tipoAccessorio;
}
public String getDescrizione_it() {
return (this.descrizione_it == null) ? "" : this.descrizione_it;
}
public String getDescrizione_en() {
return (this.descrizione_en == null) ? "" : this.descrizione_en;
}
}

View file

@ -0,0 +1,65 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class TipoAllegatoArticolo extends _ArtAdapter implements Serializable {
private long id_tipoAllegatoArticolo;
private String descrizione;
public TipoAllegatoArticolo(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TipoAllegatoArticolo() {}
public void setId_tipoAllegatoArticolo(long newId_tipoAllegatoArticolo) {
this.id_tipoAllegatoArticolo = newId_tipoAllegatoArticolo;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public long getId_tipoAllegatoArticolo() {
return this.id_tipoAllegatoArticolo;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
protected void deleteCascade() {}
public Vectumerator findByCR(TipoAllegatoArticoloCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from TIPO_ALLEGATO_ARTICOLO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
}

View file

@ -0,0 +1,32 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class TipoAllegatoArticoloCR extends CRAdapter {
private long id_tipoAllegatoArticolo;
private String descrizione;
public TipoAllegatoArticoloCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TipoAllegatoArticoloCR() {}
public void setId_tipoAllegatoArticolo(long newId_tipoAllegatoArticolo) {
this.id_tipoAllegatoArticolo = newId_tipoAllegatoArticolo;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public long getId_tipoAllegatoArticolo() {
return this.id_tipoAllegatoArticolo;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
}

View file

@ -0,0 +1,256 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class TipoCR extends CRAdapter {
private long id_tipo;
private String flg_evidenziato;
private String descrizione;
private long ricaricoBase;
private long id_tipoPadre;
private long livello;
private String indici;
private Tipo tipoPadre;
private long flgNascondi = -1L;
private String codCdc;
private long id_reparto;
private long flgPresente = -1L;
private long flgPresenteOfferte = -1L;
private long flgPresenteStock = -1L;
private long flgPresenteUsato = -1L;
private long flgEscludiWeb = -1L;
private long flgAFT = -1L;
private long flgSoloFoglie = -1L;
private long limit = 0L;
private long start;
private String tag;
private String id_marche;
private long flgMainPage = -1L;
public TipoCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TipoCR() {}
public void setId_tipo(long newId_tipo) {
this.id_tipo = newId_tipo;
}
public void setFlg_evidenziato(String newFlg_evidenziato) {
this.flg_evidenziato = newFlg_evidenziato;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public void setRicaricoBase(long newRicaricoBase) {
this.ricaricoBase = newRicaricoBase;
}
public void setId_tipoPadre(long newId_tipoPadre) {
this.id_tipoPadre = newId_tipoPadre;
setTipo(null);
}
public void setLivello(long newLivello) {
this.livello = newLivello;
}
public void setIndici(String newIndici) {
this.indici = newIndici;
}
public long getId_tipo() {
return this.id_tipo;
}
public String getFlg_evidenziato() {
return (this.flg_evidenziato == null) ? "" : this.flg_evidenziato;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione;
}
public long getRicaricoBase() {
return this.ricaricoBase;
}
public long getId_tipoPadre() {
return this.id_tipoPadre;
}
public long getLivello() {
return this.livello;
}
public String getIndici() {
return (this.indici == null) ? "" : this.indici;
}
public void setTipo(Tipo newTipo) {
this.tipoPadre = newTipo;
}
public Tipo getTipo() {
this.tipoPadre = (Tipo)getSecondaryObject(this.tipoPadre, Tipo.class, getId_tipoPadre());
return this.tipoPadre;
}
public String getCodCdc() {
return (this.codCdc == null) ? AB_EMPTY_STRING : this.codCdc;
}
public void setCodCdc(String codCdc) {
this.codCdc = codCdc;
}
public long getFlgNascondi() {
return this.flgNascondi;
}
public void setFlgNascondi(long flgNascondi) {
this.flgNascondi = flgNascondi;
}
public long getId_reparto() {
return this.id_reparto;
}
public void setId_reparto(long id_reparto) {
this.id_reparto = id_reparto;
}
public long getFlgPresente() {
return this.flgPresente;
}
public void setFlgPresente(long flgPresente) {
this.flgPresente = flgPresente;
}
public long getFlgPresenteOfferte() {
return this.flgPresenteOfferte;
}
public void setFlgPresenteOfferte(long flgPresenteOfferte) {
this.flgPresenteOfferte = flgPresenteOfferte;
}
public long getFlgPresenteStock() {
return this.flgPresenteStock;
}
public void setFlgPresenteStock(long flgPresenteStock) {
this.flgPresenteStock = flgPresenteStock;
}
public long getFlgPresenteUsato() {
return this.flgPresenteUsato;
}
public void setFlgPresenteUsato(long flgPresenteUsato) {
this.flgPresenteUsato = flgPresenteUsato;
}
public long getFlgEscludiWeb() {
return this.flgEscludiWeb;
}
public void setFlgEscludiWeb(long flgEscludiWeb) {
this.flgEscludiWeb = flgEscludiWeb;
}
public String getAFT() {
return TipologiaArticolo.getAFT(getFlgAFT());
}
public static final String getAFT(long l_flgAFT) {
return TipologiaArticolo.getAFT(l_flgAFT);
}
public long getFlgAFT() {
return this.flgAFT;
}
public void setFlgAFT(long flgAFT) {
this.flgAFT = flgAFT;
}
public long getFlgSoloFoglie() {
return this.flgSoloFoglie;
}
public void setFlgSoloFoglie(long flgSoloFoglie) {
this.flgSoloFoglie = flgSoloFoglie;
}
public long getLimit() {
return this.limit;
}
public void setLimit(long limit) {
this.limit = limit;
}
public long getStart() {
return this.start;
}
public void setStart(long start) {
this.start = start;
}
public String getTag() {
return (this.tag == null) ? AB_EMPTY_STRING : this.tag.trim();
}
public void setTag(String tag) {
this.tag = tag;
}
public static final String getTipoMagazzino(long l_flgTipoMagazzino) {
return Tipo.getTipoMagazzino(l_flgTipoMagazzino);
}
public String getId_marche() {
return (this.id_marche == null) ? AB_EMPTY_STRING : this.id_marche.trim();
}
public void setId_marche(String id_marche) {
this.id_marche = id_marche;
}
public long getFlgMainPage() {
return this.flgMainPage;
}
public void setFlgMainPage(long flgMainPage) {
this.flgMainPage = flgMainPage;
}
}

View file

@ -0,0 +1,110 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Locale;
public class TipoTaglia extends _ArtAdapter implements Serializable {
private long id_tipoTaglia;
private String descrizione;
private String codice;
public TipoTaglia(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TipoTaglia() {}
public void setId_tipoTaglia(long newId_tipoTaglia) {
this.id_tipoTaglia = newId_tipoTaglia;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public void setCodice(String newCodice) {
this.codice = newCodice;
}
public long getId_tipoTaglia() {
return this.id_tipoTaglia;
}
public String getDescrizione() {
return getDescrizione(Locale.ITALIAN.getLanguage());
}
public String getCodice() {
return (this.codice == null) ? "" : this.codice;
}
protected void deleteCascade() {}
public Vectumerator findByCR(TipoTagliaCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from TIPO_TAGLIA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByCodice(String l_codice) {
String s_Sql_Find = "select A.* from TIPO_TAGLIA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.codice='" + l_codice + "'");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
handleDebug(e);
}
}
public String getDescrizioneCompleta() {
if (getCodice().equals(getDescrizione()) || getCodice().isEmpty())
return getDescrizione();
return getCodice() + " - " + getCodice();
}
public String getDescrizione(String lang) {
if (lang.isEmpty())
lang = "it";
return getDescTxtLang("descrizione", lang);
}
public String getDescrizioneCompleta(String l_lang) {
if (getCodice().equals(getDescrizione(l_lang)) || getCodice().isEmpty())
return getDescrizione(l_lang);
return getCodice() + " - " + getCodice();
}
public boolean useDescLangTables() {
return true;
}
}

View file

@ -0,0 +1,42 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class TipoTagliaCR extends CRAdapter {
private long id_tipoTaglia;
private String descrizione;
private String codice;
public TipoTagliaCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TipoTagliaCR() {}
public void setId_tipoTaglia(long newId_tipoTaglia) {
this.id_tipoTaglia = newId_tipoTaglia;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public void setCodice(String newCodice) {
this.codice = newCodice;
}
public long getId_tipoTaglia() {
return this.id_tipoTaglia;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione;
}
public String getCodice() {
return (this.codice == null) ? "" : this.codice;
}
}

View file

@ -0,0 +1,175 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.WcString;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class TipologiaArticolo extends _ArtAdapter implements Serializable {
private long id_tipologiaArticolo;
private String descrizione;
private long flgUdm;
private long flgKg;
private long flgMt;
private long flgNr;
private long flgAFT = 0L;
public static final long AFT_NON_IMPOSTATO = -1L;
public static final long AFT_ARTICOLO = 0L;
public static final long AFT_FILATO = 1L;
public static final long AFT_TESSUTO = 2L;
public static final long AFT_CONFEZIONE = 3L;
public static final long AFT_ANNODATURA = 21L;
public static final long AFT_COLPI_DISPOSIZIONE = 20L;
public static final long AFT_CATENA = 22L;
public static final long AFT_CR_ARTICOLO_E_CONFEZIONE = 30L;
public static final int UDM_NR = 1;
public static final int UDM_KG = 2;
public static final int UDM_MT = 3;
public static final int UDM_LT = 4;
public static final int UDM_MT2 = 5;
public TipologiaArticolo(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TipologiaArticolo() {}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione;
}
protected void deleteCascade() {}
public Vectumerator findByCR(TipologiaArticoloCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from TIPOLOGIA_ARTICOLO AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public long getId_tipologiaArticolo() {
return this.id_tipologiaArticolo;
}
public void setId_tipologiaArticolo(long id_tipologiaArticolo) {
this.id_tipologiaArticolo = id_tipologiaArticolo;
}
public long getFlgUdm() {
return this.flgUdm;
}
public void setFlgUdm(long flgUdm) {
this.flgUdm = flgUdm;
}
public long getFlgKg() {
return this.flgKg;
}
public void setFlgKg(long flgKg) {
this.flgKg = flgKg;
}
public long getFlgMt() {
return this.flgMt;
}
public void setFlgMt(long flgMt) {
this.flgMt = flgMt;
}
public long getFlgNr() {
return this.flgNr;
}
public void setFlgNr(long flgNr) {
this.flgNr = flgNr;
}
public static String getUdm(long l_flgUdm) {
if (l_flgUdm == 1L)
return "nr.";
if (l_flgUdm == 2L)
return "kg.";
if (l_flgUdm == 3L)
return "mt.";
if (l_flgUdm == 5L)
return "mq.";
if (l_flgUdm == 4L)
return "l.";
return "";
}
public String getUdm() {
return getUdm(getFlgUdm());
}
public String getDescrizioneCompleta() {
return getDescrizione() + " (" + getDescrizione() + ")";
}
public String getAFT() {
if (getId_tipologiaArticolo() == 0L)
return "";
return getAFT(getFlgAFT());
}
public static final String getAFT(long l_flgAFT) {
switch ((int)l_flgAFT) {
case 0:
return "Articolo";
case 1:
return "Filato";
case 2:
return "Tessuto";
case 3:
return "Confezione";
}
return "??";
}
public long getFlgAFT() {
return this.flgAFT;
}
public void setFlgAFT(long flgAFT) {
this.flgAFT = flgAFT;
}
public boolean useDescLangTables() {
return true;
}
}

View file

@ -0,0 +1,81 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import java.io.Serializable;
public class TipologiaArticoloCR extends CRAdapter implements Serializable {
private long id_tipologiaArticolo;
private String descrizione;
private long flgUdm;
private long flgKg;
private long flgMt;
private long flgNr;
public TipologiaArticoloCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public TipologiaArticoloCR() {}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione;
}
public long getId_tipologiaArticolo() {
return this.id_tipologiaArticolo;
}
public void setId_tipologiaArticolo(long id_tipologiaArticolo) {
this.id_tipologiaArticolo = id_tipologiaArticolo;
}
public long getFlgUdm() {
return this.flgUdm;
}
public void setFlgUdm(long flgUdm) {
this.flgUdm = flgUdm;
}
public long getFlgKg() {
return this.flgKg;
}
public void setFlgKg(long flgKg) {
this.flgKg = flgKg;
}
public long getFlgMt() {
return this.flgMt;
}
public void setFlgMt(long flgMt) {
this.flgMt = flgMt;
}
public long getFlgNr() {
return this.flgNr;
}
public void setFlgNr(long flgNr) {
this.flgNr = flgNr;
}
public String getUdm() {
return TipologiaArticolo.getUdm(getFlgUdm());
}
public static String getUdm(long l_flgUdm) {
return TipologiaArticolo.getUdm(l_flgUdm);
}
}

View file

@ -0,0 +1,77 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.PreparedStatement;
import java.sql.SQLException;
public class Vetrina extends DBAdapter implements Serializable {
private static final long serialVersionUID = 5892969804207775294L;
private long id_vetrina;
private String descrizione;
public Vetrina(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Vetrina() {}
public void setId_vetrina(long newId_vetrina) {
this.id_vetrina = newId_vetrina;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public long getId_vetrina() {
return this.id_vetrina;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
protected ResParm checkDeleteCascade() {
return new ResParm(true);
}
protected void deleteCascade() {}
public Vectumerator findByCR(VetrinaCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from VETRINA AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public boolean useDescLangTables() {
return false;
}
}

View file

@ -0,0 +1,32 @@
package it.acxent.art;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
public class VetrinaCR extends CRAdapter {
private long id_vetrina;
private String descrizione;
public VetrinaCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public VetrinaCR() {}
public void setId_vetrina(long newId_vetrina) {
this.id_vetrina = newId_vetrina;
}
public void setDescrizione(String newDescrizione) {
this.descrizione = newDescrizione;
}
public long getId_vetrina() {
return this.id_vetrina;
}
public String getDescrizione() {
return (this.descrizione == null) ? "" : this.descrizione.trim();
}
}

View file

@ -0,0 +1,325 @@
package it.acxent.art;
import it.acxent.anag.Users;
import it.acxent.db.ApplParmFull;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.db.WcString;
import it.acxent.util.StringTokenizer;
import it.acxent.util.Vectumerator;
import java.io.Serializable;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
public class Wishlist extends DBAdapter implements Serializable {
private static final long serialVersionUID = 1594898932312L;
private long id_wishlist;
private long id_users;
private long id_articolo;
private long id_articoloVariante;
private long id_articoloTaglia;
private long flgAbilitaAvviso;
private double prezzoWL;
private Date dataWL;
private Time oraWL;
private double prezzoUltimoAvviso;
private long dispoLevelWL;
private long dispoLevelUltimoAvviso;
private Timestamp tmstUltimoAvviso;
private Users users;
private Articolo articolo;
private ArticoloVariante articoloVariante;
private ArticoloTaglia articoloTaglia;
public Wishlist(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public Wishlist() {}
public void setId_wishlist(long newId_wishlist) {
this.id_wishlist = newId_wishlist;
}
public void setId_users(long newId_users) {
this.id_users = newId_users;
setUsers(null);
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public void setId_articoloVariante(long newId_articoloVariante) {
this.id_articoloVariante = newId_articoloVariante;
setArticoloVariante(null);
}
public void setId_articoloTaglia(long newId_articoloTaglia) {
this.id_articoloTaglia = newId_articoloTaglia;
setArticoloTaglia(null);
}
public void setFlgAbilitaAvviso(long newFlgAbilitaAvviso) {
this.flgAbilitaAvviso = newFlgAbilitaAvviso;
}
public void setPrezzoWL(double newPrezzoWL) {
this.prezzoWL = newPrezzoWL;
}
public void setDataWL(Date newDataWL) {
this.dataWL = newDataWL;
}
public void setOraWL(Time newOraWL) {
this.oraWL = newOraWL;
}
public void setPrezzoUltimoAvviso(double newPrezzoUltimoAvviso) {
this.prezzoUltimoAvviso = newPrezzoUltimoAvviso;
}
public void setTmstUltimoAvviso(Timestamp newTmstUltimoAvviso) {
this.tmstUltimoAvviso = newTmstUltimoAvviso;
}
public long getId_wishlist() {
return this.id_wishlist;
}
public long getId_users() {
return this.id_users;
}
public long getId_articolo() {
return this.id_articolo;
}
public long getId_articoloVariante() {
return this.id_articoloVariante;
}
public long getId_articoloTaglia() {
return this.id_articoloTaglia;
}
public long getFlgAbilitaAvviso() {
return this.flgAbilitaAvviso;
}
public double getPrezzoWL() {
return this.prezzoWL;
}
public Date getDataWL() {
return this.dataWL;
}
public Time getOraWL() {
return this.oraWL;
}
public double getPrezzoUltimoAvvisoIva() {
return conIva(getPrezzoUltimoAvviso(), (double)getArticolo().getIva().getAliquota());
}
public Timestamp getTmstUltimoAvviso() {
return this.tmstUltimoAvviso;
}
public void setUsers(Users newUsers) {
this.users = newUsers;
}
public Users getUsers() {
this.users = (Users)getSecondaryObject((DBAdapter)this.users, Users.class, getId_users());
return this.users;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class, getId_articolo());
return this.articolo;
}
public void setArticoloVariante(ArticoloVariante newArticoloVariante) {
this.articoloVariante = newArticoloVariante;
}
public ArticoloVariante getArticoloVariante() {
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class, getId_articoloVariante());
return this.articoloVariante;
}
public void setArticoloTaglia(ArticoloTaglia newArticoloTaglia) {
this.articoloTaglia = newArticoloTaglia;
}
public ArticoloTaglia getArticoloTaglia() {
this.articoloTaglia = (ArticoloTaglia)getSecondaryObject(this.articoloTaglia, ArticoloTaglia.class, getId_articoloTaglia());
return this.articoloTaglia;
}
protected ResParm checkDeleteCascade() {
return new ResParm(true);
}
protected void deleteCascade() {}
public Vectumerator<Wishlist> findByCR(WishlistCR CR, int pageNumber, int pageRows) {
String s_Sql_Find = "select A.* from WISHLIST AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
if (!CR.getSearchTxt().trim().isEmpty()) {
StringTokenizer st = new StringTokenizer(CR.getSearchTxt().trim(), " ");
StringBuffer txt = new StringBuffer("(");
while (st.hasMoreTokens()) {
String token = st.nextToken();
txt.append("(A.Cognome like '%" + token + "%' or A.Nome like '%" + token + "%')");
if (st.hasMoreTokens())
txt.append(" and ");
}
txt.append(")");
wc.addWc(txt.toString());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt, pageNumber, pageRows);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public void findByUserItem(long l_id_users, Wishlist item) {
String s_Sql_Find = "select A.* from WISHLIST AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_users=" + l_id_users);
wc.addWc("A.id_articolo=" + item.getId_articolo());
if (item.getId_articoloVariante() == 0L) {
wc.addWc("(A.id_articoloVariante is null or A.id_articoloVariante=0)");
} else {
wc.addWc("A.id_articoloVariante=" + item.getId_articoloVariante());
}
if (item.getId_articoloTaglia() == 0L) {
wc.addWc("(A.id_articoloTaglia is null or A.id_articoloTaglia=0)");
} else {
wc.addWc("A.id_articoloTaglia=" + item.getId_articoloTaglia());
}
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
findFirstRecord(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
}
}
public double getPrezzoWLIva() {
return conIva(getPrezzoWL(), (double)getArticolo().getIva().getAliquota());
}
public double getPrezzoUltimoAvviso() {
return (this.prezzoUltimoAvviso == 0.0D) ? getPrezzoWL() : this.prezzoUltimoAvviso;
}
public long getDispoLevel() {
if (getId_articoloTaglia() > 0L)
return (long)getArticoloTaglia().getDispoLevel();
if (getId_articoloVariante() > 0L)
return (long)getArticoloVariante().getDispoLevel();
return (long)getArticolo().getDispoLevel();
}
public long getId_item() {
if (getId_articoloTaglia() > 0L)
return getId_articoloTaglia();
if (getId_articoloVariante() > 0L)
return getId_articoloVariante();
return getId_articolo();
}
public String getCCLinkDettaglio(ArticoloCR CR) {
return getArticolo().getCCLinkDettaglio(CR);
}
public long getFlgPrezzoModificato() {
if (getId_wishlist() == 0L)
return 0L;
if (getPrezzoUltimoAvviso() < getArticolo().getPrezzoPubblico(getUsers().getClifor()))
return -1L;
if (getPrezzoUltimoAvviso() > getArticolo().getPrezzoPubblico(getUsers().getClifor()))
return 1L;
if (getPrezzoUltimoAvviso() == getArticolo().getPrezzoPubblico(getUsers().getClifor()))
return 0L;
return 0L;
}
public boolean isDispoLevelModificata() {
if (getId_wishlist() == 0L)
return false;
if (getDispoLevelUltimoAvviso() != (long)getArticolo().getDispoLevel())
return true;
return false;
}
public Vectumerator<Wishlist> findByUser(long l_id_users, boolean conAvviso) {
String s_Sql_Find = "select A.* from WISHLIST AS A";
String s_Sql_Order = "";
WcString wc = new WcString();
wc.addWc("A.id_users=" + l_id_users);
if (conAvviso)
wc.addWc("A.flgAbilitaAvviso=1");
try {
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + s_Sql_Find + wc.toString());
return findRows(stmt);
} catch (SQLException e) {
removeCPConnection();
handleDebug(e);
return AB_EMPTY_VECTUMERATOR;
}
}
public long getDispoLevelWL() {
return this.dispoLevelWL;
}
public void setDispoLevelWL(long dispoLevelWL) {
this.dispoLevelWL = dispoLevelWL;
}
public long getDispoLevelUltimoAvviso() {
return this.dispoLevelUltimoAvviso;
}
public void setDispoLevelUltimoAvviso(long dispoLevelUltimoAvviso) {
this.dispoLevelUltimoAvviso = dispoLevelUltimoAvviso;
}
}

View file

@ -0,0 +1,185 @@
package it.acxent.art;
import it.acxent.anag.Users;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
public class WishlistCR extends CRAdapter {
private static final long serialVersionUID = 7453705089191781116L;
private long id_wishlist;
private long id_users;
private long id_articolo;
private long id_articoloVariante;
private long id_articoloTaglia;
private long flgAbilitaAvviso;
private double prezzoWL;
private Date dataWL;
private Time oraWL;
private double prezzoUltimoAvviso;
private Timestamp tmstUltimoAvviso;
private Users users;
private Articolo articolo;
private ArticoloVariante articoloVariante;
private ArticoloTaglia articoloTaglia;
public WishlistCR(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
public WishlistCR() {}
public void setId_wishlist(long newId_wishlist) {
this.id_wishlist = newId_wishlist;
}
public void setId_users(long newId_users) {
this.id_users = newId_users;
setUsers(null);
}
public void setId_articolo(long newId_articolo) {
this.id_articolo = newId_articolo;
setArticolo(null);
}
public void setId_articoloVariante(long newId_articoloVariante) {
this.id_articoloVariante = newId_articoloVariante;
setArticoloVariante(null);
}
public void setId_articoloTaglia(long newId_articoloTaglia) {
this.id_articoloTaglia = newId_articoloTaglia;
setArticoloTaglia(null);
}
public void setFlgAbilitaAvviso(long newFlgAbilitaAvviso) {
this.flgAbilitaAvviso = newFlgAbilitaAvviso;
}
public void setPrezzoWL(double newPrezzoWL) {
this.prezzoWL = newPrezzoWL;
}
public void setDataWL(Date newDataWL) {
this.dataWL = newDataWL;
}
public void setOraWL(Time newOraWL) {
this.oraWL = newOraWL;
}
public void setPrezzoUltimoAvviso(double newPrezzoUltimoAvviso) {
this.prezzoUltimoAvviso = newPrezzoUltimoAvviso;
}
public void setTmstUltimoAvviso(Timestamp newTmstUltimoAvviso) {
this.tmstUltimoAvviso = newTmstUltimoAvviso;
}
public long getId_wishlist() {
return this.id_wishlist;
}
public long getId_users() {
return this.id_users;
}
public long getId_articolo() {
return this.id_articolo;
}
public long getId_articoloVariante() {
return this.id_articoloVariante;
}
public long getId_articoloTaglia() {
return this.id_articoloTaglia;
}
public long getFlgAbilitaAvviso() {
return this.flgAbilitaAvviso;
}
public double getPrezzoWL() {
return this.prezzoWL;
}
public Date getDataWL() {
return this.dataWL;
}
public Time getOraWL() {
return this.oraWL;
}
public double getPrezzoUltimoAvviso() {
return this.prezzoUltimoAvviso;
}
public Timestamp getTmstUltimoAvviso() {
return this.tmstUltimoAvviso;
}
public void setUsers(Users newUsers) {
this.users = newUsers;
}
public Users getUsers() {
this.users = (Users)getSecondaryObject((DBAdapter)this.users, Users.class,
getId_users());
return this.users;
}
public void setArticolo(Articolo newArticolo) {
this.articolo = newArticolo;
}
public Articolo getArticolo() {
this.articolo = (Articolo)getSecondaryObject(this.articolo, Articolo.class,
getId_articolo());
return this.articolo;
}
public void setArticoloVariante(ArticoloVariante newArticoloVariante) {
this.articoloVariante = newArticoloVariante;
}
public ArticoloVariante getArticoloVariante() {
this.articoloVariante = (ArticoloVariante)getSecondaryObject(this.articoloVariante, ArticoloVariante.class,
getId_articoloVariante());
return this.articoloVariante;
}
public void setArticoloTaglia(ArticoloTaglia newArticoloTaglia) {
this.articoloTaglia = newArticoloTaglia;
}
public ArticoloTaglia getArticoloTaglia() {
this.articoloTaglia = (ArticoloTaglia)getSecondaryObject(this.articoloTaglia, ArticoloTaglia.class,
getId_articoloTaglia());
return this.articoloTaglia;
}
}

View file

@ -0,0 +1,32 @@
package it.acxent.art;
import it.acxent.anag._AnagAdapter;
import it.acxent.db.ApplParm;
import it.acxent.db.ApplParmFull;
public class _ArtAdapter extends _AnagAdapter {
public static final long SF_BOZZA = 0L;
public static final long SF_EMESSA = 1L;
public static final long SF_REG_IVA = 2L;
protected static ApplParmFull ap2;
public _ArtAdapter() {}
public _ArtAdapter(ApplParmFull newApplParmFull) {
super(newApplParmFull);
}
protected void deleteCascade() {}
protected ApplParmFull getAp2() {
if (ap2 == null) {
ApplParm apx = new ApplParm(getApFull().getParm("DBDRIVER2").getNumeroInt(), getApFull().getParm("DBNAME2").getTesto(),
getApFull().getParm("USER2").getTesto(), getApFull().getParm("PASSWORD2").getTesto());
ap2 = new ApplParmFull(apx);
}
return ap2;
}
}

View file

@ -0,0 +1 @@
package it.acxent.art.json;

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,504 @@
package it.acxent.art.servlet;
import it.acxent.anag.Listino;
import it.acxent.anag.ListinoArticolo;
import it.acxent.art.Accessorio;
import it.acxent.art.Articolo;
import it.acxent.art.ArticoloCR;
import it.acxent.art.ArticoloTaglia;
import it.acxent.art.ArticoloVariante;
import it.acxent.art.ArticoloVarianteCR;
import it.acxent.art.Colore;
import it.acxent.art.ColoreCR;
import it.acxent.art.TabellaTaglia;
import it.acxent.art.Taglia;
import it.acxent.art.TipoAccessorio;
import it.acxent.art.Vetrina;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.tex.anag.ArticoloArticoloTessuto;
import it.acxent.util.AbMessages;
import it.acxent.util.Vectumerator;
import java.io.File;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/art/ArticoloVariante.abl"})
public class ArticoloVarianteSvlt extends _MagSvlt {
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
ArticoloVariante bean = (ArticoloVariante)beanA;
if (bean.getTipo().isUsaMagazzino())
req.setAttribute("listaDisponibilita", bean.getDisponibilitaMovimento());
req.setAttribute("listaVetrine", new Vetrina(apFull).findAll());
if (bean.getTipo().getFlgUsaTaglia() == 2L) {
req.setAttribute("listaTagliePerTipo", new Taglia(apFull)
.findTaglieByTipoTaglia(bean.getArticolo().getTipo().getTipoTaglia().getId_tipoTaglia()));
req.setAttribute("listaTaglieArticolo", new ArticoloTaglia(apFull).findByArticoloVariante(bean.getId_articoloVariante()));
req.setAttribute("listaTabellaTaglie", new TabellaTaglia(apFull).findAll());
if (bean.getArticolo().getId_tipoTaglia() > 0L)
req.setAttribute("listaMisure", bean.getArticolo().getTabellaTaglia().getTagliaMisure());
}
req.setAttribute("listaListini", new Listino(apFull).findAll());
req.setAttribute("listaListiniArticolo", new ListinoArticolo(apFull).findPrezziByArticoloVariante(bean.getId_articoloVariante()));
if (bean.getTipo().getFlgAFT() == 3L)
req.setAttribute("listaArticoliTessuto", bean.findArticoliTessuto());
if (bean.getTipo().getFlgUsaVarianteColori() == 1L)
req.setAttribute("listaColori", new Colore(apFull).findByCR(new ColoreCR(), 0, 0));
if (bean.getArticolo().getFlgKit() == 1L)
req.setAttribute("listaVariantiKit", bean.getArticolo().getKitVariantiAssociati());
req.setAttribute("listListino", new Listino(apFull).findNoListinoBase());
}
protected void fillComboAfterSearch(CRAdapter CRA, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new ArticoloVariante(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new ArticoloVarianteCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
long l_id_articolo = getRequestLongParameter(req, "id_articolo");
Articolo bean2 = new Articolo(apFull);
bean2.findByPrimaryKey(l_id_articolo);
ResParm rp = new ResParm(true, "");
fillObject(req, bean2);
rp = bean2.save();
if (!rp.getStatus())
sendMessage(req, rp.getMsg());
ArticoloVariante bean = new ArticoloVariante(apFull);
bean.setId_articolo(bean2.getId_articolo());
req.setAttribute("bean", bean);
req.setAttribute("listaTipiAccessorio", new TipoAccessorio(apFull).findAll());
req.setAttribute("listaVetrine", new Vetrina(apFull).findAll());
req.setAttribute("listaTagliePerTipo", new Taglia(apFull)
.findTaglieByTipoTaglia(bean.getArticolo().getTipo().getTipoTaglia().getId_tipoTaglia()));
req.setAttribute("listaListiniArticolo", new ListinoArticolo(apFull).findPrezziByArticoloVariante(bean.getId_articoloVariante()));
if (bean.getTipo().getFlgUsaVarianteColori() == 1L)
req.setAttribute("listaColori", new Colore(apFull).findByCR(new ColoreCR(), 0, 0));
}
protected void manageMultipartRequestxxx(HttpServletRequest req, HttpServletResponse res) {
long l_id = 0L;
ArticoloVariante bean = null;
bean = new ArticoloVariante(getApFull(req));
String[] fileNameTypes = { "jpg" };
String targetDir = getDocBase() + getDocBase();
String fntImg1 = "varImg_" + getLoginUserId(req) + "_1";
String fntImg2 = "varImg_" + getLoginUserId(req) + "_2";
String fntImg3 = "varImg_" + getLoginUserId(req) + "_3";
String fntImg4 = "varImg_" + getLoginUserId(req) + "_4";
String fntImg5 = "varImg_" + getLoginUserId(req) + "_5";
String fntImg6 = "varImg_" + getLoginUserId(req) + "_6";
String[] fileNameTarget = { fntImg1, fntImg2, fntImg3, fntImg4, fntImg5, fntImg6 };
String[] fileNameParameters = { "imgVar1", "imgVar2", "imgVar3", "imgVar4", "imgVar5", "imgVar6" };
try {
if (getLoginUserGrant(req, new ArticoloVariante().getTableBeanName()) >= 3L) {
if (manageMultipartRequestParameters(req, 2000, fileNameParameters, fileNameTarget, fileNameTypes, targetDir)) {
processNoEncTypeRequest(req, res);
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "MR_FILE_ERROR"));
showBean(req, res);
}
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_RW"));
showBean(req, res);
}
} catch (Exception e) {
handleDebug(e);
}
}
protected ResParm afterSave(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
ArticoloVariante bean = (ArticoloVariante)beanA;
ResParm rp = new ResParm(true);
if (bean.getId_articolo() > 0L) {
ListinoArticolo labWWW = new ListinoArticolo(apFull);
fillObject(req, labWWW);
labWWW.setId_articoloVariante(bean.getId_articoloVariante());
ListinoArticolo listinoArticoloBaseArticolo = bean.getArticolo().getListinoArticoloBase();
ListinoArticolo listinoArticoloVarianteBase = new ListinoArticolo(apFull);
listinoArticoloVarianteBase.findByArticoloVarianteListino(labWWW.getId_articoloVariante(),
bean.getListinoBase().getId_listino());
if (labWWW.getPrezzoLA() != 0.0D && !labWWW.hasStessiValori(listinoArticoloBaseArticolo)) {
listinoArticoloVarianteBase.setId_listino(bean.getListinoBase().getId_listino());
listinoArticoloVarianteBase.setId_articolo(labWWW.getId_articolo());
listinoArticoloVarianteBase.setId_articoloVariante(labWWW.getId_articoloVariante());
listinoArticoloVarianteBase.setAbbuonoPrezzoPubblicoLA(labWWW.getAbbuonoPrezzoPubblicoLA());
listinoArticoloVarianteBase.setDataScadenzaOffertaLA(labWWW.getDataScadenzaOffertaLA());
listinoArticoloVarianteBase.setPercLA(labWWW.getPercLA());
listinoArticoloVarianteBase.setPercLA1(labWWW.getPercLA1());
listinoArticoloVarianteBase.setPercLA2(labWWW.getPercLA2());
listinoArticoloVarianteBase.setPercLA3(labWWW.getPercLA3());
listinoArticoloVarianteBase.setPrezzoLA(labWWW.getPrezzoLA());
listinoArticoloVarianteBase.setPrezzoOffertaLA(labWWW.getPrezzoOffertaLA());
listinoArticoloVarianteBase.setPrezzoConIvaLA(labWWW.getPrezzoConIvaLA());
rp = listinoArticoloVarianteBase.save();
} else if (listinoArticoloVarianteBase.getId_listinoArticolo() > 0L) {
listinoArticoloVarianteBase.delete();
}
}
return rp;
}
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
String cmd = getCmd(req);
if (cmd.equals("clearScaled")) {
ArticoloVariante bean = new ArticoloVariante(getApFull(req));
long l_id = getRequestLongParameter(req, "id_articoloVariante");
bean.findByPrimaryKey(l_id);
bean.clearScaledImg("TH");
bean.clearScaledImg("AV");
bean.clearScaledImg("CART");
sendMessage(req, "Scaled image TH AV e CART eliminate. Procedere con la nuova creazione.");
showBean(req, res);
} else if (cmd.equals("createScaled")) {
ArticoloVariante bean = new ArticoloVariante(getApFull(req));
long l_id = getRequestLongParameter(req, "id_articoloVariante");
bean.findByPrimaryKey(l_id);
req.setAttribute("bean", bean);
setJspPageRelative("articoloVarianteImg.jsp", req);
callJsp(req, res);
} else if (getCmd(req).equals("addTaglie")) {
ArticoloVariante bean = new ArticoloVariante(getApFull(req));
long l_id = getRequestLongParameter(req, "id_articoloVariante");
bean.findByPrimaryKey(l_id);
fillObject(req, bean);
ResParm rp = bean.save();
if (rp.getStatus()) {
Vectumerator vec = new Taglia(getApFull(req))
.findTaglieByTipoTaglia(bean.getArticolo().getTipo().getTipoTaglia().getId_tipoTaglia());
while (vec.hasMoreElements()) {
Taglia at = (Taglia)vec.nextElement();
ArticoloTaglia row = new ArticoloTaglia(getApFull(req));
row.setId_articolo(bean.getId_articolo());
row.setId_articoloVariante(bean.getId_articoloVariante());
row.setId_taglia(at.getId_taglia());
bean.addArticoloTaglia(row);
}
req.setAttribute("bean", bean);
} else {
sendMessage(req, rp.getErrMsg());
if (l_id == 0L)
req.setAttribute("bean", bean);
}
showBean(req, res);
} else {
showBean(req, res);
}
}
protected void addRows(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
ArticoloVariante bean = null;
ResParm rp = new ResParm(true, "");
long l_id = getRequestLongParameter(req, "id_articoloVariante");
bean = new ArticoloVariante(apFull);
bean.findByPrimaryKey(l_id);
fillObject(req, bean);
rp = bean.save();
if (rp.getStatus()) {
try {
bean.findByPrimaryKey(l_id);
fillObject(req, bean);
rp = bean.save();
req.setAttribute("id_articolo", String.valueOf(bean.getId_articolo()));
if (rp.getStatus() == true) {
if (getAct(req).equals("addAcce")) {
Accessorio accessorio = new Accessorio(apFull);
if (!getRequestParameter(req, "id_articolo").equals("")) {
fillObject(req, accessorio);
rp = bean.addAccessorio(accessorio);
sendMessage(req, rp.getMsg());
} else {
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
}
showBean(req, res);
} else if (getAct(req).equals("delAcce")) {
Accessorio accessorio = new Accessorio(apFull);
if (getRequestLongParameter(req, "id_accessorio") != 0L) {
fillObject(req, accessorio);
bean.delAccessorio(accessorio);
sendMessage(req, AbMessages.getMessage(getLocale(req), "DELETE_OK"));
} else {
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
}
showBean(req, res);
} else if (getAct(req).equals("addArticoloTaglia")) {
ArticoloTaglia row = new ArticoloTaglia(apFull);
fillObject(req, row);
rp = bean.addArticoloTaglia(row);
sendMessage(req, rp.getMsg());
showBean(req, res);
} else if (getAct(req).equals("delArticoloTaglia")) {
ArticoloTaglia row = new ArticoloTaglia(apFull);
if (getRequestLongParameter(req, "id_articoloTaglia") != 0L) {
fillObject(req, row);
bean.delTaglia(row);
sendMessage(req, AbMessages.getMessage(getLocale(req), "DELETE_OK"));
}
showBean(req, res);
} else if (getAct(req).equals("addListinoArticolo")) {
ListinoArticolo row = new ListinoArticolo(apFull);
fillObject(req, row);
rp = bean.addListinoArticolo(row);
sendMessage(req, rp.getMsg());
showBean(req, res);
} else if (getAct(req).equals("delListinoArticolo")) {
ListinoArticolo row = new ListinoArticolo(apFull);
if (getRequestLongParameter(req, "id_listinoArticolo") != 0L) {
fillObject(req, row);
bean.delListinoArticolo(row);
sendMessage(req, AbMessages.getMessage(getLocale(req), "DELETE_OK"));
} else {
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
}
showBean(req, res);
}
} else {
req.setAttribute("bean", bean);
sendMessage(req, rp.getMsg());
showBean(req, res);
}
} catch (Exception e) {
forceMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
showBean(req, res);
}
} else {
sendMessage(req, rp.getErrMsg());
showBean(req, res);
}
}
protected boolean isLoadImageServlet() {
return true;
}
protected ResParm afterSaveImmagini(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
synchronized (this) {
ResParm rp = new ResParm(true, "");
ArticoloVariante bean = (ArticoloVariante)beanA;
String targetDir = getDocBase() + getDocBase();
long l_id = bean.getId_articolo();
Vectumerator fileNames = (Vectumerator)req.getAttribute("completeAttachName");
String imgTmst = getTimeNameForFileUpload();
boolean l_newImg = false;
if (fileNames != null) {
while (fileNames.hasMoreElements()) {
String currentFileName = (String)fileNames.nextElement();
if (currentFileName.indexOf("/varImg") >= 0) {
l_newImg = true;
int idx = Integer.parseInt(
currentFileName.substring(currentFileName.lastIndexOf("_") + 1, currentFileName.lastIndexOf(".")));
if (isFileExist(currentFileName)) {
new File(targetDir + targetDir).delete();
new File(currentFileName).renameTo(new File(targetDir + targetDir));
}
}
}
if (l_newImg)
for (int j = 1; j <= 6; j++) {
String currentFileName = targetDir + targetDir;
if (isFileExist(currentFileName))
new File(currentFileName).renameTo(new File(targetDir + targetDir));
}
}
for (int i = 1; i <= 5; i++) {
if (getRequestLongParameter(req, "cmdCancellaImmagine" + i) == 1L) {
String fileName = targetDir + targetDir;
new File(fileName).delete();
}
}
if (l_newImg) {
bean.setImgTmst(imgTmst);
rp = bean.save();
req.setAttribute("bean", bean);
}
return rp;
}
}
public void _allineaPrezziConArticolo(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
ArticoloVariante bean = new ArticoloVariante(apFull);
long l_id_articolo = getRequestLongParameter(req, "id_articoloVariante");
bean.findByPrimaryKey(l_id_articolo);
if (bean.getId_articolo() > 0L) {
ListinoArticolo listinoArticoloVarianteBase = new ListinoArticolo(apFull);
listinoArticoloVarianteBase.findByArticoloVarianteListino(bean.getId_articoloVariante(), bean.getListinoBase().getId_listino());
if (listinoArticoloVarianteBase.getId_articolo() > 0L)
listinoArticoloVarianteBase.delete();
bean.setCurrentTab(getRequestParameter(req, "currentTab"));
req.setAttribute("bean", bean);
showBean(req, res);
} else {
search(req, res);
}
}
protected void actionsAfterDelete(HttpServletRequest req, HttpServletResponse res) {
try {
req.setAttribute("cmd", "md");
req.setAttribute("act", "");
req.setAttribute("currentTab", "#VAR");
RequestDispatcher rd = getServletContext().getRequestDispatcher("/admin/art/Articolo.abl");
rd.forward((ServletRequest)req, (ServletResponse)res);
} catch (Exception e) {
StringBuilder msg = new StringBuilder();
if (e.getCause() != null) {
msg.append("Causa:\n");
msg.append(e.getCause().getMessage());
msg.append("\n");
}
msg.append(e.getMessage());
handleDebug(e, 2);
forceMessage(req, getJspPage(req));
req.setAttribute("errorMsg", msg.toString());
RequestDispatcher rd = getServletContext().getRequestDispatcher("/admin/config/error.jsp");
try {
rd.forward((ServletRequest)req, (ServletResponse)res);
} catch (Exception exception) {}
}
}
protected void print(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
try {
if (getAct(req).equals("lblArt")) {
long l_id = 0L;
Articolo bean = null;
bean = new Articolo(apFull);
bean.findByPrimaryKey(new Long(l_id));
ArticoloCR CR = new ArticoloCR();
fillObject(req, CR);
CR.setId_articolo(l_id);
if (getParm("LABEL_ART_A4_ZEBRA").getNumeroInt() == 0) {
sendPdf(res, bean.creaLabelArticoloA4Pdf(CR), "LabelA4ZebraArt " + DBAdapter.getDayTimeTimestamp());
} else {
sendPdf(res, bean.creaLabelArticoloZebraPdf(CR), "LabelZebraArt " + DBAdapter.getDayTimeTimestamp());
}
} else if (getAct(req).equals("lblArtAcc")) {
long l_id = 0L;
Articolo bean = null;
l_id = getRequestLongParameter(req, "id_articolo");
bean = new Articolo(apFull);
ArticoloCR CR = new ArticoloCR();
fillObject(req, CR);
CR.setId_articolo(l_id);
if (getParm("LABEL_ART_A4_ZEBRA").getNumeroInt() == 0) {
sendPdf(res, bean.creaLabelArticoloAccA4Pdf(CR), "LabelA4ZebraAcc " + DBAdapter.getDayTimeTimestamp());
} else {
sendPdf(res, bean.creaLabelArticoloAccZebraPdf(CR), "LabelA4ZebraAcc " + DBAdapter.getDayTimeTimestamp());
}
} else {
search(req, res);
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void _addTessutoConfezioneVariante(HttpServletRequest req, HttpServletResponse res) {
ResParm rp;
ApplParmFull apFull = getApFull(req);
ArticoloArticoloTessuto bean2 = new ArticoloArticoloTessuto(apFull);
fillObject(req, bean2);
if (bean2.getId_articoloArticoloTessuto() > 0L)
bean2.findByPrimaryKey(bean2.getId_articoloArticoloTessuto());
if (bean2.getId_articoloTessuto() > 0L && bean2.getId_articoloVariante() > 0L) {
rp = bean2.save();
} else {
rp = new ResParm(false, "Errore! Tessuto o articolo non selezionato correttamente");
}
sendMessage(req, rp.getMsg());
showBean(req, res);
}
public void _delTessutoConfezioneVariante(HttpServletRequest req, HttpServletResponse res) {
ResParm rp;
ApplParmFull apFull = getApFull(req);
ArticoloArticoloTessuto bean2 = new ArticoloArticoloTessuto(apFull);
fillObject(req, bean2);
if (bean2.getId_articoloArticoloTessuto() > 0L) {
bean2.findByPrimaryKey(bean2.getId_articoloArticoloTessuto());
rp = bean2.delete();
} else {
rp = new ResParm(false, "Errore! Impossibile cancellare tessuto associato a confezione ");
}
sendMessage(req, rp.getMsg());
showBean(req, res);
}
public void _impostaTessutoPrincipale(HttpServletRequest req, HttpServletResponse res) {
ResParm rp;
ApplParmFull apFull = getApFull(req);
ArticoloArticoloTessuto bean2 = new ArticoloArticoloTessuto(apFull);
fillObject(req, bean2);
if (bean2.getId_articoloArticoloTessuto() > 0L) {
bean2.findByPrimaryKey(bean2.getId_articoloArticoloTessuto());
bean2.setFlgPrincipale(1L);
rp = bean2.save();
} else {
rp = new ResParm(false, "Errore! Impossibile cancellare tessuto associato a confezione ");
}
sendMessage(req, rp.getMsg());
showBean(req, res);
}
public void _listinoArticoloVarianteCancella(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
long l_id_articoloVariante = getRequestLongParameter(req, "id_articoloVariante");
long l_id_listino = getRequestLongParameter(req, "id_listino");
ListinoArticolo beanRow = new ListinoArticolo(apFull);
beanRow.findByArticoloVarianteListino(l_id_articoloVariante, l_id_listino);
ResParm rp = beanRow.delete();
sendMessage(req, rp.getMsg());
showBean(req, res);
}
public void _listinoArticoloVarianteMostra(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
long l_id_articoloVariante = getRequestLongParameter(req, "id_articoloVariante");
long l_id_listino = getRequestLongParameter(req, "id_listino");
ListinoArticolo la = new ListinoArticolo(apFull);
la.findByArticoloVarianteListino(l_id_articoloVariante, l_id_listino);
la.setId_listino(l_id_listino);
la.setId_articoloVariante(l_id_articoloVariante);
req.setAttribute("bean", la);
setJspPageRelative("listinoArticolo.jsp", req);
callJsp(req, res);
}
public void _listinoSalvaPrezzoAV(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
long l_id_articolo = getRequestLongParameter(req, "id_articolo");
long l_id_articoloVariante = getRequestLongParameter(req, "id_articoloVariante");
long l_id_listino = getRequestLongParameter(req, "id_listino");
ListinoArticolo beanRow = new ListinoArticolo(apFull);
beanRow.findByArticoloVarianteListino(l_id_articoloVariante, l_id_listino);
beanRow.setId_listino(l_id_listino);
beanRow.setId_articoloVariante(l_id_articoloVariante);
beanRow.setId_articolo(l_id_articolo);
beanRow.setPrezzoLA(getRequestDoubleParameter(req, "_prezzoLA"));
beanRow.setPercLA(getRequestDoubleParameter(req, "_percLA"));
beanRow.setPercLA1(getRequestDoubleParameter(req, "_percLA1"));
beanRow.setPercLA2(getRequestDoubleParameter(req, "_percLA2"));
beanRow.setPercLA3(getRequestDoubleParameter(req, "_percLA3"));
beanRow.setDataScadenzaOffertaLA(getRequestDateParameter(req, "_dataScadenzaOffertaLA"));
beanRow.setPrezzoOffertaLA(getRequestDoubleParameter(req, "_prezzoOffertaLA"));
ResParm rp = beanRow.save();
sendMessage(req, rp.getMsg());
showBean(req, res);
}
}

View file

@ -0,0 +1,91 @@
package it.acxent.art.servlet;
import it.acxent.art.CTipo;
import it.acxent.art.Caratteristica;
import it.acxent.art.CaratteristicaCR;
import it.acxent.art.Marca;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.util.AbMessages;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/artConfig/Caratteristica.abl"})
public class CaratteristicaSvlt extends _MagSvlt {
private static final long serialVersionUID = 3575908708336411061L;
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
req.setAttribute("listaMarche", new Marca(apFull).findAll());
req.setAttribute("listaCTipi", new CTipo(apFull).findTipiByCaratteristica(((Caratteristica)bean).getId_caratteristica(), 0, 0));
}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new Caratteristica(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new CaratteristicaCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
req.setAttribute("listaMarche", new Marca(getApFull(req)).findAll());
}
public void _addTipo(HttpServletRequest req, HttpServletResponse res) {
ResParm rp = new ResParm(true, "");
long l_id_tipo = getRequestLongParameter(req, "id_tipo");
long l_id = getRequestLongParameter(req, "id_caratteristica");
Caratteristica bean = new Caratteristica(getApFull(req));
bean.findByPrimaryKey(l_id);
fillObject(req, bean);
rp = bean.save();
req.setAttribute("id_caratteristica", String.valueOf(bean.getId_caratteristica()));
if (l_id_tipo > 0L) {
rp = bean.addTipo(l_id_tipo);
sendMessage(req, rp.getMsg());
}
showBean(req, res);
}
protected void addRows(HttpServletRequest req, HttpServletResponse res) {
long l_id = 0L;
Caratteristica bean = null;
ResParm rp = new ResParm(true, "");
l_id = getRequestLongParameter(req, "id_caratteristica");
bean = new Caratteristica(getApFull(req));
try {
bean.findByPrimaryKey(l_id);
fillObject(req, bean);
rp = bean.save();
req.setAttribute("id_caratteristica", String.valueOf(bean.getId_caratteristica()));
if (rp.getStatus() == true) {
long l_id_tipo = getRequestLongParameter(req, "id_tipo");
if (getAct(req).equals("addTipo")) {
if (l_id_tipo > 0L) {
rp = bean.addTipo(l_id_tipo);
sendMessage(req, rp.getMsg());
showBean(req, res);
}
} else if (getAct(req).equals("delTipo") &&
l_id_tipo > 0L) {
bean.delTipo(l_id_tipo);
sendMessage(req, AbMessages.getMessage(getLocale(req), "DELETE_OK"));
showBean(req, res);
}
} else {
req.setAttribute("bean", bean);
sendMessage(req, rp.getMsg());
showBean(req, res);
}
} catch (Exception e) {
forceMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
showBean(req, res);
}
}
}

View file

@ -0,0 +1,35 @@
package it.acxent.art.servlet;
import it.acxent.art.Colore;
import it.acxent.art.ColoreCR;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.servlet.AblServletSvlt;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/artConfig/Colore.abl"})
public class ColoreSvlt extends AblServletSvlt {
private static final long serialVersionUID = 4010591053283525511L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new Colore(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new ColoreCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected boolean isSimpleServlet(HttpServletRequest req) {
return true;
}
}

View file

@ -0,0 +1,31 @@
package it.acxent.art.servlet;
import it.acxent.art.Componente;
import it.acxent.art.ComponenteCR;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.servlet.AblServletSvlt;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/artConfig/Componente.abl"})
public class ComponenteSvlt extends AblServletSvlt {
private static final long serialVersionUID = -470730883572373477L;
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CRA, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new Componente(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new ComponenteCR(getApFull(req));
}
protected boolean isSimpleServlet(HttpServletRequest req) {
return true;
}
}

View file

@ -0,0 +1,27 @@
package it.acxent.art.servlet;
import it.acxent.art.AllegatoArticolo;
import it.acxent.servlet.GetFileSvlt;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/_a/_art/*"})
public class GetArticoloAttachNoLoginSvlt extends GetFileSvlt {
private static final long serialVersionUID = -4630036169421100261L;
protected String getFileName(HttpServletRequest req, HttpServletResponse res) {
boolean checkGrant = true;
if (checkGrant) {
AllegatoArticolo bean = new AllegatoArticolo(getApFull(req));
bean.findByPrimaryKey(getRequestLongParameter(req, "id"));
String fileName = bean.getNomeFileCompleto();
return fileName;
}
return null;
}
protected boolean isSecureServlet(HttpServletRequest req) {
return false;
}
}

View file

@ -0,0 +1,29 @@
package it.acxent.art.servlet;
import it.acxent.art.AllegatoArticolo;
import it.acxent.servlet.GetFileSvlt;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/_attach/_art/*"})
public class GetArticoloAttachSvlt extends GetFileSvlt {
private static final long serialVersionUID = -4630036169261100261L;
protected String getFileName(HttpServletRequest req, HttpServletResponse res) {
boolean checkGrant = true;
long l_id_user = getLoginUserId(req);
if (l_id_user == 0L) {
checkGrant = false;
} else {
checkGrant = true;
}
if (checkGrant) {
AllegatoArticolo bean = new AllegatoArticolo(getApFull(req));
bean.findByPrimaryKey(getRequestLongParameter(req, "id"));
String fileName = bean.getNomeFileCompleto();
return fileName;
}
return null;
}
}

View file

@ -0,0 +1,40 @@
package it.acxent.art.servlet;
import it.acxent.art.GoogleCategory;
import it.acxent.art.GoogleCategoryCR;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.servlet.AblServletSvlt;
import it.acxent.servlet.AddImgSvlt;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/artConfig/GoogleCategory.abl"})
public class GoogleCategorySvlt extends AblServletSvlt implements AddImgSvlt {
private static final long serialVersionUID = -2706537310912408276L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new GoogleCategory(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new GoogleCategoryCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected boolean isSimpleServlet(HttpServletRequest req) {
return false;
}
protected boolean isLoadImageServlet() {
return false;
}
}

View file

@ -0,0 +1,39 @@
package it.acxent.art.servlet;
import it.acxent.art.Caratteristica;
import it.acxent.art.Lista;
import it.acxent.art.ListaCR;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.servlet.AblServletSvlt;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/artConfig/Lista.abl"})
public class ListaSvlt extends AblServletSvlt {
private static final long serialVersionUID = 1567503569667512245L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
req.setAttribute("listaListe", new Caratteristica(getApFull(req))
.findListe(0, 0));
}
protected DBAdapter getBean(HttpServletRequest req) {
return new Lista(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new ListaCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected boolean isSimpleServlet(HttpServletRequest req) {
return true;
}
}

View file

@ -0,0 +1,73 @@
package it.acxent.art.servlet;
import it.acxent.art.Marca;
import it.acxent.art.MarcaCR;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.servlet.AblServletSvlt;
import it.acxent.servlet.AddImgSvlt;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/artConfig/Marca.abl"})
public class MarcaSvlt extends AblServletSvlt implements AddImgSvlt {
private static final long serialVersionUID = -7517744963553774947L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new Marca(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new MarcaCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected boolean isSimpleServlet(HttpServletRequest req) {
return false;
}
public void _aggiornaIndiciTipo(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Marca bean = new Marca(apFull);
long l_id = getRequestLongParameter(req, "id_marca");
bean.findByPrimaryKey(l_id);
if (bean.getId_marca() > 0L) {
ResParm rp = bean.startIndicizzoMarche(l_id);
if (rp.getStatus()) {
sendMessage(req, rp.getMsg());
} else {
sendMessage(req, "Errore! " + rp.getMsg());
}
} else {
sendMessage(req, "Errore! Marca non selezionata!");
}
showBean(req, res);
}
public void _aggiornaIndiciTipoAll(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Marca bean = new Marca(apFull);
long l_id = getRequestLongParameter(req, "id_marca");
ResParm rp = bean.startIndicizzoMarche(0L);
if (rp.getStatus()) {
sendMessage(req, rp.getMsg());
} else {
sendMessage(req, "Errore! " + rp.getMsg());
}
search(req, res);
}
protected boolean isLoadImageServlet() {
return true;
}
}

View file

@ -0,0 +1,38 @@
package it.acxent.art.servlet;
import it.acxent.art.Marca;
import it.acxent.art.Modello;
import it.acxent.art.ModelloCR;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.servlet.AblServletSvlt;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/art/Modello.abl"})
public class ModelloSvlt extends AblServletSvlt {
private static final long serialVersionUID = 8342909821755484567L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
req.setAttribute("listaMarche", new Marca(getApFull(req)).findAll());
}
protected DBAdapter getBean(HttpServletRequest req) {
return new Modello(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new ModelloCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected boolean isSimpleServlet(HttpServletRequest req) {
return true;
}
}

View file

@ -0,0 +1,38 @@
package it.acxent.art.servlet;
import it.acxent.anag.Iva;
import it.acxent.art.Reparto;
import it.acxent.art.RepartoCR;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.servlet.AblServletSvlt;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/artConfig/Reparto.abl"})
public class RepartoSvlt extends AblServletSvlt {
private static final long serialVersionUID = -1725537244500872025L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
req.setAttribute("listaIva", new Iva(getApFull(req)).findAll());
}
protected DBAdapter getBean(HttpServletRequest req) {
return new Reparto(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new RepartoCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected boolean isSimpleServlet(HttpServletRequest req) {
return true;
}
}

View file

@ -0,0 +1,40 @@
package it.acxent.art.servlet;
import it.acxent.art.StatoUsato;
import it.acxent.art.StatoUsatoCR;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.servlet.AblServletSvlt;
import it.acxent.servlet.AddImgSvlt;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/artConfig/StatoUsato.abl"})
public class StatoUsatoSvlt extends AblServletSvlt implements AddImgSvlt {
private static final long serialVersionUID = -4973691946479681907L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new StatoUsato(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new StatoUsatoCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected boolean isSimpleServlet(HttpServletRequest req) {
return true;
}
protected boolean isLoadImageServlet() {
return false;
}
}

View file

@ -0,0 +1,220 @@
package it.acxent.art.servlet;
import it.acxent.art.Articolo;
import it.acxent.art.TabellaTaglia;
import it.acxent.art.TabellaTagliaCR;
import it.acxent.art.TagliaMisure;
import it.acxent.art.TipoTaglia;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.servlet.AblServletSvlt;
import it.acxent.util.AbMessages;
import it.acxent.util.Vectumerator;
import java.io.File;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/artConfig/TabellaTaglia.abl"})
public class TabellaTagliaSvlt extends AblServletSvlt {
private static final long serialVersionUID = 1455352933458498203L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
TabellaTaglia bean = null;
ResParm rp = new ResParm(true, "");
long l_id = getRequestLongParameter(req, "id_tabellaTaglia");
bean = new TabellaTaglia(apFull);
try {
bean.findByPrimaryKey(l_id);
fillObject(req, bean);
rp = bean.save();
req.setAttribute("id_tabellaTaglia",
String.valueOf(bean.getId_tabellaTaglia()));
if (rp.getStatus() == true) {
if (getAct(req).equals("addMisure")) {
TagliaMisure row = new TagliaMisure(apFull);
fillObject(req, row);
rp = bean.addTagliaMisure(row);
sendMessage(req, rp.getMsg());
showBean(req, res);
} else if (getAct(req).equals("delMisure")) {
TagliaMisure row = new TagliaMisure(apFull);
long l_id_tagliaMisure = getRequestLongParameter(req, "id_tagliaMisure");
if (l_id_tagliaMisure != 0L) {
fillObject(req, row);
bean.delTagliaMisure(row);
sendMessage(req, "Cancellazione Misura Effettuata");
} else {
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
}
showBean(req, res);
} else if (getAct(req).equals("modMisure")) {
TagliaMisure row = new TagliaMisure(apFull);
long l_id_tagliaMisure = getRequestLongParameter(req, "id_tagliaMisure");
if (l_id_tagliaMisure != 0L) {
fillObject(req, row);
row.findByPrimaryKey(l_id_tagliaMisure);
req.setAttribute("misura", row);
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_OK"));
} else {
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
}
showBean(req, res);
} else if (getAct(req).equals("addArticolo")) {
Articolo row = new Articolo(apFull);
long l_id_articolo = getRequestLongParameter(req, "id_articolo");
if (l_id_articolo != 0L) {
row.findByPrimaryKey(l_id_articolo);
row.setId_tabellaTaglia(l_id);
rp = row.save();
sendMessage(req, rp.getMsg());
} else {
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
}
showBean(req, res);
} else if (getAct(req).equals("delArticolo")) {
Articolo row = new Articolo(apFull);
long l_id_articolo = getRequestLongParameter(req, "id_articolo");
if (l_id_articolo != 0L) {
row.findByPrimaryKey(l_id_articolo);
row.setId_tabellaTaglia(0L);
rp = row.save();
sendMessage(req, "Cancellazione Effettuata");
} else {
sendMessage(req, AbMessages.getMessage(getLocale(req), "READ_FAIL"));
}
showBean(req, res);
}
} else {
req.setAttribute("bean", bean);
sendMessage(req, rp.getMsg());
showBean(req, res);
}
} catch (Exception e) {
forceMessage(req,
AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
showBean(req, res);
}
}
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
TabellaTaglia bean = (TabellaTaglia)beanA;
req.setAttribute("listaTipoTaglia", bean.findAll());
req.setAttribute("listaMisure", bean.getTagliaMisure());
req.setAttribute("listaArticoli", bean.getArticoli());
}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
req.setAttribute("listaTipoTaglia", new TipoTaglia(getApFull(req)).findAll());
}
protected DBAdapter getBean(HttpServletRequest req) {
return new TabellaTaglia(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new TabellaTagliaCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
req.setAttribute("listaTipoTaglia", new TipoTaglia(getApFull(req)).findAll());
}
protected boolean isSimpleServlet(HttpServletRequest req) {
return false;
}
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
if (getCmd(req).equals("tmSu")) {
long l_id_tagliaMisure = getRequestLongParameter(req, "id_tagliaMisure");
TagliaMisure tm = new TagliaMisure(getApFull(req));
tm.findByPrimaryKey(l_id_tagliaMisure);
ResParm rp = tm.spostaSu();
sendMessage(req, rp.getMsg());
showBean(req, res);
} else if (getCmd(req).equals("tmGiu")) {
long l_id_tagliaMisure = getRequestLongParameter(req, "id_tagliaMisure");
TagliaMisure tm = new TagliaMisure(getApFull(req));
tm.findByPrimaryKey(l_id_tagliaMisure);
ResParm rp = tm.spostaGiu();
sendMessage(req, rp.getMsg());
showBean(req, res);
}
}
protected void manageMultipartRequest(HttpServletRequest req, HttpServletResponse res) {
long l_id = 0L;
TabellaTaglia bean = null;
bean = new TabellaTaglia(getApFull(req));
String[] fileNameTypes = { "gif" };
String targetDir = getDocBase() + getDocBase();
String fntImg1 = "tmpImg_" + getLoginUserId(req) + "_1";
String[] fileNameTarget = { fntImg1 };
String[] fileNameParameters = { "img1" };
try {
if (getLoginUserGrant(req, new TabellaTaglia().getTableBeanName()) >= 3L) {
if (manageMultipartRequestParameters(req, 2000, fileNameParameters, fileNameTarget, fileNameTypes, targetDir)) {
processNoEncTypeRequest(req, res);
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "MR_FILE_ERROR"));
showBean(req, res);
}
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_RW"));
showBean(req, res);
}
} catch (Exception e) {
handleDebug(e);
}
}
protected ResParm afterSave(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {
synchronized (this) {
ResParm rp = new ResParm(true, "");
TabellaTaglia bean = (TabellaTaglia)beanA;
String targetDir = getDocBase() + getDocBase();
Vectumerator fileNames = (Vectumerator)
req.getAttribute("completeAttachName");
String imgTmst = getTimeNameForFileUpload();
boolean l_newImg = false;
while (fileNames.hasMoreElements()) {
String currentFileName = (String)fileNames.nextElement();
if (currentFileName.indexOf("tmpImg_") >= 0) {
l_newImg = true;
int idx = Integer.parseInt(currentFileName.substring(
currentFileName.lastIndexOf("_") + 1,
currentFileName.lastIndexOf(".")));
if (isFileExist(currentFileName)) {
new File(targetDir + targetDir).delete();
new File(currentFileName).renameTo(new File(targetDir + targetDir));
}
}
}
if (l_newImg)
for (int j = 1; j <= 6; j++) {
String currentFileName = targetDir + targetDir;
if (isFileExist(currentFileName))
new File(currentFileName).renameTo(new File(targetDir + targetDir));
}
for (int i = 1; i <= 5; i++) {
if (getRequestLongParameter(req, "cmdCancellaImmagine" + i) == 1L) {
String fileName = targetDir + targetDir;
new File(fileName).delete();
}
}
if (l_newImg) {
bean.setImgTmst(imgTmst);
rp = bean.save();
req.setAttribute("bean", bean);
}
return rp;
}
}
protected boolean isLoadImageServlet() {
return super.isLoadImageServlet();
}
}

View file

@ -0,0 +1,59 @@
package it.acxent.art.servlet;
import it.acxent.art.Taglia;
import it.acxent.art.TagliaCR;
import it.acxent.art.TipoTaglia;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.servlet.AblServletSvlt;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/artConfig/Taglia.abl"})
public class TagliaSvlt extends AblServletSvlt {
private static final long serialVersionUID = 5185977689020806109L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
req.setAttribute("listaTipoTaglia", new TipoTaglia(getApFull(req)).findAll());
}
protected DBAdapter getBean(HttpServletRequest req) {
return new Taglia(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new TagliaCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected boolean isSimpleServlet(HttpServletRequest req) {
return true;
}
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
ResParm rp = new ResParm(true);
if (getCmd(req).equals("tmSu")) {
long l_id_taglia = getRequestLongParameter(req, "id_tagliaSposta");
Taglia tg = new Taglia(getApFull(req));
tg.findByPrimaryKey(l_id_taglia);
rp = tg.spostaSu();
sendMessage(req, rp.getMsg());
showBean(req, res);
} else if (getCmd(req).equals("tmGiu")) {
long l_id_taglia = getRequestLongParameter(req, "id_tagliaSposta");
Taglia tg = new Taglia(getApFull(req));
tg.findByPrimaryKey(l_id_taglia);
rp = tg.spostaGiu();
sendMessage(req, rp.getMsg());
showBean(req, res);
}
super.otherCommands(req, res);
}
}

View file

@ -0,0 +1,35 @@
package it.acxent.art.servlet;
import it.acxent.art.TipoAccessorio;
import it.acxent.art.TipoAccessorioCR;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.servlet.AblServletSvlt;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/artConfig/TipoAccessorio.abl"})
public class TipoAccessorioSvlt extends AblServletSvlt {
private static final long serialVersionUID = 8396401020485091181L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new TipoAccessorio(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new TipoAccessorioCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected boolean isSimpleServlet(HttpServletRequest req) {
return true;
}
}

View file

@ -0,0 +1,62 @@
package it.acxent.art.servlet;
import it.acxent.art.TipoAllegatoArticolo;
import it.acxent.art.TipoAllegatoArticoloCR;
import it.acxent.contab.TipoAllegatoDocumento;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.ResParm;
import it.acxent.servlet.AblServletSvlt;
import it.acxent.util.AbMessages;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/artConfig/TipoAllegatoArticolo.abl"})
public class TipoAllegatoArticoloSvlt extends AblServletSvlt {
private static final long serialVersionUID = -7753154721882190304L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
TipoAllegatoDocumento bean = null;
ResParm rp = new ResParm(true, "");
long l_id = getRequestLongParameter(req, "id_tipoDocumento");
bean = new TipoAllegatoDocumento(apFull);
try {
bean.findByPrimaryKey(l_id);
fillObject(req, bean);
rp = bean.save();
l_id = bean.getId_tipoAllegatoDocumento();
req.setAttribute("id_tipoAllegatoDocumento", String.valueOf(l_id));
req.setAttribute("bean", bean);
if (rp.getStatus() != true) {
req.setAttribute("bean", bean);
sendMessage(req, rp.getMsg());
showBean(req, res);
}
} catch (Exception e) {
forceMessage(req,
AbMessages.getMessage(getLocale(req), "SAVE_FAIL"));
showBean(req, res);
}
}
protected void fillComboAfterDetail(DBAdapter beanA, HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {}
protected DBAdapter getBean(HttpServletRequest req) {
return new TipoAllegatoArticolo(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new TipoAllegatoArticoloCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
protected boolean isSimpleServlet(HttpServletRequest req) {
return true;
}
}

View file

@ -0,0 +1,318 @@
package it.acxent.art.servlet;
import com.google.gson.Gson;
import it.acxent.anag.Listino;
import it.acxent.art.Reparto;
import it.acxent.art.Tipo;
import it.acxent.art.TipoCR;
import it.acxent.art.TipoTaglia;
import it.acxent.art.TipologiaArticolo;
import it.acxent.db.ApplParmFull;
import it.acxent.db.CRAdapter;
import it.acxent.db.DBAdapter;
import it.acxent.db.DBAdapterSaveResponse;
import it.acxent.db.ResParm;
import it.acxent.jsp.Ab;
import it.acxent.servlet.AblServletSvlt;
import it.acxent.util.AbMessages;
import it.acxent.util.ReturnItem;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet(urlPatterns = {"/admin/art/Tipo.abl"})
public class TipoSvlt extends AblServletSvlt {
private static final long serialVersionUID = 9212377303066459864L;
protected void addRows(HttpServletRequest req, HttpServletResponse res) {}
protected void fillComboAfterDetail(DBAdapter bean, HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
req.setAttribute("listaListino", new Listino(apFull).findNoListinoBase());
}
protected void fillComboAfterSearch(CRAdapter CR, HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Tipo tipoPadre = null;
long l_id_lista = getRequestLongParameter(req, "id_tipoPadre");
tipoPadre = new Tipo(apFull);
tipoPadre.findByPrimaryKey(l_id_lista);
req.setAttribute("tipoPadre", tipoPadre);
req.setAttribute("listaReparti", new Reparto(apFull).findAll());
req.setAttribute("listaPadri", tipoPadre.findPadri());
req.setAttribute("listaListini", new Listino(apFull).findAll());
req.setAttribute("listaTipiTaglie", new TipoTaglia(apFull).findAll());
req.setAttribute("listaTipologieArticoli", new TipologiaArticolo(apFull).findAll());
}
protected DBAdapter getBean(HttpServletRequest req) {
return new Tipo(getApFull(req));
}
protected CRAdapter getBeanCR(HttpServletRequest req) {
return new TipoCR(getApFull(req));
}
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Tipo bean = (Tipo)getBean(req);
bean.setFlgFornitori(1L);
bean.setFlgAccessori(1L);
bean.setFlgTipoMagazzino(1L);
req.setAttribute("listaListino", new Listino(apFull).findNoListinoBase());
req.setAttribute("bean", bean);
}
protected boolean isSimpleServlet(HttpServletRequest req) {
return true;
}
protected void otherCommands(HttpServletRequest req, HttpServletResponse res) {
if (getCmd(req).equals("ordinaAlfabetico")) {
Tipo bean = new Tipo(getApFull(req));
bean.ordinaAlfabeticoFigli(bean);
search(req, res);
} else {
super.otherCommands(req, res);
}
}
protected boolean isLoadImageServlet() {
return true;
}
public void _ordinaAlfabetico(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Tipo bean = new Tipo(apFull);
bean.ordinaAlfabeticoFigli(bean);
search(req, res);
}
public void _indici(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Tipo bean = new Tipo(getApFull(req));
boolean tag = (getRequestLongParameter(req, "flgRicalcolaTag") == 1L);
boolean articoli = (getRequestLongParameter(req, "flgRicalcolaArticoli") == 1L);
ResParm rp = bean.startThreadCalcolaIndici(tag, articoli);
sendMessage(req, rp.getMsg());
search(req, res);
}
public void _cambiaFlg(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Tipo bean = new Tipo(apFull);
long l_id_tipo = getRequestLongParameter(req, "id_tipo");
String l_flg = getRequestParameter(req, "flg");
bean.findByPrimaryKey(l_id_tipo);
ResParm rp = bean.cambiaFlg(l_flg);
if (rp.getStatus()) {
sendMessage(req, "Aggiornamento Effettuato");
} else {
sendMessage(req, "Errore! " + rp.getMsg());
}
search(req, res);
}
protected void search(HttpServletRequest req, HttpServletResponse res) {
try {
DBAdapter bean = getBean(req);
if (getLoginUserGrant(req, bean.getTableBeanName()) > 0L) {
ResParm rp = beforeSearch(req, res);
if (rp.getStatus()) {
CRAdapter CR = getBeanCR(req);
if (isSimpleServlet(req) || (!getAct(req).equals("del") && !getAct(req).startsWith("save") &&
!getBackRequest(req).equals(getACT_BACK())))
fillObject(req, CR);
if (getBackRequest(req).equals(getACT_BACK()) || getAct(req).equals("del")) {
CR = (CRAdapter)req.getSession().getAttribute(getATTR_CRBEAN(req));
if (CR == null)
CR = getBeanCR(req);
req.setAttribute("_id", CR.get_id());
if (!getAct(req).startsWith("del"))
fillObject(req, CR);
CR.setFlgReport("");
if (getAct2(req).equals("back"))
CR.setPageNumber(1);
}
int l_pageRow = getPageRow(req);
if (getAct(req).equals("sw")) {
setJspPageRelative(getBeanPageName(req) + "F.jsp", req);
req.setAttribute("RI", new ReturnItem(req.getParameter("RI")));
}
req.setAttribute(getCRAttribute(req), CR);
req.getSession().setAttribute(getATTR_CRBEAN(req), CR);
ApplParmFull apFull = getApFull(req);
long l_id_lista = getRequestLongParameter(req, "id_tipoPadre");
Tipo tipo = new Tipo(apFull);
tipo.findByPrimaryKey(l_id_lista);
req.setAttribute("tipoPadre", tipo);
if (CR.getFlgReport().equals("")) {
req.setAttribute("list", tipo.findFigli(0, 0));
} else {
TipoCR tCR = new TipoCR(apFull);
tCR.setFlgSoloFoglie(1L);
req.setAttribute("list", tipo.findByCR(tCR, 0, 0));
}
if (isSimpleServlet(req) && getCmd(req).equals("asq")) {
bean = (DBAdapter)req.getAttribute(getBEANAttribute(req));
if (bean == null)
bean = getBean(req);
bean.setCurrentLang(getRequestParameter(req, "currentLang"));
req.setAttribute("bean", bean);
}
sendMessage(req, AbMessages.getMessage(getLocale(req), "SEARCH_OK"));
fillComboAfterSearch(CR, req, res);
callJsp(req, res);
} else {
sendMessage(req, rp.getMsg());
callJsp(req, res);
}
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_R"));
callJsp(req, res);
}
} catch (Exception e) {
handleDebug(e, 0);
}
}
protected void sqlActions(HttpServletRequest req, HttpServletResponse res) {
Object l_id;
long l_id_tipo = getRequestLongParameter(req, "id_tipo");
if (l_id_tipo == 0L) {
req.setAttribute("flgFornitori", "1");
req.setAttribute("flgAccessori", "1");
req.setAttribute("flgTipoMagazzino", "1");
}
DBAdapter bean = getBean(req);
String pk = getPKBeanName(req);
if (isPkBeanLong(req)) {
l_id = getRequestLongParameter(req, pk);
} else {
l_id = getRequestParameter(req, pk);
}
try {
if (getLoginUserGrant(req, bean.getTableBeanName()) >= 2L) {
bean.findByPrimaryKey(l_id);
if (getAct(req).startsWith("save") || getAct(req).equals("ni")) {
fillObject(req, bean);
if (bean.getDBState() == 1 || getLoginUserGrant(req, bean.getTableBeanName()) >= 3L) {
ResParm rp = beforeSave(bean, req, res);
if (rp.getStatus())
rp.append(bean.save());
req.setAttribute("_id", bean.get_Id());
if (rp.getStatus() == true) {
if (isLoadImageServlet())
rp.append(afterImgFileSave(bean, req, res));
rp.append(afterSave(bean, req, res));
if (rp.getStatus() == true) {
sendMessage(req, AbMessages.getMessage(getLocale(req), "SAVE_OK") + AbMessages.getMessage(getLocale(req), "SAVE_OK"));
if (getAct(req).equals("ni")) {
newRecord(req, res);
return;
}
if (!isSimpleServlet(req) || getRequestLongParameter(req, "sw") == 1L || l_id_tipo == 0L)
req.setAttribute(getBEANAttribute(req), bean);
}
} else {
forceMessage(req, rp.getMsg());
req.setAttribute(getBEANAttribute(req), bean);
}
if (isSimpleServlet(req) && getRequestLongParameter(req, "sw") != 1L && l_id_tipo > 0L) {
showBean(req, res);
} else if (getAct(req).equals("saveJson")) {
DBAdapterSaveResponse dbRes = new DBAdapterSaveResponse(bean.get_Id(), bean.getLastUpdTmstString(),
bean.getLastUpdInfo(),
Ab.formatBeanMsg((String)req.getAttribute("msg"), (String)req.getAttribute("grantMsg")),
rp.getStatus());
Gson gson = new Gson();
sendHtmlMsgResponse(req, res, gson.toJson(dbRes));
} else {
showBean(req, res);
}
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_RW"));
showBean(req, res);
}
} else if (getAct(req).startsWith("del")) {
if (getLoginUserGrant(req, bean.getTableBeanName()) >= 4L) {
ResParm rp = beforeDelete(req, res);
if (rp.getStatus())
rp.append(bean.delete());
req.setAttribute("_id", "0");
if (rp.getStatus() == true) {
req.setAttribute(bean.get_IdName(), Integer.valueOf(0));
rp.append(afterDelete(bean, req, res));
if (rp.getStatus() == true) {
sendMessage(req, AbMessages.getMessage(getLocale(req), "DELETE_OK") + AbMessages.getMessage(getLocale(req), "DELETE_OK"));
if (isSimpleServlet(req)) {
actionsAfterDelete(req, res);
} else {
actionsAfterDelete(req, res);
}
}
} else {
forceMessage(req, rp.getMsg());
showBean(req, res);
}
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_RWD"));
showBean(req, res);
}
}
} else {
sendGrantMessage(req, AbMessages.getMessage(getLocale(req), "GRANT_NO_RM"));
if (getCallType(req).equals("_json")) {
if (!isUserLogged(req, res))
appendMessage(req, " Sessione Scaduta!");
DBAdapterSaveResponse dbRes = new DBAdapterSaveResponse(String.valueOf(l_id), "", bean.getLastUpdInfo(),
Ab.formatBeanMsg((String)req.getAttribute("msg"), (String)req.getAttribute("grantMsg")), false);
Gson gson = new Gson();
sendHtmlMsgResponse(req, res, gson.toJson(dbRes));
} else {
showBean(req, res);
}
}
} catch (Exception e) {
if (getAct(req).startsWith("save"))
handleDebug(AbMessages.getMessage(getLocale(req), "SAVE_FAIL"), 2);
handleDebug(AbMessages.getMessage(getLocale(req), "DELETE_FAIL"), 2);
handleDebug(e, 2);
sendMessage(req, "Errore! " + e.getMessage());
fillObject(req, bean);
req.setAttribute("bean", bean);
sendMessage(req, "Errore! " + e.getMessage());
if (isSimpleServlet(req)) {
search(req, res);
} else if (getAct(req).equals("saveJson")) {
DBAdapterSaveResponse dbRes = new DBAdapterSaveResponse(bean.get_Id(), bean.getLastUpdTmstString(),
bean.getLastUpdInfo(),
Ab.formatBeanMsg((String)req.getAttribute("msg"), (String)req.getAttribute("grantMsg")), false);
Gson gson = new Gson();
sendHtmlMsgResponse(req, res, gson.toJson(dbRes));
} else {
showBean(req, res);
}
}
}
public void _ebaySuggestion(HttpServletRequest req, HttpServletResponse res) {
ApplParmFull apFull = getApFull(req);
Tipo bean = new Tipo(apFull);
long l_id_tipo = getRequestLongParameter(req, "id_tipo");
String l_query = getRequestParameter(req, "query");
bean.findByPrimaryKey(l_id_tipo);
if (bean.getId_tipo() > 0L) {
ResParm rp = bean.setEbayCategorySuggestion(l_query);
sendMessage(req, rp.getMsg());
showBean(req, res);
} else {
sendMessage(req, "Errore! tipo non trovato");
search(req, res);
}
}
protected void newRecord(HttpServletRequest req, HttpServletResponse res) {
search(req, res);
}
}

Some files were not shown because too many files have changed in this diff Show more