Telas de Taxa de Embarque

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@20932 d1611594-4594-4d17-8e1d-87c2c4800839
master
rafael 2012-08-31 19:09:56 +00:00
parent 2d6a55be7e
commit 0114cbc3e7
10 changed files with 356 additions and 8 deletions

View File

@ -0,0 +1,20 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.rjconsultores.ventaboletos.dao;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueKm;
import java.util.List;
/**
*
* @author Desenvolvimento
*/
public interface TaxaEmbarqueKmDAO extends GenericDAO<TaxaEmbarqueKm, Integer>{
public List<TaxaEmbarqueKm> buscarPorOrgao(OrgaoConcedente orgaoconcedenteId);
}

View File

@ -0,0 +1,18 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.rjconsultores.ventaboletos.dao;
import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueParada;
import java.util.List;
/**
*
* @author Desenvolvimento
*/
public interface TaxaEmbarqueParadaDAO extends GenericDAO<TaxaEmbarqueParada, Integer> {
public List<TaxaEmbarqueParada> buscarPorLocalidade(Parada parada);
}

View File

@ -0,0 +1,38 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.rjconsultores.ventaboletos.dao.hibernate;
import com.rjconsultores.ventaboletos.dao.TaxaEmbarqueKmDAO;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueKm;
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;
/**
*
* @author Desenvolvimento
*/
@Repository("taxaEmbarqueKmDAO")
public class TaxaEmbarqueKmHibernateDAO extends GenericHibernateDAO<TaxaEmbarqueKm, Integer>
implements TaxaEmbarqueKmDAO {
@Autowired
public TaxaEmbarqueKmHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
setSessionFactory(factory);
}
public List<TaxaEmbarqueKm> buscarPorOrgao(OrgaoConcedente orgaoconcedenteId) {
Criteria c = getSession().createCriteria(getPersistentClass());
c.add(Restrictions.eq("activo", Boolean.TRUE));
c.add(Restrictions.eq("orgaoconcedenteId", orgaoconcedenteId));
return c.list();
}
}

View File

@ -0,0 +1,38 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.rjconsultores.ventaboletos.dao.hibernate;
import com.rjconsultores.ventaboletos.dao.TaxaEmbarqueParadaDAO;
import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueParada;
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;
/**
*
* @author Desenvolvimento
*/
@Repository("taxaEmbarqueParadaDAO")
public class TaxaEmbarqueParadaHibernateDAO extends GenericHibernateDAO<TaxaEmbarqueParada, Integer>
implements TaxaEmbarqueParadaDAO {
@Autowired
public TaxaEmbarqueParadaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
setSessionFactory(factory);
}
public List<TaxaEmbarqueParada> buscarPorLocalidade(Parada parada) {
Criteria c = getSession().createCriteria(getPersistentClass());
c.add(Restrictions.eq("activo", Boolean.TRUE));
c.add(Restrictions.eq("paradaId", parada));
return c.list();
}
}

View File

