Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
th-app-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amparo Oliver
th-app-java
Commits
44ebf50e
Commit
44ebf50e
authored
Nov 22, 2021
by
willgonzz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filtro de busqueda por cargo y convocatoria
parent
c5d9d805
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
7 deletions
+73
-7
curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java
+11
-4
curriculumsearch/src/main/java/com/roshka/modelo/Cargo.java
+16
-0
curriculumsearch/src/main/resources/static/Convo.js
+22
-0
curriculumsearch/src/main/webapp/jsp/postulantes.jsp
+24
-3
No files found.
curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java
View file @
44ebf50e
...
@@ -5,9 +5,8 @@ import java.util.ArrayList;
...
@@ -5,9 +5,8 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.roshka.DTO.PostulanteListaDTO
;
import
com.roshka.DTO.PostulanteListaDTO
;
import
com.roshka.modelo.*
;
import
com.roshka.modelo.*
;
import
com.roshka.modelo.Disponibilidad
;
import
com.roshka.modelo.Disponibilidad
;
...
@@ -97,7 +96,15 @@ public class PostulanteRRHHController {
...
@@ -97,7 +96,15 @@ public class PostulanteRRHHController {
model
.
addAttribute
(
"disponibilidades"
,
Disponibilidad
.
values
());
model
.
addAttribute
(
"disponibilidades"
,
Disponibilidad
.
values
());
model
.
addAttribute
(
"institucionesEducativas"
,
institucionRepository
.
findAll
());
model
.
addAttribute
(
"institucionesEducativas"
,
institucionRepository
.
findAll
());
model
.
addAttribute
(
"estadoP"
,
EstadoPostulante
.
values
());
model
.
addAttribute
(
"estadoP"
,
EstadoPostulante
.
values
());
model
.
addAttribute
(
"convocatoriaC"
,
cargoRepo
.
findAll
());
model
.
addAttribute
(
"cargos"
,
carRepo
.
findAll
());
model
.
addAttribute
(
"cargoRepo"
,
cargoRepo
);
//model.addAttribute("convocatoriaC", cargoRepo.findAll());
try
{
model
.
addAttribute
(
"convocatoriaC"
,
new
ObjectMapper
().
writeValueAsString
(
cargoRepo
.
findAll
()));
}
catch
(
JsonProcessingException
er
)
{
// TODO Auto-generated catch block
er
.
printStackTrace
();
}
Page
<
Postulante
>
postulantesPag
=
post
.
postulantesMultiFiltro
(
nombre
==
null
||
nombre
.
trim
().
isEmpty
()
?
new
TypedParameterValue
(
StringType
.
INSTANCE
,
null
)
:
new
TypedParameterValue
(
StringType
.
INSTANCE
,
"%"
+
nombre
+
"%"
),
dispo
,
lvlEng
,
lvlTec
,
tecId
,
instId
,
cargoId
,
page
,
estado
,
convId
);
Page
<
Postulante
>
postulantesPag
=
post
.
postulantesMultiFiltro
(
nombre
==
null
||
nombre
.
trim
().
isEmpty
()
?
new
TypedParameterValue
(
StringType
.
INSTANCE
,
null
)
:
new
TypedParameterValue
(
StringType
.
INSTANCE
,
"%"
+
nombre
+
"%"
),
dispo
,
lvlEng
,
lvlTec
,
tecId
,
instId
,
cargoId
,
page
,
estado
,
convId
);
List
<
Postulante
>
postulantes
=
postulantesPag
.
getContent
();
List
<
Postulante
>
postulantes
=
postulantesPag
.
getContent
();
List
<
PostulanteListaDTO
>
postulantesDTO
=
new
ArrayList
<>();
List
<
PostulanteListaDTO
>
postulantesDTO
=
new
ArrayList
<>();
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Cargo.java
View file @
44ebf50e
...
@@ -26,6 +26,22 @@ public class Cargo {
...
@@ -26,6 +26,22 @@ public class Cargo {
@Column
(
name
=
"nombre"
)
@Column
(
name
=
"nombre"
)
private
String
nombre
;
private
String
nombre
;
public
Long
getId
()
{
return
this
.
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getNombre
()
{
return
this
.
nombre
;
}
public
void
setNombre
(
String
nombre
)
{
this
.
nombre
=
nombre
;
}
@OneToMany
(
mappedBy
=
"cargo"
)
@OneToMany
(
mappedBy
=
"cargo"
)
@JsonManagedReference
@JsonManagedReference
private
List
<
ConvocatoriaCargo
>
convocatorias
;
private
List
<
ConvocatoriaCargo
>
convocatorias
;
...
...
curriculumsearch/src/main/resources/static/Convo.js
0 → 100644
View file @
44ebf50e
const
cargoSelect
=
document
.
querySelector
(
"#cargoId"
);
function
listarConvocatorias
(
id
){
const
ConvocatoriaAmostrar
=
convocatorias
.
filter
(
c
=>
c
.
cargoId
==
id
);
const
convocatoria
=
document
.
querySelector
(
"select[name=convId]"
);
const
frag
=
document
.
createDocumentFragment
();
for
(
const
conv
of
ConvocatoriaAmostrar
)
{
const
opt
=
document
.
createElement
(
"option"
);
opt
.
value
=
conv
.
id
;
if
(
conv
.
fechaFin
!=
null
){
opt
.
innerHTML
=
"Desde :"
+
new
Date
(
conv
.
fechaInicio
)
+
"-"
+
" Hasta :"
+
new
Date
(
conv
.
fechaFin
);
}
else
{
opt
.
innerHTML
=
"Desde :"
+
new
Date
(
conv
.
fechaInicio
)
}
opt
.
setAttribute
(
"data-CargoId"
,
conv
.
cargoId
);
frag
.
appendChild
(
opt
)
}
convocatoria
.
replaceChildren
(
frag
);
}
listarConvocatorias
(
cargoSelect
.
value
);
cargoSelect
.
addEventListener
(
"change"
,
evt
=>
listarConvocatorias
(
evt
.
target
.
value
))
curriculumsearch/src/main/webapp/jsp/postulantes.jsp
View file @
44ebf50e
...
@@ -151,14 +151,27 @@
...
@@ -151,14 +151,27 @@
<div class="col">
<div class="col">
<div class="row">
<div class="row">
<div class="col-auto col-md-4">
<div class="col-auto col-md-4">
<label class="form-label" for="cargoId">Cargo</label>
</div>
<div class="col-auto col-md-8">
<select class="form-select form-select-sm " name="cargoId" id="cargoId">
<option value="">Seleccione una opcion</option>
<c:forEach items="${cargos}" var="cargo">
<option value="${cargo.id}" ${param.cargoId == cargo.id ? "selected" : ""}>${cargo.getNombre()}</option>
</c:forEach>
</select>
</div>
</div>
</div>
<div class="col">
<div class="row">
<div class="col-auto col-md-4">
<label class="form-label" for="convId">Convocatoria</label>
<label class="form-label" for="convId">Convocatoria</label>
</div>
</div>
<div class="col-auto col-md-8">
<div class="col-auto col-md-8">
<select class="form-select form-select-sm " name="convId" id="convId">
<select class="form-select form-select-sm " name="convId" id="convId">
<option value="">Seleccione una opcion</option>
<option value="">Seleccione una opcion</option>
<c:forEach items="${convocatoriaC}" var="convo">
<option value="${convo.id}" ${param.convId == convo.id ? "selected" : ""}>${convo.getCargo().getNombre()}</option>
</c:forEach>
</select>
</select>
</div>
</div>
</div>
</div>
...
@@ -220,9 +233,14 @@
...
@@ -220,9 +233,14 @@
</div>
</div>
</layout:put>
</layout:put>
<layout:put block="scripts" type="APPEND">
<layout:put block="scripts" type="APPEND">
<script>
<script>
var convocatorias = ${convocatoriaC};
</script>
<script src="./Convo.js"></script>
<script>
function habilitarLvlTec(){
function habilitarLvlTec(){
//si se selecciono una tecnologia entonces permitir seleccionar un nivel
//si se selecciono una tecnologia entonces permitir seleccionar un nivel
lvlTec.disabled = tecId.value == false
lvlTec.disabled = tecId.value == false
...
@@ -231,6 +249,7 @@
...
@@ -231,6 +249,7 @@
}
}
}
}
function buscarPagina(nro){
function buscarPagina(nro){
nro--
nro--
const aBuscar = 'nroPagina='+nro
const aBuscar = 'nroPagina='+nro
...
@@ -245,6 +264,8 @@
...
@@ -245,6 +264,8 @@
const lvlTec = document.querySelector("#lvlTec");
const lvlTec = document.querySelector("#lvlTec");
tecId.addEventListener('change',habilitarLvlTec);
tecId.addEventListener('change',habilitarLvlTec);
habilitarLvlTec()
habilitarLvlTec()
</script>
</script>
</layout:put>
</layout:put>
</layout:extends>
</layout:extends>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment