AL-4545
parent
feeaccb94f
commit
22e5fcbc8b
2
pom.xml
2
pom.xml
|
@ -3,7 +3,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>br.com.rjconsultores</groupId>
|
<groupId>br.com.rjconsultores</groupId>
|
||||||
<artifactId>ModelWeb</artifactId>
|
<artifactId>ModelWeb</artifactId>
|
||||||
<version>1.121.3</version>
|
<version>1.122.0</version>
|
||||||
|
|
||||||
<distributionManagement>
|
<distributionManagement>
|
||||||
<repository>
|
<repository>
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.CodigoBarraTrecho;
|
||||||
|
|
||||||
|
public interface CodigoBarraTrechoDAO extends GenericDAO<CodigoBarraTrecho, Integer> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.hibernate.Criteria;
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.hibernate.criterion.Restrictions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.CodigoBarraTrechoDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.CodigoBarraTrecho;
|
||||||
|
|
||||||
|
@Repository("codigoBarraTrechoDAO")
|
||||||
|
public class CodigoBarraTrechoHibernateDAO extends GenericHibernateDAO<CodigoBarraTrecho, Integer>
|
||||||
|
implements CodigoBarraTrechoDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public CodigoBarraTrechoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CodigoBarraTrecho> obtenerTodos() {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq(ACTIVO, Boolean.TRUE));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,171 @@
|
||||||
|
|
||||||
|
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.SequenceGenerator;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.Temporal;
|
||||||
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "CODIGOBARRATRECHO_SEQ", sequenceName = "CODIGOBARRATRECHO_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "CODIGO_BARRA_TRECHO")
|
||||||
|
public class CodigoBarraTrecho implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CODIGOBARRATRECHO_SEQ")
|
||||||
|
@Column(name = "CODIGOBARRATRECHO_ID")
|
||||||
|
private Integer codigoBarraId;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "ORIGEN_ID")
|
||||||
|
private Parada origen;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "DESTINO_ID")
|
||||||
|
private Parada destino;
|
||||||
|
|
||||||
|
@JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID")
|
||||||
|
@ManyToOne
|
||||||
|
private Empresa empresa;
|
||||||
|
|
||||||
|
@Column(name = "CODTERMINAL")
|
||||||
|
private String codTerminal;
|
||||||
|
|
||||||
|
@Column(name = "CODEMPRESA")
|
||||||
|
private String codEmpresa;
|
||||||
|
|
||||||
|
@Column(name = "CODRUTA")
|
||||||
|
private String codRuta;
|
||||||
|
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
public CodigoBarraTrecho() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCodigoBarraId() {
|
||||||
|
return codigoBarraId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodigoBarraId(Integer codigoBarraId) {
|
||||||
|
this.codigoBarraId = codigoBarraId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parada getOrigen() {
|
||||||
|
return origen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrigen(Parada origen) {
|
||||||
|
this.origen = origen;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Parada getDestino() {
|
||||||
|
return destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDestino(Parada destino) {
|
||||||
|
this.destino = destino;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Empresa getEmpresa() {
|
||||||
|
return empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmpresa(Empresa empresa) {
|
||||||
|
this.empresa = empresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodTerminal() {
|
||||||
|
return codTerminal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodTerminal(String codTerminal) {
|
||||||
|
this.codTerminal = codTerminal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodEmpresa() {
|
||||||
|
return codEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodEmpresa(String codEmpresa) {
|
||||||
|
this.codEmpresa = codEmpresa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCodRuta() {
|
||||||
|
return codRuta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCodRuta(String codRuta) {
|
||||||
|
this.codRuta = codRuta;
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = 0;
|
||||||
|
hash += (codigoBarraId != null ? codigoBarraId.hashCode() : 0);
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object object) {
|
||||||
|
if (!(object instanceof CodigoBarraTrecho)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
CodigoBarraTrecho other = (CodigoBarraTrecho) object;
|
||||||
|
if ((this.codigoBarraId == null && other.codigoBarraId != null)
|
||||||
|
|| (this.codigoBarraId != null && !this.codigoBarraId.equals(other.codigoBarraId))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "com.rjconsultores.ventaboletos.entidad.CodigoBarraTrecho[codigoBarraId=" + codigoBarraId + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.CodigoBarraTrecho;
|
||||||
|
|
||||||
|
public interface CodigoBarraTrechoService extends GenericService<CodigoBarraTrecho, Integer> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
|
||||||
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.CodigoBarraTrechoDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.CodigoBarraTrecho;
|
||||||
|
import com.rjconsultores.ventaboletos.service.CodigoBarraTrechoService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("codigoBarraTrechoService")
|
||||||
|
public class CodigoBarraTrechoServiceImpl implements CodigoBarraTrechoService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CodigoBarraTrechoDAO codigoBarraTrechoDAO;
|
||||||
|
|
||||||
|
public List<CodigoBarraTrecho> obtenerTodos() {
|
||||||
|
return codigoBarraTrechoDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
public CodigoBarraTrecho obtenerID(Integer id) {
|
||||||
|
return codigoBarraTrechoDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public CodigoBarraTrecho suscribir(CodigoBarraTrecho entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return codigoBarraTrechoDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public CodigoBarraTrecho actualizacion(CodigoBarraTrecho entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return codigoBarraTrechoDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void borrar(CodigoBarraTrecho entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
codigoBarraTrechoDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -166,7 +166,9 @@ public enum CustomEnum {
|
||||||
*/
|
*/
|
||||||
USA_BLOQUEIO_TRECHO_CONEXAO("usaBloqueioTrechoConexao"),
|
USA_BLOQUEIO_TRECHO_CONEXAO("usaBloqueioTrechoConexao"),
|
||||||
|
|
||||||
IS_PERMITE_ALTERAR_HORARIO_CORRIDA_COM_VENDAS("isPermiteAlterarHorarioCorridaComVendas");
|
IS_PERMITE_ALTERAR_HORARIO_CORRIDA_COM_VENDAS("isPermiteAlterarHorarioCorridaComVendas"),
|
||||||
|
|
||||||
|
PADRAO_CODIGO_BARRA_TRECHO("padraoCodigoBarraTrecho");
|
||||||
|
|
||||||
private String descricao;
|
private String descricao;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue