0013746: Menu Dispositivo Venda Embarcada
fixes bug#13746 dev:Leo qua:Jose git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@91880 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
bb77bd8964
commit
0fb448f1a4
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Boleto;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Fabricio
|
||||
*/
|
||||
|
||||
public interface BoletoDAO extends GenericDAO<Boleto, Long> {
|
||||
public Boleto buscarPeloImeiDoDispositivo(String imei);
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import org.hibernate.Criteria;
|
||||
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.BoletoDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Boleto;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Fabricio
|
||||
*/
|
||||
@Repository("boletoDAO")
|
||||
public class BoletoHibernateDAO extends GenericHibernateDAO<Boleto, Long> implements BoletoDAO {
|
||||
|
||||
@Autowired
|
||||
public BoletoHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
|
||||
|
||||
public Boleto buscarPeloImeiDoDispositivo(String imei) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("imeiDispositivoEmbarcada", imei));
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
c.addOrder(Order.desc("fechorventa"));
|
||||
c.setFirstResult(0);
|
||||
c.setMaxResults(1);
|
||||
|
||||
return (Boleto) c.uniqueResult();
|
||||
}
|
||||
|
||||
}
|
|
@ -6,6 +6,9 @@ import java.util.Date;
|
|||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
@ -44,8 +47,9 @@ public class Boleto implements java.io.Serializable {
|
|||
@Column(name = "DESTINO_ID", precision = 7, scale = 0)
|
||||
private Integer destinoId;
|
||||
|
||||
@Column(name = "PUNTOVENTA_ID", precision = 7, scale = 0)
|
||||
private Integer puntoventaId;
|
||||
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
|
||||
@ManyToOne
|
||||
private PuntoVenta puntoVenta;
|
||||
|
||||
@Column(name = "CORRIDA_ID", precision = 7, scale = 0)
|
||||
private Integer corridaId;
|
||||
|
@ -196,8 +200,9 @@ public class Boleto implements java.io.Serializable {
|
|||
@Column(name = "FECMODIF", length = 7)
|
||||
private Date fecmodif;
|
||||
|
||||
@Column(name = "USUARIO_ID", precision = 7, scale = 0)
|
||||
private Integer usuarioId;
|
||||
@OneToOne
|
||||
@JoinColumn(name = "USUARIO_ID", referencedColumnName = "USUARIO_ID")
|
||||
private Usuario usuario;
|
||||
|
||||
@Column(name = "NODO_ID", precision = 2, scale = 0)
|
||||
private Byte nodoId;
|
||||
|
@ -314,6 +319,9 @@ public class Boleto implements java.io.Serializable {
|
|||
@Column(name = "ESTADOCIVIL_ID", precision = 2, scale = 0)
|
||||
private Byte estadocivilId;
|
||||
|
||||
@Column(name = "IMEI_DISPOSITIVO_EMBARCADA", length = 20)
|
||||
private String imeiDispositivoEmbarcada;
|
||||
|
||||
public Boleto() {
|
||||
}
|
||||
|
||||
|
@ -322,7 +330,7 @@ public class Boleto implements java.io.Serializable {
|
|||
}
|
||||
|
||||
public Boleto(long boletoId, String numasiento, Integer categoriaId, String numfoliosistema, Byte claseservicioId,
|
||||
Short marcaId, Integer origenId, Integer destinoId, Integer puntoventaId, Integer corridaId,
|
||||
Short marcaId, Integer origenId, Integer destinoId, PuntoVenta puntoVenta, Integer corridaId,
|
||||
Date feccorrida, String nombpasajero, BigDecimal preciobase, BigDecimal preciopagado,
|
||||
BigDecimal descuentoamparado, Byte tipoventaId, String numseriepreimpresa, String numfoliopreimpreso,
|
||||
Date fechorviaje, Date fechorventa, BigDecimal numkmviaje, String numoperacion, String indstatusoperacion,
|
||||
|
@ -334,7 +342,7 @@ public class Boleto implements java.io.Serializable {
|
|||
Long clientefidelidadId, Integer opcional1, Integer opcional2, String opcional3,
|
||||
BigDecimal preciocargoextra, BigDecimal porccategoria, BigDecimal preciopricing, Integer usuarioremotoId,
|
||||
Integer puntoventaremotoId, Byte canttransferencia, String numdocdescuento, Boolean activo, Date fecmodif,
|
||||
Integer usuarioId, Byte nodoId, Long entregaboletoId, BigDecimal importecategoria, Integer clienteId,
|
||||
Usuario usuario, Byte nodoId, Long entregaboletoId, BigDecimal importecategoria, Integer clienteId,
|
||||
Long boletooriginalId, BigDecimal importetaxaembarque, BigDecimal importepedagio, BigDecimal importeoutros,
|
||||
BigDecimal importeseguro, String descorgaodoc, String desctipodoc, String descnumdoc, String numfidelidad,
|
||||
String infopasajero, Boolean indconexion, Integer rutaId, Integer levanteId,
|
||||
|
@ -351,7 +359,7 @@ public class Boleto implements java.io.Serializable {
|
|||
this.marcaId = marcaId;
|
||||
this.origenId = origenId;
|
||||
this.destinoId = destinoId;
|
||||
this.puntoventaId = puntoventaId;
|
||||
this.puntoVenta = puntoVenta;
|
||||
this.corridaId = corridaId;
|
||||
this.feccorrida = feccorrida;
|
||||
this.nombpasajero = nombpasajero;
|
||||
|
@ -400,7 +408,7 @@ public class Boleto implements java.io.Serializable {
|
|||
this.numdocdescuento = numdocdescuento;
|
||||
this.activo = activo;
|
||||
this.fecmodif = fecmodif;
|
||||
this.usuarioId = usuarioId;
|
||||
this.usuario = usuario;
|
||||
this.nodoId = nodoId;
|
||||
this.entregaboletoId = entregaboletoId;
|
||||
this.importecategoria = importecategoria;
|
||||
|
@ -505,12 +513,12 @@ public class Boleto implements java.io.Serializable {
|
|||
this.destinoId = destinoId;
|
||||
}
|
||||
|
||||
public Integer getPuntoventaId() {
|
||||
return this.puntoventaId;
|
||||
public PuntoVenta getPuntoVenta() {
|
||||
return puntoVenta;
|
||||
}
|
||||
|
||||
public void setPuntoventaId(Integer puntoventaId) {
|
||||
this.puntoventaId = puntoventaId;
|
||||
public void setPuntoVenta(PuntoVenta puntoVenta) {
|
||||
this.puntoVenta = puntoVenta;
|
||||
}
|
||||
|
||||
public Integer getCorridaId() {
|
||||
|
@ -897,12 +905,13 @@ public class Boleto implements java.io.Serializable {
|
|||
this.fecmodif = fecmodif;
|
||||
}
|
||||
|
||||
public Integer getUsuarioId() {
|
||||
return this.usuarioId;
|
||||
|
||||
public Usuario getUsuario() {
|
||||
return usuario;
|
||||
}
|
||||
|
||||
public void setUsuarioId(Integer usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
public void setUsuario(Usuario usuario) {
|
||||
this.usuario = usuario;
|
||||
}
|
||||
|
||||
public Byte getNodoId() {
|
||||
|
@ -1209,4 +1218,12 @@ public class Boleto implements java.io.Serializable {
|
|||
this.estadocivilId = estadocivilId;
|
||||
}
|
||||
|
||||
public String getImeiDispositivoEmbarcada() {
|
||||
return imeiDispositivoEmbarcada;
|
||||
}
|
||||
|
||||
public void setImeiDispositivoEmbarcada(String imeiDispositivoEmbarcada) {
|
||||
this.imeiDispositivoEmbarcada = imeiDispositivoEmbarcada;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import javax.persistence.Id;
|
|||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
|
@ -62,8 +63,9 @@ public class DispositivoEmbarcada {
|
|||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
@OneToOne
|
||||
@JoinColumn(name = "USUARIO_ID", referencedColumnName = "USUARIO_ID")
|
||||
private Usuario usuario;
|
||||
|
||||
@OneToMany(mappedBy="dispositivoEmbarcada", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
private List<CtrlSerieEmbarcada> series = new ArrayList<CtrlSerieEmbarcada>();
|
||||
|
@ -159,11 +161,12 @@ public class DispositivoEmbarcada {
|
|||
public void setFecmodif(Date fecmodif) {
|
||||
this.fecmodif = fecmodif;
|
||||
}
|
||||
public Integer getUsuarioId() {
|
||||
return usuarioId;
|
||||
|
||||
public Usuario getUsuario() {
|
||||
return usuario;
|
||||
}
|
||||
public void setUsuarioId(Integer usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
public void setUsuario(Usuario usuario) {
|
||||
this.usuario = usuario;
|
||||
}
|
||||
public List<CtrlSerieEmbarcada> getSeries() {
|
||||
return series;
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Boleto;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Fabricio
|
||||
*/
|
||||
public interface BoletoService {
|
||||
|
||||
public Boleto buscarPeloImeiDoDispositivo(String imei);
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.rjconsultores.ventaboletos.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.rjconsultores.ventaboletos.dao.BoletoDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.Boleto;
|
||||
import com.rjconsultores.ventaboletos.service.BoletoService;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Fabricio
|
||||
*/
|
||||
@Service("boletoService")
|
||||
public class BoletoServiceImpl implements BoletoService {
|
||||
|
||||
@Autowired
|
||||
private BoletoDAO boletoDAO;
|
||||
|
||||
public Boleto buscarPeloImeiDoDispositivo(String imei) {
|
||||
return boletoDAO.buscarPeloImeiDoDispositivo(imei);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue