fixes bug#0011951

dev: thiago
qua: wallysson

Implementação efetuada conforme evidência.

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@86665 d1611594-4594-4d17-8e1d-87c2c4800839
master
emerson 2018-10-31 18:48:31 +00:00
parent 8405cedda0
commit c20b2e2aa7
9 changed files with 46 additions and 8 deletions

View File

@ -16,6 +16,7 @@ public class ConstantesFuncionSistema {
public static final String CLAVE_CALCULODIARIOCOMISSAO_AUTORIZACAOCALCULOTODASAGENCIAS = "COM.RJCONSULTORES.ADM.CALCULODIARIOCOMISSAO.AUTORIZACAOCALCULOTODASAGENCIAS";
public static final String CLAVE_HISTORICO_COMPRAS = "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOHISTORICOCOMPRAS";
public static final String CLAVE_EXPORTACAO_SGTI = "COM.RJCONSULTORES.ADMINISTRACION.GUI.ANALITICO.SGTI";
public static final String CLAVE_POSICAO_VENDA_BILHETE_IDOSO = "COM.RJCONSULTORES.ADMINISTRACION.GUI.RELATORIOS.MENU.RELATORIOPOSICAOVENDABILHETEIDOSO";

View File

@ -14,4 +14,6 @@ import java.util.List;
public interface CategoriaDAO extends GenericDAO<Categoria, Integer> {
public List<Categoria> buscar(String desccategoria);
public List<Categoria> buscarCategoriaPesquisada(String desccategoria);
}

View File

@ -26,5 +26,4 @@ public interface GenericDAO<T, ID> {
public Long count(String campo, Object o);
public void suscribirTodos(Collection<T> entidades);
}

View File

@ -9,6 +9,7 @@ import com.rjconsultores.ventaboletos.entidad.Categoria;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.MatchMode;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;
@ -44,4 +45,13 @@ public class CategoriaHibernateDAO extends GenericHibernateDAO<Categoria, Intege
return c.list();
}
@Override
public List<Categoria> buscarCategoriaPesquisada(String desccategoria) {
Criteria c = getSession().createCriteria(getPersistentClass());
c.add(Restrictions.eq("activo", Boolean.TRUE));
c.add(Restrictions.ilike("desccategoria", desccategoria, MatchMode.ANYWHERE));
return c.list();
}
}

View File

@ -1,14 +1,10 @@
package com.rjconsultores.ventaboletos.dao.hibernate;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import com.rjconsultores.ventaboletos.dao.GenericDAO;
import java.io.Serializable;
import java.lang.reflect.ParameterizedType;
import java.util.Collection;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.criterion.Criterion;
@ -16,6 +12,12 @@ import org.hibernate.criterion.Projections;
import org.hibernate.criterion.Restrictions;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import com.rjconsultores.ventaboletos.dao.GenericDAO;
/**
*
* @author gleimar

View File

@ -201,7 +201,7 @@ public class RutaHibernateDAO extends GenericHibernateDAO<Ruta, Integer> impleme
hql.append(" OR lower(prefixo) like :palavraPesquisaRuta ");
hql.append(" OR lower(str(numRuta)) like :palavraPesquisaRuta) ");
if (orgao != null) {
hql.append(" AND orgao.orgaoConcedenteId = :orgaoId ");
hql.append(" AND r.orgaoConcedente.orgaoConcedenteId = :orgaoId ");
}
Query sq = getSession().createQuery(hql.toString());

View File

@ -25,7 +25,6 @@ import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

View File

@ -0,0 +1,20 @@
package com.rjconsultores.ventaboletos.enums;
public enum TypeEventListener {
ON_CHANGE("onChange"),
ON_CLICK("onClick"),
ON_DOUBLE_CLICK("onDoubleClick"),
ON_CTRL_KEY("onCtrlKey");
private String event;
private TypeEventListener(String event) {
this.event = event;
}
public String getEvent() {
return event;
}
}

View File

@ -65,6 +65,11 @@ public class CategoriaServiceImpl implements CategoriaService {
return categoriaDAO.buscar(desccategoria);
}
@Override
public List<Categoria> buscarCategoriaPesquisada(String desccategoria) {
return categoriaDAO.buscarCategoriaPesquisada(desccategoria);
}
public List<Categoria> obtenerTodasCategoriasVisibles() {
List<Categoria> listCategoriasVisibles = new ArrayList<Categoria>();
List<Categoria> lsCategorias = obtenerTodos();