@ -6,27 +6,33 @@ package com.rjconsultores.ventaboletos.entidad;
import java.io.Serializable;
import java.math.BigDecimal;
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.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
*
* @author gleimar
*/
@Entity
@SequenceGenerator(name = "TAXA_EMBARQUE_KM_SEQ", sequenceName = "TAXA_EMBARQUE_KM_SEQ", allocationSize = 1)
@Table(name = "TAXA_EMBARQUE_KM")
public class TaxaEmbarqueKm implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "TAXA_EMBARQUE_KM_SEQ")
@Column(name = "TAXAEMBARQUEKM_ID")
private Integer taxaembarquekmId;
@Column(name = "KMATE")
@ -37,6 +43,13 @@ public class TaxaEmbarqueKm implements Serializable {
@JoinColumn(name = "ORGAOCONCEDENTE_ID", referencedColumnName = "ORGAOCONCEDENTE_ID")
@ManyToOne
private OrgaoConcedente orgaoconcedenteId;
@Column(name = "ACTIVO")
private Boolean activo;
@Column(name = "FECMODIF")
@Temporal(TemporalType.TIMESTAMP)
private Date fecmodif;
@Column(name = "USUARIO_ID")
private Integer usuarioId;
public TaxaEmbarqueKm() {
}
@ -77,6 +90,30 @@ public class TaxaEmbarqueKm implements Serializable {
this.orgaoconcedenteId = orgaoconcedenteId;
}
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;
@ -101,5 +138,4 @@ public class TaxaEmbarqueKm implements Serializable {
public String toString() {
return "com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueKm[ taxaembarquekmId=" + taxaembarquekmId + " ]";
}
}

View File

@ -6,27 +6,33 @@ package com.rjconsultores.ventaboletos.entidad;
import java.io.Serializable;
import java.math.BigDecimal;
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.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
*
* @author gleimar
*/
@Entity
@SequenceGenerator(name = "TAXA_EMBARQUE_PARADA_SEQ", sequenceName = "TAXA_EMBARQUE_PARADA_SEQ", allocationSize = 1)
@Table(name = "TAXA_EMBARQUE_PARADA")
public class TaxaEmbarqueParada implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "TAXA_EMBARQUE_PARADA_SEQ")
@Column(name = "TAXAEMBARQUEPARADA_ID")
private Integer taxaembarqueparadaId;
@Basic(optional = false)
@ -43,6 +49,13 @@ public class TaxaEmbarqueParada implements Serializable {
@JoinColumn(name = "ORGAOCONCEDENTE_ID", referencedColumnName = "ORGAOCONCEDENTE_ID")
@ManyToOne
private OrgaoConcedente orgaoconcedenteId;
@Column(name = "ACTIVO")
private Boolean activo;
@Column(name = "FECMODIF")
@Temporal(TemporalType.TIMESTAMP)
private Date fecmodif;
@Column(name = "USUARIO_ID")
private Integer usuarioId;
public TaxaEmbarqueParada() {
}
@ -104,6 +117,30 @@ public class TaxaEmbarqueParada implements Serializable {
this.orgaoconcedenteId = orgaoconcedenteId;
}
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;
@ -128,5 +165,4 @@ public class TaxaEmbarqueParada implements Serializable {
public String toString() {
return "com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueParada[ taxaembarqueparadaId=" + taxaembarqueparadaId + " ]";
}
}

View File

@ -0,0 +1,20 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.rjconsultores.ventaboletos.service;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueKm;
import java.util.List;
/**
*
* @author Desenvolvimento
*/
public interface TaxaEmbarqueKmService extends GenericService<TaxaEmbarqueKm, Integer>{
public List<TaxaEmbarqueKm> buscarPorOrgao(OrgaoConcedente orgaoconcedenteId);
}

View File

@ -0,0 +1,18 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.rjconsultores.ventaboletos.service;
import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueParada;
import java.util.List;
/**
*
* @author Desenvolvimento
*/
public interface TaxaEmbarqueParadaService extends GenericService<TaxaEmbarqueParada, Integer> {
public List<TaxaEmbarqueParada> buscarPorLocalidade(Parada parada);
}

View File

@ -0,0 +1,62 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.rjconsultores.ventaboletos.service.impl;
import com.rjconsultores.ventaboletos.dao.TaxaEmbarqueKmDAO;
import com.rjconsultores.ventaboletos.entidad.OrgaoConcedente;
import com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueKm;
import com.rjconsultores.ventaboletos.service.TaxaEmbarqueKmService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
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;
/**
*
* @author Desenvolvimento
*/
@Service("taxaEmbarqueKmService")
public class TaxaEmbarqueKmServiceImpl implements TaxaEmbarqueKmService {
@Autowired
private TaxaEmbarqueKmDAO taxaEmbarqueKmDAO;
public List<TaxaEmbarqueKm> obtenerTodos() {
return taxaEmbarqueKmDAO.obtenerTodos();
}
public TaxaEmbarqueKm obtenerID(Integer id) {
return taxaEmbarqueKmDAO.obtenerID(id);
}
@Transactional
public TaxaEmbarqueKm suscribir(TaxaEmbarqueKm entidad) {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
return taxaEmbarqueKmDAO.suscribir(entidad);
}
@Transactional
public TaxaEmbarqueKm actualizacion(TaxaEmbarqueKm entidad) {
return taxaEmbarqueKmDAO.actualizacion(entidad);
}
@Transactional
public void borrar(TaxaEmbarqueKm entidad) {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.FALSE);
taxaEmbarqueKmDAO.borrar(entidad);
}
public List<TaxaEmbarqueKm> buscarPorOrgao(OrgaoConcedente orgaoconcedenteId) {
return taxaEmbarqueKmDAO.buscarPorOrgao(orgaoconcedenteId);
}
}

View File

@ -0,0 +1,62 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.rjconsultores.ventaboletos.service.impl;
import com.rjconsultores.ventaboletos.dao.TaxaEmbarqueParadaDAO;
import com.rjconsultores.ventaboletos.entidad.Parada;
import com.rjconsultores.ventaboletos.entidad.TaxaEmbarqueParada;
import com.rjconsultores.ventaboletos.service.TaxaEmbarqueParadaService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
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;
/**
*
* @author Desenvolvimento
*/
@Service("taxaEmbarqueParadaService")
public class TaxaEmbarqueParadaServiceImpl implements TaxaEmbarqueParadaService {
@Autowired
private TaxaEmbarqueParadaDAO taxaEmbarqueParadaDAO;
public List<TaxaEmbarqueParada> obtenerTodos() {
return taxaEmbarqueParadaDAO.obtenerTodos();
}
public TaxaEmbarqueParada obtenerID(Integer id) {
return taxaEmbarqueParadaDAO.obtenerID(id);
}
@Transactional
public TaxaEmbarqueParada suscribir(TaxaEmbarqueParada entidad) {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.TRUE);
return taxaEmbarqueParadaDAO.suscribir(entidad);
}
@Transactional
public TaxaEmbarqueParada actualizacion(TaxaEmbarqueParada entidad) {
return taxaEmbarqueParadaDAO.actualizacion(entidad);
}
@Transactional
public void borrar(TaxaEmbarqueParada entidad) {
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
entidad.setFecmodif(Calendar.getInstance().getTime());
entidad.setActivo(Boolean.FALSE);
taxaEmbarqueParadaDAO.borrar(entidad);
}
public List<TaxaEmbarqueParada> buscarPorLocalidade(Parada parada) {
return taxaEmbarqueParadaDAO.buscarPorLocalidade(parada);
}
}