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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
10 deletions
+76
-10
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
+27
-6
No files found.
curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java
View file @
44ebf50e
...
...
@@ -5,9 +5,8 @@ import java.util.ArrayList;
import
java.util.List
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.roshka.DTO.PostulanteListaDTO
;
import
com.roshka.modelo.*
;
import
com.roshka.modelo.Disponibilidad
;
...
...
@@ -97,7 +96,15 @@ public class PostulanteRRHHController {
model
.
addAttribute
(
"disponibilidades"
,
Disponibilidad
.
values
());
model
.
addAttribute
(
"institucionesEducativas"
,
institucionRepository
.
findAll
());
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
);
List
<
Postulante
>
postulantes
=
postulantesPag
.
getContent
();
List
<
PostulanteListaDTO
>
postulantesDTO
=
new
ArrayList
<>();
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Cargo.java
View file @
44ebf50e
...
...
@@ -26,6 +26,22 @@ public class Cargo {
@Column
(
name
=
"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"
)
@JsonManagedReference
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,20 +151,33 @@
<div class="col">
<div class="row">
<div class="col-auto col-md-4">
<label class="form-label" for="c
onvId">Convocatoria
</label>
<label class="form-label" for="c
argoId">Cargo
</label>
</div>
<div class="col-auto col-md-8">
<select class="form-select form-select-sm " name="c
onvId" id="conv
Id">
<select class="form-select form-select-sm " name="c
argoId" id="cargo
Id">
<option value="">Seleccione una opcion</option>
<c:forEach items="${c
onvocatoriaC}" var="conv
o">
<option value="${c
onvo.id}" ${param.convId == convo.id ? "selected" : ""}>${convo.getCargo()
.getNombre()}</option>
<c:forEach items="${c
argos}" var="carg
o">
<option value="${c
argo.id}" ${param.cargoId == cargo.id ? "selected" : ""}>${cargo
.getNombre()}</option>
</c:forEach>
</select>
</div>
</div>
</div>
</div>
</form>
<div class="col">
<div class="row">
<div class="col-auto col-md-4">
<label class="form-label" for="convId">Convocatoria</label>
</div>
<div class="col-auto col-md-8">
<select class="form-select form-select-sm " name="convId" id="convId">
<option value="">Seleccione una opcion</option>
</select>
</div>
</div>
</div>
</div>
</form>
</div>
<div class="card text-dark bg-light mt-3">
...
...
@@ -219,10 +232,15 @@
</div>
</div>
</layout:put>
<layout:put block="scripts" type="APPEND">
<script>
var convocatorias = ${convocatoriaC};
</script>
<script src="./Convo.js"></script>
<script>
function habilitarLvlTec(){
//si se selecciono una tecnologia entonces permitir seleccionar un nivel
lvlTec.disabled = tecId.value == false
...
...
@@ -231,6 +249,7 @@
}
}
function buscarPagina(nro){
nro--
const aBuscar = 'nroPagina='+nro
...
...
@@ -245,6 +264,8 @@
const lvlTec = document.querySelector("#lvlTec");
tecId.addEventListener('change',habilitarLvlTec);
habilitarLvlTec()
</script>
</layout:put>
</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