Commit 2e26d315 by Joel Florentin

merge con giuli. filtro de experiencia con rangos

parents 39b53be9 c1424969
...@@ -4,12 +4,7 @@ package com.roshka.controller; ...@@ -4,12 +4,7 @@ package com.roshka.controller;
import java.io.IOException; import java.io.IOException;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
...@@ -93,7 +88,7 @@ public class PostulanteRRHHController { ...@@ -93,7 +88,7 @@ public class PostulanteRRHHController {
@RequestParam(required = false)Long lvlEng, @RequestParam(required = false)Long lvlEng,
@RequestParam(required = false)Long lvlTec, @RequestParam(required = false)Long lvlTec,
@RequestParam(required = false)Long instId, @RequestParam(required = false)Long instId,
@RequestParam(required = false)Long expInMonths, @RequestParam(required = false)String expInMonths,
@RequestParam(required = false)Long cargoId, @RequestParam(required = false)Long cargoId,
@RequestParam(required = false)Long convId, @RequestParam(required = false)Long convId,
@RequestParam(defaultValue = "0")Integer nroPagina @RequestParam(defaultValue = "0")Integer nroPagina
...@@ -114,11 +109,18 @@ public class PostulanteRRHHController { ...@@ -114,11 +109,18 @@ public class PostulanteRRHHController {
// TODO Auto-generated catch block // TODO Auto-generated catch block
er.printStackTrace(); er.printStackTrace();
} }
long infRange = 0L;
long supRange = 1200L;
if(expInMonths != null && !expInMonths.trim().isEmpty()){
String[] rango = expInMonths.split("-");
infRange = Long.parseLong(rango[0]);
supRange = Long.parseLong(rango[1]);
}
Page<Postulante> postulantesPag = post.postulantesMultiFiltro( Page<Postulante> postulantesPag = post.postulantesMultiFiltro(
nombre == null || nombre.trim().isEmpty() ? nombre == null || nombre.trim().isEmpty() ?
new TypedParameterValue(StringType.INSTANCE,null) : new TypedParameterValue(StringType.INSTANCE,null) :
new TypedParameterValue(StringType.INSTANCE,"%"+nombre+"%"), new TypedParameterValue(StringType.INSTANCE,"%"+nombre+"%"),
lvlEng, lvlTec, tecId, instId,cargoId,page,estado,convId, expInMonths); lvlEng, lvlTec, tecId, instId,cargoId,page,estado,convId, infRange, supRange);
model.addAttribute("numeroOcurrencias", postulantesPag.getTotalElements()); model.addAttribute("numeroOcurrencias", postulantesPag.getTotalElements());
List<Postulante> postulantes = postulantesPag.getContent(); List<Postulante> postulantes = postulantesPag.getContent();
List<PostulanteListaDTO> postulantesDTO = new ArrayList<>(); List<PostulanteListaDTO> postulantesDTO = new ArrayList<>();
...@@ -148,17 +150,24 @@ public class PostulanteRRHHController { ...@@ -148,17 +150,24 @@ public class PostulanteRRHHController {
@RequestParam(required = false)Long lvlEng, @RequestParam(required = false)Long lvlEng,
@RequestParam(required = false)Long lvlTec, @RequestParam(required = false)Long lvlTec,
@RequestParam(required = false)Long instId, @RequestParam(required = false)Long instId,
@RequestParam(required = false)Long expInMonths, @RequestParam(required = false)String expInMonths,
@RequestParam(required = false)Long cargoId, @RequestParam(required = false)Long cargoId,
@RequestParam(required = false)Long convId, @RequestParam(required = false)Long convId,
@RequestParam(defaultValue = "0")Integer nroPagina @RequestParam(defaultValue = "0")Integer nroPagina
) throws IOException { ) throws IOException {
Pageable page = PageRequest.of(0,Integer.MAX_VALUE,Sort.by("id")); Pageable page = PageRequest.of(0,Integer.MAX_VALUE,Sort.by("id"));
long infRange = 0L;
long supRange = 1200L;
if(expInMonths != null && !expInMonths.trim().isEmpty()){
String[] rango = expInMonths.split("-");
infRange = Long.parseLong(rango[0]);
supRange = Long.parseLong(rango[1]);
}
Page<Postulante> postulantesPag = post.postulantesMultiFiltro( Page<Postulante> postulantesPag = post.postulantesMultiFiltro(
nombre == null || nombre.trim().isEmpty() ? nombre == null || nombre.trim().isEmpty() ?
new TypedParameterValue(StringType.INSTANCE,null) : new TypedParameterValue(StringType.INSTANCE,null) :
new TypedParameterValue(StringType.INSTANCE,"%"+nombre+"%"), new TypedParameterValue(StringType.INSTANCE,"%"+nombre+"%"),
lvlEng, lvlTec, tecId, instId,cargoId,page,estado,convId, expInMonths); lvlEng, lvlTec, tecId, instId,cargoId,page,estado,convId, infRange, supRange);
List<Postulante> postulantes = postulantesPag.getContent(); List<Postulante> postulantes = postulantesPag.getContent();
List<PostulanteListaDTO> postulantesDTO = new ArrayList<>(); List<PostulanteListaDTO> postulantesDTO = new ArrayList<>();
......
...@@ -61,10 +61,10 @@ public interface PostulanteRepository extends JpaRepository<Postulante,Long> { ...@@ -61,10 +61,10 @@ public interface PostulanteRepository extends JpaRepository<Postulante,Long> {
" and (conv.cargoId = ?6 or ?6 is null ) "+ " and (conv.cargoId = ?6 or ?6 is null ) "+
"and (p.estadoPostulante = ?7 or ?7 is null) "+ "and (p.estadoPostulante = ?7 or ?7 is null) "+
" and (conv.id=?8 or ?8 is null ) " + " and (conv.id=?8 or ?8 is null ) " +
"and (p.mesesDeExperiencia >= ?9 or ?9 is null ) ") "and (p.mesesDeExperiencia >= ?9 and p.mesesDeExperiencia <= ?10 ) ")
public Page<Postulante> postulantesMultiFiltro(TypedParameterValue nombre, Long nivelInges, Long nivel, Long tecnoId, public Page<Postulante> postulantesMultiFiltro(TypedParameterValue nombre, Long nivelInges, Long nivel, Long tecnoId,
Long instId,Long cargoId, Pageable pageable, EstadoPostulante estado, Long instId,Long cargoId, Pageable pageable, EstadoPostulante estado,
Long convo, Long expInMonths); Long convo, Long infRangeExp, Long supRangeExp);
@Transactional @Transactional
@Modifying @Modifying
......
...@@ -59,10 +59,11 @@ ...@@ -59,10 +59,11 @@
<div class="col-auto col-md-8"> <div class="col-auto col-md-8">
<select class="form-select form-select-sm " name="expInMonths" id="expInMonths"> <select class="form-select form-select-sm " name="expInMonths" id="expInMonths">
<option value="">Todas</option> <option value="">Todas</option>
<option value="6">Mayor a 6 meses</option> <option value="0-6">Menor a 6 meses</option>
<option value="12">Mayor a 1 año</option> <option value="0-12">Menor a 1 año</option>
<option value="36">Mayor a 3 años</option> <option value="0-36">Menor a 3 años</option>
<option value="60">Mayor a 5 años</option> <option value="0-60">Menor a 5 años</option>
<option value="60-1200">Mayor a 5 años</option>
</select> </select>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment