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
d109fe30
Commit
d109fe30
authored
Nov 10, 2021
by
Cesar Giulano Gonzalez Maqueda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Postulacion con mismo numero de cedula actualiza postulacion anterior
parent
07dd5804
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
14 deletions
+32
-14
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+15
-2
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
+1
-1
curriculumsearch/src/main/java/com/roshka/modelo/ReferenciaPersonal.java
+2
-9
curriculumsearch/src/main/java/com/roshka/repositorio/EstudioRepository.java
+4
-0
curriculumsearch/src/main/java/com/roshka/repositorio/ExperienciaRepository.java
+3
-0
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java
+2
-0
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteTecnologiaRepository.java
+4
-1
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+1
-1
No files found.
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
View file @
d109fe30
...
@@ -47,18 +47,23 @@ public class PostulanteController {
...
@@ -47,18 +47,23 @@ public class PostulanteController {
InstitucionRepository
institucionRepository
;
InstitucionRepository
institucionRepository
;
DepartamentoRepository
depRepo
;
DepartamentoRepository
depRepo
;
CiudadRepository
ciuRepo
;
CiudadRepository
ciuRepo
;
EstudioRepository
estudioRepository
;
PostulanteTecnologiaRepository
postulanteTecnologiaRepository
;
@Autowired
@Autowired
public
PostulanteController
(
public
PostulanteController
(
PostulanteRepository
post
,
TecnologiaRepository
tecRepo
,
ExperienciaRepository
expRepo
,
PostulanteRepository
post
,
TecnologiaRepository
tecRepo
,
ExperienciaRepository
expRepo
,
InstitucionRepository
institucionRepository
,
DepartamentoRepository
depRepo
,
InstitucionRepository
institucionRepository
,
DepartamentoRepository
depRepo
,
CiudadRepository
ciuRepo
)
{
CiudadRepository
ciuRepo
,
EstudioRepository
estudioRepository
,
PostulanteTecnologiaRepository
postulanteTecnologiaRepository
)
{
this
.
post
=
post
;
this
.
post
=
post
;
this
.
tecRepo
=
tecRepo
;
this
.
tecRepo
=
tecRepo
;
this
.
expRepo
=
expRepo
;
this
.
expRepo
=
expRepo
;
this
.
institucionRepository
=
institucionRepository
;
this
.
institucionRepository
=
institucionRepository
;
this
.
depRepo
=
depRepo
;
this
.
depRepo
=
depRepo
;
this
.
ciuRepo
=
ciuRepo
;
this
.
ciuRepo
=
ciuRepo
;
this
.
estudioRepository
=
estudioRepository
;
this
.
postulanteTecnologiaRepository
=
postulanteTecnologiaRepository
;
}
}
@RequestMapping
(
"home"
)
@RequestMapping
(
"home"
)
...
@@ -121,11 +126,19 @@ public class PostulanteController {
...
@@ -121,11 +126,19 @@ public class PostulanteController {
@PostMapping
(
value
=
"/postulante"
,
consumes
=
"application/json"
)
@PostMapping
(
value
=
"/postulante"
,
consumes
=
"application/json"
)
public
String
guardarPostulante
(
@RequestBody
Postulante
postulante
){
public
String
guardarPostulante
(
@RequestBody
Postulante
postulante
){
//Codigo encargado de modificar postulacion si se envia mismo CI
Postulante
postulantex
=
post
.
findByNroDocument
(
postulante
.
getnroDocument
());
if
(
postulantex
!=
null
){
estudioRepository
.
findByPostulante
(
postulantex
).
forEach
(
x
->
estudioRepository
.
delete
(
x
));
expRepo
.
findByPostulante
(
postulantex
).
forEach
(
x
->
expRepo
.
delete
(
x
));
postulanteTecnologiaRepository
.
findByPostulante
(
postulantex
).
forEach
(
x
->
postulanteTecnologiaRepository
.
delete
(
x
));
postulante
.
setId
(
postulantex
.
getId
());
}
postulante
.
getTecnologias
().
stream
().
filter
(
postulante
.
getTecnologias
().
stream
().
filter
(
tec
->
tec
.
getTecnologia
().
getId
()
!=
0
tec
->
tec
.
getTecnologia
().
getId
()
!=
0
).
forEach
(
).
forEach
(
tec
->
tec
.
setTecnologia
(
tecRepo
.
getById
(
tec
.
getTecnologia
().
getId
()))
tec
->
tec
.
setTecnologia
(
tecRepo
.
getById
(
tec
.
getTecnologia
().
getId
()))
);
);
for
(
Estudio
estudio:
postulante
.
getEstudios
()){
for
(
Estudio
estudio:
postulante
.
getEstudios
()){
String
nombreIns
=
""
;
String
nombreIns
=
""
;
nombreIns
=
estudio
.
getInstitucion
().
getNombre
().
toLowerCase
();
nombreIns
=
estudio
.
getInstitucion
().
getNombre
().
toLowerCase
();
...
...
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
View file @
d109fe30
...
@@ -33,7 +33,7 @@ public class PostulanteTecnologia {
...
@@ -33,7 +33,7 @@ public class PostulanteTecnologia {
@JoinColumn
@JoinColumn
private
Tecnologia
tecnologia
;
private
Tecnologia
tecnologia
;
@ManyToOne
()
@ManyToOne
(
cascade
=
CascadeType
.
ALL
)
@JoinColumn
@JoinColumn
@JsonBackReference
(
value
=
"postulantetecnologia-postulante"
)
@JsonBackReference
(
value
=
"postulantetecnologia-postulante"
)
private
Postulante
postulante
;
private
Postulante
postulante
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/ReferenciaPersonal.java
View file @
d109fe30
package
com
.
roshka
.
modelo
;
package
com
.
roshka
.
modelo
;
import
javax.persistence.Column
;
import
javax.persistence.*
;
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
javax.validation.constraints.NotBlank
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
...
@@ -31,7 +24,7 @@ public class ReferenciaPersonal {
...
@@ -31,7 +24,7 @@ public class ReferenciaPersonal {
@Column
(
name
=
"relacion"
)
@Column
(
name
=
"relacion"
)
private
String
relacion
;
private
String
relacion
;
@ManyToOne
(
optional
=
false
)
@ManyToOne
(
cascade
=
CascadeType
.
ALL
,
optional
=
false
)
@JoinColumn
@JoinColumn
@JsonBackReference
@JsonBackReference
private
Postulante
postulante
;
private
Postulante
postulante
;
...
...
curriculumsearch/src/main/java/com/roshka/repositorio/EstudioRepository.java
View file @
d109fe30
package
com
.
roshka
.
repositorio
;
package
com
.
roshka
.
repositorio
;
import
com.roshka.modelo.Postulante
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
com.roshka.modelo.Estudio
;
import
com.roshka.modelo.Estudio
;
import
java.util.List
;
public
interface
EstudioRepository
extends
JpaRepository
<
Estudio
,
Long
>{
public
interface
EstudioRepository
extends
JpaRepository
<
Estudio
,
Long
>{
public
List
<
Estudio
>
findByPostulante
(
Postulante
postulante
);
}
}
curriculumsearch/src/main/java/com/roshka/repositorio/ExperienciaRepository.java
View file @
d109fe30
package
com
.
roshka
.
repositorio
;
package
com
.
roshka
.
repositorio
;
import
com.roshka.modelo.Postulante
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
...
@@ -9,4 +10,6 @@ import com.roshka.modelo.Experiencia;
...
@@ -9,4 +10,6 @@ import com.roshka.modelo.Experiencia;
public
interface
ExperienciaRepository
extends
JpaRepository
<
Experiencia
,
Long
>
{
public
interface
ExperienciaRepository
extends
JpaRepository
<
Experiencia
,
Long
>
{
public
List
<
Experiencia
>
findByCargoLike
(
String
cargo
);
public
List
<
Experiencia
>
findByCargoLike
(
String
cargo
);
public
List
<
Experiencia
>
findByPostulante
(
Postulante
postulante
);
}
}
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java
View file @
d109fe30
...
@@ -12,6 +12,8 @@ import com.roshka.modelo.Postulante;
...
@@ -12,6 +12,8 @@ import com.roshka.modelo.Postulante;
public
interface
PostulanteRepository
extends
JpaRepository
<
Postulante
,
Long
>
{
public
interface
PostulanteRepository
extends
JpaRepository
<
Postulante
,
Long
>
{
public
Postulante
findByNroDocument
(
String
ci
);
@Query
(
"select p from Postulante p join p.estudios e on e.institucion.nombre LIKE %?1%"
)
@Query
(
"select p from Postulante p join p.estudios e on e.institucion.nombre LIKE %?1%"
)
public
List
<
Postulante
>
findByInstitucionEstudio
(
String
institucion
);
public
List
<
Postulante
>
findByInstitucionEstudio
(
String
institucion
);
...
...
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteTecnologiaRepository.java
View file @
d109fe30
package
com
.
roshka
.
repositorio
;
package
com
.
roshka
.
repositorio
;
import
com.roshka.modelo.Postulante
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
com.roshka.modelo.PostulanteTecnologia
;
import
com.roshka.modelo.PostulanteTecnologia
;
public
interface
PostulanteTecnologiaRepository
extends
JpaRepository
<
PostulanteTecnologia
,
Long
>{
import
java.util.List
;
public
interface
PostulanteTecnologiaRepository
extends
JpaRepository
<
PostulanteTecnologia
,
Long
>{
public
List
<
PostulanteTecnologia
>
findByPostulante
(
Postulante
postulante
);
}
}
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
d109fe30
...
@@ -395,7 +395,7 @@
...
@@ -395,7 +395,7 @@
<input
type=
"text"
class=
"form-control d-none"
name=
"tecnologia-nombre"
id=
"tecnologia-nombre"
>
<input
type=
"text"
class=
"form-control d-none"
name=
"tecnologia-nombre"
id=
"tecnologia-nombre"
>
<label
for=
"nivel"
class=
"form-label"
>
Nivel
</label>
<label
for=
"nivel"
class=
"form-label"
>
Nivel
</label>
<input
type=
"
number"
class=
"form-control"
name=
"nivel"
id=
"nivel
"
required
>
<input
type=
"
range"
class=
"form-range"
name=
"nivel"
id=
"nivel"
min=
"1"
max=
"5
"
required
>
</form>
</form>
</div>
</div>
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
...
...
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