bug#15157
dev:wilian qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@96380 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
dd99d906c0
commit
10ba72d350
|
@ -0,0 +1,15 @@
|
||||||
|
/*
|
||||||
|
* To change this template, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.RutaIcmsExcepcion;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Administrador
|
||||||
|
*/
|
||||||
|
public interface RutaIcmsExcepcionDAO extends GenericDAO<RutaIcmsExcepcion, Integer> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||||
|
|
||||||
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.dao.RutaIcmsExcepcionDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.RutaIcmsExcepcion;
|
||||||
|
|
||||||
|
@Repository("rutaIcmsExcepcionDAO")
|
||||||
|
public class RutaIcmsExcepcionHibernateDAO extends GenericHibernateDAO<RutaIcmsExcepcion, Integer> implements RutaIcmsExcepcionDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public RutaIcmsExcepcionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -26,6 +26,8 @@ import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
import javax.persistence.Transient;
|
import javax.persistence.Transient;
|
||||||
|
|
||||||
|
import org.hibernate.annotations.Where;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Rafius
|
* @author Rafius
|
||||||
|
@ -135,6 +137,10 @@ public class Ruta implements Serializable, Comparable<Ruta> {
|
||||||
@OneToMany(mappedBy = "ruta", cascade = CascadeType.ALL)
|
@OneToMany(mappedBy = "ruta", cascade = CascadeType.ALL)
|
||||||
private List<RutaEmbarqueDesembarque> lsRutaEmbarqueDesembarque;
|
private List<RutaEmbarqueDesembarque> lsRutaEmbarqueDesembarque;
|
||||||
|
|
||||||
|
@OneToMany(mappedBy = "ruta", cascade = CascadeType.ALL)
|
||||||
|
@Where(clause = "activo = 1")
|
||||||
|
private List<RutaIcmsExcepcion> lsRutaIcmsExcepcions;
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
private Boolean isClone;
|
private Boolean isClone;
|
||||||
|
|
||||||
|
@ -575,4 +581,12 @@ public class Ruta implements Serializable, Comparable<Ruta> {
|
||||||
public void setIndVendaEmbarcada(Boolean indVendaEmbarcada) {
|
public void setIndVendaEmbarcada(Boolean indVendaEmbarcada) {
|
||||||
this.indVendaEmbarcada = indVendaEmbarcada;
|
this.indVendaEmbarcada = indVendaEmbarcada;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<RutaIcmsExcepcion> getLsRutaIcmsExcepcions() {
|
||||||
|
return lsRutaIcmsExcepcions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLsRutaIcmsExcepcions(List<RutaIcmsExcepcion> lsRutaIcmsExcepcions) {
|
||||||
|
this.lsRutaIcmsExcepcions = lsRutaIcmsExcepcions;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,168 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.BooleanUtils;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@SequenceGenerator(name = "RUTA_ICMS_EXCEPCION_SEQ", sequenceName = "RUTA_ICMS_EXCEPCION_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "RUTA_ICMS_EXCEPCION")
|
||||||
|
public class RutaIcmsExcepcion implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "RUTA_ICMS_EXCEPCION_SEQ")
|
||||||
|
@Column(name = "RUTAICMSEXCEPCION_ID")
|
||||||
|
private Integer rutaIcmsExcepcionId;
|
||||||
|
|
||||||
|
@Column(name = "INDTRIBTARIFA")
|
||||||
|
private Boolean indTribTarifa;
|
||||||
|
|
||||||
|
@Column(name = "INDTRIBTAXAEMBARQUE")
|
||||||
|
private Boolean indTribTaxaEmbarque;
|
||||||
|
|
||||||
|
@Column(name = "INDTRIBPEDAGIO")
|
||||||
|
private Boolean indTribPedagio;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "RUTA_ID")
|
||||||
|
private Ruta ruta;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "ORIGEN_ID")
|
||||||
|
private Parada origen;
|
||||||
|
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "DESTINO_ID")
|
||||||
|
private Parada destino;
|
||||||
|
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
public Integer getRutaIcmsExcepcionId() {
|
||||||
|
return rutaIcmsExcepcionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRutaIcmsExcepcionId(Integer rutaIcmsExcepcionId) {
|
||||||
|
this.rutaIcmsExcepcionId = rutaIcmsExcepcionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIndTribTarifa() {
|
||||||
|
return BooleanUtils.toBooleanObject(indTribTarifa);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndTribTarifa(Boolean indTribTarifa) {
|
||||||
|
this.indTribTarifa = indTribTarifa;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIndTribTaxaEmbarque() {
|
||||||
|
return BooleanUtils.toBooleanObject(indTribTaxaEmbarque);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndTribTaxaEmbarque(Boolean indTribTaxaEmbarque) {
|
||||||
|
this.indTribTaxaEmbarque = indTribTaxaEmbarque;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIndTribPedagio() {
|
||||||
|
return BooleanUtils.toBooleanObject(indTribPedagio);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndTribPedagio(Boolean indTribPedagio) {
|
||||||
|
this.indTribPedagio = indTribPedagio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Ruta getRuta() {
|
||||||
|
return ruta;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRuta(Ruta ruta) {
|
||||||
|
this.ruta = ruta;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 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() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((getRutaIcmsExcepcionId() == null) ? 0 : getRutaIcmsExcepcionId().hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object obj) {
|
||||||
|
if (this == obj)
|
||||||
|
return true;
|
||||||
|
if (obj == null)
|
||||||
|
return false;
|
||||||
|
if (!(obj instanceof RutaIcmsExcepcion))
|
||||||
|
return false;
|
||||||
|
RutaIcmsExcepcion other = (RutaIcmsExcepcion) obj;
|
||||||
|
if (getRutaIcmsExcepcionId() == null) {
|
||||||
|
if (other.getRutaIcmsExcepcionId() != null)
|
||||||
|
return false;
|
||||||
|
} else if (!getRutaIcmsExcepcionId().equals(other.getRutaIcmsExcepcionId()))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.RutaIcmsExcepcion;
|
||||||
|
|
||||||
|
public interface RutaIcmsExcepcionService extends GenericService<RutaIcmsExcepcion, Integer> {
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
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.RutaIcmsExcepcionDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.RutaIcmsExcepcion;
|
||||||
|
import com.rjconsultores.ventaboletos.service.RutaIcmsExcepcionService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("rutaIcmsExcepcionService")
|
||||||
|
public class RutaIcmsExcepcionServiceImpl implements RutaIcmsExcepcionService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RutaIcmsExcepcionDAO rutaIcmsExcepcionDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<RutaIcmsExcepcion> obtenerTodos() {
|
||||||
|
return rutaIcmsExcepcionDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RutaIcmsExcepcion obtenerID(Integer id) {
|
||||||
|
return rutaIcmsExcepcionDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public RutaIcmsExcepcion suscribir(RutaIcmsExcepcion entidad) {
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
return rutaIcmsExcepcionDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public RutaIcmsExcepcion actualizacion(RutaIcmsExcepcion entidad) {
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
return rutaIcmsExcepcionDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void borrar(RutaIcmsExcepcion entidad) {
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
rutaIcmsExcepcionDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue