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
196c6893
Commit
196c6893
authored
3 years ago
by
Cesar Giulano Gonzalez Maqueda
Browse files
Options
Browse Files
Download
Plain Diff
Merge con joel
parents
19be8b2c
cc771cb7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
718 additions
and
187 deletions
+718
-187
curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java
+20
-5
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+28
-2
curriculumsearch/src/main/java/com/roshka/modelo/Cargo.java
+50
-0
curriculumsearch/src/main/java/com/roshka/modelo/Ciudad.java
+71
-0
curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java
+86
-0
curriculumsearch/src/main/java/com/roshka/modelo/Departamento.java
+57
-0
curriculumsearch/src/main/java/com/roshka/modelo/EstadoCivil.java
+17
-0
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
+37
-17
curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaReconocimiento.java
+0
-50
curriculumsearch/src/main/java/com/roshka/modelo/ModalidadConverter.java
+0
-30
curriculumsearch/src/main/java/com/roshka/modelo/Nacionalidad.java
+3
-9
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
+78
-20
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
+2
-1
curriculumsearch/src/main/java/com/roshka/modelo/ReferenciaPersonal.java
+78
-0
curriculumsearch/src/main/java/com/roshka/modelo/Tecnologia.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/TipoExperiencia.java
+20
-0
curriculumsearch/src/main/java/com/roshka/repositorio/CiudadRepository.java
+4
-6
curriculumsearch/src/main/java/com/roshka/repositorio/DepartamentoRepository.java
+9
-0
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java
+1
-1
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteTecnologiaRepository.java
+0
-1
curriculumsearch/src/main/resources/json/Ciudad.json
+0
-0
curriculumsearch/src/main/resources/json/Departamento.json
+75
-0
curriculumsearch/src/main/resources/json/postulante.json
+0
-0
curriculumsearch/src/main/resources/static/main.js
+24
-3
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+56
-38
curriculumsearch/src/main/webapp/jsp/postulantes.jsp
+0
-2
No files found.
curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java
View file @
196c6893
...
...
@@ -6,9 +6,13 @@ import java.util.List;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.roshka.modelo.Ciudad
;
import
com.roshka.modelo.Departamento
;
import
com.roshka.modelo.Postulante
;
import
com.roshka.modelo.PostulanteTecnologia
;
import
com.roshka.modelo.Tecnologia
;
import
com.roshka.repositorio.CiudadRepository
;
import
com.roshka.repositorio.DepartamentoRepository
;
import
com.roshka.repositorio.PostulanteRepository
;
import
com.roshka.repositorio.TecnologiaRepository
;
...
...
@@ -29,16 +33,27 @@ public class CurriculumsearchApplication {
}
@Bean
CommandLineRunner
runner
(
PostulanteRepository
postRepo
,
TecnologiaRepository
tecRepo
)
{
CommandLineRunner
runner
(
PostulanteRepository
postRepo
,
TecnologiaRepository
tecRepo
,
DepartamentoRepository
depR
,
CiudadRepository
ciudR
)
{
return
args
->
{
// read json and write to db
ObjectMapper
mapper
=
new
ObjectMapper
();
TypeReference
<
List
<
Postulante
>>
typeReference
=
new
TypeReference
<
List
<
Postulante
>>(){};
InputStream
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/postulante.json"
);
try
{
// read json and write to db
ObjectMapper
mapper
=
new
ObjectMapper
();
TypeReference
<
List
<
Departamento
>>
typeReference1
=
new
TypeReference
<
List
<
Departamento
>>(){};
InputStream
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/Departamento.json"
);
List
<
Departamento
>
departamento
=
mapper
.
readValue
(
inputStream
,
typeReference1
);
depR
.
saveAll
(
departamento
);
System
.
out
.
println
(
"Departamentos Saved!"
);
TypeReference
<
List
<
Ciudad
>>
typeReference2
=
new
TypeReference
<
List
<
Ciudad
>>(){};
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/Ciudad.json"
);
List
<
Ciudad
>
ciudades
=
mapper
.
readValue
(
inputStream
,
typeReference2
);
ciudR
.
saveAll
(
ciudades
);
System
.
out
.
println
(
"Cuidad Saved!"
);
TypeReference
<
List
<
Postulante
>>
typeReference
=
new
TypeReference
<
List
<
Postulante
>>(){};
inputStream
=
TypeReference
.
class
.
getResourceAsStream
(
"/json/postulante.json"
);
List
<
Postulante
>
postulantes
=
mapper
.
readValue
(
inputStream
,
typeReference
);
postRepo
.
saveAll
(
postulantes
);
System
.
out
.
println
(
"postulantes Saved!"
);
}
catch
(
IOException
e
){
System
.
out
.
println
(
"Unable to save tecnologias: "
+
e
.
getMessage
());
}
...
...
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
View file @
196c6893
...
...
@@ -6,6 +6,15 @@ import java.util.List;
import
javax.validation.ConstraintViolationException
;
import
com.roshka.modelo.*
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.roshka.modelo.Disponibilidad
;
import
com.roshka.modelo.EstadoCivil
;
import
com.roshka.modelo.Nacionalidad
;
import
com.roshka.modelo.Postulante
;
import
com.roshka.modelo.TipoExperiencia
;
import
com.roshka.repositorio.CiudadRepository
;
import
com.roshka.repositorio.DepartamentoRepository
;
import
com.roshka.repositorio.ExperienciaRepository
;
import
com.roshka.repositorio.InstitucionRepository
;
import
com.roshka.repositorio.PostulanteRepository
;
...
...
@@ -27,17 +36,24 @@ public class PostulanteController {
TecnologiaRepository
tecRepo
;
ExperienciaRepository
expRepo
;
InstitucionRepository
institucionRepository
;
DepartamentoRepository
depRepo
;
CiudadRepository
ciuRepo
;
@Autowired
public
PostulanteController
(
PostulanteRepository
post
,
TecnologiaRepository
tecRepo
,
ExperienciaRepository
expRepo
,
InstitucionRepository
institucionRepository
)
{
public
PostulanteController
(
PostulanteRepository
post
,
TecnologiaRepository
tecRepo
,
ExperienciaRepository
expRepo
,
InstitucionRepository
institucionRepository
,
DepartamentoRepository
depRepo
,
CiudadRepository
ciuRepo
)
{
this
.
post
=
post
;
this
.
tecRepo
=
tecRepo
;
this
.
expRepo
=
expRepo
;
this
.
institucionRepository
=
institucionRepository
;
this
.
depRepo
=
depRepo
;
this
.
ciuRepo
=
ciuRepo
;
}
@RequestMapping
(
"/"
)
public
String
index
()
{
return
"index"
;
}
...
...
@@ -53,10 +69,20 @@ public class PostulanteController {
@RequestMapping
(
"/postulante"
)
public
String
getFormPostulante
(
Model
model
){
model
.
addAttribute
(
"tecnologias"
,
tecRepo
.
findAll
());
model
.
addAttribute
(
"modalidades"
,
Modalidad
.
values
());
model
.
addAttribute
(
"disponibilidades"
,
Disponibilidad
.
values
());
model
.
addAttribute
(
"tiposDeEstudio"
,
TipoDeEstudio
.
values
());
model
.
addAttribute
(
"estadosEstudio"
,
EstadoEstudio
.
values
());
model
.
addAttribute
(
"estadosCiviles"
,
EstadoCivil
.
values
());
model
.
addAttribute
(
"nacionalidades"
,
Nacionalidad
.
values
());
model
.
addAttribute
(
"tiposExperencia"
,
TipoExperiencia
.
values
());
try
{
model
.
addAttribute
(
"ciudades"
,
new
ObjectMapper
().
writeValueAsString
(
ciuRepo
.
findAll
()));
}
catch
(
JsonProcessingException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
model
.
addAttribute
(
"departamentos"
,
depRepo
.
findAll
());
return
"postulante-form"
;
}
...
...
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/Cargo.java
0 → 100644
View file @
196c6893
package
com
.
roshka
.
modelo
;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.OneToMany
;
import
javax.persistence.Table
;
import
javax.validation.constraints.NotBlank
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
@Entity
@Table
(
name
=
"cargo"
)
public
class
Cargo
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
private
long
id
;
@NotBlank
@Column
(
name
=
"nombre"
)
private
String
nombre
;
@OneToMany
(
mappedBy
=
"cargo"
)
@JsonManagedReference
private
List
<
ConvocatoriaCargo
>
convocatorias
;
public
long
getId
()
{
return
id
;
}
public
String
getNombre
()
{
return
nombre
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
void
setNombre
(
String
nombre
)
{
this
.
nombre
=
nombre
;
}
public
List
<
ConvocatoriaCargo
>
getConvocatorias
()
{
return
convocatorias
;
}
public
void
setConvocatorias
(
List
<
ConvocatoriaCargo
>
convocatorias
)
{
this
.
convocatorias
=
convocatorias
;
}
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/Ciudad.java
0 → 100644
View file @
196c6893
package
com
.
roshka
.
modelo
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.FetchType
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
@Entity
@Table
(
name
=
"ciudad"
)
public
class
Ciudad
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
public
Long
id
;
@Column
(
name
=
"nombre"
)
public
String
nombre
;
@Column
(
name
=
"departamento_id"
)
private
Long
departamentoId
;
public
Long
getDepartamentoId
()
{
return
this
.
departamentoId
;
}
public
void
setDepartamentoId
(
Long
departamentoId
)
{
this
.
departamentoId
=
departamentoId
;
}
@ManyToOne
(
targetEntity
=
Departamento
.
class
,
fetch
=
FetchType
.
EAGER
)
@JoinColumn
(
name
=
"departamento_id"
,
insertable
=
false
,
updatable
=
false
)
@JsonBackReference
private
Departamento
departamento
;
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
;
}
public
Departamento
getDepartamento
()
{
return
this
.
departamento
;
}
public
void
setDepartamento
(
Departamento
departamento
)
{
this
.
departamento
=
departamento
;
}
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java
0 → 100644
View file @
196c6893
package
com
.
roshka
.
modelo
;
import
java.util.Date
;
import
java.util.List
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToMany
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
import
com.roshka.utils.Helper
;
@Entity
@Table
(
name
=
"convocatoria_cargo"
)
public
class
ConvocatoriaCargo
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
private
long
id
;
@ManyToOne
()
@JoinColumn
@JsonBackReference
private
Cargo
cargo
;
@Column
(
name
=
"fecha_inicio"
)
private
Date
fechaInicio
;
@Column
(
name
=
"fecha_fin"
)
private
Date
fechaFin
;
@Column
(
name
=
"cupos"
)
private
int
cupos
;
@ManyToMany
(
mappedBy
=
"postulaciones"
)
private
List
<
Postulante
>
postulantes
;
public
long
getId
()
{
return
id
;
}
public
Cargo
getCargo
()
{
return
cargo
;
}
public
int
getCupos
()
{
return
cupos
;
}
public
Date
getFechaFin
()
{
return
fechaFin
;
}
public
Date
getFechaInicio
()
{
return
fechaInicio
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
void
setCargo
(
Cargo
cargo
)
{
this
.
cargo
=
cargo
;
}
public
void
setCupos
(
int
cupos
)
{
this
.
cupos
=
cupos
;
}
public
void
setFechaFin
(
Date
fechaFin
)
{
this
.
fechaFin
=
fechaFin
;
}
public
void
setFechaInicio
(
Date
fechaInicio
)
{
this
.
fechaInicio
=
fechaInicio
;
}
public
void
setFechaFin
(
String
fechaFin
)
{
this
.
fechaFin
=
Helper
.
convertirFecha
(
fechaFin
);
}
public
void
setFechaInicio
(
String
fechaInicio
)
{
this
.
fechaInicio
=
Helper
.
convertirFecha
(
fechaInicio
);
}
public
List
<
Postulante
>
getPostulantes
()
{
return
postulantes
;
}
public
void
setPostulantes
(
List
<
Postulante
>
postulantes
)
{
this
.
postulantes
=
postulantes
;
}
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/Departamento.java
0 → 100644
View file @
196c6893
package
com
.
roshka
.
modelo
;
import
java.util.List
;
import
javax.persistence.CascadeType
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.OneToMany
;
import
javax.persistence.Table
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
@Entity
@Table
(
name
=
"departamento"
)
public
class
Departamento
{
@Id
private
Long
id
;
@Column
(
name
=
"nombre"
)
private
String
nombre
;
@OneToMany
(
mappedBy
=
"departamento"
,
cascade
=
CascadeType
.
ALL
)
@JsonManagedReference
private
List
<
Ciudad
>
ciudad
;
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
;
}
public
List
<
Ciudad
>
getCiudad
()
{
return
this
.
ciudad
;
}
public
void
setCiudad
(
List
<
Ciudad
>
ciudad
)
{
this
.
ciudad
=
ciudad
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/EstadoCivil.java
0 → 100644
View file @
196c6893
package
com
.
roshka
.
modelo
;
import
com.fasterxml.jackson.annotation.JsonValue
;
public
enum
EstadoCivil
{
SOLTERO
(
"Soltero"
),
CONCUBINADO
(
"Concubinado"
),
CASADO
(
"Casado"
),
VIUDO
(
"Viudo"
),
DIVORCIADO
(
"Divorciado"
);
private
String
descripcion
;
private
EstadoCivil
(
String
descripcion
)
{
this
.
descripcion
=
descripcion
;
}
@JsonValue
public
String
getDescripcion
()
{
return
descripcion
;
}
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/Estudio.java
View file @
196c6893
...
...
@@ -24,7 +24,7 @@ public class Estudio {
private
TipoDeEstudio
tipoDeEstudio
;
@NotNull
(
message
=
"Este campo no puede estar vacio"
)
@ManyToOne
(
fetch
=
FetchType
.
EAGER
)
@ManyToOne
(
cascade
=
CascadeType
.
PERSIST
,
fetch
=
FetchType
.
EAGER
)
@JsonBackReference
private
Institucion
institucion
;
...
...
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/Experiencia.java
View file @
196c6893
...
...
@@ -45,18 +45,49 @@ public class Experiencia {
@NotBlank
(
message
=
"Este campo no puede estar vacio"
)
private
String
cargo
;
@Column
(
name
=
"descripcion
"
)
private
String
descripcion
;
@Column
(
name
=
"motivo_salida
"
)
private
String
motivoSalida
;
@JsonBackReference
(
value
=
"experiencia-postulante"
)
@ManyToOne
(
optional
=
false
)
@JoinColumn
private
Postulante
postulante
;
@JsonManagedReference
(
value
=
"experienciareconocimiento-experiencia"
)
@OneToMany
(
mappedBy
=
"experiencia"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
ExperienciaReconocimiento
>
reconocimientos
;
@Column
(
name
=
"tipo_experiencia"
)
@NotNull
private
TipoExperiencia
tipoExperiencia
;
@Column
(
name
=
"descripcion"
)
@NotBlank
private
String
descripcion
;
public
String
getDescripcion
()
{
return
descripcion
;
}
public
void
setDescripcion
(
String
descripcion
)
{
this
.
descripcion
=
descripcion
;
}
public
Date
getFechaDesde
()
{
return
fechaDesde
;
}
public
String
getMotivoSalida
()
{
return
motivoSalida
;
}
public
TipoExperiencia
getTipoExperiencia
()
{
return
tipoExperiencia
;
}
public
void
setMotivoSalida
(
String
motivoSalida
)
{
this
.
motivoSalida
=
motivoSalida
;
}
public
void
setTipoExperiencia
(
TipoExperiencia
tipoExperiencia
)
{
this
.
tipoExperiencia
=
tipoExperiencia
;
}
public
long
getId
()
{
return
id
;
}
...
...
@@ -105,16 +136,5 @@ public class Experiencia {
public
Postulante
getPostulante
()
{
return
postulante
;
}
public
String
getDescripcion
()
{
return
descripcion
;
}
public
void
setDescripcion
(
String
descripcion
)
{
this
.
descripcion
=
descripcion
;
}
public
void
setReconocimientos
(
List
<
ExperienciaReconocimiento
>
reconocimientos
)
{
this
.
reconocimientos
=
reconocimientos
;
}
public
List
<
ExperienciaReconocimiento
>
getReconocimientos
()
{
return
reconocimientos
;
}
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/ExperienciaReconocimiento.java
deleted
100644 → 0
View file @
19be8b2c
package
com
.
roshka
.
modelo
;
import
javax.persistence.*
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
@Entity
@Table
(
name
=
"experiencia_reconocimiento"
)
public
class
ExperienciaReconocimiento
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
@Column
(
name
=
"id"
)
private
long
id
;
@ManyToOne
(
optional
=
false
)
@JoinColumn
@JsonBackReference
(
value
=
"experienciareconocimiento-experiencia"
)
private
Experiencia
experiencia
;
@Column
(
name
=
"nombre"
)
private
String
nombre
;
@Column
(
name
=
"certificado"
)
private
String
certificado
;
public
long
getId
()
{
return
id
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
Experiencia
getExperiencia
()
{
return
experiencia
;
}
public
void
setExperiencia
(
Experiencia
experiencia
)
{
this
.
experiencia
=
experiencia
;
}
public
String
getCertificado
()
{
return
certificado
;
}
public
String
getNombre
()
{
return
nombre
;
}
public
void
setCertificado
(
String
certificado
)
{
this
.
certificado
=
certificado
;
}
public
void
setNombre
(
String
nombre
)
{
this
.
nombre
=
nombre
;
}
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/ModalidadConverter.java
deleted
100644 → 0
View file @
19be8b2c
package
com
.
roshka
.
modelo
;
import
java.util.Arrays
;
import
javax.persistence.AttributeConverter
;
import
javax.persistence.Converter
;
@Converter
(
autoApply
=
true
)
public
class
ModalidadConverter
implements
AttributeConverter
<
Modalidad
,
String
>
{
@Override
public
String
convertToDatabaseColumn
(
Modalidad
modalidad
)
{
if
(
modalidad
==
null
)
{
return
null
;
}
return
modalidad
.
getCode
();
}
@Override
public
Modalidad
convertToEntityAttribute
(
String
code
)
{
if
(
code
==
null
)
{
return
null
;
}
return
Arrays
.
stream
(
Modalidad
.
values
())
.
filter
(
c
->
c
.
getCode
().
equals
(
code
))
.
findFirst
()
.
orElseThrow
(
IllegalArgumentException:
:
new
);
}
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/
Mod
alidad.java
→
curriculumsearch/src/main/java/com/roshka/modelo/
Nacion
alidad.java
View file @
196c6893
...
...
@@ -2,22 +2,16 @@ package com.roshka.modelo;
import
com.fasterxml.jackson.annotation.JsonValue
;
public
enum
Mod
alidad
{
P
RESENCIAL
(
"P"
,
"Presencial"
),
SEMIPRESENCIAL
(
"S"
,
"Semi Presencial"
),
REMOTO
(
"R"
,
"Remot
o"
);
public
enum
Nacion
alidad
{
P
Y
(
"Paraguayo"
),
EX
(
"Extranjer
o"
);
private
String
code
;
private
String
descripcion
;
private
Modalidad
(
String
code
,
String
descripcion
)
{
this
.
code
=
code
;
private
Nacionalidad
(
String
descripcion
)
{
this
.
descripcion
=
descripcion
;
}
@JsonValue
public
String
getCode
()
{
return
code
;
}
public
String
getDescripcion
()
{
return
descripcion
;
}
...
...
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
View file @
196c6893
...
...
@@ -3,6 +3,7 @@ package com.roshka.modelo;
import
javax.persistence.*
;
import
javax.validation.constraints.*
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonManagedReference
;
import
com.roshka.utils.Helper
;
...
...
@@ -39,10 +40,11 @@ public class Postulante {
@Email
(
message
=
"Formato incorrecto de correo"
)
private
String
correo
;
@Column
(
name
=
"ciudad"
)
@NotBlank
(
message
=
"Este campo no puede estar vacio"
)
@Size
(
max
=
120
)
private
String
ciudad
;
@ManyToOne
(
targetEntity
=
Ciudad
.
class
,
fetch
=
FetchType
.
EAGER
)
@JoinColumn
(
name
=
"ciudad_id"
,
insertable
=
false
,
updatable
=
false
)
private
Ciudad
ciudad
;
@Column
(
name
=
"ciudad_id"
)
private
Long
ciudadId
;
@Column
(
name
=
"telefono"
)
@NotBlank
(
message
=
"Este campo no puede estar vacio"
)
...
...
@@ -64,9 +66,18 @@ public class Postulante {
@Column
(
name
=
"curriculum"
)
private
String
curriculum
;
@Column
(
name
=
"modalidad"
,
length
=
2
)
@Column
(
name
=
"estado_civil"
)
@NotNull
private
EstadoCivil
estadoCivil
;
@Column
(
name
=
"nacionalidad"
,
length
=
2
)
@NotNull
private
Modalidad
modalidad
;
private
Nacionalidad
nacionalidad
;
@Column
(
name
=
"tipo_documento"
,
length
=
2
)
@NotBlank
(
message
=
"este campo debe estar completo"
)
private
String
tipoDocumento
;
@Column
(
name
=
"disponibilidad"
,
length
=
2
)
private
Disponibilidad
disponibilidad
;
...
...
@@ -83,6 +94,18 @@ public class Postulante {
@OneToMany
(
mappedBy
=
"postulante"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
Estudio
>
estudios
;
@JsonManagedReference
@OneToMany
(
mappedBy
=
"postulante"
,
cascade
=
CascadeType
.
ALL
)
private
List
<
ReferenciaPersonal
>
referencias
;
@ManyToMany
(
cascade
=
CascadeType
.
ALL
)
@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
;
public
long
getId
()
{
return
id
;
...
...
@@ -124,14 +147,6 @@ public class Postulante {
this
.
correo
=
correo
;
}
public
String
getCiudad
()
{
return
ciudad
;
}
public
void
setCiudad
(
String
ciudad
)
{
this
.
ciudad
=
ciudad
;
}
public
String
getTelefono
()
{
return
telefono
;
}
...
...
@@ -176,16 +191,45 @@ public class Postulante {
this
.
curriculum
=
curriculum
;
}
public
Modalidad
getModalidad
()
{
return
modalidad
;
public
Disponibilidad
getDisponibilidad
()
{
return
disponibilidad
;
}
public
void
setModalidad
(
Modalidad
modalidad
)
{
this
.
modalidad
=
modali
dad
;
public
Ciudad
getCiudad
(
)
{
return
this
.
ciu
dad
;
}
public
Disponibilidad
getDisponibilidad
()
{
return
disponibilidad
;
public
void
setCiudad
(
Ciudad
ciudad
)
{
this
.
ciudad
=
ciudad
;
}
public
Long
getCiudadId
()
{
return
this
.
ciudadId
;
}
public
void
setCiudadId
(
Long
ciudadId
)
{
this
.
ciudadId
=
ciudadId
;
}
public
void
setEstadoCivil
(
EstadoCivil
estadoCivil
)
{
this
.
estadoCivil
=
estadoCivil
;
}
public
void
setTipoDocumento
(
String
tipoDocumento
)
{
this
.
tipoDocumento
=
tipoDocumento
;
}
public
EstadoCivil
getEstadoCivil
()
{
return
estadoCivil
;
}
public
String
getTipoDocumento
()
{
return
tipoDocumento
;
}
public
Nacionalidad
getNacionalidad
()
{
return
nacionalidad
;
}
public
void
setNacionalidad
(
Nacionalidad
nacionalidad
)
{
this
.
nacionalidad
=
nacionalidad
;
}
public
void
setDisponibilidad
(
Disponibilidad
disponibilidad
)
{
...
...
@@ -211,4 +255,18 @@ public class Postulante {
public
void
setExperiencias
(
List
<
Experiencia
>
experiencias
)
{
this
.
experiencias
=
experiencias
;
}
public
List
<
ConvocatoriaCargo
>
getPostulaciones
()
{
return
postulaciones
;
}
public
void
setPostulaciones
(
List
<
ConvocatoriaCargo
>
postulaciones
)
{
this
.
postulaciones
=
postulaciones
;
}
public
void
setReferencias
(
List
<
ReferenciaPersonal
>
referencias
)
{
this
.
referencias
=
referencias
;
}
public
List
<
ReferenciaPersonal
>
getReferencias
()
{
return
referencias
;
}
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
View file @
196c6893
...
...
@@ -12,7 +12,7 @@ import javax.persistence.Table;
import
javax.persistence.UniqueConstraint
;
import
javax.validation.constraints.Max
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotBlank
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
@Entity
...
...
@@ -37,6 +37,7 @@ public class PostulanteTecnologia {
@JoinColumn
@JsonBackReference
(
value
=
"postulantetecnologia-postulante"
)
private
Postulante
postulante
;
public
long
getId
()
{
return
id
;
}
...
...
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/ReferenciaPersonal.java
0 → 100644
View file @
196c6893
package
com
.
roshka
.
modelo
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.JoinColumn
;
import
javax.persistence.ManyToOne
;
import
javax.persistence.Table
;
import
javax.validation.constraints.NotBlank
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
@Entity
@Table
(
name
=
"referencia_personal"
)
public
class
ReferenciaPersonal
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
)
private
Long
id
;
@NotBlank
@Column
(
name
=
"nombre"
)
private
String
nombre
;
@NotBlank
@Column
(
name
=
"telefono"
)
private
String
telefono
;
@NotBlank
@Column
(
name
=
"relacion"
)
private
String
relacion
;
@ManyToOne
(
optional
=
false
)
@JoinColumn
@JsonBackReference
private
Postulante
postulante
;
public
Long
getId
()
{
return
id
;
}
public
String
getNombre
()
{
return
nombre
;
}
public
String
getRelacion
()
{
return
relacion
;
}
public
String
getTelefono
()
{
return
telefono
;
}
public
Postulante
getPostulante
()
{
return
postulante
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
void
setNombre
(
String
nombre
)
{
this
.
nombre
=
nombre
;
}
public
void
setRelacion
(
String
relacion
)
{
this
.
relacion
=
relacion
;
}
public
void
setTelefono
(
String
telefono
)
{
this
.
telefono
=
telefono
;
}
public
void
setPostulante
(
Postulante
postulante
)
{
this
.
postulante
=
postulante
;
}
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/Tecnologia.java
View file @
196c6893
...
...
@@ -7,7 +7,7 @@ import javax.persistence.GenerationType;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.validation.constraints.NotBlank
;
import
java.util.Locale
;
@Entity
@Table
(
name
=
"tecnologia"
)
...
...
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/modelo/TipoExperiencia.java
0 → 100644
View file @
196c6893
package
com
.
roshka
.
modelo
;
import
com.fasterxml.jackson.annotation.JsonValue
;
public
enum
TipoExperiencia
{
TRABAJO_NORMAL
(
"Trabajo Normal"
),
PASANTIA
(
"Pasantia"
);
private
String
descripcion
;
private
TipoExperiencia
(
String
descripcion
){
this
.
descripcion
=
descripcion
;
}
@JsonValue
public
String
getDescripcion
()
{
return
descripcion
;
}
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/repositorio/
ExperienciaReconocimiento
Repository.java
→
curriculumsearch/src/main/java/com/roshka/repositorio/
Ciudad
Repository.java
View file @
196c6893
package
com
.
roshka
.
repositorio
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
com.roshka.modelo.ExperienciaReconocimiento
;
import
com.roshka.modelo.Ciudad
;
import
org.springframework.data.jpa.repository.JpaRepository
;
public
interface
ExperienciaReconocimientoRepository
extends
JpaRepository
<
ExperienciaReconocimiento
,
Long
>
{
public
interface
CiudadRepository
extends
JpaRepository
<
Ciudad
,
Long
>
{
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/repositorio/DepartamentoRepository.java
0 → 100644
View file @
196c6893
package
com
.
roshka
.
repositorio
;
import
com.roshka.modelo.Departamento
;
import
org.springframework.data.jpa.repository.JpaRepository
;
public
interface
DepartamentoRepository
extends
JpaRepository
<
Departamento
,
Long
>
{
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java
View file @
196c6893
...
...
@@ -6,7 +6,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import
org.springframework.data.jpa.repository.Query
;
import
com.roshka.modelo.Postulante
;
import
com.roshka.modelo.PostulanteTecnologia
;
public
interface
PostulanteRepository
extends
JpaRepository
<
Postulante
,
Long
>
{
...
...
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteTecnologiaRepository.java
View file @
196c6893
package
com
.
roshka
.
repositorio
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
com.roshka.modelo.PostulanteTecnologia
;
...
...
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/resources/json/Ciudad.json
0 → 100644
View file @
196c6893
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/resources/json/Departamento.json
0 → 100644
View file @
196c6893
[
{
"id"
:
0
,
"nombre"
:
"ASUNCION"
},
{
"id"
:
1
,
"nombre"
:
"CONCEPCION"
},
{
"id"
:
2
,
"nombre"
:
"SAN PEDRO"
},
{
"id"
:
3
,
"nombre"
:
"CORDILLERA"
},
{
"id"
:
4
,
"nombre"
:
"GUAIRA"
},
{
"id"
:
5
,
"nombre"
:
"CAAGUAZU"
},
{
"id"
:
6
,
"nombre"
:
"CAAZAPA"
},
{
"id"
:
7
,
"nombre"
:
"ITAPUA"
},
{
"id"
:
8
,
"nombre"
:
"MISIONES"
},
{
"id"
:
9
,
"nombre"
:
"PARAGUARI"
},
{
"id"
:
10
,
"nombre"
:
"ALTO PARANA"
},
{
"id"
:
11
,
"nombre"
:
"CENTRAL"
},
{
"id"
:
12
,
"nombre"
:
"NEEMBUCU"
},
{
"id"
:
13
,
"nombre"
:
"AMAMBAY"
},
{
"id"
:
14
,
"nombre"
:
"CANINDEYU"
},
{
"id"
:
15
,
"nombre"
:
"PRESIDENTE HAYES"
},
{
"id"
:
16
,
"nombre"
:
"BOQUERON"
},
{
"id"
:
17
,
"nombre"
:
"ALTO PARAGUAY"
}
]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/resources/json/postulante.json
View file @
196c6893
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/resources/static/main.js
View file @
196c6893
...
...
@@ -315,6 +315,27 @@ function eliminarEstudio(event) {
//evento para cambio de ciudad segun departamento
const
depSelect
=
document
.
querySelector
(
"#departamentos"
);
depSelect
.
addEventListener
(
"change"
,
evt
=>
listarCiudades
(
evt
.
target
.
value
))
listarCiudades
(
depSelect
.
value
);
//variable ciudades esta declarada en el jsp
/**
* Listar todas las ciudades en el select de ciudades
* @param {*} depId
*/
function
listarCiudades
(
depId
){
const
ciuAmostrar
=
ciudades
.
filter
(
c
=>
c
.
departamentoId
==
depId
);
const
ciudad
=
document
.
querySelector
(
"select[name=ciudadId]"
);
const
frag
=
document
.
createDocumentFragment
();
for
(
const
ciu
of
ciuAmostrar
)
{
const
opt
=
document
.
createElement
(
"option"
);
opt
.
value
=
ciu
.
id
;
opt
.
innerHTML
=
ciu
.
nombre
;
opt
.
setAttribute
(
"data-departamentoId"
,
ciu
.
departamentoId
);
frag
.
appendChild
(
opt
)
}
ciudad
.
replaceChildren
(
frag
);
}
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
196c6893
...
...
@@ -171,7 +171,23 @@
Luce Bien!
</div>
</div>
<div
class=
"inputs mb-3 col-md-6"
>
<label
for=
"nacionalidad"
class=
"form-label"
>
Nacionalidad
</label>
<select
name=
"nacionalidad"
id=
"nacionalidad"
class=
"bg-light"
>
<c:forEach
items=
"${nacionalidades}"
var=
"nacionalidad"
>
<option
value=
"${nacionalidad.getDescripcion()}"
>
${nacionalidad.getDescripcion()}
</option>
</c:forEach>
</select>
</div>
<div
class=
"inputs mb-3 col-md-6"
>
<label
for=
"tipoDocumento"
class=
"form-label"
>
Tipo de documento
</label>
<input
type=
"text"
name=
"tipoDocumento"
class=
"form-control "
id=
"tipoDocumento"
required
>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
</div>
<div
class=
"inputs mb-3 col-md-6"
>
<label
for=
"ci"
class=
"form-label"
>
Cedula de identidad
</label>
...
...
@@ -181,13 +197,23 @@
</div>
</div>
<div
class=
"inputs mb-3 col-md-6"
>
<label
form=
"ciudad"
class=
"form-label"
>
Ciudad
</label>
<input
type=
"text"
name=
"ciudad"
class=
"form-control "
id=
"ciudad"
required
>
<div
class=
"valid-feedback"
>
Luce Bien!
</div>
<div
class=
"inputs mb-3 col-md-6"
>
<label
for=
"departamentos"
class=
"form-label"
>
Departamentos
</label>
<select
id=
"departamentos"
class=
"bg-light"
>
<c:forEach
items=
"${departamentos}"
var=
"departamentos"
>
<option
value=
"${departamentos.getId()}"
>
${departamentos.getNombre()}
</option>
</c:forEach>
</select>
</div>
<div
class=
"inputs mb-3 col-md-6"
>
<label
for=
"ciudad"
class=
"form-label"
>
Ciudad
</label>
<select
name=
"ciudadId"
id=
"ciudad"
class=
"bg-light"
>
</select>
</div>
<div
class=
"inputs mb-3 col-md-6"
>
<label
for=
"telefono"
class=
"form-label"
>
Telefono
</label>
<input
type=
"number"
name=
"telefono"
class=
"form-control "
id=
"telefono"
required
>
...
...
@@ -225,10 +251,10 @@
</select>
</div>
<div
class=
"inputs mb-3 col-md-6"
>
<label
for=
"
modalidad"
class=
"form-label"
>
Modalidad
</label>
<select
name=
"
modalidad"
id=
"modalidad
"
class=
"bg-light"
>
<c:forEach
items=
"${
modalidades}"
var=
"modalidad
"
>
<option
value=
"${
modalidad.getCode()}"
>
${modalidad
.getDescripcion()}
</option>
<label
for=
"
estadoCivil"
class=
"form-label"
>
Estado Civil
</label>
<select
name=
"
estadoCivil"
id=
"estadoCivil
"
class=
"bg-light"
>
<c:forEach
items=
"${
estadosCiviles}"
var=
"estadoCivil
"
>
<option
value=
"${
estadoCivil.getDescripcion()}"
>
${estadoCivil
.getDescripcion()}
</option>
</c:forEach>
...
...
@@ -316,35 +342,22 @@
<label
for=
"refTel"
class=
"form-label"
>
Telefono de la Referencia
</label>
<input
type=
"text"
class=
"form-control "
name=
"telefonoReferencia"
id=
"refTel"
>
</div>
<div
class=
"inputs"
>
<label
for=
"motivoSalida"
class=
"form-label"
>
Motivo de Salida
</label>
<textarea
class=
"form-control "
name=
"motivoSalida"
id=
"motivoSalida"
></textarea>
</div>
<div
class=
"inputs"
>
<label
for=
"tipoExperiencia"
class=
"form-label"
>
Tipo de Experiencia
</label>
<select
name=
"tipoExperiencia"
id=
"tipoExperiencia"
class=
"bg-light"
>
<c:forEach
items=
"${tiposExperencia}"
var=
"tipoExperiencia"
>
<option
value=
"${tipoExperiencia.getDescripcion()}"
>
${tipoExperiencia.getDescripcion()}
</option>
</c:forEach>
</select>
</div>
<div
class=
"inputs"
>
<label
class=
"form-label"
>
Reconocimientos
</label>
</div>
<div
class=
"row mb-3"
>
<div
class=
"inputs col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-nombre-0"
placeholder=
"Titulo del reconocimiento"
aria-label=
"First name"
>
</div>
<div
class=
" inputs col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-certificado-0"
placeholder=
"Adjuntar archivo"
aria-label=
"Last name"
>
</div>
</div>
<div
class=
"row mb-3"
>
<div
class=
"inputs col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-nombre-1"
placeholder=
"Titulo del reconocimiento"
aria-label=
"First name"
>
</div>
<div
class=
"inputs col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-certificado-1"
placeholder=
"Adjuntar archivo"
aria-label=
"Last name"
>
</div>
</div>
<div
class=
"row mb-3"
>
<div
class=
"inputs col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-nombre-2"
placeholder=
"Titulo del reconocimiento"
aria-label=
"First name"
>
</div>
<div
class=
"inputs col"
>
<input
type=
"text"
class=
"form-control"
name=
"rec-certificado-2"
placeholder=
"Adjuntar archivo"
aria-label=
"Last name"
>
</div>
</div>
</form>
</div>
...
...
@@ -462,6 +475,10 @@
<script
src=
"https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity=
"sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
crossorigin=
"anonymous"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
integrity=
"sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
crossorigin=
"anonymous"
></script>
<script
src=
"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"
integrity=
"sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy"
crossorigin=
"anonymous"
></script>
<script>
var
ciudades
=
$
{
ciudades
};
</script>
<script
src=
"./main.js"
></script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/webapp/jsp/postulantes.jsp
View file @
196c6893
...
...
@@ -41,7 +41,6 @@
<tr>
<th
scope=
"col"
>
#
</th>
<th
scope=
"col"
>
Nombre
</th>
<th
scope=
"col"
>
Modalidad
</th>
<th
scope=
"col"
>
Disponibilidad
</th>
<th
scope=
"col"
>
Nivel de Ingles
</th>
<th
scope=
"col"
>
Experiencia
</th>
...
...
@@ -53,7 +52,6 @@
<tr>
<th
scope=
"row"
>
${staPost.index + 1}
</th>
<td>
${postulante.nombre} ${postulante.apellido}
</td>
<td>
${postulante.modalidad.getDescripcion()}
</td>
<td>
${postulante.disponibilidad.getDescripcion()}
</td>
<td>
${postulante.nivelIngles}
</td>
<td>
0
</td>
...
...
This diff is collapsed.
Click to expand it.
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