first commit
This commit is contained in:
commit
4d332ef662
27586 changed files with 3281783 additions and 0 deletions
311
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Accessorio.java
Normal file
311
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Accessorio.java
Normal file
|
|
@ -0,0 +1,311 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.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 DISTINCT A.* from ACCESSORIO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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 = String.valueOf(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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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 = String.valueOf(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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,168 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getNomeFileCompleto() {
|
||||
return getNomeFileCompleto(getArticolo().getPathAllegato());
|
||||
}
|
||||
|
||||
public String getNomeFileCompleto(String l_path) {
|
||||
return String.valueOf(l_path) + getId_articolo() + "_" + getNomeFile();
|
||||
}
|
||||
|
||||
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 String.valueOf(getId_articolo()) + "_" + getNomeFile();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
7097
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Articolo.java
Normal file
7097
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Articolo.java
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,121 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, 0, 0);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
1335
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ArticoloCR.java
Normal file
1335
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ArticoloCR.java
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,117 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return getSum(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return 0.0D;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,412 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.anag.Fornitore;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.tex.anag.ArticoloTessuto;
|
||||
import com.ablia.tex.anag.ArticoloTessutoColore;
|
||||
import com.ablia.util.DoubleOperator;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Date;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
public class ArticoloFornitore extends _ArtAdapter implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private long id_clifor;
|
||||
|
||||
private String codiceFornitore;
|
||||
|
||||
private long id_articolo;
|
||||
|
||||
private double costo;
|
||||
|
||||
private Articolo articolo;
|
||||
|
||||
private Fornitore fornitore;
|
||||
|
||||
private Date dataUltimoPrezzo;
|
||||
|
||||
private double costoVecchio;
|
||||
|
||||
private long flgFuoriListino;
|
||||
|
||||
private double costoSconto;
|
||||
|
||||
private long costoScontoQta;
|
||||
|
||||
private long dispCash;
|
||||
|
||||
private long dispSede;
|
||||
|
||||
private long flgAbituale;
|
||||
|
||||
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;
|
||||
|
||||
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 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 DISTINCT A.* from articolo_fornitore AS A";
|
||||
String s_Sql_Order = "";
|
||||
String wc = "";
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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(String.valueOf(sql_String) + wc);
|
||||
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 (getCosto() != 0.0D) {
|
||||
DoubleOperator temp = new DoubleOperator(getArticolo().getPrezzoPubblico());
|
||||
temp.setScale(4, 1);
|
||||
temp.divide(getCosto());
|
||||
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 Vectumerator findById_articoloFornitore(long l_id_articolo, long l_id_fornitore, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 findByArticoloFornitore(long l_id_clifor, long l_id_articolo) {
|
||||
String s_Sql_Find = "select DISTINCT 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("id_clifor=" + l_id_clifor);
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void findByArticoloTessutoFornitore(long l_id_clifor, long l_id_articoloTessuto) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findById_articoloTessuto(long l_id_articoloTessuto, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import java.sql.Date;
|
||||
|
||||
public class ArticoloFornitoreCR extends CRAdapter {
|
||||
private long id_fornitore;
|
||||
|
||||
private String 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;
|
||||
|
||||
public ArticoloFornitoreCR(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
public ArticoloFornitoreCR() {}
|
||||
|
||||
public void setId_fornitore(long newId_fornitore) {
|
||||
this.id_fornitore = newId_fornitore;
|
||||
}
|
||||
|
||||
public void setId_articolo(String 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 String getId_articolo() {
|
||||
return (this.id_articolo == null) ? "" : 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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.anag.Clifor;
|
||||
import com.ablia.anag.PrezzoArticolo;
|
||||
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 getDataScadenzaOfferta();
|
||||
|
||||
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 getPrezzoBaseIvaConAbbuono();
|
||||
|
||||
double getPrezzoOfferta();
|
||||
|
||||
double getPrezzoIvatoBarrato();
|
||||
|
||||
long getFlgNoleggio();
|
||||
|
||||
double getPrezzoNoleggioIva();
|
||||
|
||||
double getPrezzoOffertaIva();
|
||||
|
||||
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();
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.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();
|
||||
}
|
||||
|
|
@ -0,0 +1,152 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.anag.Clifor;
|
||||
import com.ablia.anag._AnagAdapter;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findByArticolo(long id_articolo) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.anag.Clifor;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
471
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ArticoloTaglia.java
Normal file
471
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ArticoloTaglia.java
Normal file
|
|
@ -0,0 +1,471 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.cart.CartItemIterface;
|
||||
import com.ablia.contab.Movimento;
|
||||
import com.ablia.contab.RigaDocumento;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.DoubleOperator;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString());
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findByArticoloVariante(long l_id_articoloVariante) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} 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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 String.valueOf(getArticoloVariante().getCartItemDescription(lang)) + " " + translate("taglia", lang) + " " + getTaglia().getCodice();
|
||||
return String.valueOf(getArticolo().getNome()) + " " + translate("taglia", lang) + " " + getTaglia().getCodice();
|
||||
}
|
||||
|
||||
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 DISTINCT A.* from ARTICOLO_TAGLIA AS A INNER JOIN MOVIMENTO AS B ON A.id_articolotaglia = B.id_articoloTaglia ";
|
||||
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(String.valueOf(s_Sql_Find) + wc.toString());
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDescrizioneCompleta() {
|
||||
if (getId_articoloVariante() != 0L)
|
||||
return String.valueOf(getArticoloVariante().getDescrizione()) + " [" + getTaglia().getDescrizione() + "] ";
|
||||
return String.valueOf(getArticolo().getDescrizione()) + " [" + getTaglia().getDescrizione() + "] ";
|
||||
}
|
||||
|
||||
public String getDescrizioneCompleta(String lang) {
|
||||
if (getId_articoloVariante() != 0L)
|
||||
return String.valueOf(getArticoloVariante().getDescrizione(lang)) + " [" + getTaglia().getDescrizione(lang) + "] ";
|
||||
return String.valueOf(getArticolo().getDescrizione(lang)) + " [" + getTaglia().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() ? false : true) & ((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;
|
||||
}
|
||||
}
|
||||
382
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ArticoloUsato.java
Normal file
382
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ArticoloUsato.java
Normal file
|
|
@ -0,0 +1,382 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.anag.Clifor;
|
||||
import com.ablia.contab.RigaDocumento;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 Vectumerator findByCR(ArticoloUsatoCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Clifor getFornitoreByArticolo(String l_id_articolo) {
|
||||
if (l_id_articolo.isEmpty())
|
||||
return new Clifor(getApFull());
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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) ? "" : 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;
|
||||
}
|
||||
}
|
||||
1411
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ArticoloVariante.java
Normal file
1411
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ArticoloVariante.java
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,194 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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) ? "" : 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;
|
||||
|
||||
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) ? "" : 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) ? "" : this.nomeV;
|
||||
}
|
||||
|
||||
public void setNomeV(String nomeV) {
|
||||
this.nomeV = nomeV;
|
||||
}
|
||||
|
||||
public String getDescrizioneArticolo() {
|
||||
return (this.descrizioneArticolo == null) ? "" : 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) ? "" : 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;
|
||||
}
|
||||
}
|
||||
114
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/CTipo.java
Normal file
114
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/CTipo.java
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(l_id_tipo) + tipo.getIndici(), ":");
|
||||
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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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;
|
||||
}
|
||||
}
|
||||
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/CTipoCR.java
Normal file
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/CTipoCR.java
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/CTipoKey.java
Normal file
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/CTipoKey.java
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.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;
|
||||
}
|
||||
}
|
||||
274
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Caratteristica.java
Normal file
274
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Caratteristica.java
Normal file
|
|
@ -0,0 +1,274 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.DbInterface;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 = 1L;
|
||||
|
||||
private long id_caratteristica;
|
||||
|
||||
private long flgCR;
|
||||
|
||||
private String descrizione_it;
|
||||
|
||||
private String descrizioneAggiuntiva;
|
||||
|
||||
private long flgTipoVal;
|
||||
|
||||
private long ordine;
|
||||
|
||||
private long flgRicercaWeb;
|
||||
|
||||
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 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 DISTINCT 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 = String.valueOf(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(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findCaratteristicheByTipo(long l_id_tipo, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(l_id_tipo) + tipo.getIndici(), ":");
|
||||
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(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
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, Exception {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.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 DISTINCT A.* from caratteristica_articolo AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
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 DISTINCT A.* 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(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
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 "??";
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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()));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
178
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Colore.java
Normal file
178
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Colore.java
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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 = String.valueOf(s_Sql_Find) +
|
||||
" LEFT join (SELECT LL.* FROM DESC_TXT_LANG AS LL where LL.tabella='COLORE' AND LL.campo='descrizione' " + wcLang +
|
||||
" ) 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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 = String.valueOf(s_Sql_Find) +
|
||||
" LEFT join (SELECT LL.* FROM DESC_TXT_LANG AS LL where LL.tabella='COLORE' AND LL.campo='descrizione' and LL.lang='" +
|
||||
l_lang + "' ) 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public void findByDescrizione(String l_descrizione) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
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()) {
|
||||
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()) {
|
||||
sb.append(getDescrizione());
|
||||
} else {
|
||||
sb.append(getCodiceColore());
|
||||
sb.append(" ");
|
||||
sb.append(getDescrizione());
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
36
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ColoreCR.java
Normal file
36
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ColoreCR.java
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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();
|
||||
}
|
||||
}
|
||||
76
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Componente.java
Normal file
76
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Componente.java
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.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 DISTINCT A.* from COMPONENTE AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT A.* from COMPONENTE AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.sigla='" + l_sigla + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getDescrizioneCompleta(String lang) {
|
||||
return String.valueOf(getSigla()) + " " + getDescrizionePS(lang);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
220
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Kit.java
Normal file
220
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Kit.java
Normal file
|
|
@ -0,0 +1,220 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.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 DISTINCT A.* from KIT AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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;
|
||||
}
|
||||
}
|
||||
12
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/KitCR.java
Normal file
12
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/KitCR.java
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
|
||||
public class KitCR extends CRAdapter {
|
||||
public KitCR() {}
|
||||
|
||||
public KitCR(ApplParmFull newAp) {
|
||||
super(newAp);
|
||||
}
|
||||
}
|
||||
177
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Lista.java
Normal file
177
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Lista.java
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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;
|
||||
|
||||
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 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 findByCR(ListaCR CR, int pageNumber, int pageRows) {
|
||||
String s_Sql_Find = "select DISTINCT 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 = '" +
|
||||
|
||||
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(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public void findByValore(String l_valore) {
|
||||
String s_Sql_Find = "select DISTINCT A.* from LISTA AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
wc.addWc("A.valore ='" + l_valore + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator findByTipo(long l_id_tipo, String lang) {
|
||||
if (l_id_tipo == 0L)
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
String s_Sql_FindC = "select DISTINCT 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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
return findRows(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
42
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ListaCR.java
Normal file
42
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ListaCR.java
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
298
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Marca.java
Normal file
298
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Marca.java
Normal file
|
|
@ -0,0 +1,298 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.common.StatusMsg;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.util.Timer;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class Marca extends _ArtAdapter implements Serializable {
|
||||
private long id_marca;
|
||||
|
||||
private String descrizione;
|
||||
|
||||
private String articoliTrattati;
|
||||
|
||||
private String link;
|
||||
|
||||
private String indiciTipo;
|
||||
|
||||
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 = true;
|
||||
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 ");
|
||||
}
|
||||
timer.stop();
|
||||
StatusMsg.updateMsgByTag(Marca.this.getApFull(), "INDICIZZAZIONE MARCHE ", " FINE " + rp.getMsg() + " " + timer.getDurataHourMin());
|
||||
try {
|
||||
sleep(10000L);
|
||||
} catch (Exception e) {}
|
||||
StatusMsg.deleteMsgByTag(Marca.this.apFull, "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();
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public Vectumerator findByCR(MarcaCR CR, 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();
|
||||
if (!CR.getDescrizioneS().isEmpty())
|
||||
wc.addWc("A.descrizione like'" + CR.getDescrizioneS() + "%'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
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 DISTINCT A.* from MARCA AS A";
|
||||
String s_Sql_Order = "";
|
||||
String wc = "";
|
||||
wc = buildWc(wc, "A.descrizione='" + l_desc + "'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public Vectumerator<Marca> findMarchePresentiByTipo(long l_id_tipo) {
|
||||
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 + ":%'");
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc + s_Sql_Order);
|
||||
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 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);
|
||||
}
|
||||
}
|
||||
Iterator<String> iteHsIDT = hsIDT.iterator();
|
||||
StringBuilder sb = new StringBuilder(":");
|
||||
while (iteHsIDT.hasNext()) {
|
||||
sb.append(iteHsIDT.next());
|
||||
sb.append(":");
|
||||
}
|
||||
setIndiciTipo(sb.toString());
|
||||
rp = save();
|
||||
StatusMsg.updateMsgByTag(getApFull(), TAG_THREAD_MSG, String.valueOf(getDescrizione()) + " " + getIndiciTipo() + " " + rp.getMsg());
|
||||
return rp;
|
||||
}
|
||||
return rp;
|
||||
}
|
||||
|
||||
public static boolean isThreadAttivo() {
|
||||
return threadindicizzoMarche;
|
||||
}
|
||||
|
||||
public final ResParm startIndicizzoMarche(long l_id_marca) {
|
||||
if (!isThreadAttivo())
|
||||
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) {
|
||||
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());
|
||||
}
|
||||
StringBuffer s_Sql_Find = new StringBuffer(
|
||||
"select DISTINCT 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();
|
||||
Articolo articolo = new Articolo(getApFull());
|
||||
CR.setId_marche("");
|
||||
CR.setFlgOrderBy(0L);
|
||||
articolo.findWebByArticoloCRCreateWC(CR, s_Sql_Find, wc);
|
||||
try {
|
||||
if (debug) {
|
||||
sb.append("\n");
|
||||
sb.append(s_Sql_Find + wc.toString() + s_sqlOrderBy);
|
||||
}
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + wc.toString() + s_sqlOrderBy);
|
||||
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 Vectumerator findWebByArticoloCROld(ArticoloCR CR, int pageNumber, int pageRows) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
boolean debug = true;
|
||||
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());
|
||||
}
|
||||
StringBuffer s_Sql_Find = new StringBuffer(
|
||||
"select DISTINCT M.* from ARTICOLO AS A left JOIN TIPO AS C2 ON A.id_tipo2=C2.id_tipo 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();
|
||||
Articolo articolo = new Articolo(getApFull());
|
||||
CR.setId_marche("");
|
||||
CR.setFlgOrderBy(0L);
|
||||
articolo.findWebByArticoloCRCreateWCOld(CR, s_Sql_Find, wc);
|
||||
try {
|
||||
if (debug) {
|
||||
sb.append("\n");
|
||||
sb.append(s_Sql_Find + wc.toString() + s_sqlOrderBy);
|
||||
}
|
||||
PreparedStatement stmt = getConn().prepareStatement(s_Sql_Find + wc.toString() + s_sqlOrderBy);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/MarcaCR.java
Normal file
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/MarcaCR.java
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
|
||||
public class MarcaCR extends CRAdapter {
|
||||
private long id_marca;
|
||||
|
||||
private String descrizioneS;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
88
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Modello.java
Normal file
88
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Modello.java
Normal file
|
|
@ -0,0 +1,88 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
56
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ModelloCR.java
Normal file
56
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/ModelloCR.java
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
111
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Reparto.java
Normal file
111
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Reparto.java
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.anag.Iva;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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;
|
||||
}
|
||||
}
|
||||
53
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/RepartoCR.java
Normal file
53
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/RepartoCR.java
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
141
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Rivalutazione.java
Normal file
141
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Rivalutazione.java
Normal file
|
|
@ -0,0 +1,141 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return (Rivalutazione)getFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return new Rivalutazione(getApFull());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
423
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/TabellaTaglia.java
Normal file
423
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/TabellaTaglia.java
Normal file
|
|
@ -0,0 +1,423 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 String.valueOf(getId_tabellaTaglia()) + "_" + oldTmst + "_" + imgNumber + ".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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
258
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Taglia.java
Normal file
258
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Taglia.java
Normal file
|
|
@ -0,0 +1,258 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.common.DescTxtLang;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public void findByTipoTagliaTaglia1(String l_tipoTaglia, String l_taglia) {
|
||||
String s_Sql_Find = "select DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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, Exception {
|
||||
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();
|
||||
}
|
||||
}
|
||||
52
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/TagliaCR.java
Normal file
52
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/TagliaCR.java
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
376
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/TagliaMisure.java
Normal file
376
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/TagliaMisure.java
Normal file
|
|
@ -0,0 +1,376 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
|
||||
protected void prepareSave(PreparedStatement ps) throws SQLException, Exception {
|
||||
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;
|
||||
}
|
||||
}
|
||||
186
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/TagliaMisureCR.java
Normal file
186
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/TagliaMisureCR.java
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
1644
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Tipo.java
Normal file
1644
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Tipo.java
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,85 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(
|
||||
String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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();
|
||||
}
|
||||
}
|
||||
232
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/TipoCR.java
Normal file
232
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/TipoCR.java
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
|
||||
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) ? "" : 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) ? "" : this.tag.trim();
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
}
|
||||
110
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/TipoTaglia.java
Normal file
110
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/TipoTaglia.java
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
findFirstRecord(stmt);
|
||||
} catch (SQLException e) {
|
||||
handleDebug(e);
|
||||
}
|
||||
}
|
||||
|
||||
public String getDescrizioneCompleta() {
|
||||
if (getCodice().equals(getDescrizione()) || getCodice().isEmpty())
|
||||
return getDescrizione();
|
||||
return String.valueOf(getCodice()) + " - " + getDescrizione();
|
||||
}
|
||||
|
||||
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 String.valueOf(getCodice()) + " - " + getDescrizione(l_lang);
|
||||
}
|
||||
|
||||
public boolean useDescLangTables() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,169 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.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_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 DISTINCT A.* from TIPOLOGIA_ARTICOLO AS A";
|
||||
String s_Sql_Order = "";
|
||||
WcString wc = new WcString();
|
||||
try {
|
||||
PreparedStatement stmt = getConn().prepareStatement(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
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 String.valueOf(getDescrizione()) + " (" + getUdm(getFlgUdm()) + ")";
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,73 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
71
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Vetrina.java
Normal file
71
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/Vetrina.java
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.db.WcString;
|
||||
import com.ablia.util.StringTokenizer;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.Serializable;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class Vetrina extends DBAdapter implements Serializable {
|
||||
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 DISTINCT 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(String.valueOf(s_Sql_Find) + wc.toString() + s_Sql_Order);
|
||||
return findRows(stmt, pageNumber, pageRows);
|
||||
} catch (SQLException e) {
|
||||
removeCPConnection();
|
||||
handleDebug(e);
|
||||
return AB_EMPTY_VECTUMERATOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/VetrinaCR.java
Normal file
32
rus/WEB-INF/lib/abliaDbCom_src/com/ablia/art/VetrinaCR.java
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.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();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.ablia.art;
|
||||
|
||||
import com.ablia.anag._AnagAdapter;
|
||||
import com.ablia.db.ApplParm;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.ablia.anag.Users;
|
||||
import com.ablia.common.Access;
|
||||
import com.ablia.common.UsersI;
|
||||
import com.ablia.db.ApplParm;
|
||||
import com.ablia.servlet.AblServletSvlt;
|
||||
|
||||
/**
|
||||
* Insert the type's description here. Creation date: (31/07/2000 16.02.49)
|
||||
*
|
||||
* @author: Administrator
|
||||
*/
|
||||
public abstract class _MagSvlt extends AblServletSvlt {
|
||||
protected static ApplParm ap2;
|
||||
|
||||
/**
|
||||
* Utilizzata nel caso in cui ho bisogno dei profili per accedere Creation
|
||||
* date: (05/08/2000 15.29.26)
|
||||
*
|
||||
* @param req
|
||||
* javax.servlet.http.HttpServletRequest
|
||||
* @param msg
|
||||
* java.lang.String
|
||||
*/
|
||||
protected boolean checkLoginProfile(HttpServletRequest req) {
|
||||
try {
|
||||
// controllo il profilo e l'abilitazione
|
||||
if (getLoginUser(req) == null) {
|
||||
forceJspPage(getLoginPage(null, null),req);
|
||||
return true; // utente non loggato
|
||||
} else if (getLoginUser(req).getFlgValido().equals("N")) {
|
||||
// utente non piu' valido
|
||||
forceJspPage(super.getLoginPage(null, null),req);
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
return false;
|
||||
} else if (getLoginUser(req).getId_userProfile() > 0) {
|
||||
// amministratori
|
||||
// forceJspPage(super.getLoginPage());
|
||||
return true;
|
||||
} else {
|
||||
forceJspPage(super.getLoginPage(null, null),req);
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert the method's description here. Creation date: (24/10/2001 8.25.10)
|
||||
*
|
||||
* @return java.lang.String
|
||||
* @param req
|
||||
* javax.servlet.http.HttpServletRequest
|
||||
*/
|
||||
protected String getAct3(HttpServletRequest req) {
|
||||
return getRequestParameter(req, "act3");
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert the method's description here. Creation date: (24/10/2001 8.25.10)
|
||||
*
|
||||
* @return java.lang.String
|
||||
* @param req
|
||||
* javax.servlet.http.HttpServletRequest
|
||||
*/
|
||||
protected String getCmd3(HttpServletRequest req) {
|
||||
return getRequestParameter(req, "cmd3");
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert the method's description here. Creation date: (18/09/2000
|
||||
* 18.40.01)
|
||||
*
|
||||
* @return java.lang.String
|
||||
*/
|
||||
protected String getLoginPage(HttpServletRequest req,
|
||||
HttpServletResponse res) {
|
||||
// return getJspPage(req).equals(com.ablia.db.DBAdapter.AB_EMPTY_STRING) ?
|
||||
// "/menu/menu.jsp" : getJspPage(req);
|
||||
return "/admin/menu/menu.jsp";
|
||||
}
|
||||
|
||||
/**
|
||||
* Questo metodo deve essere sovrascritto dalle sottoclassi se non viene
|
||||
* utilizzato l'utente standard ablia Creation date: (05/10/2000 19.47.58)
|
||||
*
|
||||
* @return com.ablia.common.User
|
||||
*/
|
||||
protected com.ablia.common.Users getUser(HttpServletRequest req) {
|
||||
return new Users(getAp());
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert the method's description here. Creation date: (28/12/2001
|
||||
* 12.14.33)
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
protected boolean useAlwaysSendRedirect() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.ablia.servlet.AcServlet#getAp(javax.servlet.http.HttpServletRequest)
|
||||
*/
|
||||
protected ApplParm getAp2() {
|
||||
if (ap2 == null) {
|
||||
ap2 = new ApplParm(getAp().getParm("DBDRIVER2").getNumeroInt(),
|
||||
getAp().getParm("DBNAME2").getTesto(), getAp().getParm(
|
||||
"USER2").getTesto(), getAp().getParm("PASSWORD2")
|
||||
.getTesto());
|
||||
}
|
||||
return ap2;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,455 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.anag.Listino;
|
||||
import com.ablia.anag.ListinoArticolo;
|
||||
import com.ablia.art.Accessorio;
|
||||
import com.ablia.art.Articolo;
|
||||
import com.ablia.art.ArticoloCR;
|
||||
import com.ablia.art.ArticoloTaglia;
|
||||
import com.ablia.art.ArticoloVariante;
|
||||
import com.ablia.art.ArticoloVarianteCR;
|
||||
import com.ablia.art.Colore;
|
||||
import com.ablia.art.ColoreCR;
|
||||
import com.ablia.art.TabellaTaglia;
|
||||
import com.ablia.art.Taglia;
|
||||
import com.ablia.art.TipoAccessorio;
|
||||
import com.ablia.art.Vetrina;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.tex.anag.ArticoloArticoloTessuto;
|
||||
import com.ablia.util.AbMessages;
|
||||
import com.ablia.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));
|
||||
}
|
||||
|
||||
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 = String.valueOf(getDocBase()) + bean.getArticolo().getPathAttach();
|
||||
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()) {
|
||||
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 = String.valueOf(getDocBase()) + bean.getArticolo().getPathAttach();
|
||||
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(String.valueOf(targetDir) + bean.getImgFileName(idx)).delete();
|
||||
new File(currentFileName).renameTo(new File(String.valueOf(targetDir) + bean.getImgFileName(idx, imgTmst)));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (l_newImg)
|
||||
for (int j = 1; j <= 6; j++) {
|
||||
String currentFileName = String.valueOf(targetDir) + bean.getImgFileName(j);
|
||||
if (isFileExist(currentFileName))
|
||||
new File(currentFileName).renameTo(new File(String.valueOf(targetDir) + bean.getImgFileName(j, imgTmst)));
|
||||
}
|
||||
}
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
if (getRequestLongParameter(req, "cmdCancellaImmagine" + i) == 1L) {
|
||||
String fileName = String.valueOf(targetDir) + bean.getImgFileName(i);
|
||||
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));
|
||||
} else {
|
||||
sendPdf(res, bean.creaLabelArticoloZebraPdf(CR));
|
||||
}
|
||||
} 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));
|
||||
} else {
|
||||
sendPdf(res, bean.creaLabelArticoloAccZebraPdf(CR));
|
||||
}
|
||||
} 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.CTipo;
|
||||
import com.ablia.art.Caratteristica;
|
||||
import com.ablia.art.CaratteristicaCR;
|
||||
import com.ablia.art.Marca;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.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()) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.Colore;
|
||||
import com.ablia.art.ColoreCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.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 = 1L;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.Componente;
|
||||
import com.ablia.art.ComponenteCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.AllegatoArticolo;
|
||||
import com.ablia.servlet.GetFileSvlt;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public class GetArticoloAttachSvlt extends GetFileSvlt {
|
||||
protected String getFileName(HttpServletRequest req, HttpServletResponse res) {
|
||||
AllegatoArticolo bean = new AllegatoArticolo(getApFull(req));
|
||||
bean.findByPrimaryKey(getRequestLongParameter(req, "id"));
|
||||
String fileName = bean.getNomeFileCompleto();
|
||||
return fileName;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.Caratteristica;
|
||||
import com.ablia.art.Lista;
|
||||
import com.ablia.art.ListaCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.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 = 1L;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.Marca;
|
||||
import com.ablia.art.MarcaCR;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.servlet.AblServletSvlt;
|
||||
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 {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
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 true;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.Marca;
|
||||
import com.ablia.art.Modello;
|
||||
import com.ablia.art.ModelloCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.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 = 1L;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.anag.Iva;
|
||||
import com.ablia.art.Reparto;
|
||||
import com.ablia.art.RepartoCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.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 = 1L;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,235 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.Articolo;
|
||||
import com.ablia.art.TabellaTaglia;
|
||||
import com.ablia.art.TabellaTagliaCR;
|
||||
import com.ablia.art.TagliaMisure;
|
||||
import com.ablia.art.TipoTaglia;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.servlet.AblServletSvlt;
|
||||
import com.ablia.util.AbMessages;
|
||||
import com.ablia.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 = 1L;
|
||||
|
||||
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()) {
|
||||
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 = String.valueOf(getDocBase()) + bean.getPathImgTabellaTaglia();
|
||||
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 = String.valueOf(getDocBase()) + bean.getPathImgTabellaTaglia();
|
||||
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(String.valueOf(targetDir) + bean.getImgFileName(idx)).delete();
|
||||
new File(currentFileName).renameTo(new File(String.valueOf(targetDir) +
|
||||
bean.getImgFileName(idx, imgTmst)));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (l_newImg)
|
||||
for (int j = 1; j <= 6; j++) {
|
||||
String currentFileName = String.valueOf(targetDir) + bean.getImgFileName(j);
|
||||
if (isFileExist(currentFileName))
|
||||
new File(currentFileName).renameTo(new File(String.valueOf(targetDir) +
|
||||
bean.getImgFileName(j, imgTmst)));
|
||||
}
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
if (getRequestLongParameter(req, "cmdCancellaImmagine" + i) == 1L) {
|
||||
String fileName = String.valueOf(targetDir) + bean.getImgFileName(i);
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.Taglia;
|
||||
import com.ablia.art.TagliaCR;
|
||||
import com.ablia.art.TipoTaglia;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.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 = 1L;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.TipoAccessorio;
|
||||
import com.ablia.art.TipoAccessorioCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.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 = 1L;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.TipoAllegatoArticolo;
|
||||
import com.ablia.art.TipoAllegatoArticoloCR;
|
||||
import com.ablia.contab.TipoAllegatoDocumento;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.servlet.AblServletSvlt;
|
||||
import com.ablia.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 = 1L;
|
||||
|
||||
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()) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.anag.Listino;
|
||||
import com.ablia.art.Reparto;
|
||||
import com.ablia.art.Tipo;
|
||||
import com.ablia.art.TipoCR;
|
||||
import com.ablia.art.TipoTaglia;
|
||||
import com.ablia.art.TipologiaArticolo;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.db.ResParm;
|
||||
import com.ablia.servlet.AblServletSvlt;
|
||||
import com.ablia.util.AbMessages;
|
||||
import com.ablia.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 = 1L;
|
||||
|
||||
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) {
|
||||
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) {}
|
||||
|
||||
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(getApFull(req));
|
||||
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(String.valueOf(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.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.TipoTaglia;
|
||||
import com.ablia.art.TipoTagliaCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.servlet.AblServletSvlt;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/artConfig/TipoTaglia.abl"})
|
||||
public class TipoTagliaSvlt extends AblServletSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
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 TipoTaglia(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new TipoTagliaCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.TipologiaArticolo;
|
||||
import com.ablia.art.TipologiaArticoloCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.servlet.AblServletSvlt;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/artConfig/TipologiaArticolo.abl"})
|
||||
public class TipologiaArticoloSvlt extends AblServletSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
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 TipologiaArticolo(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new TipologiaArticoloCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.art.Vetrina;
|
||||
import com.ablia.art.VetrinaCR;
|
||||
import com.ablia.db.CRAdapter;
|
||||
import com.ablia.db.DBAdapter;
|
||||
import com.ablia.servlet.AblServletSvlt;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@WebServlet(urlPatterns = {"/admin/artConfig/Vetrina.abl"})
|
||||
public class VetrinaSvlt extends AblServletSvlt {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
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 Vetrina(getApFull(req));
|
||||
}
|
||||
|
||||
protected CRAdapter getBeanCR(HttpServletRequest req) {
|
||||
return new VetrinaCR(getApFull(req));
|
||||
}
|
||||
|
||||
protected void prepareNewRecord(HttpServletRequest req, HttpServletResponse res) {}
|
||||
|
||||
protected boolean isSimpleServlet(HttpServletRequest req) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
package com.ablia.art.servlet;
|
||||
|
||||
import com.ablia.common.Users;
|
||||
import com.ablia.db.ApplParm;
|
||||
import com.ablia.db.ApplParmFull;
|
||||
import com.ablia.servlet.AblServletSvlt;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public abstract class _MagSvlt extends AblServletSvlt {
|
||||
protected static ApplParmFull ap2;
|
||||
|
||||
protected boolean checkLoginProfile(HttpServletRequest req) {
|
||||
try {
|
||||
if (getLoginUser(req) == null) {
|
||||
forceJspPage(getLoginPage(null, null), req);
|
||||
return true;
|
||||
}
|
||||
if (getLoginUser(req).getFlgValido().equals("N")) {
|
||||
forceJspPage(super.getLoginPage(null, null), req);
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
return false;
|
||||
}
|
||||
if (getLoginUser(req).getId_userProfile() > 0L)
|
||||
return true;
|
||||
forceJspPage(super.getLoginPage(null, null), req);
|
||||
req.getSession().removeAttribute("loginUser_id");
|
||||
req.getSession().removeAttribute("utenteLogon");
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
handleDebug(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
protected String getAct3(HttpServletRequest req) {
|
||||
return getRequestParameter(req, "act3");
|
||||
}
|
||||
|
||||
protected String getCmd3(HttpServletRequest req) {
|
||||
return getRequestParameter(req, "cmd3");
|
||||
}
|
||||
|
||||
protected String getLoginPage(HttpServletRequest req, HttpServletResponse res) {
|
||||
return "/admin/menu/menu.jsp";
|
||||
}
|
||||
|
||||
protected Users getUser(HttpServletRequest req) {
|
||||
return new com.ablia.anag.Users(getApFull(req));
|
||||
}
|
||||
|
||||
protected boolean useAlwaysSendRedirect() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected ApplParmFull getAp2() {
|
||||
if (ap2 == null) {
|
||||
ApplParmFull apFull = getApFull();
|
||||
ApplParm apx = new ApplParm(apFull.getParm("DBDRIVER2").getNumeroInt(), apFull.getParm("DBNAME2").getTesto(),
|
||||
apFull.getParm("USER2").getTesto(), apFull.getParm("PASSWORD2").getTesto());
|
||||
ap2 = new ApplParmFull(apx);
|
||||
}
|
||||
return ap2;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.ablia.art.taglib;
|
||||
|
||||
import com.ablia.art.Marca;
|
||||
import com.ablia.taglib.AbstractFillListTag;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.jsp.JspException;
|
||||
|
||||
public class CaricaMarcaTag extends AbstractFillListTag {
|
||||
public int doStartTag() throws JspException {
|
||||
try {
|
||||
HttpServletRequest req = (HttpServletRequest)
|
||||
this.pageContext.getRequest();
|
||||
req.setAttribute("listaMarche", new Marca(getApFull()).findAll());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new JspException("Errore per lista " +
|
||||
getNomelista() + ": " + e.getMessage());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package com.ablia.art.taglib;
|
||||
|
||||
import com.ablia.art.Articolo;
|
||||
import com.ablia.taglib.AbstractDbTag;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.JspTagException;
|
||||
|
||||
public class IfVetrinaTag extends AbstractDbTag {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected int currentNestedValue;
|
||||
|
||||
private long vetrina;
|
||||
|
||||
protected static final String _WC = "_WC";
|
||||
|
||||
protected static final String _NESTVAL = "_WCNESTVAL";
|
||||
|
||||
public int doAfterBody() throws JspException {
|
||||
try {
|
||||
this.bodyContent.writeOut((Writer)this.bodyContent.getEnclosingWriter());
|
||||
setNestedValue();
|
||||
return 0;
|
||||
} catch (IOException ex) {
|
||||
throw new JspTagException(ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public int doStartTag() {
|
||||
this.currentNestedValue = getNestedValue();
|
||||
this.pageContext.setAttribute("_WC" + this.currentNestedValue, new Boolean(
|
||||
getWherecondition()));
|
||||
if (getWherecondition())
|
||||
return 2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected int getNestedValue() {
|
||||
if (this.pageContext.getAttribute("_WCNESTVAL") == null) {
|
||||
this.pageContext.setAttribute("_WCNESTVAL", "1");
|
||||
return 1;
|
||||
}
|
||||
int nv = Integer.parseInt((String)
|
||||
this.pageContext.getAttribute("_WCNESTVAL"));
|
||||
nv++;
|
||||
this.pageContext.setAttribute("_WCNESTVAL", String.valueOf(nv));
|
||||
return nv;
|
||||
}
|
||||
|
||||
public boolean getWherecondition() {
|
||||
Vectumerator theList = new Articolo(getApFull()).findRandomArticoli(
|
||||
getVetrina(), 1, false);
|
||||
if (theList == null || theList.getTotNumberOfRecords() == 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void setNestedValue() {
|
||||
this.pageContext.setAttribute("_WCNESTVAL", String.valueOf(this.currentNestedValue));
|
||||
}
|
||||
|
||||
public long getVetrina() {
|
||||
return this.vetrina;
|
||||
}
|
||||
|
||||
public void setVetrina(long vetrina) {
|
||||
this.vetrina = vetrina;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.ablia.art.taglib;
|
||||
|
||||
import com.ablia.art.Tipo;
|
||||
import com.ablia.db.DBAdapter;
|
||||
|
||||
public class TipoListJQTreeTag extends com.ablia.taglib.TipoListJQTreeTag {
|
||||
protected DBAdapter getTipoBean() {
|
||||
return new Tipo(getApFull());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.ablia.art.taglib;
|
||||
|
||||
import com.ablia.art.Tipo;
|
||||
import com.ablia.db.DBAdapter;
|
||||
|
||||
public class TipoListTreeTag extends com.ablia.taglib.TipoListTreeTag {
|
||||
protected DBAdapter getTipoBean() {
|
||||
return new Tipo(getApFull());
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
package com.ablia.art.taglib;
|
||||
|
||||
import com.ablia.art.Articolo;
|
||||
import com.ablia.art.ArticoloInterface;
|
||||
import com.ablia.taglib.AbstractDbTag;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.IOException;
|
||||
import java.text.NumberFormat;
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.JspTagException;
|
||||
|
||||
public class VetrinaTag extends AbstractDbTag {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String rowbeanname;
|
||||
|
||||
private long vetrina;
|
||||
|
||||
private int num;
|
||||
|
||||
private NumberFormat nf;
|
||||
|
||||
private Vectumerator theList;
|
||||
|
||||
public int doAfterBody() throws JspException {
|
||||
try {
|
||||
if (this.theList.hasMoreElements()) {
|
||||
ArticoloInterface row = (ArticoloInterface)
|
||||
this.theList.nextElement();
|
||||
this.pageContext.setAttribute(getRowbeanname(), row);
|
||||
this.pageContext.setAttribute("nfV", getNf());
|
||||
this.pageContext.setAttribute("idx",
|
||||
String.valueOf(this.theList.getIndex()));
|
||||
return 2;
|
||||
}
|
||||
String body = getBodyContent().getString();
|
||||
this.bodyContent.getEnclosingWriter().print(body);
|
||||
return 0;
|
||||
} catch (IOException ex) {
|
||||
throw new JspTagException(ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public int doStartTag() {
|
||||
this.theList = new Articolo(getApFull()).findRandomArticoli(getVetrina(),
|
||||
getNum(), false);
|
||||
if (this.theList == null)
|
||||
return 0;
|
||||
this.theList.moveFirst();
|
||||
if (this.theList.hasMoreElements()) {
|
||||
ArticoloInterface row = (ArticoloInterface)
|
||||
this.theList.nextElement();
|
||||
this.pageContext.setAttribute(getRowbeanname(), row);
|
||||
this.pageContext.setAttribute("nfV", getNf());
|
||||
this.pageContext.setAttribute("idx", String.valueOf(this.theList.getIndex()));
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getRowbeanname() {
|
||||
return (this.rowbeanname == null) ? "rowBean" : this.rowbeanname;
|
||||
}
|
||||
|
||||
public void setRowbeanname(String s) {
|
||||
this.rowbeanname = s;
|
||||
}
|
||||
|
||||
public long getVetrina() {
|
||||
return this.vetrina;
|
||||
}
|
||||
|
||||
public void setVetrina(long vetrina) {
|
||||
this.vetrina = vetrina;
|
||||
}
|
||||
|
||||
public int getNum() {
|
||||
return (this.num == 0) ? 1 : this.num;
|
||||
}
|
||||
|
||||
public void setNum(int num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public NumberFormat getNf() {
|
||||
return getApFull().getNf2();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.ablia.art.taglib;
|
||||
|
||||
import javax.servlet.jsp.tagext.TagData;
|
||||
import javax.servlet.jsp.tagext.TagExtraInfo;
|
||||
import javax.servlet.jsp.tagext.VariableInfo;
|
||||
|
||||
public class VetrinaTagExtraInfo extends TagExtraInfo {
|
||||
public VariableInfo[] getVariableInfo(TagData tagdata) {
|
||||
String rowBeanName = (tagdata.getAttributeString("rowbeanname") != null) ?
|
||||
tagdata.getAttributeString("rowbeanname") :
|
||||
"rowBean";
|
||||
String rowBeanClass = "com.ablia.art.ArticoloInterface";
|
||||
return new VariableInfo[] { new VariableInfo(rowBeanName, rowBeanClass, true,
|
||||
0),
|
||||
new VariableInfo("nfV", "java.text.NumberFormat", true,
|
||||
0),
|
||||
new VariableInfo("idx", "java.lang.String", true,
|
||||
0) };
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,111 @@
|
|||
package com.ablia.art.taglib;
|
||||
|
||||
import com.ablia.art.Articolo;
|
||||
import com.ablia.art.ArticoloCR;
|
||||
import com.ablia.taglib.AbstractDbTag;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import javax.servlet.jsp.JspException;
|
||||
|
||||
public class WhileArticoloTag extends AbstractDbTag {
|
||||
private String rowbeanname;
|
||||
|
||||
private Vectumerator theList;
|
||||
|
||||
private long flgStockOfferte;
|
||||
|
||||
private String lang;
|
||||
|
||||
private long id_tipo;
|
||||
|
||||
public int doAfterBody() throws JspException {
|
||||
try {
|
||||
boolean flgOk = false;
|
||||
Articolo obj = null;
|
||||
while (this.theList.hasMoreElements()) {
|
||||
if (!(obj = (Articolo)this.theList.nextElement()).getNome().equals(
|
||||
"")) {
|
||||
flgOk = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flgOk) {
|
||||
this.pageContext.setAttribute(getRowbeanname(), obj);
|
||||
return 2;
|
||||
}
|
||||
this.bodyContent.writeOut((Writer)this.bodyContent.getEnclosingWriter());
|
||||
return 0;
|
||||
} catch (IOException ioexception) {
|
||||
throw new JspException(ioexception.getMessage());
|
||||
} catch (Exception exception) {
|
||||
throw new JspException(exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void doInitBody() {}
|
||||
|
||||
public int doStartTag() {
|
||||
try {
|
||||
if (getId_tipo() == 0L)
|
||||
return 0;
|
||||
Articolo bean = new Articolo(getApFull());
|
||||
ArticoloCR CR = new ArticoloCR(getApFull());
|
||||
CR.setId_tipo(getId_tipo());
|
||||
CR.setFlgStockOfferte(getFlgStockOfferte());
|
||||
this.theList = bean.findByCR(CR, 0, 0);
|
||||
} catch (Exception e) {
|
||||
this.theList = new Vectumerator();
|
||||
}
|
||||
if (this.theList == null)
|
||||
return 0;
|
||||
this.pageContext.getRequest().setAttribute("listaArticoli", this.theList);
|
||||
this.theList.moveFirst();
|
||||
boolean flgOk = false;
|
||||
Articolo obj = null;
|
||||
while (this.theList.hasMoreElements()) {
|
||||
if (!(obj = (Articolo)this.theList.nextElement()).getNome().equals(
|
||||
"")) {
|
||||
flgOk = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flgOk) {
|
||||
this.pageContext.setAttribute(getRowbeanname(), obj);
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getRowbeanname() {
|
||||
return (this.rowbeanname == null) ? "rowBean" : this.rowbeanname;
|
||||
}
|
||||
|
||||
public long getFlgStockOfferte() {
|
||||
return this.flgStockOfferte;
|
||||
}
|
||||
|
||||
public void setRowbeanname(String s) {
|
||||
this.rowbeanname = s;
|
||||
}
|
||||
|
||||
public void setFlgStockOfferte(long newStock) {
|
||||
this.flgStockOfferte = newStock;
|
||||
}
|
||||
|
||||
public String getLang() {
|
||||
return (this.lang == null) ? "" : this.lang;
|
||||
}
|
||||
|
||||
public void setLang(String lang) {
|
||||
this.lang = lang;
|
||||
}
|
||||
|
||||
public long getId_tipo() {
|
||||
return this.id_tipo;
|
||||
}
|
||||
|
||||
public void setId_tipo(long id_tipo) {
|
||||
this.id_tipo = id_tipo;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.ablia.art.taglib;
|
||||
|
||||
import javax.servlet.jsp.tagext.TagData;
|
||||
import javax.servlet.jsp.tagext.TagExtraInfo;
|
||||
import javax.servlet.jsp.tagext.VariableInfo;
|
||||
|
||||
public class WhileArticoloTagExtraInfo extends TagExtraInfo {
|
||||
public VariableInfo[] getVariableInfo(TagData tagdata) {
|
||||
String rowBeanName = (tagdata.getAttributeString("rowbeanname") != null) ?
|
||||
tagdata.getAttributeString("rowbeanname") :
|
||||
"rowBean";
|
||||
String rowBeanClass = "com.ablia.art.Articolo";
|
||||
return
|
||||
new VariableInfo[] { new VariableInfo(rowBeanName, rowBeanClass, true, 0) };
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,178 @@
|
|||
package com.ablia.art.taglib;
|
||||
|
||||
import com.ablia.art.Tipo;
|
||||
import com.ablia.art.TipoCR;
|
||||
import com.ablia.taglib.AbstractDbTag;
|
||||
import com.ablia.util.Vectumerator;
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import javax.servlet.jsp.JspException;
|
||||
|
||||
public class WhileTipoTag extends AbstractDbTag {
|
||||
private String rowbeanname;
|
||||
|
||||
private Vectumerator theList;
|
||||
|
||||
private String lang;
|
||||
|
||||
private long id_tipoPadre;
|
||||
|
||||
private long id_tipoPadreSelected;
|
||||
|
||||
private long id_reparto;
|
||||
|
||||
private String flgStockOfferte;
|
||||
|
||||
private long flgWww;
|
||||
|
||||
private long limit;
|
||||
|
||||
private long start;
|
||||
|
||||
private String tag;
|
||||
|
||||
public int doAfterBody() throws JspException {
|
||||
try {
|
||||
boolean flgOk = false;
|
||||
Tipo obj = null;
|
||||
while (this.theList.hasMoreElements()) {
|
||||
obj = (Tipo)this.theList.nextElement();
|
||||
if (!obj.getDescrizione(getLang()).equals("")) {
|
||||
flgOk = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flgOk) {
|
||||
this.pageContext.setAttribute(getRowbeanname(), obj);
|
||||
return 2;
|
||||
}
|
||||
this.bodyContent.writeOut((Writer)this.bodyContent.getEnclosingWriter());
|
||||
return 0;
|
||||
} catch (IOException ioexception) {
|
||||
throw new JspException(ioexception.getMessage());
|
||||
} catch (Exception exception) {
|
||||
throw new JspException(exception.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public void doInitBody() {}
|
||||
|
||||
public int doStartTag() {
|
||||
try {
|
||||
if (getId_tipoPadre() != 0L && getId_tipoPadre() != getId_tipoPadreSelected())
|
||||
return 0;
|
||||
Tipo bean = new Tipo(getApFull());
|
||||
if (getId_tipoPadre() != 0L)
|
||||
bean.findByPrimaryKey(getId_tipoPadre());
|
||||
TipoCR CR = new TipoCR();
|
||||
CR.setFlgNascondi(0L);
|
||||
CR.setFlgEscludiWeb(0L);
|
||||
CR.setId_reparto(getId_reparto());
|
||||
CR.setFlgEscludiWeb(getFlgWww());
|
||||
CR.setLimit(getLimit());
|
||||
CR.setStart(getStart());
|
||||
CR.setTag(getTag());
|
||||
this.theList = bean.findFigli(CR, 0, 0, false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
this.theList = new Vectumerator();
|
||||
}
|
||||
if (this.theList == null)
|
||||
return 0;
|
||||
this.pageContext.getRequest().setAttribute("listaTipi", this.theList);
|
||||
this.theList.moveFirst();
|
||||
boolean flgOk = false;
|
||||
Tipo obj = null;
|
||||
while (this.theList.hasMoreElements()) {
|
||||
if (!(obj = (Tipo)this.theList.nextElement()).getDescrizione(getLang()).equals("")) {
|
||||
flgOk = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flgOk) {
|
||||
this.pageContext.setAttribute(getRowbeanname(), obj);
|
||||
return 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public String getRowbeanname() {
|
||||
return (this.rowbeanname == null) ? "rowBean" : this.rowbeanname;
|
||||
}
|
||||
|
||||
public void setRowbeanname(String s) {
|
||||
this.rowbeanname = s;
|
||||
}
|
||||
|
||||
public long getId_tipoPadreSelected() {
|
||||
return this.id_tipoPadreSelected;
|
||||
}
|
||||
|
||||
public void setId_tipoPadreSelected(long id_tipoPadreSelected) {
|
||||
this.id_tipoPadreSelected = id_tipoPadreSelected;
|
||||
}
|
||||
|
||||
public String getLang() {
|
||||
return (this.lang == null) ? "" : this.lang;
|
||||
}
|
||||
|
||||
public void setLang(String lang) {
|
||||
this.lang = lang;
|
||||
}
|
||||
|
||||
public long getId_tipoPadre() {
|
||||
return this.id_tipoPadre;
|
||||
}
|
||||
|
||||
public void setId_tipoPadre(long id_tipoPadre) {
|
||||
this.id_tipoPadre = id_tipoPadre;
|
||||
}
|
||||
|
||||
public long getId_reparto() {
|
||||
return this.id_reparto;
|
||||
}
|
||||
|
||||
public void setId_reparto(long id_reparto) {
|
||||
this.id_reparto = id_reparto;
|
||||
}
|
||||
|
||||
public String getFlgStockOfferte() {
|
||||
return (this.flgStockOfferte == null) ? "" : this.flgStockOfferte;
|
||||
}
|
||||
|
||||
public void setFlgStockOfferte(String flgStato) {
|
||||
this.flgStockOfferte = flgStato;
|
||||
}
|
||||
|
||||
public long getFlgWww() {
|
||||
return this.flgWww;
|
||||
}
|
||||
|
||||
public void setFlgWww(long flgWww) {
|
||||
this.flgWww = flgWww;
|
||||
}
|
||||
|
||||
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) ? "" : this.tag.trim();
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.ablia.art.taglib;
|
||||
|
||||
import javax.servlet.jsp.tagext.TagData;
|
||||
import javax.servlet.jsp.tagext.TagExtraInfo;
|
||||
import javax.servlet.jsp.tagext.VariableInfo;
|
||||
|
||||
public class WhileTipoTagExtraInfo extends TagExtraInfo {
|
||||
public VariableInfo[] getVariableInfo(TagData tagdata) {
|
||||
String rowBeanName = (tagdata.getAttributeString("rowbeanname") != null) ?
|
||||
tagdata.getAttributeString("rowbeanname") :
|
||||
"rowBean";
|
||||
String rowBeanClass = "com.ablia.art.Tipo";
|
||||
return
|
||||
new VariableInfo[] { new VariableInfo(rowBeanName, rowBeanClass, true, 0) };
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue