diff --git a/src/com/rjconsultores/ventaboletos/dao/FechamentoParamptovtaDAO.java b/src/com/rjconsultores/ventaboletos/dao/FechamentoParamptovtaDAO.java index 1effcceab..56de43823 100644 --- a/src/com/rjconsultores/ventaboletos/dao/FechamentoParamptovtaDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/FechamentoParamptovtaDAO.java @@ -3,11 +3,12 @@ package com.rjconsultores.ventaboletos.dao; import java.util.List; import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; public interface FechamentoParamptovtaDAO extends GenericDAO { public List buscaParametrosPorEmpresas(List empresasId); public List buscaParametrosPorEmpresa(Integer empresasId); - public FechamentoParamptovta buscaParametrosPorPuntoventa(Integer puntoventaId); + public List buscaParametrosPorPuntoventa(PuntoVenta puntoventa); } diff --git a/src/com/rjconsultores/ventaboletos/dao/hibernate/FechamentoParamptovtaHibernateDAO.java b/src/com/rjconsultores/ventaboletos/dao/hibernate/FechamentoParamptovtaHibernateDAO.java index 0ea9fb604..57b6e1e76 100644 --- a/src/com/rjconsultores/ventaboletos/dao/hibernate/FechamentoParamptovtaHibernateDAO.java +++ b/src/com/rjconsultores/ventaboletos/dao/hibernate/FechamentoParamptovtaHibernateDAO.java @@ -12,6 +12,7 @@ import org.springframework.stereotype.Repository; import com.rjconsultores.ventaboletos.dao.FechamentoParamptovtaDAO; import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; @Repository("fechamentoParamptovtaDAO") @@ -61,13 +62,14 @@ public class FechamentoParamptovtaHibernateDAO extends GenericHibernateDAO buscaParametrosPorPuntoventa(PuntoVenta puntoventa) { + Criteria query = getSession().createCriteria(getPersistentClass()); + query.add(Restrictions.eq("puntoventa", puntoventa)); query.add(Restrictions.eq("activo", Boolean.TRUE)); - return (FechamentoParamptovta)query.uniqueResult(); + List params = query.list(); + + return params; } } diff --git a/src/com/rjconsultores/ventaboletos/service/FechamentoParamptovtaService.java b/src/com/rjconsultores/ventaboletos/service/FechamentoParamptovtaService.java index 0725fc141..117749935 100644 --- a/src/com/rjconsultores/ventaboletos/service/FechamentoParamptovtaService.java +++ b/src/com/rjconsultores/ventaboletos/service/FechamentoParamptovtaService.java @@ -3,12 +3,13 @@ package com.rjconsultores.ventaboletos.service; import java.util.List; import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; public interface FechamentoParamptovtaService extends GenericService { public List buscaParametrosPorEmpresas(List empresasId); public List buscaParametrosPorEmpresa(Integer empresasId); public FechamentoParamptovta suscribirOrActualizacion(FechamentoParamptovta FechamentoParamptovta); - public FechamentoParamptovta buscaParametrosPorPuntoventa(Integer puntoventaId); + public List buscaParametrosPorPuntoventa(PuntoVenta puntoventa); } diff --git a/src/com/rjconsultores/ventaboletos/service/impl/FechamentoParamptovtaServiceImpl.java b/src/com/rjconsultores/ventaboletos/service/impl/FechamentoParamptovtaServiceImpl.java index 110b3eabf..2744e4936 100644 --- a/src/com/rjconsultores/ventaboletos/service/impl/FechamentoParamptovtaServiceImpl.java +++ b/src/com/rjconsultores/ventaboletos/service/impl/FechamentoParamptovtaServiceImpl.java @@ -8,6 +8,7 @@ import org.springframework.transaction.annotation.Transactional; import com.rjconsultores.ventaboletos.dao.FechamentoParamptovtaDAO; import com.rjconsultores.ventaboletos.entidad.FechamentoParamptovta; +import com.rjconsultores.ventaboletos.entidad.PuntoVenta; import com.rjconsultores.ventaboletos.service.FechamentoParamptovtaService; @Service("fechamentoParamptovtaService") @@ -71,8 +72,8 @@ public class FechamentoParamptovtaServiceImpl implements FechamentoParamptovtaSe } @Override - public FechamentoParamptovta buscaParametrosPorPuntoventa(Integer puntoventaId) { - FechamentoParamptovta params = fechamentoParamptovtaDAO.buscaParametrosPorPuntoventa(puntoventaId); + public List buscaParametrosPorPuntoventa(PuntoVenta puntoventa) { + List params = fechamentoParamptovtaDAO.buscaParametrosPorPuntoventa(puntoventa); return params; } }