git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@31285 d1611594-4594-4d17-8e1d-87c2c4800839
parent
c513cccb2d
commit
947d1e3bff
|
@ -0,0 +1,14 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionConf;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
|
|
||||||
|
public interface ConexionConfDAO extends GenericDAO<ConexionConf, Long> {
|
||||||
|
|
||||||
|
public ConexionConf buscar(Long conexionCtrlId, Integer numgrupo);
|
||||||
|
|
||||||
|
public List<ConexionConf> buscarPorConexionCtrl(ConexionCtrl conexionCtrl);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
|
|
||||||
|
public interface ConexionCtrlDAO extends GenericDAO<ConexionCtrl, Long> {
|
||||||
|
|
||||||
|
}
|
|
@ -2,15 +2,19 @@ package com.rjconsultores.ventaboletos.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Conexion;
|
||||||
import com.rjconsultores.ventaboletos.vo.conexion.ConexionVO;
|
import com.rjconsultores.ventaboletos.vo.conexion.ConexionVO;
|
||||||
|
|
||||||
public interface ConexionDAO {
|
public interface ConexionDAO extends GenericDAO<Conexion, Integer> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apaga os dados temporários das tabelas de conexion_temp e conexion_ctrl_temp
|
* Apaga os dados temporários das tabelas de conexion_temp e conexion_ctrl_temp
|
||||||
* @param usuarioId TODO
|
*
|
||||||
|
* @param usuarioId
|
||||||
*/
|
*/
|
||||||
public void generarConexiones(Integer usuarioId);
|
public void generarConexiones(Integer usuarioId);
|
||||||
|
|
||||||
public List<ConexionVO> buscarConexiones(Integer origenId,Integer destinoId);
|
public List<ConexionVO> buscarConexiones(Integer origenId, Integer destinoId);
|
||||||
|
|
||||||
|
public List<Conexion> buscarPorConexionCtrl(Long conexcionCtrlId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ package com.rjconsultores.ventaboletos.dao;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
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.ConexionConfDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionConf;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
|
|
||||||
|
@Repository("conexionConfDAO")
|
||||||
|
public class ConexionConfHibernateDAO extends GenericHibernateDAO<ConexionConf, Long>
|
||||||
|
implements ConexionConfDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ConexionConfHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConexionConf> obtenerTodos() {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConexionConf buscar(Long conexionCtrlId, Integer numgrupo) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.add(Restrictions.eq("grupo", numgrupo));
|
||||||
|
|
||||||
|
Criteria ctrl = c.createCriteria("conexionCtrl");
|
||||||
|
ctrl.add(Restrictions.eq("conexionctrlId", conexionCtrlId));
|
||||||
|
|
||||||
|
return (ConexionConf) c.uniqueResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConexionConf> buscarPorConexionCtrl(ConexionCtrl conexionCtrl) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.add(Restrictions.eq("conexionCtrl", conexionCtrl));
|
||||||
|
|
||||||
|
return c.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.ConexionCtrlDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
|
|
||||||
|
@Repository("conexionCtrlDAO")
|
||||||
|
public class ConexionCtrlHibernateDAO extends GenericHibernateDAO<ConexionCtrl, Long>
|
||||||
|
implements ConexionCtrlDAO {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
public ConexionCtrlHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
setSessionFactory(factory);
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,9 +4,11 @@ import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.apache.log4j.Logger;
|
import org.hibernate.Criteria;
|
||||||
import org.hibernate.Query;
|
import org.hibernate.Query;
|
||||||
import org.hibernate.SessionFactory;
|
import org.hibernate.SessionFactory;
|
||||||
|
import org.hibernate.criterion.Order;
|
||||||
|
import org.hibernate.criterion.Restrictions;
|
||||||
import org.hibernate.transform.AliasToBeanResultTransformer;
|
import org.hibernate.transform.AliasToBeanResultTransformer;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
|
@ -19,8 +21,8 @@ import com.rjconsultores.ventaboletos.entidad.ConexionTemp;
|
||||||
import com.rjconsultores.ventaboletos.vo.conexion.ConexionVO;
|
import com.rjconsultores.ventaboletos.vo.conexion.ConexionVO;
|
||||||
|
|
||||||
@Repository("conexionDAO")
|
@Repository("conexionDAO")
|
||||||
public class ConexionHibernateDAO extends GenericHibernateDAO<Conexion, Integer> implements ConexionDAO {
|
public class ConexionHibernateDAO extends GenericHibernateDAO<Conexion, Integer>
|
||||||
private static Logger log = Logger.getLogger(ConexionHibernateDAO.class);
|
implements ConexionDAO {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public ConexionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
public ConexionHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||||
|
@ -30,25 +32,26 @@ public class ConexionHibernateDAO extends GenericHibernateDAO<Conexion, Integer>
|
||||||
@Override
|
@Override
|
||||||
public List<ConexionVO> buscarConexiones(Integer origenId, Integer destinoId) {
|
public List<ConexionVO> buscarConexiones(Integer origenId, Integer destinoId) {
|
||||||
StringBuilder sb = new StringBuilder("");
|
StringBuilder sb = new StringBuilder("");
|
||||||
sb.append("select po1.descparada as conOrigen, pd1.descparada as conDestino ,c.numgrupo as grupo ,po2.descparada as tramoOrigen, pd2.descparada as tramoDestino ");
|
sb.append(" select cc.conexionctrlId as conexionCtrlId, po1.descparada as conOrigen, pd1.descparada as conDestino ,c.numgrupo as grupo ,po2.descparada as tramoOrigen, pd2.descparada as tramoDestino ");
|
||||||
sb.append("from ");
|
sb.append(" from ");
|
||||||
sb.append(" ConexionCtrl cc, ");
|
sb.append(" ConexionCtrl cc, ");
|
||||||
sb.append(" Conexion c, ");
|
sb.append(" Conexion c, ");
|
||||||
sb.append(" Parada po1, ");
|
sb.append(" Parada po1, ");
|
||||||
sb.append(" Parada pd1, ");
|
sb.append(" Parada pd1, ");
|
||||||
sb.append(" Parada po2, ");
|
sb.append(" Parada po2, ");
|
||||||
sb.append(" Parada pd2 ");
|
sb.append(" Parada pd2 ");
|
||||||
sb.append("where ");
|
sb.append(" where ");
|
||||||
sb.append(" cc.conexionctrlId = c.conexionctrlId ");
|
sb.append(" c.activo=1 ");
|
||||||
sb.append(" and po1.paradaId = cc.origenId ");
|
sb.append(" and cc.conexionctrlId = c.conexionctrlId ");
|
||||||
sb.append(" and pd1.paradaId = cc.destinoId ");
|
sb.append(" and po1.paradaId = cc.origenId ");
|
||||||
sb.append(" and po2.paradaId = c.origenId ");
|
sb.append(" and pd1.paradaId = cc.destinoId ");
|
||||||
sb.append(" and pd2.paradaId = c.destinoId ");
|
sb.append(" and po2.paradaId = c.origenId ");
|
||||||
if (origenId != null){
|
sb.append(" and pd2.paradaId = c.destinoId ");
|
||||||
sb.append(" and cc.origenId = ").append(origenId);
|
if (origenId != null) {
|
||||||
|
sb.append(" and cc.origenId = ").append(origenId);
|
||||||
}
|
}
|
||||||
if (destinoId != null){
|
if (destinoId != null) {
|
||||||
sb.append(" and cc.destinoId = ").append(destinoId);
|
sb.append(" and cc.destinoId = ").append(destinoId);
|
||||||
}
|
}
|
||||||
sb.append(" ");
|
sb.append(" ");
|
||||||
sb.append(" ");
|
sb.append(" ");
|
||||||
|
@ -58,7 +61,6 @@ public class ConexionHibernateDAO extends GenericHibernateDAO<Conexion, Integer>
|
||||||
query.setResultTransformer(new AliasToBeanResultTransformer(ConexionVO.class));
|
query.setResultTransformer(new AliasToBeanResultTransformer(ConexionVO.class));
|
||||||
|
|
||||||
return query.list();
|
return query.list();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -107,8 +109,8 @@ public class ConexionHibernateDAO extends GenericHibernateDAO<Conexion, Integer>
|
||||||
sb.append(" t2.destino.paradaId ");
|
sb.append(" t2.destino.paradaId ");
|
||||||
|
|
||||||
Map<String, Long> mapConexionCtrlId = new HashMap<String, Long>();
|
Map<String, Long> mapConexionCtrlId = new HashMap<String, Long>();
|
||||||
int grupo = 0;
|
|
||||||
for (Object[] obj : lsParadas) {
|
for (Object[] obj : lsParadas) {
|
||||||
|
int grupo = 0;
|
||||||
Integer origenId = (Integer) obj[0];
|
Integer origenId = (Integer) obj[0];
|
||||||
Integer destinoId = (Integer) obj[1];
|
Integer destinoId = (Integer) obj[1];
|
||||||
|
|
||||||
|
@ -138,7 +140,6 @@ public class ConexionHibernateDAO extends GenericHibernateDAO<Conexion, Integer>
|
||||||
|
|
||||||
conexionCtrlId = (Long) this.getSession().save(c);
|
conexionCtrlId = (Long) this.getSession().save(c);
|
||||||
mapConexionCtrlId.put(claveConexionCtrl, conexionCtrlId);
|
mapConexionCtrlId.put(claveConexionCtrl, conexionCtrlId);
|
||||||
|
|
||||||
}
|
}
|
||||||
grupo++;
|
grupo++;
|
||||||
|
|
||||||
|
@ -167,17 +168,52 @@ public class ConexionHibernateDAO extends GenericHibernateDAO<Conexion, Integer>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.getSession().createQuery("DELETE Conexion").executeUpdate();
|
// deletando, exceto conexoes que foram criadas manualmente:
|
||||||
this.getSession().createQuery("DELETE ConexionCtrl").executeUpdate();
|
this.getSession().createQuery("DELETE Conexion c WHERE c.conexionctrlId NOT IN (SELECT cc.conexionCtrl.conexionctrlId FROM ConexionConf cc)").executeUpdate();
|
||||||
|
this.getSession().createQuery("DELETE ConexionCtrl cct WHERE cct.conexionctrlId NOT IN (SELECT cc.conexionCtrl.conexionctrlId FROM ConexionConf cc)").executeUpdate();
|
||||||
|
|
||||||
sb = new StringBuilder("");
|
sb = new StringBuilder("");
|
||||||
sb.append("INSERT INTO ConexionCtrl (conexionctrlId,fecmodif,activo,usuarioId,origenId,destinoId) ");
|
sb.append(" INSERT INTO ConexionCtrl (conexionctrlId,fecmodif,activo,usuarioId,origenId,destinoId) ");
|
||||||
sb.append("SELECT conexionctrlId,fecmodif,activo,usuarioId,origenId,destinoId from ConexionCtrlTemp )");
|
sb.append(" SELECT cct.conexionctrlId, ");
|
||||||
|
sb.append(" cct.fecmodif, ");
|
||||||
|
sb.append(" cct.activo, ");
|
||||||
|
sb.append(" cct.usuarioId, ");
|
||||||
|
sb.append(" cct.origenId, ");
|
||||||
|
sb.append(" cct.destinoId ");
|
||||||
|
sb.append(" FROM ConexionCtrlTemp cct ");
|
||||||
|
sb.append(" WHERE cct.origenId || '_' || cct.destinoId NOT IN ");
|
||||||
|
sb.append(" ( SELECT cc.origenId || '_' || cc.destinoId ");
|
||||||
|
sb.append(" FROM ConexionCtrl cc ");
|
||||||
|
sb.append(" WHERE cc.activo = 1) ");
|
||||||
this.getSession().createQuery(sb.toString()).executeUpdate();
|
this.getSession().createQuery(sb.toString()).executeUpdate();
|
||||||
|
|
||||||
sb = new StringBuilder("");
|
sb = new StringBuilder("");
|
||||||
sb.append("INSERT INTO Conexion (conexionId,numgrupo,numsecuencia,activo,fecmodif,usuarioId,origenId,destinoId,conexionctrlId) ");
|
sb.append(" INSERT INTO Conexion (conexionId,numgrupo,numsecuencia,activo,fecmodif,usuarioId,origenId,destinoId,conexionctrlId) ");
|
||||||
sb.append("SELECT conexionId,numgrupo,numsecuencia,activo,fecmodif,usuarioId,origenId,destinoId,conexionctrlId from ConexionTemp )");
|
sb.append(" SELECT ct.conexionId, ");
|
||||||
|
sb.append(" ct.numgrupo, ");
|
||||||
|
sb.append(" ct.numsecuencia, ");
|
||||||
|
sb.append(" ct.activo, ");
|
||||||
|
sb.append(" ct.fecmodif, ");
|
||||||
|
sb.append(" ct.usuarioId, ");
|
||||||
|
sb.append(" ct.origenId, ");
|
||||||
|
sb.append(" ct.destinoId, ");
|
||||||
|
sb.append(" ct.conexionctrlId ");
|
||||||
|
sb.append(" FROM ConexionTemp ct ");
|
||||||
|
sb.append(" WHERE ct.origenId || '_' || ct.destinoId NOT IN ");
|
||||||
|
sb.append(" ( SELECT c.origenId || '_' || c.destinoId ");
|
||||||
|
sb.append(" FROM Conexion c ");
|
||||||
|
sb.append(" WHERE c.activo = 1) ");
|
||||||
this.getSession().createQuery(sb.toString()).executeUpdate();
|
this.getSession().createQuery(sb.toString()).executeUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Conexion> buscarPorConexionCtrl(Long conexionCtrlId) {
|
||||||
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
c.add(Restrictions.eq("conexionctrlId", conexionCtrlId));
|
||||||
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
|
c.addOrder(Order.asc("numgrupo"));
|
||||||
|
c.addOrder(Order.asc("numsecuencia"));
|
||||||
|
|
||||||
|
return c.list();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,6 @@ import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.EmpresaDAO;
|
import com.rjconsultores.ventaboletos.dao.EmpresaDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -10,9 +10,10 @@ import java.util.Date;
|
||||||
import javax.persistence.Basic;
|
import javax.persistence.Basic;
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.JoinColumn;
|
import javax.persistence.SequenceGenerator;
|
||||||
import javax.persistence.ManyToOne;
|
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
|
@ -22,11 +23,13 @@ import javax.persistence.TemporalType;
|
||||||
* @author gleimar
|
* @author gleimar
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
|
@SequenceGenerator(name = "CONEXION_SEQ", sequenceName = "CONEXION_SEQ", allocationSize = 1)
|
||||||
@Table(name = "CONEXION")
|
@Table(name = "CONEXION")
|
||||||
public class Conexion implements Serializable {
|
public class Conexion implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
@Basic(optional = false)
|
@Basic(optional = false)
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CONEXION_SEQ")
|
||||||
@Column(name = "CONEXION_ID")
|
@Column(name = "CONEXION_ID")
|
||||||
private Long conexionId;
|
private Long conexionId;
|
||||||
@Column(name = "NUMGRUPO")
|
@Column(name = "NUMGRUPO")
|
||||||
|
@ -46,12 +49,6 @@ public class Conexion implements Serializable {
|
||||||
private Integer destinoId;
|
private Integer destinoId;
|
||||||
@Column(name = "CONEXIONCTRL_ID")
|
@Column(name = "CONEXIONCTRL_ID")
|
||||||
private Long conexionctrlId;
|
private Long conexionctrlId;
|
||||||
@JoinColumn(name = "ORIGEN_ID", referencedColumnName = "PARADA_ID", insertable = false, updatable = false)
|
|
||||||
@ManyToOne
|
|
||||||
private Parada origen;
|
|
||||||
@JoinColumn(name = "DESTINO_ID", referencedColumnName = "PARADA_ID", insertable = false, updatable = false)
|
|
||||||
@ManyToOne
|
|
||||||
private Parada destino;
|
|
||||||
|
|
||||||
public Conexion() {
|
public Conexion() {
|
||||||
}
|
}
|
||||||
|
@ -117,7 +114,6 @@ public class Conexion implements Serializable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object object) {
|
public boolean equals(Object object) {
|
||||||
// TODO: Warning - this method won't work in the case the id fields are not set
|
|
||||||
if (!(object instanceof Conexion)) {
|
if (!(object instanceof Conexion)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,163 @@
|
||||||
|
package com.rjconsultores.ventaboletos.entidad;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
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 = "CONEXION_CONF_SEQ", sequenceName = "CONEXION_CONF_SEQ", allocationSize = 1)
|
||||||
|
@Table(name = "CONEXION_CONF")
|
||||||
|
public class ConexionConf implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
@Id
|
||||||
|
@Column(name = "CONEXIONCONF_ID")
|
||||||
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CONEXION_CONF_SEQ")
|
||||||
|
private Long conexionConfId;
|
||||||
|
@ManyToOne
|
||||||
|
@JoinColumn(name = "CONEXIONCTRL_ID", referencedColumnName = "CONEXIONCTRL_ID")
|
||||||
|
private ConexionCtrl conexionCtrl;
|
||||||
|
@Column(name = "GRUPO")
|
||||||
|
private Integer grupo;
|
||||||
|
@Column(name = "PORSEC1")
|
||||||
|
private BigDecimal porSec1;
|
||||||
|
@Column(name = "PORSEC2")
|
||||||
|
private BigDecimal porSec2;
|
||||||
|
@Column(name = "TIEMPOMIN")
|
||||||
|
private Integer tiempoMin;
|
||||||
|
@Column(name = "TIEMPOMAX")
|
||||||
|
private Integer tiempoMax;
|
||||||
|
@Column(name = "INDDISPONIBLE")
|
||||||
|
private Boolean indisponible;
|
||||||
|
@Column(name = "ACTIVO")
|
||||||
|
private Boolean activo;
|
||||||
|
@Column(name = "FECMODIF")
|
||||||
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
|
private Date fecmodif;
|
||||||
|
@Column(name = "USUARIO_ID")
|
||||||
|
private Integer usuarioId;
|
||||||
|
|
||||||
|
public Long getConexionConfId() {
|
||||||
|
return conexionConfId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConexionConfId(Long conexionConfId) {
|
||||||
|
this.conexionConfId = conexionConfId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConexionCtrl getConexionCtrl() {
|
||||||
|
return conexionCtrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConexionCtrl(ConexionCtrl conexionCtrl) {
|
||||||
|
this.conexionCtrl = conexionCtrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getGrupo() {
|
||||||
|
return grupo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGrupo(Integer grupo) {
|
||||||
|
this.grupo = grupo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPorSec1() {
|
||||||
|
return porSec1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPorSec1(BigDecimal porSec1) {
|
||||||
|
this.porSec1 = porSec1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getPorSec2() {
|
||||||
|
return porSec2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPorSec2(BigDecimal porSec2) {
|
||||||
|
this.porSec2 = porSec2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTiempoMin() {
|
||||||
|
return tiempoMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTiempoMin(Integer tiempoMin) {
|
||||||
|
this.tiempoMin = tiempoMin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getTiempoMax() {
|
||||||
|
return tiempoMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTiempoMax(Integer tiempoMax) {
|
||||||
|
this.tiempoMax = tiempoMax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIndisponible() {
|
||||||
|
return indisponible;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndisponible(Boolean indisponible) {
|
||||||
|
this.indisponible = indisponible;
|
||||||
|
}
|
||||||
|
|
||||||
|
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 + ((conexionConfId == null) ? 0 : conexionConfId.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;
|
||||||
|
ConexionConf other = (ConexionConf) obj;
|
||||||
|
if (conexionConfId == null) {
|
||||||
|
if (other.conexionConfId != null)
|
||||||
|
return false;
|
||||||
|
} else if (!conexionConfId.equals(other.conexionConfId))
|
||||||
|
return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -9,100 +9,101 @@ import java.util.Date;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.SequenceGenerator;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author gleimar
|
* @author gleimar
|
||||||
*/
|
*/
|
||||||
@Entity
|
@Entity
|
||||||
|
@SequenceGenerator(name = "CONEXION_CTRL_SEQ", sequenceName = "CONEXION_CTRL_SEQ", allocationSize = 1)
|
||||||
@Table(name = "CONEXION_CTRL")
|
@Table(name = "CONEXION_CTRL")
|
||||||
public class ConexionCtrl implements Serializable {
|
public class ConexionCtrl implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@Id
|
@Id
|
||||||
@Column(name = "CONEXIONCTRL_ID")
|
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CONEXION_CTRL_SEQ")
|
||||||
private Long conexionctrlId;
|
@Column(name = "CONEXIONCTRL_ID")
|
||||||
@Column(name = "FECMODIF")
|
private Long conexionctrlId;
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
@Column(name = "FECMODIF")
|
||||||
private Date fecmodif;
|
@Temporal(TemporalType.TIMESTAMP)
|
||||||
@Column(name = "ACTIVO")
|
private Date fecmodif;
|
||||||
private Boolean activo;
|
@Column(name = "ACTIVO")
|
||||||
@Column(name = "USUARIO_ID")
|
private Boolean activo;
|
||||||
private Integer usuarioId;
|
@Column(name = "USUARIO_ID")
|
||||||
@Column(name = "ORIGEN_ID")
|
private Integer usuarioId;
|
||||||
private Integer origenId;
|
@Column(name = "ORIGEN_ID")
|
||||||
@Column(name = "DESTINO_ID")
|
private Integer origenId;
|
||||||
private Integer destinoId;
|
@Column(name = "DESTINO_ID")
|
||||||
|
private Integer destinoId;
|
||||||
|
|
||||||
public ConexionCtrl() {
|
public ConexionCtrl() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConexionCtrl(Long conexionctrlId) {
|
public ConexionCtrl(Long conexionctrlId) {
|
||||||
this.conexionctrlId = conexionctrlId;
|
this.conexionctrlId = conexionctrlId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getConexionctrlId() {
|
public Long getConexionctrlId() {
|
||||||
return conexionctrlId;
|
return conexionctrlId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConexionctrlId(Long conexionctrlId) {
|
public void setConexionctrlId(Long conexionctrlId) {
|
||||||
this.conexionctrlId = conexionctrlId;
|
this.conexionctrlId = conexionctrlId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Date getFecmodif() {
|
public Date getFecmodif() {
|
||||||
return fecmodif;
|
return fecmodif;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFecmodif(Date fecmodif) {
|
public void setFecmodif(Date fecmodif) {
|
||||||
this.fecmodif = fecmodif;
|
this.fecmodif = fecmodif;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Boolean getActivo() {
|
public Boolean getActivo() {
|
||||||
return activo;
|
return activo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setActivo(Boolean activo) {
|
public void setActivo(Boolean activo) {
|
||||||
this.activo = activo;
|
this.activo = activo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getUsuarioId() {
|
public Integer getUsuarioId() {
|
||||||
return usuarioId;
|
return usuarioId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUsuarioId(Integer usuarioId) {
|
public void setUsuarioId(Integer usuarioId) {
|
||||||
this.usuarioId = usuarioId;
|
this.usuarioId = usuarioId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 0;
|
int hash = 0;
|
||||||
hash += (conexionctrlId != null ? conexionctrlId.hashCode() : 0);
|
hash += (conexionctrlId != null ? conexionctrlId.hashCode() : 0);
|
||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object object) {
|
public boolean equals(Object object) {
|
||||||
// TODO: Warning - this method won't work in the case the id fields are not set
|
if (!(object instanceof ConexionCtrl)) {
|
||||||
if (!(object instanceof ConexionCtrl)) {
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
ConexionCtrl other = (ConexionCtrl) object;
|
||||||
ConexionCtrl other = (ConexionCtrl) object;
|
if ((this.conexionctrlId == null && other.conexionctrlId != null) || (this.conexionctrlId != null && !this.conexionctrlId.equals(other.conexionctrlId))) {
|
||||||
if ((this.conexionctrlId == null && other.conexionctrlId != null) || (this.conexionctrlId != null && !this.conexionctrlId.equals(other.conexionctrlId))) {
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "com.rjconsultores.entidad.ConexionCtrl[ conexionctrlId=" + conexionctrlId + " ]";
|
return "com.rjconsultores.entidad.ConexionCtrl[ conexionctrlId=" + conexionctrlId + " ]";
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getOrigenId() {
|
public Integer getOrigenId() {
|
||||||
return origenId;
|
return origenId;
|
||||||
|
@ -119,5 +120,4 @@ public class ConexionCtrl implements Serializable {
|
||||||
public void setDestinoId(Integer destinoId) {
|
public void setDestinoId(Integer destinoId) {
|
||||||
this.destinoId = destinoId;
|
this.destinoId = destinoId;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,24 +4,22 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service;
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.CategoriaTipoPtoVta;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.TipoPuntoVenta;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Categoria;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Administrador
|
* @author Administrador
|
||||||
*/
|
*/
|
||||||
public interface CategoriaService extends GenericService<Categoria, Integer> {
|
public interface CategoriaService extends GenericService<Categoria, Integer> {
|
||||||
|
|
||||||
public List<Categoria> buscar(String desccategoria);
|
public List<Categoria> buscar(String desccategoria);
|
||||||
/**
|
|
||||||
* Hance una búsqueda de todas las categorias que son visibles al usuario
|
|
||||||
* Ejemplo de categorias que no son vis
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public List<Categoria> obtenerTodasCategoriasVisibles();
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hance una búsqueda de todas las categorias que son visibles al usuario Ejemplo de categorias que no son vis
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public List<Categoria> obtenerTodasCategoriasVisibles();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionConf;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
|
|
||||||
|
public interface ConexionConfService extends GenericService<ConexionConf, Long> {
|
||||||
|
|
||||||
|
public ConexionConf buscar(Long conexionCtrlId, Integer numgrupo);
|
||||||
|
|
||||||
|
public List<ConexionConf> buscarPorConexionCtrl(ConexionCtrl entidad);
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
|
|
||||||
|
public interface ConexionCtrlService extends GenericService<ConexionCtrl, Long> {
|
||||||
|
|
||||||
|
}
|
|
@ -2,16 +2,24 @@ package com.rjconsultores.ventaboletos.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Conexion;
|
||||||
import com.rjconsultores.ventaboletos.vo.conexion.ConexionVO;
|
import com.rjconsultores.ventaboletos.vo.conexion.ConexionVO;
|
||||||
|
|
||||||
public interface ConexionService {
|
public interface ConexionService {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gera as conexões possíveis para os tramos do sistema
|
* Gera as conexões possíveis para os tramos do sistema
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void gerarConexiones();
|
public void gerarConexiones();
|
||||||
|
|
||||||
public List<ConexionVO> buscarConexiones(Integer origenId,Integer destinoId);
|
public List<ConexionVO> buscarConexiones(Integer origenId, Integer destinoId);
|
||||||
|
|
||||||
|
public Conexion suscribir(Conexion conexion);
|
||||||
|
|
||||||
|
public Conexion actualizacion(Conexion conexion);
|
||||||
|
|
||||||
|
public void borrar(Conexion conexion);
|
||||||
|
|
||||||
|
public List<Conexion> buscarPorConexionCtrl(Long conexcionCtrlId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,64 +7,57 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.ClienteDAO;
|
|
||||||
import com.rjconsultores.ventaboletos.dao.ClienteDireccionDAO;
|
import com.rjconsultores.ventaboletos.dao.ClienteDireccionDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Cliente;
|
|
||||||
import com.rjconsultores.ventaboletos.entidad.ClienteDireccion;
|
import com.rjconsultores.ventaboletos.entidad.ClienteDireccion;
|
||||||
import com.rjconsultores.ventaboletos.service.ClienteDireccionService;
|
import com.rjconsultores.ventaboletos.service.ClienteDireccionService;
|
||||||
import com.rjconsultores.ventaboletos.service.ClienteService;
|
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Desenvolvimento
|
* @author Desenvolvimento
|
||||||
*/
|
*/
|
||||||
@Service("clienteDireccionService")
|
@Service("clienteDireccionService")
|
||||||
public class ClienteDireccionServiceImpl implements ClienteDireccionService{
|
public class ClienteDireccionServiceImpl implements ClienteDireccionService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ClienteDireccionDAO clienteDAO;
|
private ClienteDireccionDAO clienteDAO;
|
||||||
|
|
||||||
public List<ClienteDireccion> obtenerTodos() {
|
public List<ClienteDireccion> obtenerTodos() {
|
||||||
return clienteDAO.obtenerTodos();
|
return clienteDAO.obtenerTodos();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClienteDireccion obtenerID(Integer id) {
|
public ClienteDireccion obtenerID(Integer id) {
|
||||||
return clienteDAO.obtenerID(id);
|
return clienteDAO.obtenerID(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ClienteDireccion suscribir(ClienteDireccion entidad) {
|
public ClienteDireccion suscribir(ClienteDireccion entidad) {
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.TRUE);
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
return clienteDAO.suscribir(entidad);
|
return clienteDAO.suscribir(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ClienteDireccion actualizacion(ClienteDireccion entidad) {
|
public ClienteDireccion actualizacion(ClienteDireccion entidad) {
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setActivo(Boolean.TRUE);
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
return clienteDAO.actualizacion(entidad);
|
return clienteDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
@Transactional
|
public void borrar(ClienteDireccion entidad) {
|
||||||
public void borrar(ClienteDireccion entidad) {
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
entidad.setFecmodif(Calendar.getInstance().getTime());
|
entidad.setActivo(Boolean.FALSE);
|
||||||
entidad.setActivo(Boolean.FALSE);
|
|
||||||
|
|
||||||
clienteDAO.actualizacion(entidad);
|
clienteDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public List<ClienteDireccion> buscar(Integer clienteId) {
|
|
||||||
return clienteDAO.buscar(clienteId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public List<ClienteDireccion> buscar(Integer clienteId) {
|
||||||
|
return clienteDAO.buscar(clienteId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,65 @@
|
||||||
|
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.ConexionConfDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionConf;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
|
import com.rjconsultores.ventaboletos.service.ConexionConfService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("conexionConfService")
|
||||||
|
public class ConexionConfServiceImpl implements ConexionConfService {
|
||||||
|
@Autowired
|
||||||
|
private ConexionConfDAO conexionConfDAO;
|
||||||
|
|
||||||
|
public List<ConexionConf> obtenerTodos() {
|
||||||
|
return conexionConfDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConexionConf obtenerID(Long id) {
|
||||||
|
return conexionConfDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public ConexionConf suscribir(ConexionConf entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return conexionConfDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public ConexionConf actualizacion(ConexionConf entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return conexionConfDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void borrar(ConexionConf entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
conexionConfDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ConexionConf buscar(Long conexionCtrlId, Integer numgrupo) {
|
||||||
|
return conexionConfDAO.buscar(conexionCtrlId, numgrupo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ConexionConf> buscarPorConexionCtrl(ConexionCtrl entidad) {
|
||||||
|
return conexionConfDAO.buscarPorConexionCtrl(entidad);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
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.ConexionCtrlDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Conexion;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionConf;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.ConexionCtrl;
|
||||||
|
import com.rjconsultores.ventaboletos.service.ConexionConfService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.ConexionCtrlService;
|
||||||
|
import com.rjconsultores.ventaboletos.service.ConexionService;
|
||||||
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
|
|
||||||
|
@Service("conexionCtrlService")
|
||||||
|
public class ConexionCtrlServiceImpl implements ConexionCtrlService {
|
||||||
|
@Autowired
|
||||||
|
private ConexionCtrlDAO conexionCtrlDAO;
|
||||||
|
@Autowired
|
||||||
|
private ConexionService conexionDAO;
|
||||||
|
@Autowired
|
||||||
|
private ConexionConfService conexionConfDAO;
|
||||||
|
|
||||||
|
public List<ConexionCtrl> obtenerTodos() {
|
||||||
|
return conexionCtrlDAO.obtenerTodos();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ConexionCtrl obtenerID(Long id) {
|
||||||
|
return conexionCtrlDAO.obtenerID(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public ConexionCtrl suscribir(ConexionCtrl entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return conexionCtrlDAO.suscribir(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public ConexionCtrl actualizacion(ConexionCtrl entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return conexionCtrlDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void borrar(ConexionCtrl entidad) {
|
||||||
|
entidad.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
entidad.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
entidad.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
List<Conexion> lsConexion = conexionDAO.buscarPorConexionCtrl(entidad.getConexionctrlId());
|
||||||
|
for (Conexion conexion : lsConexion) {
|
||||||
|
conexionDAO.borrar(conexion);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<ConexionConf> lsConexionConf = conexionConfDAO.buscarPorConexionCtrl(entidad);
|
||||||
|
for (ConexionConf conexionConf : lsConexionConf) {
|
||||||
|
conexionConfDAO.borrar(conexionConf);
|
||||||
|
}
|
||||||
|
|
||||||
|
conexionCtrlDAO.actualizacion(entidad);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
package com.rjconsultores.ventaboletos.service.impl;
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -7,6 +8,7 @@ import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.ConexionDAO;
|
import com.rjconsultores.ventaboletos.dao.ConexionDAO;
|
||||||
|
import com.rjconsultores.ventaboletos.entidad.Conexion;
|
||||||
import com.rjconsultores.ventaboletos.service.ConexionService;
|
import com.rjconsultores.ventaboletos.service.ConexionService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import com.rjconsultores.ventaboletos.vo.conexion.ConexionVO;
|
import com.rjconsultores.ventaboletos.vo.conexion.ConexionVO;
|
||||||
|
@ -27,4 +29,39 @@ public class ConexionServiceImpl implements ConexionService {
|
||||||
public List<ConexionVO> buscarConexiones(Integer origenId, Integer destinoId) {
|
public List<ConexionVO> buscarConexiones(Integer origenId, Integer destinoId) {
|
||||||
return conexionDAO.buscarConexiones(origenId, destinoId);
|
return conexionDAO.buscarConexiones(origenId, destinoId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public Conexion suscribir(Conexion conexion) {
|
||||||
|
conexion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
conexion.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
conexion.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return conexionDAO.suscribir(conexion);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public Conexion actualizacion(Conexion conexion) {
|
||||||
|
conexion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
conexion.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
conexion.setActivo(Boolean.TRUE);
|
||||||
|
|
||||||
|
return conexionDAO.actualizacion(conexion);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Conexion> buscarPorConexionCtrl(Long conexcionCtrlId) {
|
||||||
|
return conexionDAO.buscarPorConexionCtrl(conexcionCtrlId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void borrar(Conexion conexion) {
|
||||||
|
conexion.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||||
|
conexion.setFecmodif(Calendar.getInstance().getTime());
|
||||||
|
conexion.setActivo(Boolean.FALSE);
|
||||||
|
|
||||||
|
conexionDAO.actualizacion(conexion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,14 @@
|
||||||
*/
|
*/
|
||||||
package com.rjconsultores.ventaboletos.service.impl;
|
package com.rjconsultores.ventaboletos.service.impl;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.rjconsultores.ventaboletos.dao.ParadaDAO;
|
import com.rjconsultores.ventaboletos.dao.ParadaDAO;
|
||||||
import com.rjconsultores.ventaboletos.dao.TramoDAO;
|
import com.rjconsultores.ventaboletos.dao.TramoDAO;
|
||||||
import com.rjconsultores.ventaboletos.entidad.Ciudad;
|
import com.rjconsultores.ventaboletos.entidad.Ciudad;
|
||||||
|
@ -14,17 +22,6 @@ import com.rjconsultores.ventaboletos.exception.BusinessException;
|
||||||
import com.rjconsultores.ventaboletos.service.ParadaService;
|
import com.rjconsultores.ventaboletos.service.ParadaService;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
|
||||||
import org.apache.commons.collections.Predicate;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.zkoss.util.resource.Labels;
|
|
||||||
import org.zkoss.zul.Messagebox;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -6,35 +6,53 @@ public class ConexionVO {
|
||||||
private Integer grupo;
|
private Integer grupo;
|
||||||
private String tramoOrigen;
|
private String tramoOrigen;
|
||||||
private String tramoDestino;
|
private String tramoDestino;
|
||||||
|
private Long conexionCtrlId;
|
||||||
|
|
||||||
public String getConOrigen() {
|
public String getConOrigen() {
|
||||||
return conOrigen;
|
return conOrigen;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConOrigen(String conOrigen) {
|
public void setConOrigen(String conOrigen) {
|
||||||
this.conOrigen = conOrigen;
|
this.conOrigen = conOrigen;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getConDestino() {
|
public String getConDestino() {
|
||||||
return conDestino;
|
return conDestino;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConDestino(String conDestino) {
|
public void setConDestino(String conDestino) {
|
||||||
this.conDestino = conDestino;
|
this.conDestino = conDestino;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getGrupo() {
|
public Integer getGrupo() {
|
||||||
return grupo;
|
return grupo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGrupo(Integer grupo) {
|
public void setGrupo(Integer grupo) {
|
||||||
this.grupo = grupo;
|
this.grupo = grupo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTramoOrigen() {
|
public String getTramoOrigen() {
|
||||||
return tramoOrigen;
|
return tramoOrigen;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTramoOrigen(String tramoOrigen) {
|
public void setTramoOrigen(String tramoOrigen) {
|
||||||
this.tramoOrigen = tramoOrigen;
|
this.tramoOrigen = tramoOrigen;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTramoDestino() {
|
public String getTramoDestino() {
|
||||||
return tramoDestino;
|
return tramoDestino;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTramoDestino(String tramoDestino) {
|
public void setTramoDestino(String tramoDestino) {
|
||||||
this.tramoDestino = tramoDestino;
|
this.tramoDestino = tramoDestino;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getConexionCtrlId() {
|
||||||
|
return conexionCtrlId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConexionCtrlId(Long conexionCtrlId) {
|
||||||
|
this.conexionCtrlId = conexionCtrlId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue