Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
th-app-java
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amparo Oliver
th-app-java
Commits
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
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
31 additions
and
13 deletions
+31
-13
curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java
+14
-1
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 {
InstitucionRepository
institucionRepository
;
DepartamentoRepository
depRepo
;
CiudadRepository
ciuRepo
;
EstudioRepository
estudioRepository
;
PostulanteTecnologiaRepository
postulanteTecnologiaRepository
;
@Autowired
public
PostulanteController
(
PostulanteRepository
post
,
TecnologiaRepository
tecRepo
,
ExperienciaRepository
expRepo
,
InstitucionRepository
institucionRepository
,
DepartamentoRepository
depRepo
,
CiudadRepository
ciuRepo
)
{
CiudadRepository
ciuRepo
,
EstudioRepository
estudioRepository
,
PostulanteTecnologiaRepository
postulanteTecnologiaRepository
)
{
this
.
post
=
post
;
this
.
tecRepo
=
tecRepo
;
this
.
expRepo
=
expRepo
;
this
.
institucionRepository
=
institucionRepository
;
this
.
depRepo
=
depRepo
;
this
.
ciuRepo
=
ciuRepo
;
this
.
estudioRepository
=
estudioRepository
;
this
.
postulanteTecnologiaRepository
=
postulanteTecnologiaRepository
;
}
@RequestMapping
(
"home"
)
...
...
@@ -121,6 +126,14 @@ public class PostulanteController {
@PostMapping
(
value
=
"/postulante"
,
consumes
=
"application/json"
)
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
(
tec
->
tec
.
getTecnologia
().
getId
()
!=
0
).
forEach
(
...
...
curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java
View file @
d109fe30
...
...
@@ -33,7 +33,7 @@ public class PostulanteTecnologia {
@JoinColumn
private
Tecnologia
tecnologia
;
@ManyToOne
()
@ManyToOne
(
cascade
=
CascadeType
.
ALL
)
@JoinColumn
@JsonBackReference
(
value
=
"postulantetecnologia-postulante"
)
private
Postulante
postulante
;
...
...
curriculumsearch/src/main/java/com/roshka/modelo/ReferenciaPersonal.java
View file @
d109fe30
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.persistence.*
;
import
javax.validation.constraints.NotBlank
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
...
...
@@ -31,7 +24,7 @@ public class ReferenciaPersonal {
@Column
(
name
=
"relacion"
)
private
String
relacion
;
@ManyToOne
(
optional
=
false
)
@ManyToOne
(
cascade
=
CascadeType
.
ALL
,
optional
=
false
)
@JoinColumn
@JsonBackReference
private
Postulante
postulante
;
...
...
curriculumsearch/src/main/java/com/roshka/repositorio/EstudioRepository.java
View file @
d109fe30
package
com
.
roshka
.
repositorio
;
import
com.roshka.modelo.Postulante
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
com.roshka.modelo.Estudio
;
import
java.util.List
;
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
;
import
com.roshka.modelo.Postulante
;
import
org.springframework.data.jpa.repository.JpaRepository
;
...
...
@@ -9,4 +10,6 @@ import com.roshka.modelo.Experiencia;
public
interface
ExperienciaRepository
extends
JpaRepository
<
Experiencia
,
Long
>
{
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;
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%"
)
public
List
<
Postulante
>
findByInstitucionEstudio
(
String
institucion
);
...
...
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteTecnologiaRepository.java
View file @
d109fe30
package
com
.
roshka
.
repositorio
;
import
com.roshka.modelo.Postulante
;
import
org.springframework.data.jpa.repository.JpaRepository
;
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 @@
<input
type=
"text"
class=
"form-control d-none"
name=
"tecnologia-nombre"
id=
"tecnologia-nombre"
>
<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>
</div>
<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