Pacote - Cria configuração de pacotes (bug #6041)
Merge com a trunk git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@41520 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
1d368a768d
commit
786ef5c1ee
|
@ -0,0 +1,12 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ItemAdicional;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
|
||||
public interface ItemAdicionalDAO extends GenericDAO<ItemAdicional, Integer> {
|
||||
|
||||
public List<ItemAdicional> buscaItemAdicionalPacote(Pacote pacote);
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
|
||||
public interface PacoteDAO extends GenericDAO<Pacote, Integer> {
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ItemAdicional;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteItem;
|
||||
|
||||
public interface PacoteItemDAO extends GenericDAO<PacoteItem, Integer> {
|
||||
|
||||
public PacoteItem buscaPacoteItem(Pacote pacote, ItemAdicional item);
|
||||
|
||||
public List<PacoteItem> buscaItensPacote(Pacote pacote);
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteTarifa;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
|
||||
|
||||
public interface PacoteTarifaDAO extends GenericDAO<PacoteTarifa, Integer> {
|
||||
|
||||
public PacoteTarifa buscaPacoteTarifa(Pacote pacote, TipoTarifaPacote tipoTarifaPacote);
|
||||
|
||||
public List<PacoteTarifa> buscaTarifasPacote(Pacote pacote);
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
|
||||
|
||||
public interface TipoTarifaPacoteDAO extends GenericDAO<TipoTarifaPacote, Integer> {
|
||||
|
||||
public List<TipoTarifaPacote> buscaTipoTarifaPacote(Pacote pacote);
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.Order;
|
||||
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.ItemAdicionalDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.ItemAdicional;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
|
||||
@Repository("itemAdicionalDAO")
|
||||
public class ItemAdicionalHibernateDAO extends GenericHibernateDAO<ItemAdicional, Integer> implements ItemAdicionalDAO {
|
||||
|
||||
@Autowired
|
||||
public ItemAdicionalHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<ItemAdicional> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.addOrder(Order.asc("descitemadicional"));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<ItemAdicional> buscaItemAdicionalPacote(Pacote pacote) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" select pi.itemAdicional ");
|
||||
sb.append(" from PacoteItem pi ");
|
||||
sb.append(" where pi.pacote.pacoteId = :pacoteId ");
|
||||
sb.append(" and pi.activo = 1 ");
|
||||
|
||||
Query query = getSession().createQuery(sb.toString());
|
||||
query.setInteger("pacoteId", pacote.getPacoteId());
|
||||
|
||||
return query.list();
|
||||
}
|
||||
|
||||
}
|
|
@ -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.PacoteDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
|
||||
@Repository("pacoteDAO")
|
||||
public class PacoteHibernateDAO extends GenericHibernateDAO<Pacote, Integer> implements PacoteDAO {
|
||||
|
||||
@Autowired
|
||||
public PacoteHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Query;
|
||||
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.PacoteItemDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.ItemAdicional;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteItem;
|
||||
|
||||
@Repository("pacoteItemDAO")
|
||||
public class PacoteItemHibernateDAO extends GenericHibernateDAO<PacoteItem, Integer> implements PacoteItemDAO {
|
||||
|
||||
@Autowired
|
||||
public PacoteItemHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacoteItem buscaPacoteItem(Pacote pacote, ItemAdicional item) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" from PacoteItem pi ");
|
||||
sb.append(" where pi.pacote.pacoteId = :pacoteId ");
|
||||
sb.append(" and pi.itemAdicional.itemadicionalId = :itemadicionalId ");
|
||||
sb.append(" and pi.activo = 1 ");
|
||||
|
||||
Query query = getSession().createQuery(sb.toString());
|
||||
query.setInteger("pacoteId", pacote.getPacoteId());
|
||||
query.setInteger("itemadicionalId", item.getItemadicionalId());
|
||||
|
||||
return (PacoteItem) query.uniqueResult();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<PacoteItem> buscaItensPacote(Pacote pacote) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" from PacoteItem pi ");
|
||||
sb.append(" where pi.pacote.pacoteId = :pacoteId ");
|
||||
sb.append(" and pi.activo = 1 ");
|
||||
|
||||
Query query = getSession().createQuery(sb.toString());
|
||||
query.setInteger("pacoteId", pacote.getPacoteId());
|
||||
|
||||
return query.list();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Query;
|
||||
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.PacoteTarifaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteTarifa;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
|
||||
|
||||
@Repository("pacoteTarifaDAO")
|
||||
public class PacoteTarifaHibernateDAO extends GenericHibernateDAO<PacoteTarifa, Integer> implements PacoteTarifaDAO {
|
||||
|
||||
@Autowired
|
||||
public PacoteTarifaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacoteTarifa buscaPacoteTarifa(Pacote pacote, TipoTarifaPacote tipoTarifaPacote) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" from PacoteTarifa pt ");
|
||||
sb.append(" where pt.pacote.pacoteId = :pacoteId ");
|
||||
sb.append(" and pt.tipoTarifaPacote.tipotarifapacoteId = :tipotarifapacoteId ");
|
||||
sb.append(" and pt.activo = 1 ");
|
||||
|
||||
Query query = getSession().createQuery(sb.toString());
|
||||
query.setInteger("pacoteId", pacote.getPacoteId());
|
||||
query.setInteger("tipotarifapacoteId", tipoTarifaPacote.getTipotarifapacoteId());
|
||||
|
||||
return (PacoteTarifa) query.uniqueResult();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<PacoteTarifa> buscaTarifasPacote(Pacote pacote) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" from PacoteTarifa pt ");
|
||||
sb.append(" where pt.pacote.pacoteId = :pacoteId ");
|
||||
sb.append(" and pt.activo = 1 ");
|
||||
|
||||
Query query = getSession().createQuery(sb.toString());
|
||||
query.setInteger("pacoteId", pacote.getPacoteId());
|
||||
|
||||
return query.list();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.Query;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.Order;
|
||||
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.TipoTarifaPacoteDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
|
||||
|
||||
@Repository("tipoTarifaPacoteDAO")
|
||||
public class TipoTarifaPacoteHibernateDAO extends GenericHibernateDAO<TipoTarifaPacote, Integer>
|
||||
implements TipoTarifaPacoteDAO {
|
||||
|
||||
@Autowired
|
||||
public TipoTarifaPacoteHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<TipoTarifaPacote> obtenerTodos() {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.addOrder(Order.asc("desctipotarifa"));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public List<TipoTarifaPacote> buscaTipoTarifaPacote(Pacote pacote) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" select pt.tipoTarifaPacote ");
|
||||
sb.append(" from PacoteTarifa pt ");
|
||||
sb.append(" where pt.pacote.pacoteId = :pacoteId ");
|
||||
sb.append(" and pt.activo = 1 ");
|
||||
|
||||
Query query = getSession().createQuery(sb.toString());
|
||||
query.setInteger("pacoteId", pacote.getPacoteId());
|
||||
|
||||
return query.list();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,136 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
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.JoinTable;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@Table(name = "ITEM_ADICIONAL")
|
||||
@SequenceGenerator(name = "ITEM_ADICIONAL_SEQ", sequenceName = "ITEM_ADICIONAL_SEQ", allocationSize = 1)
|
||||
public class ItemAdicional implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "ITEM_ADICIONAL_SEQ")
|
||||
@Column(name = "ITEMADICIONAL_ID")
|
||||
private Integer itemadicionalId;
|
||||
@Column(name = "DESCITEMADICIONAL")
|
||||
private String descitemadicional;
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@ManyToMany
|
||||
@JoinTable(name = "PACOTE_ITEM", joinColumns = { @JoinColumn(name = "ITEMADICIONAL_ID") },
|
||||
inverseJoinColumns = { @JoinColumn(name = "PACOTE_ID") })
|
||||
private List<Pacote> pacoteList;
|
||||
|
||||
public ItemAdicional() {
|
||||
}
|
||||
|
||||
public ItemAdicional(Integer itemadicionalId, String descitemadicional, Boolean activo, Date fecmodif, Integer usuarioId) {
|
||||
super();
|
||||
this.itemadicionalId = itemadicionalId;
|
||||
this.descitemadicional = descitemadicional;
|
||||
this.activo = activo;
|
||||
this.fecmodif = fecmodif;
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
public Integer getItemadicionalId() {
|
||||
return itemadicionalId;
|
||||
}
|
||||
|
||||
public void setItemadicionalId(Integer itemadicionalId) {
|
||||
this.itemadicionalId = itemadicionalId;
|
||||
}
|
||||
|
||||
public String getDescitemadicional() {
|
||||
return descitemadicional;
|
||||
}
|
||||
|
||||
public void setDescitemadicional(String descitemadicional) {
|
||||
this.descitemadicional = descitemadicional;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public List<Pacote> getPacoteList() {
|
||||
return pacoteList;
|
||||
}
|
||||
|
||||
public void setPacoteList(List<Pacote> pacoteList) {
|
||||
this.pacoteList = pacoteList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((itemadicionalId == null) ? 0 : itemadicionalId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
ItemAdicional other = (ItemAdicional) obj;
|
||||
if (itemadicionalId == null) {
|
||||
if (other.itemadicionalId != null)
|
||||
return false;
|
||||
} else if (!itemadicionalId.equals(other.itemadicionalId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getDescitemadicional() + " - " + this.getItemadicionalId();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,200 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
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.JoinTable;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@Table(name = "PACOTE")
|
||||
@SequenceGenerator(name = "PACOTE_SEQ", sequenceName = "PACOTE_SEQ", allocationSize = 1)
|
||||
public class Pacote implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "PACOTE_SEQ")
|
||||
@Column(name = "PACOTE_ID")
|
||||
private Integer pacoteId;
|
||||
@Column(name = "NOMPACOTE")
|
||||
private String nompacote;
|
||||
@Column(name = "DESCPACOTE")
|
||||
private String descpacote;
|
||||
@Column(name = "INDVENDAAGENCIA")
|
||||
private Boolean indvendaagencia;
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@JoinColumn(name = "RUTA_ID", referencedColumnName = "RUTA_ID")
|
||||
@ManyToOne
|
||||
private Ruta ruta;
|
||||
@ManyToMany
|
||||
@JoinTable(name = "PACOTE_ITEM", joinColumns = { @JoinColumn(name = "PACOTE_ID") },
|
||||
inverseJoinColumns = { @JoinColumn(name = "ITEMADICIONAL_ID") })
|
||||
private List<ItemAdicional> itemAdicionalList;
|
||||
|
||||
@ManyToMany
|
||||
@JoinTable(name = "PACOTE_TARIFA", joinColumns = { @JoinColumn(name = "PACOTE_ID") },
|
||||
inverseJoinColumns = { @JoinColumn(name = "TIPOTARIFAPACOTE_ID") })
|
||||
private List<TipoTarifaPacote> tipoTarifaPacoteList;
|
||||
|
||||
public Pacote() {
|
||||
}
|
||||
|
||||
public Pacote(Integer pacoteId, String nompacote, String descpacote, Boolean indvendaagencia, Boolean activo, Date fecmodif, Integer usuarioId, Ruta ruta) {
|
||||
this.pacoteId = pacoteId;
|
||||
this.nompacote = nompacote;
|
||||
this.descpacote = descpacote;
|
||||
this.indvendaagencia = indvendaagencia;
|
||||
this.activo = activo;
|
||||
this.fecmodif = fecmodif;
|
||||
this.usuarioId = usuarioId;
|
||||
this.ruta = ruta;
|
||||
}
|
||||
|
||||
public Integer getPacoteId() {
|
||||
return pacoteId;
|
||||
}
|
||||
|
||||
public void setPacoteId(Integer pacoteId) {
|
||||
this.pacoteId = pacoteId;
|
||||
}
|
||||
|
||||
public String getNompacote() {
|
||||
return nompacote;
|
||||
}
|
||||
|
||||
public void setNompacote(String nompacote) {
|
||||
this.nompacote = nompacote;
|
||||
}
|
||||
|
||||
public String getDescpacote() {
|
||||
return descpacote;
|
||||
}
|
||||
|
||||
public void setDescpacote(String descpacote) {
|
||||
this.descpacote = descpacote;
|
||||
}
|
||||
|
||||
public Boolean getIndvendaagencia() {
|
||||
return indvendaagencia;
|
||||
}
|
||||
|
||||
public void setIndvendaagencia(Boolean indvendaagencia) {
|
||||
this.indvendaagencia = indvendaagencia;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public Ruta getRuta() {
|
||||
return ruta;
|
||||
}
|
||||
|
||||
public void setRuta(Ruta ruta) {
|
||||
this.ruta = ruta;
|
||||
}
|
||||
|
||||
public List<ItemAdicional> getItemAdicionalList() {
|
||||
if (this.itemAdicionalList == null || this.itemAdicionalList.isEmpty())
|
||||
return new ArrayList<ItemAdicional>();
|
||||
|
||||
List<ItemAdicional> aux = new ArrayList<ItemAdicional>();
|
||||
for (ItemAdicional item : this.itemAdicionalList) {
|
||||
if (item.getActivo())
|
||||
aux.add(item);
|
||||
}
|
||||
return aux;
|
||||
}
|
||||
|
||||
public void setItemAdicionalList(List<ItemAdicional> itemAdicionalList) {
|
||||
this.itemAdicionalList = itemAdicionalList;
|
||||
}
|
||||
|
||||
public List<TipoTarifaPacote> getTipoTarifaPacoteList() {
|
||||
if (this.tipoTarifaPacoteList == null || this.tipoTarifaPacoteList.isEmpty())
|
||||
return new ArrayList<TipoTarifaPacote>();
|
||||
|
||||
List<TipoTarifaPacote> aux = new ArrayList<TipoTarifaPacote>();
|
||||
for (TipoTarifaPacote item : this.tipoTarifaPacoteList) {
|
||||
if (item.getActivo())
|
||||
aux.add(item);
|
||||
}
|
||||
return aux;
|
||||
}
|
||||
|
||||
public void setTipoTarifaPacoteList(List<TipoTarifaPacote> tipoTarifaPacoteList) {
|
||||
this.tipoTarifaPacoteList = tipoTarifaPacoteList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((pacoteId == null) ? 0 : pacoteId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
Pacote other = (Pacote) obj;
|
||||
if (pacoteId == null) {
|
||||
if (other.pacoteId != null)
|
||||
return false;
|
||||
} else if (!pacoteId.equals(other.pacoteId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Pacote [pacoteId=" + pacoteId + ", nompacote=" + nompacote + ", descpacote=" + descpacote + ", indvendaagencia=" + indvendaagencia + ", activo=" + activo + ", fecmodif=" + fecmodif + ", usuarioId=" + usuarioId + ", ruta=" + ruta + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
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
|
||||
@Table(name = "PACOTE_ITEM")
|
||||
@SequenceGenerator(name = "PACOTE_ITEM_SEQ", sequenceName = "PACOTE_ITEM_SEQ", allocationSize = 1)
|
||||
public class PacoteItem implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "PACOTE_ITEM_SEQ")
|
||||
@Column(name = "PACOTEITEM_ID")
|
||||
private Integer pacoteItemId;
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@JoinColumn(name = "PACOTE_ID", referencedColumnName = "PACOTE_ID")
|
||||
@ManyToOne
|
||||
private Pacote pacote;
|
||||
@JoinColumn(name = "ITEMADICIONAL_ID", referencedColumnName = "ITEMADICIONAL_ID")
|
||||
@ManyToOne
|
||||
private ItemAdicional itemAdicional;
|
||||
|
||||
public PacoteItem() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Integer getPacoteItemId() {
|
||||
return pacoteItemId;
|
||||
}
|
||||
|
||||
public void setPacoteItemId(Integer pacoteItemId) {
|
||||
this.pacoteItemId = pacoteItemId;
|
||||
}
|
||||
|
||||
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 + ((pacoteItemId == null) ? 0 : pacoteItemId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
public Pacote getPacote() {
|
||||
return pacote;
|
||||
}
|
||||
|
||||
public void setPacote(Pacote pacote) {
|
||||
this.pacote = pacote;
|
||||
}
|
||||
|
||||
public ItemAdicional getItemAdicional() {
|
||||
return itemAdicional;
|
||||
}
|
||||
|
||||
public void setItemAdicional(ItemAdicional itemAdicional) {
|
||||
this.itemAdicional = itemAdicional;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
PacoteItem other = (PacoteItem) obj;
|
||||
if (pacoteItemId == null) {
|
||||
if (other.pacoteItemId != null)
|
||||
return false;
|
||||
} else if (!pacoteItemId.equals(other.pacoteItemId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PacoteItem [pacoteItemId=" + pacoteItemId + ", activo=" + activo + ", fecmodif=" + fecmodif + ", usuarioId=" + usuarioId + ", pacoteId=" + pacote + ", itemadicionalId=" + itemAdicional + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,145 @@
|
|||
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.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@Table(name = "PACOTE_TARIFA")
|
||||
@SequenceGenerator(name = "PACOTE_TARIFA_SEQ", sequenceName = "PACOTE_TARIFA_SEQ", allocationSize = 1)
|
||||
public class PacoteTarifa implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "PACOTE_TARIFA_SEQ")
|
||||
@Column(name = "PACOTETARIFA_ID ")
|
||||
private Integer pacotetarifaId;
|
||||
@Column(name = "TARIFA")
|
||||
private BigDecimal tarifa;
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@JoinColumn(name = "PACOTE_ID", referencedColumnName = "PACOTE_ID")
|
||||
@ManyToOne
|
||||
private Pacote pacote;
|
||||
@JoinColumn(name = "TIPOTARIFAPACOTE_ID", referencedColumnName = "TIPOTARIFAPACOTE_ID")
|
||||
@ManyToOne
|
||||
private TipoTarifaPacote tipoTarifaPacote;
|
||||
|
||||
public PacoteTarifa() {
|
||||
super();
|
||||
}
|
||||
|
||||
public PacoteTarifa(Integer pacotetarifaId, Boolean activo, Date fecmodif, Integer usuarioId) {
|
||||
super();
|
||||
this.pacotetarifaId = pacotetarifaId;
|
||||
this.activo = activo;
|
||||
this.fecmodif = fecmodif;
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
public Integer getPacotetarifaId() {
|
||||
return pacotetarifaId;
|
||||
}
|
||||
|
||||
public void setPacotetarifaId(Integer pacotetarifaId) {
|
||||
this.pacotetarifaId = pacotetarifaId;
|
||||
}
|
||||
|
||||
public BigDecimal getTarifa() {
|
||||
return tarifa;
|
||||
}
|
||||
|
||||
public void setTarifa(BigDecimal tarifa) {
|
||||
this.tarifa = tarifa;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public Pacote getPacote() {
|
||||
return pacote;
|
||||
}
|
||||
|
||||
public void setPacote(Pacote pacote) {
|
||||
this.pacote = pacote;
|
||||
}
|
||||
|
||||
public TipoTarifaPacote getTipoTarifaPacote() {
|
||||
return tipoTarifaPacote;
|
||||
}
|
||||
|
||||
public void setTipoTarifaPacote(TipoTarifaPacote tipoTarifaPacote) {
|
||||
this.tipoTarifaPacote = tipoTarifaPacote;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((pacotetarifaId == null) ? 0 : pacotetarifaId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
PacoteTarifa other = (PacoteTarifa) obj;
|
||||
if (pacotetarifaId == null) {
|
||||
if (other.pacotetarifaId != null)
|
||||
return false;
|
||||
} else if (!pacotetarifaId.equals(other.pacotetarifaId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PacoteTarifa [pacotetarifaId=" + pacotetarifaId + ", activo=" + activo + ", fecmodif=" + fecmodif + ", usuarioId=" + usuarioId + ", pacote=" + pacote + ", tipoTarifaPacote=" + tipoTarifaPacote + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,137 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
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.JoinTable;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
@Entity
|
||||
@Table(name = "TIPO_TARIFA_PACOTE")
|
||||
@SequenceGenerator(name = "TIPO_TARIFA_PACOTE_SEQ", sequenceName = "TIPO_TARIFA_PACOTE_SEQ", allocationSize = 1)
|
||||
public class TipoTarifaPacote implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "TIPO_TARIFA_PACOTE_SEQ")
|
||||
@Column(name = "TIPOTARIFAPACOTE_ID")
|
||||
private Integer tipotarifapacoteId;
|
||||
@Column(name = "DESCTIPOTARIFA")
|
||||
private String desctipotarifa;
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@ManyToMany
|
||||
@JoinTable(name = "PACOTE_TARIFA", joinColumns = { @JoinColumn(name = "TIPOTARIFAPACOTE_ID") },
|
||||
inverseJoinColumns = { @JoinColumn(name = "PACOTE_ID") })
|
||||
private List<Pacote> pacoteList;
|
||||
|
||||
public TipoTarifaPacote() {
|
||||
super();
|
||||
}
|
||||
|
||||
public TipoTarifaPacote(Integer tipotarifapacoteId, String desctipotarifa, Boolean activo, Date fecmodif, Integer usuarioId) {
|
||||
super();
|
||||
this.tipotarifapacoteId = tipotarifapacoteId;
|
||||
this.desctipotarifa = desctipotarifa;
|
||||
this.activo = activo;
|
||||
this.fecmodif = fecmodif;
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
public Integer getTipotarifapacoteId() {
|
||||
return tipotarifapacoteId;
|
||||
}
|
||||
|
||||
public void setTipotarifapacoteId(Integer tipotarifapacoteId) {
|
||||
this.tipotarifapacoteId = tipotarifapacoteId;
|
||||
}
|
||||
|
||||
public String getDesctipotarifa() {
|
||||
return desctipotarifa;
|
||||
}
|
||||
|
||||
public void setDesctipotarifa(String desctipotarifa) {
|
||||
this.desctipotarifa = desctipotarifa;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public List<Pacote> getPacoteList() {
|
||||
return pacoteList;
|
||||
}
|
||||
|
||||
public void setPacoteList(List<Pacote> pacoteList) {
|
||||
this.pacoteList = pacoteList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((tipotarifapacoteId == null) ? 0 : tipotarifapacoteId.hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
TipoTarifaPacote other = (TipoTarifaPacote) obj;
|
||||
if (tipotarifapacoteId == null) {
|
||||
if (other.tipotarifapacoteId != null)
|
||||
return false;
|
||||
} else if (!tipotarifapacoteId.equals(other.tipotarifapacoteId))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getDesctipotarifa() + " - " + getTipotarifapacoteId();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ItemAdicional;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
|
||||
public interface ItemAdicionalService extends GenericService<ItemAdicional, Integer> {
|
||||
|
||||
public List<ItemAdicional> buscaItemAdicionalPacote(Pacote pacote);
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.ItemAdicional;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteItem;
|
||||
|
||||
public interface PacoteItemService extends GenericService<PacoteItem, Integer> {
|
||||
|
||||
public PacoteItem vincularItemPacote(PacoteItem pacoteItem, Pacote pacote, ItemAdicional item);
|
||||
|
||||
public PacoteItem buscaPacoteItem(Pacote pacote, ItemAdicional item);
|
||||
|
||||
public List<PacoteItem> buscaItensPacote(Pacote pacote);
|
||||
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
|
||||
public interface PacoteService extends GenericService<Pacote, Integer> {
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteTarifa;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
|
||||
|
||||
public interface PacoteTarifaService extends GenericService<PacoteTarifa, Integer> {
|
||||
|
||||
public PacoteTarifa vincularPacoteTarifa(PacoteTarifa pacoteTarifa, Pacote pacote, TipoTarifaPacote tipoTarifaPacote, BigDecimal tarifa);
|
||||
|
||||
public PacoteTarifa buscaPacoteTarifa(Pacote pacote, TipoTarifaPacote tipoTarifaPacote);
|
||||
|
||||
public List<PacoteTarifa> buscaTarifasPacote(Pacote pacote);
|
||||
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
|
||||
|
||||
public interface TipoTarifaPacoteService extends GenericService<TipoTarifaPacote, Integer> {
|
||||
|
||||
public List<TipoTarifaPacote> buscaTipoTarifaPacote(Pacote pacote);
|
||||
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
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.ItemAdicionalDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.ItemAdicional;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.service.ItemAdicionalService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("itemAdicionalService")
|
||||
public class ItemAdicionalServiceImpl implements ItemAdicionalService {
|
||||
|
||||
@Autowired
|
||||
private ItemAdicionalDAO itemAdicionalDAO;
|
||||
|
||||
@Override
|
||||
public List<ItemAdicional> obtenerTodos() {
|
||||
return itemAdicionalDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemAdicional obtenerID(Integer id) {
|
||||
return itemAdicionalDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public ItemAdicional suscribir(ItemAdicional entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return itemAdicionalDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public ItemAdicional actualizacion(ItemAdicional entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return itemAdicionalDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void borrar(ItemAdicional entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
itemAdicionalDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemAdicional> buscaItemAdicionalPacote(Pacote pacote) {
|
||||
return itemAdicionalDAO.buscaItemAdicionalPacote(pacote);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
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.PacoteItemDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.ItemAdicional;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteItem;
|
||||
import com.rjconsultores.ventaboletos.service.PacoteItemService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("pacoteItemService")
|
||||
public class PacoteItemServiceImpl implements PacoteItemService {
|
||||
|
||||
@Autowired
|
||||
private PacoteItemDAO pacoteItemDAO;
|
||||
|
||||
@Override
|
||||
public List<PacoteItem> obtenerTodos() {
|
||||
return pacoteItemDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacoteItem obtenerID(Integer id) {
|
||||
return pacoteItemDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public PacoteItem suscribir(PacoteItem entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return pacoteItemDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public PacoteItem actualizacion(PacoteItem entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return pacoteItemDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void borrar(PacoteItem entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
pacoteItemDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional(readOnly = false)
|
||||
@Override
|
||||
public PacoteItem vincularItemPacote(PacoteItem pacoteItem, Pacote pacote, ItemAdicional item) {
|
||||
|
||||
if (pacoteItem == null) {
|
||||
pacoteItem = new PacoteItem();
|
||||
}
|
||||
|
||||
pacoteItem.setItemAdicional(item);
|
||||
pacoteItem.setPacote(pacote);
|
||||
|
||||
if (pacoteItem.getPacoteItemId() == null) {
|
||||
return suscribir(pacoteItem);
|
||||
} else {
|
||||
return actualizacion(pacoteItem);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacoteItem buscaPacoteItem(Pacote pacote, ItemAdicional item) {
|
||||
return pacoteItemDAO.buscaPacoteItem(pacote, item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PacoteItem> buscaItensPacote(Pacote pacote) {
|
||||
return pacoteItemDAO.buscaItensPacote(pacote);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
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.PacoteDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.service.PacoteService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("pacoteService")
|
||||
public class PacoteServiceImpl implements PacoteService {
|
||||
|
||||
@Autowired
|
||||
private PacoteDAO pacoteDAO;
|
||||
|
||||
@Override
|
||||
public List<Pacote> obtenerTodos() {
|
||||
return pacoteDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pacote obtenerID(Integer id) {
|
||||
return pacoteDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Pacote suscribir(Pacote entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
|
||||
return pacoteDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Pacote actualizacion(Pacote entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
|
||||
return pacoteDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void borrar(Pacote entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
pacoteDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
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.PacoteTarifaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.PacoteTarifa;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
|
||||
import com.rjconsultores.ventaboletos.service.PacoteTarifaService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("pacoteTarifaService")
|
||||
public class PacoteTarifaServiceImpl implements PacoteTarifaService {
|
||||
|
||||
@Autowired
|
||||
private PacoteTarifaDAO pacoteTarifaDAO;
|
||||
|
||||
@Override
|
||||
public List<PacoteTarifa> obtenerTodos() {
|
||||
return pacoteTarifaDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacoteTarifa obtenerID(Integer id) {
|
||||
return pacoteTarifaDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public PacoteTarifa suscribir(PacoteTarifa entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return pacoteTarifaDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public PacoteTarifa actualizacion(PacoteTarifa entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return pacoteTarifaDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void borrar(PacoteTarifa entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
pacoteTarifaDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional(readOnly = false)
|
||||
@Override
|
||||
public PacoteTarifa vincularPacoteTarifa(PacoteTarifa pacoteTarifa, Pacote pacote, TipoTarifaPacote tipoTarifaPacote, BigDecimal tarifa) {
|
||||
|
||||
if (pacoteTarifa == null) {
|
||||
pacoteTarifa = new PacoteTarifa();
|
||||
}
|
||||
|
||||
pacoteTarifa.setTarifa(tarifa);
|
||||
pacoteTarifa.setTipoTarifaPacote(tipoTarifaPacote);
|
||||
pacoteTarifa.setPacote(pacote);
|
||||
|
||||
if (pacoteTarifa.getPacotetarifaId() == null) {
|
||||
return suscribir(pacoteTarifa);
|
||||
} else {
|
||||
return actualizacion(pacoteTarifa);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacoteTarifa buscaPacoteTarifa(Pacote pacote, TipoTarifaPacote tipoTarifaPacote) {
|
||||
return pacoteTarifaDAO.buscaPacoteTarifa(pacote, tipoTarifaPacote);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PacoteTarifa> buscaTarifasPacote(Pacote pacote) {
|
||||
return pacoteTarifaDAO.buscaTarifasPacote(pacote);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,66 @@
|
|||
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.TipoTarifaPacoteDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Pacote;
|
||||
import com.rjconsultores.ventaboletos.entidad.TipoTarifaPacote;
|
||||
import com.rjconsultores.ventaboletos.service.TipoTarifaPacoteService;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
|
||||
@Service("tipoTarifaPacoteService")
|
||||
public class TipoTarifaPacoteServiceImpl implements TipoTarifaPacoteService {
|
||||
|
||||
@Autowired
|
||||
private TipoTarifaPacoteDAO tipoTarifaPacoteDAO;
|
||||
|
||||
@Override
|
||||
public List<TipoTarifaPacote> obtenerTodos() {
|
||||
return tipoTarifaPacoteDAO.obtenerTodos();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TipoTarifaPacote obtenerID(Integer id) {
|
||||
return tipoTarifaPacoteDAO.obtenerID(id);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public TipoTarifaPacote suscribir(TipoTarifaPacote entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return tipoTarifaPacoteDAO.suscribir(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public TipoTarifaPacote actualizacion(TipoTarifaPacote entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.TRUE);
|
||||
|
||||
return tipoTarifaPacoteDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void borrar(TipoTarifaPacote entidad) {
|
||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||
entidad.setActivo(Boolean.FALSE);
|
||||
|
||||
tipoTarifaPacoteDAO.actualizacion(entidad);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TipoTarifaPacote> buscaTipoTarifaPacote(Pacote pacote) {
|
||||
return tipoTarifaPacoteDAO.buscaTipoTarifaPacote(pacote);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue