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
ef5c655f
Commit
ef5c655f
authored
Nov 25, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix de filtro convocatorias en lista postulantes
parent
23771fa9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
8 deletions
+43
-8
curriculumsearch/src/main/java/com/roshka/DTO/ConvocatoriaDTO.java
+29
-0
curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java
+14
-8
No files found.
curriculumsearch/src/main/java/com/roshka/DTO/ConvocatoriaDTO.java
0 → 100644
View file @
ef5c655f
package
com
.
roshka
.
DTO
;
import
java.util.Date
;
import
com.roshka.modelo.EstadoConvocatoria
;
import
lombok.Data
;
@Data
public
class
ConvocatoriaDTO
{
private
Long
id
;
private
Long
cargoId
;
private
EstadoConvocatoria
estado
;
private
Date
fechaInicio
;
private
Date
fechaFin
;
public
ConvocatoriaDTO
(
Long
id
,
Long
cargoId
,
EstadoConvocatoria
estado
,
Date
fechaInicio
,
Date
fechaFin
)
{
this
.
id
=
id
;
this
.
cargoId
=
cargoId
;
this
.
estado
=
estado
;
this
.
fechaInicio
=
fechaInicio
;
this
.
fechaFin
=
fechaFin
;
}
public
ConvocatoriaDTO
()
{
}
}
curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java
View file @
ef5c655f
...
...
@@ -3,6 +3,7 @@ package com.roshka.controller;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.roshka.DTO.ConvocatoriaDTO
;
import
com.roshka.DTO.PostulanteListaDTO
;
import
com.roshka.modelo.DBFile
;
import
com.roshka.modelo.EstadoPostulante
;
...
...
@@ -12,6 +13,7 @@ import com.roshka.service.PdfGenerator;
import
com.roshka.utils.PostulantesExcelExporter
;
import
org.hibernate.jpa.TypedParameterValue
;
import
org.hibernate.type.StringType
;
import
org.modelmapper.ModelMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.core.io.ByteArrayResource
;
import
org.springframework.core.io.Resource
;
...
...
@@ -36,6 +38,7 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Controller
...
...
@@ -49,7 +52,7 @@ public class PostulanteRRHHController {
CiudadRepository
ciuRepo
;
EstudioRepository
estudioRepository
;
PostulanteTecnologiaRepository
postulanteTecnologiaRepository
;
ConvocatoriaRepository
c
argo
Repo
;
ConvocatoriaRepository
c
onv
Repo
;
CargoRepository
carRepo
;
DBFileRepository
fileRepo
;
...
...
@@ -59,7 +62,7 @@ public class PostulanteRRHHController {
InstitucionRepository
institucionRepository
,
DepartamentoRepository
depRepo
,
CiudadRepository
ciuRepo
,
EstudioRepository
estudioRepository
,
PostulanteTecnologiaRepository
postulanteTecnologiaRepository
,
ConvocatoriaRepository
c
argo
Repo
,
CargoRepository
carRepo
,
DBFileRepository
fileRepo
)
{
ConvocatoriaRepository
c
onv
Repo
,
CargoRepository
carRepo
,
DBFileRepository
fileRepo
)
{
this
.
post
=
post
;
this
.
tecRepo
=
tecRepo
;
this
.
expRepo
=
expRepo
;
...
...
@@ -68,7 +71,7 @@ public class PostulanteRRHHController {
this
.
ciuRepo
=
ciuRepo
;
this
.
estudioRepository
=
estudioRepository
;
this
.
postulanteTecnologiaRepository
=
postulanteTecnologiaRepository
;
this
.
c
argoRepo
=
cargo
Repo
;
this
.
c
onvRepo
=
conv
Repo
;
this
.
carRepo
=
carRepo
;
this
.
fileRepo
=
fileRepo
;
}
...
...
@@ -94,10 +97,13 @@ public class PostulanteRRHHController {
model
.
addAttribute
(
"estadoP"
,
EstadoPostulante
.
values
());
model
.
addAttribute
(
"cargos"
,
carRepo
.
findAll
());
model
.
addAttribute
(
"cargoRepo"
,
cargoRepo
);
//model.addAttribute("convocatoriaC", cargoRepo.findAll());
try
{
model
.
addAttribute
(
"convocatoriaC"
,
new
ObjectMapper
().
writeValueAsString
(
cargoRepo
.
findAll
()));
//se convierte a DTO las convocatorias
model
.
addAttribute
(
"convocatoriaC"
,
new
ObjectMapper
().
writeValueAsString
(
convRepo
.
findAll
().
stream
().
map
(
conv
->
new
ConvocatoriaDTO
(
conv
.
getId
(),
conv
.
getCargoId
(),
conv
.
getEstado
(),
conv
.
getFechaInicio
(),
conv
.
getFechaFin
())
)
.
collect
(
Collectors
.
toList
()))
);
}
catch
(
JsonProcessingException
er
)
{
// TODO Auto-generated catch block
er
.
printStackTrace
();
...
...
@@ -187,8 +193,8 @@ public class PostulanteRRHHController {
filtros
.
put
(
"institucion"
,
instId
==
null
?
"-"
:
institucionRepository
.
findById
(
instId
).
get
().
getNombre
());
filtros
.
put
(
"estado"
,
estado
==
null
?
"-"
:
estado
.
getEstado
());
filtros
.
put
(
"experienciaEnMeses"
,
expInMonths
==
null
?
"-"
:
expInMonths
.
toString
());
filtros
.
put
(
"convocatoria"
,
convId
==
null
?
"-"
:
c
argo
Repo
.
findById
(
convId
).
get
().
getCargo
().
getNombre
());
filtros
.
put
(
"convocatoriaFecha"
,
convId
==
null
?
"-"
:
c
argo
Repo
.
findById
(
convId
).
get
().
getFechaInicio
().
toString
());
filtros
.
put
(
"convocatoria"
,
convId
==
null
?
"-"
:
c
onv
Repo
.
findById
(
convId
).
get
().
getCargo
().
getNombre
());
filtros
.
put
(
"convocatoriaFecha"
,
convId
==
null
?
"-"
:
c
onv
Repo
.
findById
(
convId
).
get
().
getFechaInicio
().
toString
());
PostulantesExcelExporter
excelExporter
=
new
PostulantesExcelExporter
(
postulantesDTO
,
filtros
);
...
...
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