diff --git a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java index 2d0f9db..b96a8c4 100644 --- a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java +++ b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java @@ -8,6 +8,7 @@ import com.roshka.DTO.PostulanteListaDTO; import com.roshka.modelo.DBFile; import com.roshka.modelo.EstadoPostulante; import com.roshka.modelo.Postulante; +import com.roshka.modelo.TipoDeEstudio; import com.roshka.repositorio.*; import com.roshka.service.PdfGenerator; import com.roshka.utils.PostulantesExcelExporter; @@ -82,7 +83,7 @@ public class PostulanteRRHHController { @RequestParam(required = false)EstadoPostulante estado, @RequestParam(required = false)Long lvlEng, @RequestParam(required = false)Long lvlTec, - @RequestParam(required = false)Long instId, + @RequestParam(required = false)TipoDeEstudio tipoest, @RequestParam(required = false)String expInMonths, @RequestParam(required = false)Long cargoId, @RequestParam(required = false)Long convId, @@ -92,7 +93,7 @@ public class PostulanteRRHHController { final Integer CANTIDAD_POR_PAGINA = 10; Pageable page = PageRequest.of(nroPagina,CANTIDAD_POR_PAGINA,Sort.by("id")); model.addAttribute("tecnologias", tecRepo.findAll()); - model.addAttribute("institucionesEducativas", institucionRepository.findAll()); + model.addAttribute("tiposDeEstudios", TipoDeEstudio.values()); model.addAttribute("estadoP", EstadoPostulante.values()); model.addAttribute("cargos", carRepo.findAll()); @@ -118,7 +119,7 @@ public class PostulanteRRHHController { nombre == null || nombre.trim().isEmpty() ? new TypedParameterValue(StringType.INSTANCE,null) : new TypedParameterValue(StringType.INSTANCE,"%"+nombre+"%"), - lvlEng, lvlTec, tecId, instId,cargoId,page,estado,convId, infRange, supRange); + lvlEng, lvlTec, tecId, tipoest,cargoId,page,estado,convId, infRange, supRange); model.addAttribute("numeroOcurrencias", postulantesPag.getTotalElements()); List postulantes = postulantesPag.getContent(); List postulantesDTO = new ArrayList<>(); @@ -147,7 +148,7 @@ public class PostulanteRRHHController { @RequestParam(required = false)EstadoPostulante estado, @RequestParam(required = false)Long lvlEng, @RequestParam(required = false)Long lvlTec, - @RequestParam(required = false)Long instId, + @RequestParam(required = false)TipoDeEstudio tipoest, @RequestParam(required = false)String expInMonths, @RequestParam(required = false)Long cargoId, @RequestParam(required = false)Long convId, @@ -165,7 +166,7 @@ public class PostulanteRRHHController { nombre == null || nombre.trim().isEmpty() ? new TypedParameterValue(StringType.INSTANCE,null) : new TypedParameterValue(StringType.INSTANCE,"%"+nombre+"%"), - lvlEng, lvlTec, tecId, instId,cargoId,page,estado,convId, infRange, supRange); + lvlEng, lvlTec, tecId, tipoest,cargoId,page,estado,convId, infRange, supRange); List postulantes = postulantesPag.getContent(); List postulantesDTO = new ArrayList<>(); @@ -189,8 +190,8 @@ public class PostulanteRRHHController { filtros.put("nivelIngles", lvlEng == null ? "-" : lvlEng.toString()); filtros.put("tecnologia", tecId == null ? "-" : tecRepo.findById(tecId).get().getNombre()); filtros.put("nivelTecnologia", lvlTec == null ? "-" : lvlTec.toString()); - filtros.put("institucion", instId == null ? "-" : institucionRepository.findById(instId).get().getNombre()); - filtros.put("estado", estado == null ? "-" : estado.getEstado()); + filtros.put("tipoDeEstudio", tipoest == null ? "-" : tipoest.getName()); + filtros.put("estado", estado == null ? "-" : estado.getEstado()); filtros.put("experienciaEnMeses", expInMonths == null ? "-" : expInMonths.toString()); filtros.put("convocatoria", convId == null ? "-" : convRepo.findById(convId).get().getCargo().getNombre()); filtros.put("convocatoriaFecha", convId == null ? "-" : convRepo.findById(convId).get().getFechaInicio().toString()); diff --git a/curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java b/curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java index 4913bb2..72f38dc 100644 --- a/curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java +++ b/curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java @@ -2,6 +2,8 @@ package com.roshka.repositorio; import com.roshka.modelo.EstadoPostulante; import com.roshka.modelo.Postulante; +import com.roshka.modelo.TipoDeEstudio; + import org.hibernate.jpa.TypedParameterValue; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -19,6 +21,7 @@ public interface PostulanteRepository extends JpaRepository { @Query("select p from Postulante p join p.estudios e on e.institucion.nombre LIKE %?1%") public List findByInstitucionEstudio(String institucion); + @Query("select p from Postulante p " + "JOIN PostulanteTecnologia pt ON pt.postulante.id = p.id " + @@ -54,13 +57,14 @@ public interface PostulanteRepository extends JpaRepository { "and (p.nivelIngles >= ?2 or ?2 is null) "+ "and (pt.nivel >= ?3 or ?3 is null) "+ "and (pt.tecnologia.id = ?4 or ?4 is null) "+ - " and (e.institucion.id = ?5 or ?5 is null ) "+ + // " and (e.institucion.id = ?5 or ?5 is null ) "+ + " and (e.tipoDeEstudio = ?5 or ?5 is null ) "+ " and (conv.cargoId = ?6 or ?6 is null ) "+ "and (p.estadoPostulante = ?7 or ?7 is null) "+ " and (conv.id=?8 or ?8 is null ) " + "and (p.mesesDeExperiencia >= ?9 and p.mesesDeExperiencia <= ?10 ) ") public Page postulantesMultiFiltro(TypedParameterValue nombre, Long nivelInges, Long nivel, Long tecnoId, - Long instId,Long cargoId, Pageable pageable, EstadoPostulante estado, + TipoDeEstudio tipoDeEstudio,Long cargoId, Pageable pageable, EstadoPostulante estado, Long convo, Long infRangeExp, Long supRangeExp); @Transactional diff --git a/curriculumsearch/src/main/java/com/roshka/utils/PostulantesExcelExporter.java b/curriculumsearch/src/main/java/com/roshka/utils/PostulantesExcelExporter.java index dd4d514..ae5c53d 100644 --- a/curriculumsearch/src/main/java/com/roshka/utils/PostulantesExcelExporter.java +++ b/curriculumsearch/src/main/java/com/roshka/utils/PostulantesExcelExporter.java @@ -59,7 +59,7 @@ public class PostulantesExcelExporter { createCell(row, 2, "Experiencia (Meses)", style); createCell(row, 3, "Tecnologias", style); createCell(row, 4, "Nivel Tecnologia", style); - createCell(row, 5, "Institucion", style); + createCell(row, 5, "Tipo de estudio", style); createCell(row, 6, "Estado", style); createCell(row, 7, "Convocatoria", style); createCell(row, 8, "Fecha Inicio Convocatoria", style); @@ -118,7 +118,7 @@ public class PostulantesExcelExporter { createCell(row, 2, filtros.get("experienciaEnMeses"), style); createCell(row, 3, filtros.get("tecnologia"), style); createCell(row, 4, filtros.get("nivelTecnologia"), style); - createCell(row, 5, filtros.get("institucion"), style); + createCell(row, 5, filtros.get("tipoDeEstudio"), style); createCell(row, 6, filtros.get("estado"), style); createCell(row, 7, filtros.get("convocatoria"), style); createCell(row, 8, filtros.get("convocatoriaFecha"), style); diff --git a/curriculumsearch/src/main/webapp/jsp/postulantes.jsp b/curriculumsearch/src/main/webapp/jsp/postulantes.jsp index 273213c..b07a2b5 100644 --- a/curriculumsearch/src/main/webapp/jsp/postulantes.jsp +++ b/curriculumsearch/src/main/webapp/jsp/postulantes.jsp @@ -100,14 +100,14 @@
- +
- - - + +