frederico 2016-07-25 19:06:35 +00:00
parent e3d4b54da3
commit 78b3f31ae8
4 changed files with 26 additions and 0 deletions

View File

@ -3,7 +3,10 @@ package com.rjconsultores.ventaboletos.dao;
import java.util.List; import java.util.List;
import com.rjconsultores.ventaboletos.entidad.ExcepcionPeaje; import com.rjconsultores.ventaboletos.entidad.ExcepcionPeaje;
import com.rjconsultores.ventaboletos.entidad.ExcepcionPeajeVigencia;
public interface ExcepcionPeajeDAO extends GenericDAO<ExcepcionPeaje, Integer> { public interface ExcepcionPeajeDAO extends GenericDAO<ExcepcionPeaje, Integer> {
public List<ExcepcionPeaje> buscar(String descconvenio, String cveconvenio); public List<ExcepcionPeaje> buscar(String descconvenio, String cveconvenio);
public void deletarVigencias(List<ExcepcionPeajeVigencia> epv);
} }

View File

@ -4,6 +4,7 @@ import java.util.List;
import org.hibernate.Criteria; import org.hibernate.Criteria;
import org.hibernate.Hibernate; import org.hibernate.Hibernate;
import org.hibernate.Query;
import org.hibernate.Session; import org.hibernate.Session;
import org.hibernate.SessionFactory; import org.hibernate.SessionFactory;
import org.hibernate.criterion.Order; import org.hibernate.criterion.Order;
@ -15,6 +16,7 @@ import org.springframework.stereotype.Repository;
import com.rjconsultores.ventaboletos.dao.ExcepcionPeajeDAO; import com.rjconsultores.ventaboletos.dao.ExcepcionPeajeDAO;
import com.rjconsultores.ventaboletos.entidad.AbastoCentral; import com.rjconsultores.ventaboletos.entidad.AbastoCentral;
import com.rjconsultores.ventaboletos.entidad.ExcepcionPeaje; import com.rjconsultores.ventaboletos.entidad.ExcepcionPeaje;
import com.rjconsultores.ventaboletos.entidad.ExcepcionPeajeVigencia;
@Repository("excepcionPeajeDAO") @Repository("excepcionPeajeDAO")
public class ExcepcionPeajeHibernateDAO extends GenericHibernateDAO<ExcepcionPeaje, Integer> public class ExcepcionPeajeHibernateDAO extends GenericHibernateDAO<ExcepcionPeaje, Integer>
@ -50,4 +52,17 @@ implements ExcepcionPeajeDAO {
} }
return list; return list;
} }
@Override
public void deletarVigencias(List<ExcepcionPeajeVigencia> excepcionPeajeVigencias) {
for (ExcepcionPeajeVigencia epv : excepcionPeajeVigencias) {
String hql = " update ExcepcionPeajeVigencia set activo = false, fecModif = :fecModif, usuarioId = :usuarioId where excepcionPeajeVigenciaId = " + epv.getExcepcionPeajeVigenciaId();
Query sq = getSession().createQuery(hql);
sq.setTimestamp("fecModif", epv.getFecmodif());
sq.setInteger("usuarioId", epv.getUsuarioId());
sq.executeUpdate();
}
}
} }

View File

@ -3,9 +3,11 @@ package com.rjconsultores.ventaboletos.service;
import java.util.List; import java.util.List;
import com.rjconsultores.ventaboletos.entidad.ExcepcionPeaje; import com.rjconsultores.ventaboletos.entidad.ExcepcionPeaje;
import com.rjconsultores.ventaboletos.entidad.ExcepcionPeajeVigencia;
public interface ExcepcionPeajeService extends GenericService<ExcepcionPeaje, Integer> { public interface ExcepcionPeajeService extends GenericService<ExcepcionPeaje, Integer> {
public List<ExcepcionPeaje> buscar(String descconvenio, String cveconvenio); public List<ExcepcionPeaje> buscar(String descconvenio, String cveconvenio);
public void deletarVigencias(List<ExcepcionPeajeVigencia> epv);
} }

View File

@ -10,6 +10,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.rjconsultores.ventaboletos.dao.ExcepcionPeajeDAO; import com.rjconsultores.ventaboletos.dao.ExcepcionPeajeDAO;
import com.rjconsultores.ventaboletos.entidad.ExcepcionPeaje; import com.rjconsultores.ventaboletos.entidad.ExcepcionPeaje;
import com.rjconsultores.ventaboletos.entidad.ExcepcionPeajeVigencia;
import com.rjconsultores.ventaboletos.service.ExcepcionPeajeService; import com.rjconsultores.ventaboletos.service.ExcepcionPeajeService;
import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado; import com.rjconsultores.ventaboletos.utilerias.UsuarioLogado;
@ -82,4 +83,9 @@ public class ExcepcionPeajeServiceImpl implements ExcepcionPeajeService {
excepcionPeajeDAO.actualizacion(entidad); excepcionPeajeDAO.actualizacion(entidad);
} }
@Override
public void deletarVigencias(List<ExcepcionPeajeVigencia> epv) {
excepcionPeajeDAO.deletarVigencias(epv);
}
} }