fixes bug #6518
fixes bug #6519 fixes bug #6508 git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@46436 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
9724283941
commit
5b197590ab
|
@ -25,4 +25,6 @@ public interface UsuarioDAO extends GenericDAO<Usuario, Integer> {
|
|||
public List<Usuario> buscarPelaCveUsuario(String cveUsuario);
|
||||
|
||||
public List<UsuarioActivoVO> buscarUsuariosActivo();
|
||||
|
||||
public List<Usuario> buscarPeloNomeLike(String nome);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import org.hibernate.Criteria;
|
|||
import org.hibernate.Query;
|
||||
import org.hibernate.SQLQuery;
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.criterion.MatchMode;
|
||||
import org.hibernate.criterion.Order;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.hibernate.transform.AliasToBeanResultTransformer;
|
||||
|
@ -95,4 +96,16 @@ public class UsuarioHibernateDAO extends GenericHibernateDAO<Usuario, Integer> i
|
|||
|
||||
return sql.list();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Usuario> buscarPeloNomeLike(String nome) {
|
||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||
|
||||
c.add(Restrictions.like("nombusuario", nome, MatchMode.START));
|
||||
c.addOrder(Order.asc("nombusuario"));
|
||||
|
||||
return c.list();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,17 +12,16 @@ 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.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
import javax.persistence.SequenceGenerator;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -86,6 +85,8 @@ public class Autobus implements Serializable {
|
|||
private Empresa empresa;
|
||||
@OneToMany(mappedBy = "autobus", cascade = CascadeType.ALL)
|
||||
private List<AutobusDoc> autobusDocList;
|
||||
@Column(name = "NUMVAGON")
|
||||
private String numvagon;
|
||||
|
||||
public Autobus() {
|
||||
}
|
||||
|
@ -294,4 +295,12 @@ public class Autobus implements Serializable {
|
|||
public String toString() {
|
||||
return getNumautobus();
|
||||
}
|
||||
|
||||
public String getNumvagon() {
|
||||
return numvagon;
|
||||
}
|
||||
|
||||
public void setNumvagon(String numvagon) {
|
||||
this.numvagon = numvagon;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,14 @@ public class TipoTarifaPacote implements Serializable {
|
|||
super();
|
||||
}
|
||||
|
||||
public TipoTarifaPacote(Integer tipotarifapacoteId, String desctipotarifa) {
|
||||
this();
|
||||
this.tipotarifapacoteId = tipotarifapacoteId;
|
||||
this.desctipotarifa = desctipotarifa;
|
||||
}
|
||||
|
||||
public TipoTarifaPacote(Integer tipotarifapacoteId, String desctipotarifa, Boolean activo, Date fecmodif, Integer usuarioId) {
|
||||
super();
|
||||
this();
|
||||
this.tipotarifapacoteId = tipotarifapacoteId;
|
||||
this.desctipotarifa = desctipotarifa;
|
||||
this.activo = activo;
|
||||
|
@ -131,7 +137,7 @@ public class TipoTarifaPacote implements Serializable {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getDesctipotarifa() + " - " + getTipotarifapacoteId();
|
||||
return getDesctipotarifa();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,6 +27,7 @@ import javax.persistence.Table;
|
|||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.hibernate.annotations.Fetch;
|
||||
import org.hibernate.annotations.FetchMode;
|
||||
import org.springframework.security.core.Authentication;
|
||||
|
@ -353,5 +354,19 @@ public class Usuario implements Serializable, Authentication, UserDetails {
|
|||
public void setFecContrasena(Date fecContrasena) {
|
||||
this.fecContrasena = fecContrasena;
|
||||
}
|
||||
|
||||
public String getNombUsuarioCompleto() {
|
||||
StringBuilder sNome = new StringBuilder(getNombusuario());
|
||||
if(StringUtils.isNotBlank(getNombpaterno())) {
|
||||
sNome.append(" ")
|
||||
.append(getNombpaterno());
|
||||
}
|
||||
if(StringUtils.isNotBlank(getNombmaterno())) {
|
||||
sNome.append(" ")
|
||||
.append(getNombmaterno());
|
||||
}
|
||||
|
||||
return sNome.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -34,4 +34,6 @@ public interface UsuarioService {
|
|||
public Usuario suscribirActualizar(Usuario entidad, String senha, Perfil perfil) throws BusinessException;
|
||||
|
||||
public Usuario cambiarContrasena(Usuario entidad, String senha) throws BusinessException;
|
||||
|
||||
public List<Usuario> buscarPeloNomeLike(String nome);
|
||||
}
|
|
@ -210,4 +210,10 @@ public class UsuarioServiceImpl implements UsuarioService, UserDetailsService {
|
|||
public List<Usuario> buscarPelaCveUsuario(String cveUsuario) {
|
||||
return usuarioDAO.buscarPelaCveUsuario(cveUsuario);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Usuario> buscarPeloNomeLike(String nome) {
|
||||
return usuarioDAO.buscarPeloNomeLike(nome);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue