Série para venda embarcada
bug#13748 dev:trevezani qua: git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@91498 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
a5ae4514a6
commit
4e10906d31
|
@ -13,6 +13,7 @@ public interface CtrlSerieEmbarcadaDAO extends GenericDAO<CtrlSerieEmbarcada, L
|
|||
|
||||
public CtrlSerieEmbarcada suscribir(CtrlSerieEmbarcada entity);
|
||||
public CtrlSerieEmbarcada actualizacion(CtrlSerieEmbarcada entity);
|
||||
public void borrar(CtrlSerieEmbarcada entity);
|
||||
|
||||
public Boolean validaDispositivoEmpresaEstadoCadastrado(DispositivoEmbarcada dispositivo, Empresa empresa, Estado estado);
|
||||
public List<SerieEmbarcada> buscarSeriesEmbarcadaDisponivel(final Integer empresaId, final Integer estadoId);
|
||||
|
|
|
@ -14,4 +14,6 @@ public interface DispositivoEmbarcadaDAO extends GenericDAO<DispositivoEmbarcad
|
|||
public DispositivoEmbarcada buscarImei(String imei);
|
||||
public List<DispositivoEmbarcada> buscarPorEmpresaPuntoVenta(Empresa empresa, PuntoVenta puntoventa);
|
||||
|
||||
public List<DispositivoEmbarcada> buscarTodos();
|
||||
|
||||
}
|
||||
|
|
|
@ -27,4 +27,7 @@ public interface UsuarioDAO extends GenericDAO<Usuario, Integer> {
|
|||
public List<UsuarioActivoVO> buscarUsuariosActivo();
|
||||
|
||||
public List<Usuario> buscarPeloNomeLike(String nome);
|
||||
|
||||
public Usuario buscarPeloId(Integer usuarioId);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.rjconsultores.ventaboletos.dao.hibernate;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
@ -22,10 +23,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
|
||||
import com.rjconsultores.ventaboletos.dao.CtrlSerieEmbarcadaDAO;
|
||||
import com.rjconsultores.ventaboletos.entidad.CtrlSerieEmbarcada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Curso;
|
||||
import com.rjconsultores.ventaboletos.entidad.DispositivoEmbarcada;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empresa;
|
||||
import com.rjconsultores.ventaboletos.entidad.Estado;
|
||||
import com.rjconsultores.ventaboletos.exception.SerieEmbarcadaNaoDisponivelException;
|
||||
import com.rjconsultores.ventaboletos.utilerias.RegistroConDependenciaException;
|
||||
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
|
||||
import com.rjconsultores.ventaboletos.vo.embarcada.SerieEmbarcada;
|
||||
|
||||
@Repository("ctrlSerieEmbarcadaDAO")
|
||||
|
@ -40,6 +44,9 @@ public class CtrlSerieEmbarcadaHibernateDAO extends GenericHibernateDAO<CtrlSer
|
|||
@Override
|
||||
@Transactional
|
||||
public CtrlSerieEmbarcada suscribir(CtrlSerieEmbarcada entity) {
|
||||
entity.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entity.setFecmodif(Calendar.getInstance().getTime());
|
||||
|
||||
try {
|
||||
this.getHibernateTemplate().save(entity);
|
||||
getHibernateTemplate().flush();
|
||||
|
@ -50,11 +57,24 @@ public class CtrlSerieEmbarcadaHibernateDAO extends GenericHibernateDAO<CtrlSer
|
|||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void borrar(CtrlSerieEmbarcada entity) {
|
||||
entity.setActivo(Boolean.FALSE);
|
||||
|
||||
actualizacion(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public CtrlSerieEmbarcada actualizacion(CtrlSerieEmbarcada entity) {
|
||||
entity.setUsuarioId(UsuarioLogado.getUsuarioLogado().getUsuarioId());
|
||||
entity.setFecmodif(Calendar.getInstance().getTime());
|
||||
|
||||
entity = getHibernateTemplate().merge(entity);
|
||||
|
||||
getHibernateTemplate().flush();
|
||||
|
||||
return entity;
|
||||
}
|
||||
|
||||
|
|
|
@ -115,5 +115,16 @@ public class DispositivoEmbarcadaHibernateDAO extends GenericHibernateDAO<Dispos
|
|||
|
||||
return qry.list();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<DispositivoEmbarcada> buscarTodos() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("from DispositivoEmbarcada de ");
|
||||
sb.append("where activo = 1 ");
|
||||
|
||||
Query qry = getSession().createQuery(sb.toString());
|
||||
|
||||
return qry.list();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.springframework.stereotype.Repository;
|
|||
|
||||
import com.rjconsultores.ventaboletos.dao.UsuarioDAO;
|
||||
import com.rjconsultores.ventaboletos.dao.sqlbuilder.SQLBuilder;
|
||||
import com.rjconsultores.ventaboletos.entidad.ContaMD;
|
||||
import com.rjconsultores.ventaboletos.entidad.Empleado;
|
||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||
import com.rjconsultores.ventaboletos.vo.caja.UsuarioActivoVO;
|
||||
|
@ -108,4 +109,12 @@ public class UsuarioHibernateDAO extends GenericHibernateDAO<Usuario, Integer> i
|
|||
|
||||
return c.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Usuario buscarPeloId(Integer usuarioId) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("usuarioId", usuarioId));
|
||||
|
||||
return (Usuario) c.uniqueResult();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,8 +31,11 @@ public class CtrlSerieEmbarcada implements Serializable {
|
|||
@ManyToOne
|
||||
@JoinColumn(name = "DISPOSITIVOEMBARCADA_ID", referencedColumnName = "DISPOSITIVOEMBARCADA_ID")
|
||||
private DispositivoEmbarcada dispositivoEmbarcada;
|
||||
@OneToOne
|
||||
@JoinColumn(name = "EMPRESA_ID")
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "PUNTOVENTA_ID", referencedColumnName = "PUNTOVENTA_ID")
|
||||
private PuntoVenta puntoventa;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "EMPRESA_ID", referencedColumnName = "EMPRESA_ID")
|
||||
private Empresa empresa;
|
||||
@ManyToOne
|
||||
@JoinColumn(name = "ESTADO_ID", referencedColumnName = "ESTADO_ID")
|
||||
|
@ -166,4 +169,12 @@ public class CtrlSerieEmbarcada implements Serializable {
|
|||
public void setUsuarioId(Integer usuarioId) {
|
||||
this.usuarioId = usuarioId;
|
||||
}
|
||||
|
||||
public PuntoVenta getPuntoventa() {
|
||||
return puntoventa;
|
||||
}
|
||||
|
||||
public void setPuntoventa(PuntoVenta puntoventa) {
|
||||
this.puntoventa = puntoventa;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,5 +171,9 @@ public class DispositivoEmbarcada {
|
|||
public void setSeries(List<CtrlSerieEmbarcada> series) {
|
||||
this.series = series;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.getDescricao();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,133 @@
|
|||
package com.rjconsultores.ventaboletos.vo.embarcada;
|
||||
|
||||
public class AutorizacaoUsoSerieEmbarcadaVO {
|
||||
private Long id;
|
||||
private String empresa;
|
||||
private String uf;
|
||||
private String serie;
|
||||
private String numero;
|
||||
private String descricao;
|
||||
private String registro;
|
||||
private String mac;
|
||||
private String bloqueado;
|
||||
private String manutencao;
|
||||
private String baixado;
|
||||
private String agencia;
|
||||
private String ultimoAcessoUsuario;
|
||||
private String ultimoAcessoDataHora;
|
||||
|
||||
public AutorizacaoUsoSerieEmbarcadaVO() {
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getEmpresa() {
|
||||
return empresa;
|
||||
}
|
||||
|
||||
public void setEmpresa(String empresa) {
|
||||
this.empresa = empresa;
|
||||
}
|
||||
|
||||
public String getUf() {
|
||||
return uf;
|
||||
}
|
||||
|
||||
public void setUf(String uf) {
|
||||
this.uf = uf;
|
||||
}
|
||||
|
||||
public String getSerie() {
|
||||
return serie;
|
||||
}
|
||||
|
||||
public void setSerie(String serie) {
|
||||
this.serie = serie;
|
||||
}
|
||||
|
||||
public String getNumero() {
|
||||
return numero;
|
||||
}
|
||||
|
||||
public void setNumero(String numero) {
|
||||
this.numero = numero;
|
||||
}
|
||||
|
||||
public String getDescricao() {
|
||||
return descricao;
|
||||
}
|
||||
|
||||
public void setDescricao(String descricao) {
|
||||
this.descricao = descricao;
|
||||
}
|
||||
|
||||
public String getRegistro() {
|
||||
return registro;
|
||||
}
|
||||
|
||||
public void setRegistro(String registro) {
|
||||
this.registro = registro;
|
||||
}
|
||||
|
||||
public String getMac() {
|
||||
return mac;
|
||||
}
|
||||
|
||||
public void setMac(String mac) {
|
||||
this.mac = mac;
|
||||
}
|
||||
|
||||
public String getBloqueado() {
|
||||
return bloqueado;
|
||||
}
|
||||
|
||||
public void setBloqueado(String bloqueado) {
|
||||
this.bloqueado = bloqueado;
|
||||
}
|
||||
|
||||
public String getManutencao() {
|
||||
return manutencao;
|
||||
}
|
||||
|
||||
public void setManutencao(String manutencao) {
|
||||
this.manutencao = manutencao;
|
||||
}
|
||||
|
||||
public String getBaixado() {
|
||||
return baixado;
|
||||
}
|
||||
|
||||
public void setBaixado(String baixado) {
|
||||
this.baixado = baixado;
|
||||
}
|
||||
|
||||
public String getAgencia() {
|
||||
return agencia;
|
||||
}
|
||||
|
||||
public void setAgencia(String agencia) {
|
||||
this.agencia = agencia;
|
||||
}
|
||||
|
||||
public String getUltimoAcessoUsuario() {
|
||||
return ultimoAcessoUsuario;
|
||||
}
|
||||
|
||||
public void setUltimoAcessoUsuario(String ultimoAcessoUsuario) {
|
||||
this.ultimoAcessoUsuario = ultimoAcessoUsuario;
|
||||
}
|
||||
|
||||
public String getUltimoAcessoDataHora() {
|
||||
return ultimoAcessoDataHora;
|
||||
}
|
||||
|
||||
public void setUltimoAcessoDataHora(String ultimoAcessoDataHora) {
|
||||
this.ultimoAcessoDataHora = ultimoAcessoDataHora;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue