diff --git a/src/com/rjconsultores/ventaboletos/dao/EstacionDAO.java b/src/com/rjconsultores/ventaboletos/dao/EstacionDAO.java index 0108ca7ba..02801549f 100644 --- a/src/com/rjconsultores/ventaboletos/dao/EstacionDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/EstacionDAO.java @@ -31,6 +31,8 @@ public interface EstacionDAO extends GenericDAO { public List buscar(Long numCaja, PuntoVenta puntoVenta); public List buscarEstaciones(PuntoVenta puntoVenta); + + public List buscarEstaciones(List lsPuntoVenta); public List buscarPuntosVentaEstacionPorUsuario(Usuario usuario); diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/EstacionHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/EstacionHibernateDAO.java index 384aa32a1..10f125a7a 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/EstacionHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/EstacionHibernateDAO.java @@ -174,4 +174,19 @@ public class EstacionHibernateDAO extends GenericHibernateDAO } + @SuppressWarnings("unchecked") + @Override + public List buscarEstaciones(List lsPuntoVenta) { + + Criteria c = getSession().createCriteria(getPersistentClass()); + c.add(Restrictions.eq("activo", Boolean.TRUE)); + c.add(Restrictions.in("puntoVenta", lsPuntoVenta)); + c.addOrder(Order.asc("numcaja")); + c.addOrder(Order.asc("descestacion")); + c.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); + + return c.list(); + + } + } diff --git a/src/com/rjconsultores/ventaboletos/service/EstacionService.java b/src/com/rjconsultores/ventaboletos/service/EstacionService.java index 2f8f8a301..46dfaede4 100644 --- a/src/com/rjconsultores/ventaboletos/service/EstacionService.java +++ b/src/com/rjconsultores/ventaboletos/service/EstacionService.java @@ -40,6 +40,8 @@ public interface EstacionService { public Long getDecimalMAC(String mac); public List buscarEstaciones(PuntoVenta puntoVenta); + + public List buscarEstaciones(List lsPuntoVenta); public void devolverFoliosAutomaticosImpressoraFiscal(EstacionImpresora ei); diff --git a/src/com/rjconsultores/ventaboletos/service/impl/EstacionServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/EstacionServiceImpl.java index c459d65ab..8f5d863c9 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/EstacionServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/EstacionServiceImpl.java @@ -203,4 +203,9 @@ public class EstacionServiceImpl implements EstacionService { return estaciones; } + @Override + public List buscarEstaciones(List lsPuntoVenta) { + return estacionDAO.buscarEstaciones(lsPuntoVenta); + } + }