14633: Usuário para ckeck-in
fixes bug#14633 dev:valdir qua:jose git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@94978 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
c71e52ad7f
commit
a23a8f1d9b
|
@ -4,11 +4,12 @@
|
|||
*/
|
||||
package com.rjconsultores.ventaboletos.dao;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.rjconsultores.ventaboletos.entidad.Empleado;
|
||||
import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||
import com.rjconsultores.ventaboletos.vo.caja.UsuarioActivoVO;
|
||||
|
||||
import java.util.List;
|
||||
import com.rjconsultores.ventaboletos.vo.embarcada.UsuarioEmbarcadaVO;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -30,4 +31,6 @@ public interface UsuarioDAO extends GenericDAO<Usuario, Integer> {
|
|||
|
||||
public Usuario buscarPeloId(Integer usuarioId);
|
||||
|
||||
public List<UsuarioEmbarcadaVO> buscarPorFuncionSistema(Long funcionSistemaId);
|
||||
|
||||
}
|
||||
|
|
|
@ -14,7 +14,9 @@ import org.hibernate.criterion.MatchMode;
|
|||
import org.hibernate.criterion.Order;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.hibernate.transform.AliasToBeanResultTransformer;
|
||||
import org.hibernate.transform.Transformers;
|
||||
import org.hibernate.type.IntegerType;
|
||||
import org.hibernate.type.LongType;
|
||||
import org.hibernate.type.StringType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
@ -22,10 +24,10 @@ 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;
|
||||
import com.rjconsultores.ventaboletos.vo.embarcada.UsuarioEmbarcadaVO;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -117,4 +119,29 @@ public class UsuarioHibernateDAO extends GenericHibernateDAO<Usuario, Integer> i
|
|||
|
||||
return (Usuario) c.uniqueResult();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UsuarioEmbarcadaVO> buscarPorFuncionSistema(Long funcionSistemaId){
|
||||
StringBuilder sQuery = new StringBuilder();
|
||||
sQuery.append("select u.usuario_Id as usuarioId, null as nome, u.cveusuario as cveusuario, u.desccontrasena as senha, null as email from usuario u ");
|
||||
sQuery.append("where ");
|
||||
sQuery.append(" u.activo = 1 ");
|
||||
sQuery.append(" and u.usuario_id in ( ");
|
||||
sQuery.append(" select up.usuario_id ");
|
||||
sQuery.append(" from usuario_perfil up ");
|
||||
sQuery.append(" join perfil_funcion pf on pf.perfil_id = up.perfil_id ");
|
||||
sQuery.append(" where pf.funcionsistema_id = :funcionSistemaId AND pf.activo = 1 and up.activo = 1 ");
|
||||
sQuery.append(" ) ");
|
||||
|
||||
Query qr = getSession().createSQLQuery(sQuery.toString())
|
||||
.addScalar("usuarioId", new LongType())
|
||||
.addScalar("nome", new StringType())
|
||||
.addScalar("cveusuario", new StringType())
|
||||
.addScalar("senha", new StringType())
|
||||
.addScalar("email", new StringType())
|
||||
.setResultTransformer(Transformers.aliasToBean(UsuarioEmbarcadaVO.class));
|
||||
|
||||
qr.setLong("funcionSistemaId", funcionSistemaId);
|
||||
return (List<UsuarioEmbarcadaVO>)qr.list();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ public class UsuarioEmbarcadaVO {
|
|||
private String senha;
|
||||
private String email;
|
||||
|
||||
public UsuarioEmbarcadaVO(){}
|
||||
|
||||
public UsuarioEmbarcadaVO(Long usuarioId, String nome, String cveusuario, String senha, String email) {
|
||||
super();
|
||||
this.usuarioId = usuarioId;
|
||||
|
|
Loading…
Reference in New Issue