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
e1ff3f2b
Commit
e1ff3f2b
authored
Nov 10, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Plain Diff
merge con convocatoria-form
parents
b3aa5626
d4e647f7
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
283 additions
and
59 deletions
+283
-59
curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java
+50
-2
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+20
-4
curriculumsearch/src/main/java/com/roshka/modelo/Cargo.java
+3
-0
curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java
+3
-0
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
+3
-1
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
+1
-1
curriculumsearch/src/main/java/com/roshka/repositorio/ConvocatoriaRepository.java
+2
-1
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java
+4
-2
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
+51
-46
curriculumsearch/src/main/resources/static/main.js
+73
-0
curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp
+6
-0
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+38
-2
curriculumsearch/src/main/webapp/jsp/postulantes.jsp
+1
-0
No files found.
curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java
View file @
e1ff3f2b
...
...
@@ -9,11 +9,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 +30,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 +45,29 @@ 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
<
ConvocatoriaCargo
>>
typeReference4
=
new
TypeReference
<
List
<
ConvocatoriaCargo
>>(){};
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/convocatoria.json"
);
List
<
ConvocatoriaCargo
>
convocatorias
=
mapper
.
readValue
(
inputStream
,
typeReference4
);
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()));
postulante.getPostulaciones().get(i).getFechaInicio();
}
} */
postRepo
.
saveAll
(
postulantes
);
System
.
out
.
println
(
"postulantes Saved!"
);
String
password
=
new
BCryptPasswordEncoder
().
encode
(
"test"
);
...
...
@@ -58,7 +80,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 +99,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/controller/PostulanteController.java
View file @
e1ff3f2b
...
...
@@ -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,6 +31,8 @@ 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
;
...
...
@@ -51,18 +55,22 @@ public class PostulanteController {
InstitucionRepository
institucionRepository
;
DepartamentoRepository
depRepo
;
CiudadRepository
ciuRepo
;
ConvocatoriaRepository
cargoRepo
;
CargoRepository
carRepo
;
@Autowired
public
PostulanteController
(
PostulanteRepository
post
,
TecnologiaRepository
tecRepo
,
ExperienciaRepository
expRepo
,
InstitucionRepository
institucionRepository
,
DepartamentoRepository
depRepo
,
CiudadRepository
ciuRepo
)
{
CiudadRepository
ciuRepo
,
ConvocatoriaRepository
cargoRepo
,
CargoRepository
carRepo
)
{
this
.
post
=
post
;
this
.
tecRepo
=
tecRepo
;
this
.
expRepo
=
expRepo
;
this
.
institucionRepository
=
institucionRepository
;
this
.
depRepo
=
depRepo
;
this
.
ciuRepo
=
ciuRepo
;
this
.
cargoRepo
=
cargoRepo
;
this
.
carRepo
=
carRepo
;
}
@RequestMapping
(
"home"
)
...
...
@@ -81,6 +89,7 @@ public class PostulanteController {
@RequestParam
(
required
=
false
)
Long
lvlTec
,
@RequestParam
(
required
=
false
)
Long
instId
,
@RequestParam
(
required
=
false
)
Long
expInMonths
,
@RequestParam
(
required
=
false
)
Long
cargoId
,
@RequestParam
(
defaultValue
=
"0"
)
Integer
nroPagina
)
{
final
Integer
CANTIDAD_POR_PAGINA
=
5
;
...
...
@@ -88,7 +97,7 @@ public class PostulanteController {
model
.
addAttribute
(
"tecnologias"
,
tecRepo
.
findAll
());
model
.
addAttribute
(
"disponibilidades"
,
Disponibilidad
.
values
());
model
.
addAttribute
(
"institucionesEducativas"
,
institucionRepository
.
findAll
());
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
,
page
);
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
<>();
...
...
@@ -117,11 +126,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
());
...
...
@@ -135,6 +145,12 @@ 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 @
e1ff3f2b
...
...
@@ -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 @
e1ff3f2b
...
...
@@ -15,10 +15,13 @@ 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
)
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
View file @
e1ff3f2b
...
...
@@ -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,6 +16,7 @@ import java.util.List;
@Entity
@Table
(
name
=
"postulante"
)
@JsonIdentityInfo
(
generator
=
ObjectIdGenerators
.
UUIDGenerator
.
class
,
property
=
"@UUID"
)
public
class
Postulante
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
...
...
@@ -103,7 +106,6 @@ public class Postulante {
joinColumns
=
@JoinColumn
(
name
=
"postulante_id"
,
referencedColumnName
=
"id"
),
inverseJoinColumns
=
@JoinColumn
(
name
=
"convocatoria_cargo_id"
,
referencedColumnName
=
"id"
)
)
@JsonIgnore
private
List
<
ConvocatoriaCargo
>
postulaciones
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
View file @
e1ff3f2b
...
...
@@ -34,7 +34,7 @@ public class PostulanteTecnologia {
private
Tecnologia
tecnologia
;
@ManyToOne
()
@JoinColumn
@JoinColumn
@JsonBackReference
(
value
=
"postulantetecnologia-postulante"
)
private
Postulante
postulante
;
...
...
curriculumsearch/src/main/java/com/roshka/repositorio/ConvocatoriaRepository.java
View file @
e1ff3f2b
...
...
@@ -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 @
e1ff3f2b
...
...
@@ -46,12 +46,14 @@ public interface PostulanteRepository extends JpaRepository<Postulante,Long> {
"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
Page
<
Postulante
>
postulantesMultiFiltro
(
TypedParameterValue
nombre
,
Disponibilidad
disponibilidad
,
Long
nivelInges
,
Long
nivel
,
Long
tecnoId
,
Long
instId
,
Pageable
pageable
);
" 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 @
e1ff3f2b
[
{
"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 @
e1ff3f2b
[
{
"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 @
e1ff3f2b
[
{
"resumen"
:
"In irure aliquip qui cillum veniam sint amet amet sint ex proident anim mollit."
,
"nacionalidad"
:
"Paraguayo"
,
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"resumen"
:
"In irure aliquip qui cillum veniam sint amet amet sint ex proident anim mollit."
,
"nacionalidad"
:
"Paraguayo"
,
"postulaciones"
:
[{
"id"
:
1
}],
"estadoCivil"
:
"Soltero"
,
"tipoDocumento"
:
"CI"
,
"nombre"
:
"Taylor"
,
"apellido"
:
"Obrien"
,
"correo"
:
"gladysalexander@dadabase.com"
,
...
...
@@ -13,13 +14,13 @@
"fechaNacimiento"
:
"2021-08-16"
,
"nivelIngles"
:
1
,
"disponibilidad"
:
"C"
,
"experiencias"
:
[
{
"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"
...
...
@@ -334,4 +340,4 @@
}
]
}
]
\ No newline at end of file
]
curriculumsearch/src/main/resources/static/main.js
View file @
e1ff3f2b
var
cont_experiencia
=
0
;
let
cont_estudios
=
0
;
let
cont_tecnologia
=
0
;
let
cont_cargo
=
0
;
const
experiencias
=
[];
const
estudios
=
[];
const
tecnologias
=
[];
const
postulaciones
=
[];
const
formValidator
=
function
()
{
'use strict'
...
...
@@ -191,6 +193,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
);
...
...
@@ -324,7 +327,77 @@ 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
)
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'
);
console
.
log
(
postulaciones
[
0
])
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="'
+
pairs
[
"cargo-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 @
e1ff3f2b
...
...
@@ -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 @
e1ff3f2b
...
...
@@ -260,7 +260,13 @@
</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>
</div>
...
...
@@ -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 @
e1ff3f2b
...
...
@@ -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"
>
...
...
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