git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@26110 d1611594-4594-4d17-8e1d-87c2c4800839
parent
d86a5c5402
commit
dc67efb223
|
@ -4,12 +4,8 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.CortesiaDAO;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Cortesia;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.CortesiaBeneficiario;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empleado;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.Criteria;
|
import org.hibernate.Criteria;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
import org.hibernate.criterion.Restrictions;
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
@ -17,6 +13,10 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.CortesiaDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Cortesia;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Empleado;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Shiro
|
* @author Shiro
|
||||||
|
|
|
@ -84,7 +84,8 @@ public class CategoriaDescuento implements Serializable {
|
||||||
private Integer tiempoActivar;
|
private Integer tiempoActivar;
|
||||||
@Column(name = "TIEMPODESACTIVAR")
|
@Column(name = "TIEMPODESACTIVAR")
|
||||||
private Integer tiempoDesactivar;
|
private Integer tiempoDesactivar;
|
||||||
|
@Column(name = "INDVENTAABIERTO")
|
||||||
|
private Boolean indVentaAbierto;
|
||||||
|
|
||||||
public enum DisponibilidadeFeriado {
|
public enum DisponibilidadeFeriado {
|
||||||
// Declaração dos enum
|
// Declaração dos enum
|
||||||
|
@ -111,7 +112,7 @@ public class CategoriaDescuento implements Serializable {
|
||||||
this.valor = valor;
|
this.valor = valor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CategoriaDescuento() {
|
public CategoriaDescuento() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,15 +321,15 @@ public class CategoriaDescuento implements Serializable {
|
||||||
return tiempoActivar;
|
return tiempoActivar;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTiempoActivar(Integer hora,Integer minuto) {
|
public void setTiempoActivar(Integer hora, Integer minuto) {
|
||||||
setTiempoDesactivar(null);
|
setTiempoDesactivar(null);
|
||||||
hora = (hora == null)?0:hora;
|
hora = (hora == null) ? 0 : hora;
|
||||||
minuto = (minuto == null)?0:minuto;
|
minuto = (minuto == null) ? 0 : minuto;
|
||||||
|
|
||||||
int totalMinutos = (hora*60)+minuto;
|
int totalMinutos = (hora * 60) + minuto;
|
||||||
setTiempoActivar( (totalMinutos == 0)?null:totalMinutos);
|
setTiempoActivar((totalMinutos == 0) ? null : totalMinutos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTiempoActivar(Integer tiempoActivar) {
|
public void setTiempoActivar(Integer tiempoActivar) {
|
||||||
this.tiempoActivar = tiempoActivar;
|
this.tiempoActivar = tiempoActivar;
|
||||||
}
|
}
|
||||||
|
@ -337,16 +338,24 @@ public class CategoriaDescuento implements Serializable {
|
||||||
return tiempoDesactivar;
|
return tiempoDesactivar;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTiempoDesactivar(Integer hora,Integer minuto) {
|
public void setTiempoDesactivar(Integer hora, Integer minuto) {
|
||||||
setTiempoActivar(null);
|
setTiempoActivar(null);
|
||||||
hora = (hora == null)?0:hora;
|
hora = (hora == null) ? 0 : hora;
|
||||||
minuto = (minuto == null)?0:minuto;
|
minuto = (minuto == null) ? 0 : minuto;
|
||||||
|
|
||||||
int totalMinutos = (hora*60)+minuto;
|
int totalMinutos = (hora * 60) + minuto;
|
||||||
setTiempoDesactivar( (totalMinutos == 0)?null:totalMinutos);
|
setTiempoDesactivar((totalMinutos == 0) ? null : totalMinutos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTiempoDesactivar(Integer tiempoDesactivar) {
|
public void setTiempoDesactivar(Integer tiempoDesactivar) {
|
||||||
this.tiempoDesactivar = tiempoDesactivar;
|
this.tiempoDesactivar = tiempoDesactivar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getIndVentaAbierto() {
|
||||||
|
return indVentaAbierto;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndVentaAbierto(Boolean indVentaAbierto) {
|
||||||
|
this.indVentaAbierto = indVentaAbierto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -75,17 +74,17 @@ public class Estacion implements Serializable {
|
||||||
private String nomeArquivoLayout;
|
private String nomeArquivoLayout;
|
||||||
@Column(name = "NOMEIMPRESSORARELATORIO")
|
@Column(name = "NOMEIMPRESSORARELATORIO")
|
||||||
private String nomeImpressoraRelatorio;
|
private String nomeImpressoraRelatorio;
|
||||||
@OneToMany(mappedBy = "estacion", cascade = CascadeType.ALL,fetch=FetchType.EAGER)
|
@OneToMany(mappedBy = "estacion", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||||
private List<EstacionSitef> estacionSitefList;
|
private List<EstacionSitef> estacionSitefList;
|
||||||
|
@OneToMany(mappedBy = "estacion", cascade = CascadeType.ALL)
|
||||||
|
private List<EstacionImpresora> lsEstacionImpresora;
|
||||||
|
|
||||||
public Estacion() {
|
public Estacion() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Estacion(Integer estacionId) {
|
public Estacion(Integer estacionId) {
|
||||||
this.estacionId = estacionId;
|
this.estacionId = estacionId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getEstacionId() {
|
public Integer getEstacionId() {
|
||||||
|
@ -200,7 +199,6 @@ public class Estacion implements Serializable {
|
||||||
this.nomeImpressoraRelatorio = nomeImpressoraRelatorio;
|
this.nomeImpressoraRelatorio = nomeImpressoraRelatorio;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 0;
|
int hash = 0;
|
||||||
|
@ -220,25 +218,44 @@ public class Estacion implements Serializable {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "com.rjconsultores.ventaboletos.entidad.Estacion[estacionId=" + estacionId + "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<EstacionSitef> getEstacionSitefList() {
|
public List<EstacionSitef> getEstacionSitefList() {
|
||||||
List<EstacionSitef> tmp = new ArrayList<EstacionSitef>();
|
List<EstacionSitef> tmp = new ArrayList<EstacionSitef>();
|
||||||
|
|
||||||
if(estacionSitefList != null){
|
if (estacionSitefList != null) {
|
||||||
for(EstacionSitef es:estacionSitefList){
|
for (EstacionSitef es : estacionSitefList) {
|
||||||
if (es.getActivo()){
|
if (es.getActivo()) {
|
||||||
tmp.add(es);
|
tmp.add(es);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEstacionSitefList(List<EstacionSitef> estacionSitefList) {
|
public void setEstacionSitefList(List<EstacionSitef> estacionSitefList) {
|
||||||
this.estacionSitefList = estacionSitefList;
|
this.estacionSitefList = estacionSitefList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<EstacionImpresora> getLsEstacionImpresora() {
|
||||||
|
List<EstacionImpresora> tmp = new ArrayList<EstacionImpresora>();
|
||||||
|
|
||||||
|
if (lsEstacionImpresora != null) {
|
||||||
|
for (EstacionImpresora es : lsEstacionImpresora) {
|
||||||
|
if (es.getActivo()) {
|
||||||
|
tmp.add(es);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return tmp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLsEstacionImpresora(List<EstacionImpresora> lsEstacionImpresora) {
|
||||||
|
this.lsEstacionImpresora = lsEstacionImpresora;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "com.rjconsultores.ventaboletos.entidad.Estacion[estacionId=" + estacionId + "]";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import javax.persistence.Basic;
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.ManyToOne;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "ESTACION_IMPRESORA_SEQ", sequenceName = "ESTACION_IMPRESORA_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "ESTACION_IMPRESORA ")
|
||||||
|
public class EstacionImpresora implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "ESTACION_IMPRESORA_SEQ")
|
||||||
|
@Column(name = "ESTACIONIMPRESORA_ID")
|
||||||
|
private Integer estacionImpresoraId;
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "ESTACION_ID", referencedColumnName = "ESTACION_ID")
|
||||||
|
private Estacion estacion;
|
||||||
|
@OneToOne
|
||||||
|
@JoinColumn(name = "EMPRESA_ID")
|
||||||
|
private Empresa empresa;
|
||||||
|
@Column(name = "NOMBIMPRESORA")
|
||||||
|
private String nombImpresora;
|
||||||
|
@Column(name = "NOMBARCHIVOLAYOUT")
|
||||||
|
private String nombArchivoLayout;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
public Integer getEstacionImpresoraId() {
|
||||||
|
return estacionImpresoraId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEstacionImpresoraId(Integer estacionImpresoraId) {
|
||||||
|
this.estacionImpresoraId = estacionImpresoraId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Estacion getEstacion() {
|
||||||
|
return estacion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEstacion(Estacion estacion) {
|
||||||
|
this.estacion = estacion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNombImpresora() {
|
||||||
|
return nombImpresora;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNombImpresora(String nombImpresora) {
|
||||||
|
this.nombImpresora = nombImpresora;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNombArchivoLayout() {
|
||||||
|
return nombArchivoLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNombArchivoLayout(String nombArchivoLayout) {
|
||||||
|
this.nombArchivoLayout = nombArchivoLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getActivo() {
|
||||||
|
return activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivo(Boolean activo) {
|
||||||
|
this.activo = activo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getFecmodif() {
|
||||||
|
return fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFecmodif(Date fecmodif) {
|
||||||
|
this.fecmodif = fecmodif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUsuarioId() {
|
||||||
|
return usuarioId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
|
this.usuarioId = usuarioId;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue