Correção para não listar TODOS no convecio.fixes bug#7637
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Model/trunk/modelWeb@57955 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
56c3cfcf80
commit
7dd3d39f76
|
@ -18,7 +18,7 @@ import com.rjconsultores.ventaboletos.entidad.PuntoVenta;
|
||||||
public interface PuntoVentaDAO extends GenericDAO<PuntoVenta, Integer> {
|
public interface PuntoVentaDAO extends GenericDAO<PuntoVenta, Integer> {
|
||||||
|
|
||||||
|
|
||||||
public List<PuntoVenta> buscaLike(String strEstacion);
|
public List<PuntoVenta> buscaLike(String strEstacion, boolean sinTodos);
|
||||||
|
|
||||||
public List<PuntoVenta> busca(String nomPuntoVenta, String numPuntoVenta);
|
public List<PuntoVenta> busca(String nomPuntoVenta, String numPuntoVenta);
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@ import com.rjconsultores.ventaboletos.entidad.Usuario;
|
||||||
public class PuntoVentaHibernateDAO extends GenericHibernateDAO<PuntoVenta, Integer>
|
public class PuntoVentaHibernateDAO extends GenericHibernateDAO<PuntoVenta, Integer>
|
||||||
implements PuntoVentaDAO {
|
implements PuntoVentaDAO {
|
||||||
|
|
||||||
|
public static final int ID_PUNTO_VENTA_TODOS = -1;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PtovtaTipoEstoqueDAO ptovtaTipoEstoqueDAO;
|
private PtovtaTipoEstoqueDAO ptovtaTipoEstoqueDAO;
|
||||||
|
|
||||||
|
@ -55,21 +57,21 @@ public class PuntoVentaHibernateDAO extends GenericHibernateDAO<PuntoVenta, Inte
|
||||||
return c.list();
|
return c.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
// public List<PuntoVenta> buscaLike(String strEstacion) {
|
|
||||||
// Criteria c = getSession().createCriteria(getPersistentClass());
|
|
||||||
// c.add(Restrictions.eq("activo", Boolean.TRUE));
|
|
||||||
// c.add(Restrictions.like("nombpuntoventa", strEstacion, MatchMode.START));
|
|
||||||
//
|
|
||||||
// return c.list();
|
|
||||||
// }
|
|
||||||
|
|
||||||
public List<PuntoVenta> buscaLike(String strEstacion) {
|
public List<PuntoVenta> buscaLike(String strEstacion, boolean sinTodos) {
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
|
||||||
Criterion cr1 = Restrictions.like("nombpuntoventa", strEstacion, MatchMode.START);
|
Criterion cr1 = Restrictions.like("nombpuntoventa", strEstacion, MatchMode.START);
|
||||||
|
|
||||||
Criterion crActivo = Restrictions.eq("activo", Boolean.TRUE);
|
Criterion crActivo = Restrictions.eq("activo", Boolean.TRUE);
|
||||||
|
|
||||||
|
|
||||||
|
if (sinTodos){
|
||||||
|
Criterion crSinTodos = Restrictions.ne("puntoventaId", ID_PUNTO_VENTA_TODOS);
|
||||||
|
c.add(crSinTodos);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
PtovtaTipoEstoque supr = ptovtaTipoEstoqueDAO.buscarTipoSuprimento();
|
PtovtaTipoEstoque supr = ptovtaTipoEstoqueDAO.buscarTipoSuprimento();
|
||||||
PtovtaTipoEstoque cont = ptovtaTipoEstoqueDAO.buscarTipoContabilidade();
|
PtovtaTipoEstoque cont = ptovtaTipoEstoqueDAO.buscarTipoContabilidade();
|
||||||
|
|
||||||
|
@ -102,10 +104,8 @@ public class PuntoVentaHibernateDAO extends GenericHibernateDAO<PuntoVenta, Inte
|
||||||
|
|
||||||
public List<PuntoVenta> buscaPuntoVentaParada(Parada parada) {
|
public List<PuntoVenta> buscaPuntoVentaParada(Parada parada) {
|
||||||
Criteria c = getSession().createCriteria(getPersistentClass());
|
Criteria c = getSession().createCriteria(getPersistentClass());
|
||||||
|
|
||||||
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
c.add(Restrictions.eq("activo", Boolean.TRUE));
|
||||||
c.add(Restrictions.eq("parada", parada));
|
c.add(Restrictions.eq("parada", parada));
|
||||||
|
|
||||||
c.addOrder(Order.asc("nombpuntoventa"));
|
c.addOrder(Order.asc("nombpuntoventa"));
|
||||||
|
|
||||||
return c.list();
|
return c.list();
|
||||||
|
|
|
@ -30,7 +30,7 @@ public interface PuntoVentaService {
|
||||||
|
|
||||||
public void borrar(PuntoVenta entidad)throws BusinessException;
|
public void borrar(PuntoVenta entidad)throws BusinessException;
|
||||||
|
|
||||||
public List<PuntoVenta> buscaLike(String strEstacion);
|
public List<PuntoVenta> buscaLike(String strEstacion, boolean sinTodos);
|
||||||
|
|
||||||
public List<PuntoVenta> buscar(String nomPuntoVenta, String numPuntoVenta);
|
public List<PuntoVenta> buscar(String nomPuntoVenta, String numPuntoVenta);
|
||||||
|
|
||||||
|
|
|
@ -249,8 +249,8 @@ public class PuntoVentaServiceImpl implements PuntoVentaService {
|
||||||
puntoVentaDAO.actualizacion(entidad);
|
puntoVentaDAO.actualizacion(entidad);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PuntoVenta> buscaLike(String strEstacion) {
|
public List<PuntoVenta> buscaLike(String strEstacion, boolean sinTodos) {
|
||||||
return puntoVentaDAO.buscaLike(strEstacion);
|
return puntoVentaDAO.buscaLike(strEstacion, sinTodos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<PuntoVenta> buscar(String nomPuntoVenta, String numPuntoVenta) {
|
public List<PuntoVenta> buscar(String nomPuntoVenta, String numPuntoVenta) {
|
||||||
|
|
Loading…
Reference in New Issue