From dc67efb223ce7f5bc2ca4d580e2936f2be3f77b7 Mon Sep 17 00:00:00 2001 From: rodrigo Date: Thu, 2 May 2013 14:21:54 +0000 Subject: [PATCH] git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@26110 d1611594-4594-4d17-8e1d-87c2c4800839 --- .../dao/hibernate/CortesiaHibernateDAO.java | 10 +- .../entidad/CategoriaDescuento.java | 41 ++++--- .../ventaboletos/entidad/Estacion.java | 49 +++++--- .../entidad/EstacionImpresora.java | 112 ++++++++++++++++++ 4 files changed, 175 insertions(+), 37 deletions(-) create mode 100644 src/com/rjconsultores/ventaboletos/entidad/EstacionImpresora.java diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaHibernateDAO.java index 78068d3a7..e36705460 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/CortesiaHibernateDAO.java @@ -4,12 +4,8 @@ */ 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 org.hibernate.Criteria; import org.hibernate.SessionFactory; 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.stereotype.Repository; +import com.rjconsultores.ventaboletos.dao.CortesiaDAO; +import com.rjconsultores.ventaboletos.entidad.Cortesia; +import com.rjconsultores.ventaboletos.entidad.Empleado; + /** * * @author Shiro diff --git a/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java b/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java index 4c7f604dc..0967b77b3 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java +++ b/src/com/rjconsultores/ventaboletos/entidad/CategoriaDescuento.java @@ -84,7 +84,8 @@ public class CategoriaDescuento implements Serializable { private Integer tiempoActivar; @Column(name = "TIEMPODESACTIVAR") private Integer tiempoDesactivar; - + @Column(name = "INDVENTAABIERTO") + private Boolean indVentaAbierto; public enum DisponibilidadeFeriado { // Declaração dos enum @@ -111,7 +112,7 @@ public class CategoriaDescuento implements Serializable { this.valor = valor; } } - + public CategoriaDescuento() { } @@ -320,15 +321,15 @@ public class CategoriaDescuento implements Serializable { return tiempoActivar; } - public void setTiempoActivar(Integer hora,Integer minuto) { + public void setTiempoActivar(Integer hora, Integer minuto) { setTiempoDesactivar(null); - hora = (hora == null)?0:hora; - minuto = (minuto == null)?0:minuto; - - int totalMinutos = (hora*60)+minuto; - setTiempoActivar( (totalMinutos == 0)?null:totalMinutos); + hora = (hora == null) ? 0 : hora; + minuto = (minuto == null) ? 0 : minuto; + + int totalMinutos = (hora * 60) + minuto; + setTiempoActivar((totalMinutos == 0) ? null : totalMinutos); } - + public void setTiempoActivar(Integer tiempoActivar) { this.tiempoActivar = tiempoActivar; } @@ -337,16 +338,24 @@ public class CategoriaDescuento implements Serializable { return tiempoDesactivar; } - public void setTiempoDesactivar(Integer hora,Integer minuto) { + public void setTiempoDesactivar(Integer hora, Integer minuto) { setTiempoActivar(null); - hora = (hora == null)?0:hora; - minuto = (minuto == null)?0:minuto; - - int totalMinutos = (hora*60)+minuto; - setTiempoDesactivar( (totalMinutos == 0)?null:totalMinutos); + hora = (hora == null) ? 0 : hora; + minuto = (minuto == null) ? 0 : minuto; + + int totalMinutos = (hora * 60) + minuto; + setTiempoDesactivar((totalMinutos == 0) ? null : totalMinutos); } - + public void setTiempoDesactivar(Integer tiempoDesactivar) { this.tiempoDesactivar = tiempoDesactivar; } + + public Boolean getIndVentaAbierto() { + return indVentaAbierto; + } + + public void setIndVentaAbierto(Boolean indVentaAbierto) { + this.indVentaAbierto = indVentaAbierto; + } } diff --git a/src/com/rjconsultores/ventaboletos/entidad/Estacion.java b/src/com/rjconsultores/ventaboletos/entidad/Estacion.java index 20fc2b843..7422c6692 100644 --- a/src/com/rjconsultores/ventaboletos/entidad/Estacion.java +++ b/src/com/rjconsultores/ventaboletos/entidad/Estacion.java @@ -6,7 +6,6 @@ package com.rjconsultores.ventaboletos.entidad; import java.io.Serializable; import java.util.ArrayList; -import java.util.Collections; import java.util.Date; import java.util.List; @@ -75,17 +74,17 @@ public class Estacion implements Serializable { private String nomeArquivoLayout; @Column(name = "NOMEIMPRESSORARELATORIO") private String nomeImpressoraRelatorio; - @OneToMany(mappedBy = "estacion", cascade = CascadeType.ALL,fetch=FetchType.EAGER) + @OneToMany(mappedBy = "estacion", cascade = CascadeType.ALL, fetch = FetchType.EAGER) private List estacionSitefList; - + @OneToMany(mappedBy = "estacion", cascade = CascadeType.ALL) + private List lsEstacionImpresora; public Estacion() { - } - + public Estacion(Integer estacionId) { this.estacionId = estacionId; - + } public Integer getEstacionId() { @@ -200,7 +199,6 @@ public class Estacion implements Serializable { this.nomeImpressoraRelatorio = nomeImpressoraRelatorio; } - @Override public int hashCode() { int hash = 0; @@ -220,25 +218,44 @@ public class Estacion implements Serializable { return true; } - @Override - public String toString() { - return "com.rjconsultores.ventaboletos.entidad.Estacion[estacionId=" + estacionId + "]"; - } - public List getEstacionSitefList() { List tmp = new ArrayList(); - - if(estacionSitefList != null){ - for(EstacionSitef es:estacionSitefList){ - if (es.getActivo()){ + + if (estacionSitefList != null) { + for (EstacionSitef es : estacionSitefList) { + if (es.getActivo()) { tmp.add(es); } } } + return tmp; } public void setEstacionSitefList(List estacionSitefList) { this.estacionSitefList = estacionSitefList; } + + public List getLsEstacionImpresora() { + List tmp = new ArrayList(); + + if (lsEstacionImpresora != null) { + for (EstacionImpresora es : lsEstacionImpresora) { + if (es.getActivo()) { + tmp.add(es); + } + } + } + + return tmp; + } + + public void setLsEstacionImpresora(List lsEstacionImpresora) { + this.lsEstacionImpresora = lsEstacionImpresora; + } + + @Override + public String toString() { + return "com.rjconsultores.ventaboletos.entidad.Estacion[estacionId=" + estacionId + "]"; + } } diff --git a/src/com/rjconsultores/ventaboletos/entidad/EstacionImpresora.java b/src/com/rjconsultores/ventaboletos/entidad/EstacionImpresora.java new file mode 100644 index 000000000..d625d4d57 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/entidad/EstacionImpresora.java @@ -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; + } +}