13750: Método Sincronizar Dispositivo
bug#13750 dev:alberto qua:Rogerio git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@91217 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
a69947d57c
commit
50359b3e8c
|
@ -0,0 +1,7 @@
|
|||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.CtrlSerieEmbarcada;
|
||||
|
||||
public interface CtrlSerieEmbarcadaDAO extends GenericDAO<CtrlSerieEmbarcada, Long> {
|
||||
|
||||
}
|
|
@ -5,4 +5,5 @@ import com.rjconsultores.ventaboletos.entidad.DispositivoEmbarcada;
|
|||
public interface DispositivoEmbarcadaDAO extends GenericDAO<DispositivoEmbarcada, Long> {
|
||||
|
||||
public DispositivoEmbarcada buscarMac(String mac);
|
||||
public DispositivoEmbarcada buscarImei(String imei);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
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.CtrlSerieEmbarcadaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CtrlSerieEmbarcada;
|
||||
|
||||
@Repository("ctrlSerieEmbarcadaDAO")
|
||||
public class CtrlSerieEmbarcadaHibernateDAO extends GenericHibernateDAO<CtrlSerieEmbarcada, Long> implements CtrlSerieEmbarcadaDAO {
|
||||
|
||||
@Autowired
|
||||
public CtrlSerieEmbarcadaHibernateDAO(@Qualifier("sessionFactory") SessionFactory factory) {
|
||||
setSessionFactory(factory);
|
||||
}
|
||||
}
|
|
@ -44,6 +44,15 @@ public class DispositivoEmbarcadaHibernateDAO extends GenericHibernateDAO<Dispos
|
|||
|
||||
return (DispositivoEmbarcada) c.uniqueResult();
|
||||
}
|
||||
|
||||
public DispositivoEmbarcada buscarImei(String imei){
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
c.add(Restrictions.eq("imei", imei));
|
||||
|
||||
return (DispositivoEmbarcada) c.uniqueResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DispositivoEmbarcada suscribir(DispositivoEmbarcada entity) {
|
||||
|
|
|
@ -0,0 +1,118 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
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
|
||||
@SequenceGenerator(name = "CTRL_SERIE_EMBARCADA_SEQ", sequenceName = "CTRL_SERIE_EMBARCADA_SEQ", allocationSize = 1)
|
||||
@Table(name = "CTRL_SERIE_EMBARCADA")
|
||||
public class CtrlSerieEmbarcada {
|
||||
@Id
|
||||
@Basic(optional = false)
|
||||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "CTRL_SERIE_EMBARCADA_SEQ")
|
||||
@Column(name = "CTRLSERIEEMBARCADA_ID")
|
||||
private Long ctrlSerieEmbarcadaId;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "DISPOSITIVOEMBARCADA_ID", referencedColumnName = "DISPOSITIVOEMBARCADA_ID")
|
||||
private DispositivoEmbarcada dispositivoEmbarcada;
|
||||
@Column(name = "EMPRESA_ID")
|
||||
private Long empresaId;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "ESTADO_ID", referencedColumnName = "ESTADO_ID")
|
||||
private Estado estado;
|
||||
@Column(name = "SERIE")
|
||||
private String serie;
|
||||
@Column(name = "NUMEROINICIAL")
|
||||
private String numeroInicial;
|
||||
@Column(name = "NUMEROCORRENTE")
|
||||
private String numeroCorrente;
|
||||
@Column(name = "IND_BAIXADO")
|
||||
private Boolean indBaixado;
|
||||
@Column(name = "ACTIVO")
|
||||
private Boolean activo;
|
||||
@Basic(optional = false)
|
||||
@Column(name = "FECMODIF")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date fecmodif;
|
||||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
|
||||
public Long getCtrlSerieEmbarcadaId() {
|
||||
return ctrlSerieEmbarcadaId;
|
||||
}
|
||||
public void setCtrlSerieEmbarcadaId(Long ctrlSerieEmbarcadaId) {
|
||||
this.ctrlSerieEmbarcadaId = ctrlSerieEmbarcadaId;
|
||||
}
|
||||
public DispositivoEmbarcada getDispositivoEmbarcadaId() {
|
||||
return dispositivoEmbarcada;
|
||||
}
|
||||
public void setDispositivoEmbarcadaId(DispositivoEmbarcada dispositivoEmbarcadaId) {
|
||||
this.dispositivoEmbarcada = dispositivoEmbarcadaId;
|
||||
}
|
||||
public Long getEmpresaId() {
|
||||
return empresaId;
|
||||
}
|
||||
public void setEmpresaId(Long empresaId) {
|
||||
this.empresaId = empresaId;
|
||||
}
|
||||
public Estado getEstado() {
|
||||
return estado;
|
||||
}
|
||||
public void setEstado(Estado estadoId) {
|
||||
this.estado = estadoId;
|
||||
}
|
||||
public String getSerie() {
|
||||
return serie;
|
||||
}
|
||||
public void setSerie(String serie) {
|
||||
this.serie = serie;
|
||||
}
|
||||
public String getNumeroInicial() {
|
||||
return numeroInicial;
|
||||
}
|
||||
public void setNumeroInicial(String numeroInicial) {
|
||||
this.numeroInicial = numeroInicial;
|
||||
}
|
||||
public String getNumeroCorrente() {
|
||||
return numeroCorrente;
|
||||
}
|
||||
public void setNumeroCorrente(String numeroCorrente) {
|
||||
this.numeroCorrente = numeroCorrente;
|
||||
}
|
||||
public Boolean getIndBaixado() {
|
||||
return indBaixado;
|
||||
}
|
||||
public void setIndBaixado(Boolean indBaixado) {
|
||||
this.indBaixado = indBaixado;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -1,13 +1,19 @@
|
|||
package com.rjconsultores.ventaboletos.entidad;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
|
@ -56,6 +62,9 @@ public class DispositivoEmbarcada {
|
|||
@Column(name = "USUARIO_ID")
|
||||
private Integer usuarioId;
|
||||
|
||||
@OneToMany(mappedBy="dispositivoEmbarcada", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
|
||||
private List<CtrlSerieEmbarcada> series = new ArrayList<CtrlSerieEmbarcada>();
|
||||
|
||||
public Long getDispositivoEmbarcadaId() {
|
||||
return dispositivoEmbarcadaId;
|
||||
}
|
||||
|
@ -151,5 +160,12 @@ public class DispositivoEmbarcada {
|
|||
}
|
||||
public void setUsuarioId(Integer usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
public List<CtrlSerieEmbarcada> getSeries() {
|
||||
return series;
|
||||
}
|
||||
public void setSeries(List<CtrlSerieEmbarcada> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,113 @@
|
|||
package com.rjconsultores.ventaboletos.vo.embarcada;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DispositivoEmbarcadaVO {
|
||||
|
||||
private Long idAgencia;
|
||||
private String descAgencia;
|
||||
private String descEquipamento;
|
||||
private Integer bloqueado;
|
||||
private Integer manutencao;
|
||||
private Integer baixado;
|
||||
private Long idempresa;
|
||||
private String descEmpresa;
|
||||
private List<EstadoDispositivoEmbarcadaVO> estados = new ArrayList<EstadoDispositivoEmbarcadaVO>();
|
||||
private String cnpjAgencia;
|
||||
private String enderecoAgencia;
|
||||
private String cnpjEmpresa;
|
||||
private String enderecoEmpresa;
|
||||
|
||||
public void add(EstadoDispositivoEmbarcadaVO estado){
|
||||
estados.add(estado);
|
||||
}
|
||||
|
||||
public Long getIdAgencia() {
|
||||
return idAgencia;
|
||||
}
|
||||
public void setIdAgencia(Long idAgencia) {
|
||||
this.idAgencia = idAgencia;
|
||||
}
|
||||
public String getDescAgencia() {
|
||||
return descAgencia;
|
||||
}
|
||||
public void setDescAgencia(String descAgencia) {
|
||||
this.descAgencia = descAgencia;
|
||||
}
|
||||
public String getDescEquipamento() {
|
||||
return descEquipamento;
|
||||
}
|
||||
public void setDescEquipamento(String descEquipamento) {
|
||||
this.descEquipamento = descEquipamento;
|
||||
}
|
||||
public Integer getBloqueado() {
|
||||
return bloqueado;
|
||||
}
|
||||
public void setBloqueado(Integer bloqueado) {
|
||||
this.bloqueado = bloqueado;
|
||||
}
|
||||
public Integer getManutencao() {
|
||||
return manutencao;
|
||||
}
|
||||
public void setManutencao(Integer manutencao) {
|
||||
this.manutencao = manutencao;
|
||||
}
|
||||
public Integer getBaixado() {
|
||||
return baixado;
|
||||
}
|
||||
public void setBaixado(Integer baixado) {
|
||||
this.baixado = baixado;
|
||||
}
|
||||
public Long getIdempresa() {
|
||||
return idempresa;
|
||||
}
|
||||
public void setIdempresa(Long idempresa) {
|
||||
this.idempresa = idempresa;
|
||||
}
|
||||
public String getDescEmpresa() {
|
||||
return descEmpresa;
|
||||
}
|
||||
public void setDescEmpresa(String descEmpresa) {
|
||||
this.descEmpresa = descEmpresa;
|
||||
}
|
||||
public List<EstadoDispositivoEmbarcadaVO> getEstados() {
|
||||
return estados;
|
||||
}
|
||||
public void setEstados(List<EstadoDispositivoEmbarcadaVO> estados) {
|
||||
this.estados = estados;
|
||||
}
|
||||
|
||||
public String getCnpjAgencia() {
|
||||
return cnpjAgencia;
|
||||
}
|
||||
|
||||
public void setCnpjAgencia(String cnpjAgencia) {
|
||||
this.cnpjAgencia = cnpjAgencia;
|
||||
}
|
||||
|
||||
public String getEnderecoAgencia() {
|
||||
return enderecoAgencia;
|
||||
}
|
||||
|
||||
public void setEnderecoAgencia(String enderecoAgencia) {
|
||||
this.enderecoAgencia = enderecoAgencia;
|
||||
}
|
||||
|
||||
public String getCnpjEmpresa() {
|
||||
return cnpjEmpresa;
|
||||
}
|
||||
|
||||
public void setCnpjEmpresa(String cnpjEmpresa) {
|
||||
this.cnpjEmpresa = cnpjEmpresa;
|
||||
}
|
||||
|
||||
public String getEnderecoEmpresa() {
|
||||
return enderecoEmpresa;
|
||||
}
|
||||
|
||||
public void setEnderecoEmpresa(String enderecoEmpresa) {
|
||||
this.enderecoEmpresa = enderecoEmpresa;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.rjconsultores.ventaboletos.vo.embarcada;
|
||||
|
||||
public class EstadoDispositivoEmbarcadaVO {
|
||||
private Long idUf;
|
||||
private String descUf;
|
||||
private String serie;
|
||||
private String numBpe;
|
||||
|
||||
public Long getIdUf() {
|
||||
return idUf;
|
||||
}
|
||||
public void setIdUf(Long idUf) {
|
||||
this.idUf = idUf;
|
||||
}
|
||||
public String getDescUf() {
|
||||
return descUf;
|
||||
}
|
||||
public void setDescUf(String descUf) {
|
||||
this.descUf = descUf;
|
||||
}
|
||||
public String getSerie() {
|
||||
return serie;
|
||||
}
|
||||
public void setSerie(String serie) {
|
||||
this.serie = serie;
|
||||
}
|
||||
public String getNumBpe() {
|
||||
return numBpe;
|
||||
}
|
||||
public void setNumBpe(String numBpe) {
|
||||
this.numBpe = numBpe;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue