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
1
Merge Requests
1
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
Oscar Enrique Gonzalez Escurra
th-app-java
Commits
3a517c83
Commit
3a517c83
authored
Nov 10, 2021
by
Cesar Giulano Gonzalez Maqueda
Browse files
Options
Browse Files
Download
Plain Diff
Merge con joel-william
parents
14bbcaae
14988be1
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
353 additions
and
77 deletions
+353
-77
curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java
+57
-2
curriculumsearch/src/main/java/com/roshka/DTO/PostulanteListaDTO.java
+4
-4
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+30
-5
curriculumsearch/src/main/java/com/roshka/modelo/Cargo.java
+4
-1
curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java
+4
-1
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/Institucion.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
+8
-6
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
+4
-3
curriculumsearch/src/main/java/com/roshka/modelo/RRHHUser.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/ReferenciaPersonal.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/Tecnologia.java
+1
-1
curriculumsearch/src/main/java/com/roshka/repositorio/ConvocatoriaRepository.java
+2
-1
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java
+9
-5
curriculumsearch/src/main/resources/json/cargo.json
+11
-0
curriculumsearch/src/main/resources/json/convocatoria.json
+17
-0
curriculumsearch/src/main/resources/json/postulante.json
+48
-42
curriculumsearch/src/main/resources/static/main.js
+83
-0
curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp
+6
-0
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+37
-1
curriculumsearch/src/main/webapp/jsp/postulantes.jsp
+23
-0
No files found.
curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java
View file @
3a517c83
...
...
@@ -2,6 +2,7 @@ package com.roshka;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.fasterxml.jackson.core.type.TypeReference
;
...
...
@@ -9,11 +10,13 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
com.roshka.modelo.*
;
import
com.roshka.repositorio.*
;
import
org.hibernate.PersistentObjectException
;
import
org.springframework.boot.CommandLineRunner
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.domain.EntityScan
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.config.EnableJpaRepositories
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
...
...
@@ -28,7 +31,7 @@ public class CurriculumsearchApplication {
@Bean
CommandLineRunner
runner
(
PostulanteRepository
postRepo
,
TecnologiaRepository
tecRepo
,
DepartamentoRepository
depR
,
CiudadRepository
ciudR
,
RRHHUserRepository
rrhhUserRepository
)
{
CiudadRepository
ciudR
,
RRHHUserRepository
rrhhUserRepository
,
CargoRepository
cargoR
,
ConvocatoriaRepository
convR
)
{
return
args
->
{
try
{
// read json and write to db
...
...
@@ -43,9 +46,35 @@ public class CurriculumsearchApplication {
List
<
Ciudad
>
ciudades
=
mapper
.
readValue
(
inputStream
,
typeReference2
);
ciudR
.
saveAll
(
ciudades
);
System
.
out
.
println
(
"Cuidad Saved!"
);
TypeReference
<
List
<
Cargo
>>
typeReference3
=
new
TypeReference
<
List
<
Cargo
>>(){};
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/cargo.json"
);
List
<
Cargo
>
cargos
=
mapper
.
readValue
(
inputStream
,
typeReference3
);
cargoR
.
saveAll
(
cargos
);
cargoR
.
flush
();
System
.
out
.
println
(
"Cargos Saved!"
);
/* TypeReference<List<Tecnologia>> typeReference5 = new TypeReference<List<Tecnologia>>(){};
inputStream = TypeReference.class.getResourceAsStream("/json/tecnologia.json");
List<Tecnologia> tecnologias= mapper.readValue(inputStream,typeReference5);
tecRepo.saveAll(tecnologias);
tecRepo.flush();
System.out.println("Cargos Saved!"); */
TypeReference
<
List
<
ConvocatoriaCargo
>>
typeReference4
=
new
TypeReference
<
List
<
ConvocatoriaCargo
>>(){};
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/convocatoria.json"
);
List
<
ConvocatoriaCargo
>
convocatorias
=
mapper
.
readValue
(
inputStream
,
typeReference4
);
convocatorias
=
convR
.
saveAll
(
convocatorias
);
convR
.
flush
();
System
.
out
.
println
(
"convocatorias Saved!"
);
TypeReference
<
List
<
Postulante
>>
typeReference
=
new
TypeReference
<
List
<
Postulante
>>(){};
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/postulante.json"
);
List
<
Postulante
>
postulantes
=
mapper
.
readValue
(
inputStream
,
typeReference
);
/* for (Postulante postulante : postulantes) {
for (int i = 0; i < postulante.getPostulaciones().size(); i++) {
postulante.getPostulaciones().set(i, convR.getById(postulante.getPostulaciones().get(i).getId()));
}
} */
postRepo
.
saveAll
(
postulantes
);
System
.
out
.
println
(
"postulantes Saved!"
);
String
password
=
new
BCryptPasswordEncoder
().
encode
(
"test"
);
...
...
@@ -58,7 +87,17 @@ public class CurriculumsearchApplication {
System
.
out
.
println
(
"Usuario Test: \nEmail: test@test.com\nPassword: test"
);
}
catch
(
IOException
e
){
System
.
out
.
println
(
"Unable to save tecnologias: "
+
e
.
getMessage
());
System
.
out
.
println
(
"Unable to save: "
+
e
.
getMessage
());
}
catch
(
PersistentObjectException
ex
){
System
.
out
.
println
(
"Unable to save: "
+
ex
.
getMessage
());
ex
.
printStackTrace
();
}
catch
(
Exception
ex
){
System
.
out
.
println
(
"Unable to save: "
+
ex
.
getMessage
());
ex
.
printStackTrace
();
}
...
...
@@ -67,5 +106,21 @@ public class CurriculumsearchApplication {
};
}
public
static
<
Q
,
T
extends
JpaRepository
<
Q
,
Long
>>
void
guardarJson
(
T
repo
,
String
srcJson
)
{
ObjectMapper
mapper
=
new
ObjectMapper
();
TypeReference
<
List
<
Q
>>
typeReference1
=
new
TypeReference
<
List
<
Q
>>(){};
InputStream
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
srcJson
);
List
<
Q
>
listaAguardar
;
try
{
listaAguardar
=
mapper
.
readValue
(
inputStream
,
typeReference1
);
repo
.
saveAll
(
listaAguardar
);
repo
.
flush
();
System
.
out
.
println
(
srcJson
+
" Saved!"
);
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
}
curriculumsearch/src/main/java/com/roshka/DTO/PostulanteListaDTO.java
View file @
3a517c83
...
...
@@ -10,11 +10,11 @@ public class PostulanteListaDTO {
private
String
nombre
;
private
String
apellido
;
private
Disponibilidad
disponibilidad
;
private
Integer
nivelIngles
;
private
Long
nivelIngles
;
private
Long
experienciaMeses
;
private
List
<
PostulanteTecnologia
>
tecnologias
;
public
PostulanteListaDTO
(
Long
id
,
String
nombre
,
String
apellido
,
Disponibilidad
disponibilidad
,
Integer
nivelIngles
,
Long
experienciaMeses
,
List
<
PostulanteTecnologia
>
tecnologias
)
{
Long
nivelIngles
,
Long
experienciaMeses
,
List
<
PostulanteTecnologia
>
tecnologias
)
{
this
.
id
=
id
;
this
.
nombre
=
nombre
;
this
.
apellido
=
apellido
;
...
...
@@ -47,10 +47,10 @@ public class PostulanteListaDTO {
public
void
setDisponibilidad
(
Disponibilidad
disponibilidad
)
{
this
.
disponibilidad
=
disponibilidad
;
}
public
Integer
getNivelIngles
()
{
public
Long
getNivelIngles
()
{
return
nivelIngles
;
}
public
void
setNivelIngles
(
Integer
nivelIngles
)
{
public
void
setNivelIngles
(
Long
nivelIngles
)
{
this
.
nivelIngles
=
nivelIngles
;
}
public
Long
getExperienciaMeses
()
{
...
...
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
View file @
3a517c83
...
...
@@ -2,6 +2,7 @@ package com.roshka.controller;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Locale
;
...
...
@@ -19,6 +20,7 @@ import com.roshka.modelo.Postulante;
import
com.roshka.modelo.TipoExperiencia
;
import
com.roshka.repositorio.*
;
import
com.roshka.repositorio.CiudadRepository
;
import
com.roshka.repositorio.ConvocatoriaRepository
;
import
com.roshka.repositorio.DepartamentoRepository
;
import
com.roshka.repositorio.ExperienciaRepository
;
import
com.roshka.repositorio.InstitucionRepository
;
...
...
@@ -29,7 +31,13 @@ import com.roshka.utils.Helper;
import
org.hibernate.jpa.TypedParameterValue
;
import
org.hibernate.type.StringType
;
import
org.hibernate.type.IntegerType
;
import
org.hibernate.type.LongType
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.stereotype.Controller
;
...
...
@@ -49,13 +57,16 @@ public class PostulanteController {
CiudadRepository
ciuRepo
;
EstudioRepository
estudioRepository
;
PostulanteTecnologiaRepository
postulanteTecnologiaRepository
;
ConvocatoriaRepository
cargoRepo
;
CargoRepository
carRepo
;
@Autowired
public
PostulanteController
(
PostulanteRepository
post
,
TecnologiaRepository
tecRepo
,
ExperienciaRepository
expRepo
,
InstitucionRepository
institucionRepository
,
DepartamentoRepository
depRepo
,
CiudadRepository
ciuRepo
,
EstudioRepository
estudioRepository
,
PostulanteTecnologiaRepository
postulanteTecnologiaRepository
)
{
PostulanteTecnologiaRepository
postulanteTecnologiaRepository
,
ConvocatoriaRepository
cargoRepo
,
CargoRepository
carRepo
)
{
this
.
post
=
post
;
this
.
tecRepo
=
tecRepo
;
this
.
expRepo
=
expRepo
;
...
...
@@ -64,6 +75,8 @@ public class PostulanteController {
this
.
ciuRepo
=
ciuRepo
;
this
.
estudioRepository
=
estudioRepository
;
this
.
postulanteTecnologiaRepository
=
postulanteTecnologiaRepository
;
this
.
cargoRepo
=
cargoRepo
;
this
.
carRepo
=
carRepo
;
}
@RequestMapping
(
"home"
)
...
...
@@ -81,12 +94,17 @@ public class PostulanteController {
@RequestParam
(
required
=
false
)
Long
lvlEng
,
@RequestParam
(
required
=
false
)
Long
lvlTec
,
@RequestParam
(
required
=
false
)
Long
instId
,
@RequestParam
(
required
=
false
)
Long
expInMonths
@RequestParam
(
required
=
false
)
Long
expInMonths
,
@RequestParam
(
required
=
false
)
Long
cargoId
,
@RequestParam
(
defaultValue
=
"0"
)
Integer
nroPagina
)
{
final
Integer
CANTIDAD_POR_PAGINA
=
5
;
Pageable
page
=
PageRequest
.
of
(
nroPagina
,
CANTIDAD_POR_PAGINA
,
Sort
.
by
(
"id"
));
model
.
addAttribute
(
"tecnologias"
,
tecRepo
.
findAll
());
model
.
addAttribute
(
"disponibilidades"
,
Disponibilidad
.
values
());
model
.
addAttribute
(
"institucionesEducativas"
,
institucionRepository
.
findAll
());
List
<
Postulante
>
postulantes
=
post
.
postulantesMultiFiltro
(
nombre
==
null
||
nombre
.
trim
().
isEmpty
()
?
new
TypedParameterValue
(
StringType
.
INSTANCE
,
null
)
:
new
TypedParameterValue
(
StringType
.
INSTANCE
,
"%"
+
nombre
+
"%"
),
dispo
,
lvlEng
,
lvlTec
,
tecId
,
instId
);
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
);
List
<
Postulante
>
postulantes
=
postulantesPag
.
getContent
();
List
<
PostulanteListaDTO
>
postulantesDTO
=
new
ArrayList
<>();
for
(
Postulante
postulante
:
postulantes
)
{
...
...
@@ -100,6 +118,7 @@ public class PostulanteController {
postulantesDTO
.
add
(
new
PostulanteListaDTO
(
postulante
.
getId
(),
postulante
.
getNombre
(),
postulante
.
getApellido
(),
postulante
.
getDisponibilidad
(),
postulante
.
getNivelIngles
(),
expTotal
,
postulante
.
getTecnologias
()));
}
model
.
addAttribute
(
"pages"
,
postulantesPag
.
getTotalPages
());
model
.
addAttribute
(
"postulantes"
,
postulantesDTO
);
return
"postulantes"
;
}
...
...
@@ -113,11 +132,12 @@ public class PostulanteController {
model
.
addAttribute
(
"estadosCiviles"
,
EstadoCivil
.
values
());
model
.
addAttribute
(
"nacionalidades"
,
Nacionalidad
.
values
());
model
.
addAttribute
(
"tiposExperencia"
,
TipoExperiencia
.
values
());
model
.
addAttribute
(
"CargosDisponibles"
,
cargoRepo
.
f1ndByCargoAndEstado
(
new
TypedParameterValue
(
LongType
.
INSTANCE
,
null
),
new
Date
(),
new
TypedParameterValue
(
IntegerType
.
INSTANCE
,
1
)));
try
{
model
.
addAttribute
(
"ciudades"
,
new
ObjectMapper
().
writeValueAsString
(
ciuRepo
.
findAll
()));
}
catch
(
JsonProcessingException
e
)
{
}
catch
(
JsonProcessingException
e
r
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
e
r
.
printStackTrace
();
}
model
.
addAttribute
(
"departamentos"
,
depRepo
.
findAll
());
...
...
@@ -139,6 +159,11 @@ public class PostulanteController {
).
forEach
(
tec
->
tec
.
setTecnologia
(
tecRepo
.
getById
(
tec
.
getTecnologia
().
getId
()))
);
/* for (int i = 0; i < postulante.getPostulaciones().size(); i++) {
postulante.getPostulaciones().set(i, cargoRepo.getById(postulante.getPostulaciones().get(i).getId()));
}
*/
for
(
Estudio
estudio:
postulante
.
getEstudios
()){
String
nombreIns
=
""
;
nombreIns
=
estudio
.
getInstitucion
().
getNombre
().
toLowerCase
();
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Cargo.java
View file @
3a517c83
...
...
@@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonManagedReference;
@Table
(
name
=
"cargo"
)
public
class
Cargo
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@NotBlank
...
...
@@ -47,4 +47,7 @@ public class Cargo {
public
void
setConvocatorias
(
List
<
ConvocatoriaCargo
>
convocatorias
)
{
this
.
convocatorias
=
convocatorias
;
}
public
static
Object
values
()
{
return
null
;
}
}
curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java
View file @
3a517c83
...
...
@@ -15,13 +15,16 @@ import javax.persistence.Table;
import
javax.persistence.Transient
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
import
com.fasterxml.jackson.annotation.JsonIdentityInfo
;
import
com.fasterxml.jackson.annotation.ObjectIdGenerators
;
import
com.roshka.utils.Helper
;
@Entity
@Table
(
name
=
"convocatoria_cargo"
)
@JsonIdentityInfo
(
generator
=
ObjectIdGenerators
.
UUIDGenerator
.
class
,
property
=
"@UUID"
)
public
class
ConvocatoriaCargo
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@ManyToOne
()
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
View file @
3a517c83
...
...
@@ -15,7 +15,7 @@ import com.roshka.utils.Helper;
@Table
(
name
=
"estudio"
)
public
class
Estudio
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
private
long
id
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
View file @
3a517c83
...
...
@@ -23,7 +23,7 @@ import javax.validation.constraints.Past;
@Table
(
name
=
"experiencia"
)
public
class
Experiencia
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
long
id
;
@Column
(
name
=
"institucion"
)
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Institucion.java
View file @
3a517c83
...
...
@@ -10,7 +10,7 @@ import java.util.List;
@Table
(
name
=
"institucion"
)
public
class
Institucion
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
private
long
id
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
View file @
3a517c83
...
...
@@ -3,8 +3,10 @@ package com.roshka.modelo;
import
javax.persistence.*
;
import
javax.validation.constraints.*
;
import
com.fasterxml.jackson.annotation.JsonIdentityInfo
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
import
com.fasterxml.jackson.annotation.ObjectIdGenerators
;
import
com.roshka.utils.Helper
;
import
java.util.ArrayList
;
...
...
@@ -14,9 +16,10 @@ import java.util.List;
@Entity
@Table
(
name
=
"postulante"
)
@JsonIdentityInfo
(
generator
=
ObjectIdGenerators
.
UUIDGenerator
.
class
,
property
=
"@UUID"
)
public
class
Postulante
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
private
long
id
;
...
...
@@ -61,7 +64,7 @@ public class Postulante {
@Column
(
name
=
"nivel_ingles"
)
@Min
(
value
=
1
)
@Max
(
value
=
5
)
private
Integer
nivelIngles
;
private
Long
nivelIngles
;
@Column
(
name
=
"curriculum"
)
private
String
curriculum
;
...
...
@@ -98,12 +101,11 @@ public class Postulante {
@OneToMany
(
mappedBy
=
"postulante"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
ReferenciaPersonal
>
referencias
;
@ManyToMany
(
cascade
=
CascadeType
.
ALL
)
@ManyToMany
()
@JoinTable
(
uniqueConstraints
=
@UniqueConstraint
(
columnNames
=
{
"postulante_id"
,
"convocatoria_cargo_id"
}),
joinColumns
=
@JoinColumn
(
name
=
"postulante_id"
,
referencedColumnName
=
"id"
),
inverseJoinColumns
=
@JoinColumn
(
name
=
"convocatoria_cargo_id"
,
referencedColumnName
=
"id"
)
)
@JsonIgnore
private
List
<
ConvocatoriaCargo
>
postulaciones
;
...
...
@@ -175,11 +177,11 @@ public class Postulante {
this
.
resumen
=
resumen
;
}
public
Integer
getNivelIngles
()
{
public
Long
getNivelIngles
()
{
return
nivelIngles
;
}
public
void
setNivelIngles
(
Integer
nivelIngles
)
{
public
void
setNivelIngles
(
Long
nivelIngles
)
{
this
.
nivelIngles
=
nivelIngles
;
}
...
...
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
View file @
3a517c83
...
...
@@ -21,7 +21,7 @@ uniqueConstraints=@UniqueConstraint(columnNames={"postulante_id", "tecnologia_id
public
class
PostulanteTecnologia
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
private
long
id
;
...
...
@@ -29,11 +29,12 @@ public class PostulanteTecnologia {
@Min
(
value
=
1
)
@Max
(
value
=
5
)
private
Long
nivel
;
@ManyToOne
(
cascade
=
{
CascadeType
.
PERSIST
,
CascadeType
.
MERGE
},
optional
=
false
)
@ManyToOne
(
cascade
=
{
CascadeType
.
PERSIST
},
optional
=
false
)
@JoinColumn
private
Tecnologia
tecnologia
;
@ManyToOne
(
cascade
=
CascadeType
.
ALL
)
@ManyToOne
()
@JoinColumn
@JsonBackReference
(
value
=
"postulantetecnologia-postulante"
)
private
Postulante
postulante
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/RRHHUser.java
View file @
3a517c83
...
...
@@ -6,7 +6,7 @@ import javax.persistence.*;
@Table
(
name
=
"recursos_humanos_user"
)
public
class
RRHHUser
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@Column
(
nullable
=
false
,
unique
=
true
,
length
=
45
)
...
...
curriculumsearch/src/main/java/com/roshka/modelo/ReferenciaPersonal.java
View file @
3a517c83
...
...
@@ -9,7 +9,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference;
@Table
(
name
=
"referencia_personal"
)
public
class
ReferenciaPersonal
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Long
id
;
@NotBlank
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Tecnologia.java
View file @
3a517c83
...
...
@@ -12,7 +12,7 @@ import javax.validation.constraints.NotBlank;
@Entity
@Table
(
name
=
"tecnologia"
)
public
class
Tecnologia
{
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Id
@Column
(
name
=
"id"
)
private
long
id
;
...
...
curriculumsearch/src/main/java/com/roshka/repositorio/ConvocatoriaRepository.java
View file @
3a517c83
...
...
@@ -11,7 +11,8 @@ import org.springframework.data.jpa.repository.Query;
public
interface
ConvocatoriaRepository
extends
JpaRepository
<
ConvocatoriaCargo
,
Long
>
{
public
List
<
ConvocatoriaCargo
>
findByCargoId
(
Long
cargoId
);
//@Query(value="selec x from ConvocatoriaCargo x where (x.fechaFinal > ?1)",nativeQuery = true)
//public List<ConvocatoriaCargo> findConvocatoriaCargoByCargo(Date fechaFinal);
@Query
(
"select c from ConvocatoriaCargo c where ( ?1 is null and ?3 is null) or ( ( ( (c.fechaFin > ?2 and ?3 = 1) or (c.fechaFin < ?2 and ?3 = 0)) or ?3 is null ) and (c.cargoId = ?1 or ?1 is null) )"
)
public
List
<
ConvocatoriaCargo
>
f1ndByCargoAndEstado
(
TypedParameterValue
cargoId
,
Date
fecha
,
TypedParameterValue
isOpen
);
}
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java
View file @
3a517c83
...
...
@@ -3,6 +3,8 @@ package com.roshka.repositorio;
import
java.util.List
;
import
org.hibernate.jpa.TypedParameterValue
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
...
...
@@ -43,15 +45,17 @@ public interface PostulanteRepository extends JpaRepository<Postulante,Long> {
@Query
(
value
=
"select DISTINCT p "
+
"from Postulante p join p.experiencias x "
+
"join p.estudios e "
+
"join p.tecnologias pt "
+
"from Postulante p left join p.experiencias x "
+
"left join p.estudios e "
+
"left join p.tecnologias pt "
+
"left join p.postulaciones conv "
+
"where (?1 is null or lower(p.nombre) LIKE lower(?1) or lower(p.apellido) LIKE lower(?1) ) "
+
"and (p.disponibilidad = ?2 or ?2 is null) "
+
"and (p.nivelIngles >= ?3 or ?3 is null) "
+
"and (pt.nivel >= ?4 or ?4 is null) "
+
"and (pt.tecnologia.id = ?5 or ?5 is null) "
+
" and (e.institucion.id = ?6 or ?6 is null ) "
)
public
List
<
Postulante
>
postulantesMultiFiltro
(
TypedParameterValue
nombre
,
Disponibilidad
disponibilidad
,
Long
nivelInges
,
Long
nivel
,
Long
tecnoId
,
Long
instId
);
" and (e.institucion.id = ?6 or ?6 is null ) "
+
" and (conv.cargoId = ?7 or ?7 is null ) "
)
public
Page
<
Postulante
>
postulantesMultiFiltro
(
TypedParameterValue
nombre
,
Disponibilidad
disponibilidad
,
Long
nivelInges
,
Long
nivel
,
Long
tecnoId
,
Long
instId
,
Long
cargoId
,
Pageable
pageable
);
}
curriculumsearch/src/main/resources/json/cargo.json
0 → 100644
View file @
3a517c83
[
{
"id"
:
1
,
"nombre"
:
"dev java"
},
{
"id"
:
2
,
"nombre"
:
"dev php"
}
]
\ No newline at end of file
curriculumsearch/src/main/resources/json/convocatoria.json
0 → 100644
View file @
3a517c83
[
{
"id"
:
1
,
"cargoId"
:
1
,
"fechaInicio"
:
"2021-11-01"
,
"fechaFin"
:
"2021-11-30"
,
"cupos"
:
20
},
{
"id"
:
2
,
"cargoId"
:
2
,
"fechaInicio"
:
"2021-11-01"
,
"fechaFin"
:
"2021-11-30"
,
"cupos"
:
20
}
]
\ No newline at end of file
curriculumsearch/src/main/resources/json/postulante.json
View file @
3a517c83
[
{
"resumen"
:
"In irure aliquip qui cillum veniam sint amet amet sint ex proident anim mollit."
,
"nacionalidad"
:
"Paraguayo"
,
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nacionalidad"
:
"Paraguayo"
,
"postulaciones"
:
[{
"id"
:
1
}],
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nombre"
:
"Taylor"
,
"apellido"
:
"Obrien"
,
"correo"
:
"gladysalexander@dadabase.com"
,
...
...
@@ -19,7 +20,7 @@
"institucion"
:
"Fanfare"
,
"fechaDesde"
:
"2014-09-10"
,
"fechaHasta"
:
"2016-01-01"
,
"tipoExperiencia"
:
"Trabajo Normal"
,
"tipoExperiencia"
:
"Trabajo Normal"
,
"cargo"
:
"dba"
,
"descripcion"
:
"Enim qui Lorem ut magna."
,
"nombreReferencia"
:
"Marissa"
,
...
...
@@ -29,8 +30,8 @@
"estudios"
:
[
{
"tipoDeEstudio"
:
"TERCIARIO"
,
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"fechaDesde"
:
"2014-08-28"
,
"fechaHasta"
:
"2016-01-01"
,
"temaDeEstudio"
:
"analista"
...
...
@@ -59,9 +60,10 @@
},
{
"resumen"
:
"Do nostrud aliqua adipisicing in sunt aute id do elit ut dolor ad aliquip."
,
"nacionalidad"
:
"Paraguayo"
,
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nacionalidad"
:
"Paraguayo"
,
"postulaciones"
:
[{
"id"
:
1
}],
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nombre"
:
"Hopkins"
,
"apellido"
:
"Parks"
,
"correo"
:
"grahamgriffith@zilidium.com"
,
...
...
@@ -80,15 +82,15 @@
"cargo"
:
"developer frontend"
,
"descripcion"
:
"Consequat fugiat qui sint deserunt ullamco."
,
"nombreReferencia"
:
"Iva"
,
"tipoExperiencia"
:
"Trabajo Normal"
,
"tipoExperiencia"
:
"Trabajo Normal"
,
"telefonoReferencia"
:
"(947) 580-2363"
}
],
"estudios"
:
[
{
"tipoDeEstudio"
:
"TERCIARIO"
,
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"fechaDesde"
:
"2014-07-08"
,
"fechaHasta"
:
"2016-01-01"
,
"temaDeEstudio"
:
"lic inf"
...
...
@@ -105,9 +107,10 @@
},
{
"resumen"
:
"Occaecat non cupidatat amet reprehenderit consectetur ullamco et."
,
"nacionalidad"
:
"Paraguayo"
,
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nacionalidad"
:
"Paraguayo"
,
"postulaciones"
:
[{
"id"
:
1
}],
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nombre"
:
"Alejandra"
,
"apellido"
:
"Riggs"
,
"correo"
:
"ruthrobertson@homelux.com"
,
...
...
@@ -124,7 +127,7 @@
"fechaDesde"
:
"2014-08-26"
,
"fechaHasta"
:
"2016-01-01"
,
"cargo"
:
"dba"
,
"tipoExperiencia"
:
"Trabajo Normal"
,
"tipoExperiencia"
:
"Trabajo Normal"
,
"descripcion"
:
"Aute culpa ea mollit adipisicing dolore dolore amet adipisicing occaecat commodo enim cillum."
,
"nombreReferencia"
:
"Rose"
,
"telefonoReferencia"
:
"(853) 471-2006"
...
...
@@ -133,8 +136,8 @@
"estudios"
:
[
{
"tipoDeEstudio"
:
"TERCIARIO"
,
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"fechaDesde"
:
"2014-02-13"
,
"fechaHasta"
:
"2016-01-01"
,
"temaDeEstudio"
:
"lic inf"
...
...
@@ -151,9 +154,10 @@
},
{
"resumen"
:
"Qui ullamco excepteur velit ad ullamco id id nisi irure dolore cupidatat mollit ullamco veniam."
,
"nacionalidad"
:
"Paraguayo"
,
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nacionalidad"
:
"Paraguayo"
,
"postulaciones"
:
[{
"id"
:
1
}],
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nombre"
:
"Angelina"
,
"apellido"
:
"Wallace"
,
"correo"
:
"christiwalls@capscreen.com"
,
...
...
@@ -173,14 +177,14 @@
"descripcion"
:
"Aliquip occaecat minim dolor enim commodo."
,
"nombreReferencia"
:
"Elba"
,
"telefonoReferencia"
:
"(881) 568-2597"
,
"tipoExperiencia"
:
"Trabajo Normal"
"tipoExperiencia"
:
"Trabajo Normal"
}
],
"estudios"
:
[
{
"tipoDeEstudio"
:
"TERCIARIO"
,
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"fechaDesde"
:
"2014-12-22"
,
"fechaHasta"
:
"2016-01-01"
,
"temaDeEstudio"
:
"ing inf"
...
...
@@ -197,9 +201,10 @@
},
{
"resumen"
:
"Deserunt tempor ut et eiusmod et labore Lorem."
,
"nacionalidad"
:
"Paraguayo"
,
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nacionalidad"
:
"Paraguayo"
,
"postulaciones"
:
[{
"id"
:
1
}],
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nombre"
:
"Rivas"
,
"apellido"
:
"Owens"
,
"correo"
:
"shirleyguzman@equitox.com"
,
...
...
@@ -219,14 +224,14 @@
"descripcion"
:
"Dolore nulla deserunt fugiat est reprehenderit tempor qui excepteur."
,
"nombreReferencia"
:
"Crawford"
,
"telefonoReferencia"
:
"(903) 568-2045"
,
"tipoExperiencia"
:
"Trabajo Normal"
"tipoExperiencia"
:
"Trabajo Normal"
}
],
"estudios"
:
[
{
"tipoDeEstudio"
:
"TERCIARIO"
,
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"fechaDesde"
:
"2014-08-03"
,
"fechaHasta"
:
"2016-01-01"
,
"temaDeEstudio"
:
"lic inf"
...
...
@@ -243,8 +248,9 @@
},
{
"resumen"
:
"Aliqua est adipisicing do exercitation sit laborum aliquip aliqua adipisicing enim aute."
,
"nacionalidad"
:
"Paraguayo"
,
"estadoCivil"
:
"Soltero"
,
"nacionalidad"
:
"Paraguayo"
,
"postulaciones"
:
[{
"id"
:
1
}],
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nombre"
:
"Estelle"
,
"apellido"
:
"Gamble"
,
...
...
@@ -265,14 +271,14 @@
"descripcion"
:
"Do do est ad ea pariatur aliquip sit ipsum in duis laborum velit magna."
,
"nombreReferencia"
:
"Schultz"
,
"telefonoReferencia"
:
"(903) 420-3902"
,
"tipoExperiencia"
:
"Trabajo Normal"
"tipoExperiencia"
:
"Trabajo Normal"
}
],
"estudios"
:
[
{
"tipoDeEstudio"
:
"TERCIARIO"
,
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"fechaDesde"
:
"2014-07-13"
,
"fechaHasta"
:
"2016-01-01"
,
"temaDeEstudio"
:
"ing inf"
...
...
@@ -289,9 +295,10 @@
},
{
"resumen"
:
"Officia eiusmod ut reprehenderit tempor consequat elit amet ex voluptate aute anim do."
,
"nacionalidad"
:
"Paraguayo"
,
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nacionalidad"
:
"Paraguayo"
,
"postulaciones"
:
[{
"id"
:
1
}],
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nombre"
:
"Mariana"
,
"apellido"
:
"Ratliff"
,
"correo"
:
"loramiddleton@musanpoly.com"
,
...
...
@@ -311,15 +318,14 @@
"descripcion"
:
"Anim labore anim veniam deserunt ex aute."
,
"nombreReferencia"
:
"Francesca"
,
"telefonoReferencia"
:
"(961) 420-2150"
,
"tipoExperiencia"
:
"Trabajo Normal"
"tipoExperiencia"
:
"Trabajo Normal"
}
],
"estudios"
:
[
{
"tipoDeEstudio"
:
"TERCIARIO"
,
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"estado"
:
"SUSPENDIDO"
,
"institucion"
:
{
"nombre"
:
"UNA"
},
"fechaDesde"
:
"2014-10-03"
,
"fechaHasta"
:
"2016-01-01"
,
"temaDeEstudio"
:
"ing inf"
...
...
curriculumsearch/src/main/resources/static/main.js
View file @
3a517c83
var
cont_experiencia
=
0
;
let
cont_estudios
=
0
;
let
cont_tecnologia
=
0
;
let
cont_cargo
=
0
;
const
experiencias
=
[];
const
estudios
=
[];
const
tecnologias
=
[];
let
noValidateFlag
=
false
;
const
postulaciones
=
[];
const
formValidator
=
function
()
{
'use strict'
...
...
@@ -193,6 +197,7 @@ function serializeJSON (form) {
pairs
[
"experiencias"
]
=
experiencias
.
filter
(
exp
=>
exp
)
//eliminacion de nulos
pairs
[
"estudios"
]
=
estudios
.
filter
(
est
=>
est
)
//eliminacion de nulos
pairs
[
"tecnologias"
]
=
tecnologias
.
filter
(
tec
=>
tec
)
//eliminacion de nulos
pairs
[
"postulaciones"
]
=
postulaciones
.
filter
(
car
=>
car
)
//eliminacion de nulos
// Return the JSON string
return
JSON
.
stringify
(
pairs
,
null
,
2
);
...
...
@@ -329,7 +334,85 @@ function eliminarEstudio(event) {
//eliminar en html
event
.
target
.
parentElement
.
remove
()
}
/*--------------------------------------------------------------------*/
function
agregarFieldCargo
(){
//recoger del form
const
pairs
=
{};
const
formcar
=
document
.
querySelector
(
"[name=cargo-form]"
);
const
formData
=
new
FormData
(
formcar
);
//Validacion
let
returnFlag
=
false
;
let
requiredValues
=
[
"nombre"
]
formData
.
forEach
((
value
,
key
)
=>
{
if
(
requiredValues
.
includes
(
key
)
&&
value
===
""
&&
returnFlag
==
false
){
console
.
log
(
key
,
value
)
returnFlag
=
true
;
}
});
if
(
returnFlag
===
true
){
let
message
=
"Rellene "
for
(
let
i
=
0
;
i
<
requiredValues
.
length
;
i
++
){
message
+=
", "
+
requiredValues
[
i
];
}
message
+=
" como minimo."
alert
(
message
);
return
;
}
for
(
const
[
name
,
value
]
of
formData
){
pairs
[
name
]
=
value
}
console
.
log
(
pairs
)
for
(
let
i
=
0
;
i
<
cont_cargo
;
i
++
){
if
(
postulaciones
[
i
]
!==
null
){
if
(
postulaciones
[
i
][
"id"
]
===
pairs
[
"cargo-id"
]){
alert
(
"Ya has agregado ese cargo!"
)
cont_cargo
--
;
return
;
}
}
}
postulaciones
[
cont_cargo
]
=
{}
postulaciones
[
cont_cargo
][
"id"
]
=
pairs
[
"cargo-id"
]
//postulaciones[cont_cargo]["cargo"]=pairs["cargo-id"]=="-1"?{nombre: pairs["cargo-nombre"]}:{id: pairs["cargo-id"],nombre:document.querySelector('[name=cargo-id] > option[value="'+pairs["cargo-id"]+'"]').innerHTML}
console
.
log
(
postulaciones
)
formcar
.
reset
();
//imprimir lista actualizada
const
div
=
document
.
querySelector
(
"#cargos"
)
const
div1
=
document
.
createElement
(
'div'
);
let
content1
=
'<ul>'
for
(
let
index
=
0
;
index
<
postulaciones
.
length
;
index
++
)
{
const
car
=
postulaciones
[
index
];
if
(
car
==
null
)
continue
;
content1
+=
`
<li id="car-
${
index
}
">
${
document
.
querySelector
(
'[name=cargo-id] > option[value="'
+
car
.
id
+
'"]'
).
innerHTML
}
<button type="button" onclick="eliminarCargoPostulante(event)">Eliminar</button>
</li>
`
}
content1
+=
"</ul>"
div1
.
innerHTML
=
content1
div
.
innerHTML
=
''
;
div
.
appendChild
(
div1
);
cont_cargo
++
;
}
/*---------------------------------------------------------------------------------------------------*/
function
eliminarCargoPostulante
(
event
)
{
//eliminar del array
postulaciones
[
event
.
target
.
parentElement
.
id
.
split
(
"-"
)[
1
]]
=
null
//eliminar en html
event
.
target
.
parentElement
.
remove
()
}
/*--------------------------------------------------------------------*/
//evento para cambio de ciudad segun departamento
...
...
curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp
View file @
3a517c83
...
...
@@ -67,6 +67,12 @@
<label>
Telefono: ${detalle_referencias.getTelefono()}
</label><br>
</c:forEach>
<br><label>
CARGOS AL CUAL POSTULA
</label><br>
<c:forEach
items=
"${postulante.postulaciones}"
var=
"convocatoria"
>
<label>
Nombre: ${convocatoria.getCargo().getNombre()}
</label><br>
</c:forEach>
</div>
...
...
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
3a517c83
...
...
@@ -260,6 +260,12 @@
</select>
</div>
<div
class=
"inputs p-3 py-5"
>
<div
class=
" inputs d-flex justify-content-between align-items-center experience"
><span
class=
"border px-3 p-1 add-experience"
data-toggle=
"modal"
data-target=
"#cargoForm"
><i
class=
"fa fa-plus"
></i>
Cargo al que postulas
</span></div><br>
</div>
<div
class=
"mt-3 gap-2 d-flex justify-content-between"
id=
"cargos"
>
</div>
<div
class=
"inputs p-3 py-5"
>
<div
class=
" inputs d-flex justify-content-between align-items-center experience"
><span
class=
"border px-3 p-1 add-experience"
data-toggle=
"modal"
data-target=
"#experienciaForm"
><i
class=
"fa fa-plus"
></i>
Agregar Experiencia
</span></div><br>
...
...
@@ -296,7 +302,37 @@
</div>
</div>
</form>
<!---------------------------------------Modal de Cargos disponibles---------------------------------------------------------------->
<div
class=
"modal fade"
id=
"cargoForm"
tabindex=
"-2"
role=
"dialog"
aria-labelledby=
"cargoForm"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
role=
"document"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<h5
class=
"modal-title"
id=
"exampleModalLabel"
>
CargosDisponibles
</h5>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-label=
"Close"
>
<span
aria-hidden=
"true"
>
×
</span>
</button>
</div>
<div
class=
"modal-body"
>
<form
name=
"cargo-form"
class=
"needs-validation"
novalidate
>
<label
for=
"cargo-nombre"
class=
"form-label"
>
Cargo
</label>
<div
class=
"input-group mb-3"
>
<select
class=
"form-select"
name=
"cargo-id"
aria-label=
"Default select example"
required
>
<option
value=
"-1"
selected
>
Open this select menu
</option>
<c:forEach
items=
"${CargosDisponibles}"
var=
"convocatoria"
>
<option
value=
"${convocatoria.getId()}"
>
${convocatoria.getCargo().getNombre()}
</option>
</c:forEach>
>
</select>
</div>
</form>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-secondary"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-primary"
onclick=
"agregarFieldCargo()"
data-dismiss=
"modal"
>
Agregar
</button>
</div>
</div>
</div>
</div>
<!-------------------------------------------------------------------------------------------------------------------------->
<!--Modal de Experiencia-->
<div
class=
"modal fade"
id=
"experienciaForm"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"experienciaForm"
aria-hidden=
"true"
>
...
...
curriculumsearch/src/main/webapp/jsp/postulantes.jsp
View file @
3a517c83
...
...
@@ -62,6 +62,7 @@
<option
value=
"36"
>
Mayor a 3 años
</option>
<option
value=
"60"
>
Mayor a 5 años
</option>
</select>
</form>
</div>
<table
class=
"table"
>
...
...
@@ -91,7 +92,17 @@
<td><a
href=
"/postulante/${postulante.id}"
>
Ver
</a></td>
</tr>
</c:forEach>
</tbody>
</table>
<div>
<nav
aria-label=
"Page navigation example"
>
<ul
class=
"pagination"
>
<c:forEach
begin=
"1"
end=
"${pages}"
var=
"nro"
>
<li
class=
"page-item ${(param.nroPagina == null and nro == 1) or param.nroPagina == nro-1 ? 'active' : ''}"
><a
class=
"page-link"
href=
"javascript:buscarPagina(${nro})"
>
${nro}
</a></li>
</c:forEach>
</ul>
</nav>
</div>
<script>
function
habilitarLvlTec
(){
...
...
@@ -102,10 +113,21 @@
}
}
function
buscarPagina
(
nro
){
nro
--
const
aBuscar
=
'nroPagina='
+
nro
if
(
!
location
.
search
)
location
.
search
=
"?"
+
aBuscar
const
inicial
=
location
.
search
.
search
(
aBuscar
);
if
(
inicial
==-
1
){
//si no se encuentra y hay otros queries
location
.
search
=
"&"
+
aBuscar
}
location
.
search
.
replace
(
'nroPagina='
,
aBuscar
)
}
const
tecId
=
document
.
querySelector
(
"#tecId"
);
const
lvlTec
=
document
.
querySelector
(
"#lvlTec"
);
tecId
.
addEventListener
(
'change'
,
habilitarLvlTec
);
habilitarLvlTec
()
</script>
</body>
</html>
\ No newline at end of file
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