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
9ef31f8f
Commit
9ef31f8f
authored
Nov 24, 2021
by
Cesar Giulano Gonzalez Maqueda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Actualizacion de guardado de experiencia
parent
0dc0e788
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
42 deletions
+67
-42
curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java
+11
-19
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
+16
-0
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java
+5
-2
curriculumsearch/src/main/java/com/roshka/utils/PostulantesExcelExporter.java
+9
-4
curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp
+26
-17
No files found.
curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java
View file @
9ef31f8f
...
...
@@ -100,7 +100,7 @@ public class PostulanteRRHHController {
@RequestParam
(
required
=
false
)
Long
convId
,
@RequestParam
(
defaultValue
=
"0"
)
Integer
nroPagina
)
throws
IOException
{
final
Integer
CANTIDAD_POR_PAGINA
=
5
;
final
Integer
CANTIDAD_POR_PAGINA
=
1
;
Pageable
page
=
PageRequest
.
of
(
nroPagina
,
CANTIDAD_POR_PAGINA
,
Sort
.
by
(
"id"
));
model
.
addAttribute
(
"tecnologias"
,
tecRepo
.
findAll
());
model
.
addAttribute
(
"disponibilidades"
,
Disponibilidad
.
values
());
...
...
@@ -120,20 +120,16 @@ public class PostulanteRRHHController {
nombre
==
null
||
nombre
.
trim
().
isEmpty
()
?
new
TypedParameterValue
(
StringType
.
INSTANCE
,
null
)
:
new
TypedParameterValue
(
StringType
.
INSTANCE
,
"%"
+
nombre
+
"%"
),
dispo
,
lvlEng
,
lvlTec
,
tecId
,
instId
,
cargoId
,
page
,
estado
,
convId
);
dispo
,
lvlEng
,
lvlTec
,
tecId
,
instId
,
cargoId
,
page
,
estado
,
convId
,
expInMonths
);
model
.
addAttribute
(
"numeroOcurrencias"
,
postulantesPag
.
getTotalElements
());
List
<
Postulante
>
postulantes
=
postulantesPag
.
getContent
();
List
<
PostulanteListaDTO
>
postulantesDTO
=
new
ArrayList
<>();
for
(
Postulante
postulante
:
postulantes
)
{
long
expTotal
=
0
;
//Sumamos el tiempo de experiencia total en meses de cada postulante
//expTotal = postulante.getExperiencias().stream().mapToLong(e -> Helper.getMonthsDifference(e.getFechaDesde(), e.getFechaHasta())).sum();
for
(
Experiencia
experiencia
:
postulante
.
getExperiencias
())
{
expTotal
+=
Helper
.
getMonthsDifference
(
experiencia
.
getFechaDesde
(),
experiencia
.
getFechaHasta
());
}
if
(
expInMonths
!=
null
&&
expInMonths
>
expTotal
)
continue
;
postulantesDTO
.
add
(
new
PostulanteListaDTO
(
postulante
.
getId
(),
postulante
.
getNombre
(),
postulante
.
getApellido
(),
postulante
.
getDisponibilidad
(),
postulante
.
getNivelIngles
(),
expTotal
,
postulante
.
getTecnologias
(),
postulante
.
getEstadoPostulante
(),
postulante
.
getPostulaciones
()));
postulantesDTO
.
add
(
new
PostulanteListaDTO
(
postulante
.
getId
(),
postulante
.
getNombre
(),
postulante
.
getApellido
(),
postulante
.
getDisponibilidad
(),
postulante
.
getNivelIngles
(),
postulante
.
getMesesDeExperiencia
(),
postulante
.
getTecnologias
(),
postulante
.
getEstadoPostulante
(),
postulante
.
getPostulaciones
()));
}
model
.
addAttribute
(
"pages"
,
postulantesPag
.
getTotalPages
());
...
...
@@ -165,19 +161,15 @@ public class PostulanteRRHHController {
nombre
==
null
||
nombre
.
trim
().
isEmpty
()
?
new
TypedParameterValue
(
StringType
.
INSTANCE
,
null
)
:
new
TypedParameterValue
(
StringType
.
INSTANCE
,
"%"
+
nombre
+
"%"
),
dispo
,
lvlEng
,
lvlTec
,
tecId
,
instId
,
cargoId
,
page
,
estado
,
convId
);
dispo
,
lvlEng
,
lvlTec
,
tecId
,
instId
,
cargoId
,
page
,
estado
,
convId
,
expInMonths
);
List
<
Postulante
>
postulantes
=
postulantesPag
.
getContent
();
List
<
PostulanteListaDTO
>
postulantesDTO
=
new
ArrayList
<>();
for
(
Postulante
postulante
:
postulantes
)
{
long
expTotal
=
0
;
//Sumamos el tiempo de experiencia total en meses de cada postulante
//expTotal = postulante.getExperiencias().stream().mapToLong(e -> Helper.getMonthsDifference(e.getFechaDesde(), e.getFechaHasta())).sum();
for
(
Experiencia
experiencia
:
postulante
.
getExperiencias
())
{
expTotal
+=
Helper
.
getMonthsDifference
(
experiencia
.
getFechaDesde
(),
experiencia
.
getFechaHasta
());
}
if
(
expInMonths
!=
null
&&
expInMonths
>
expTotal
)
continue
;
postulantesDTO
.
add
(
new
PostulanteListaDTO
(
postulante
.
getId
(),
postulante
.
getNombre
(),
postulante
.
getApellido
(),
postulante
.
getDisponibilidad
(),
postulante
.
getNivelIngles
(),
expTotal
,
postulante
.
getTecnologias
(),
postulante
.
getEstadoPostulante
(),
postulante
.
getPostulaciones
()));
postulantesDTO
.
add
(
new
PostulanteListaDTO
(
postulante
.
getId
(),
postulante
.
getNombre
(),
postulante
.
getApellido
(),
postulante
.
getDisponibilidad
(),
postulante
.
getNivelIngles
(),
postulante
.
getMesesDeExperiencia
(),
postulante
.
getTecnologias
(),
postulante
.
getEstadoPostulante
(),
postulante
.
getPostulaciones
()));
}
response
.
setContentType
(
"application/octet-stream"
);
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Postulante.java
View file @
9ef31f8f
...
...
@@ -135,11 +135,16 @@ public class Postulante {
@Column
(
name
=
"fecha_contratado"
)
private
Date
fechaContratado
;
@Column
(
name
=
"meses_de_exp"
)
private
Long
mesesDeExperiencia
;
public
void
setFechaNacimiento
(
String
fechaNacimiento
)
{
this
.
fechaNacimiento
=
Helper
.
convertirFecha
(
fechaNacimiento
);
}
@PrePersist
public
void
precargarFechas
(){
this
.
fechaCreacion
=
new
Date
();
...
...
@@ -147,6 +152,17 @@ public class Postulante {
this
.
estadoPostulante
=
EstadoPostulante
.
NUEVO
;
this
.
comentarioRRHH
=
null
;
}
@PostPersist
private
void
calcularExperienciaEnMese
(){
long
expTotal
=
0
;
//expTotal = postulante.getExperiencias().stream().mapToLong(e -> Helper.getMonthsDifference(e.getFechaDesde(), e.getFechaHasta())).sum();
for
(
Experiencia
experiencia
:
this
.
experiencias
)
{
expTotal
+=
Helper
.
getMonthsDifference
(
experiencia
.
getFechaDesde
(),
experiencia
.
getFechaHasta
());
}
this
.
mesesDeExperiencia
=
expTotal
;
}
@PreUpdate
public
void
actualizarFecha
(){
this
.
fechaActualizacion
=
new
Date
();
...
...
curriculumsearch/src/main/java/com/roshka/repositorio/PostulanteRepository.java
View file @
9ef31f8f
...
...
@@ -62,8 +62,11 @@ public interface PostulanteRepository extends JpaRepository<Postulante,Long> {
" and (e.institucion.id = ?6 or ?6 is null ) "
+
" and (conv.cargoId = ?7 or ?7 is null ) "
+
"and (p.estadoPostulante = ?8 or ?8 is null) "
+
" and (conv.id=?9 or ?9 is null ) "
)
public
Page
<
Postulante
>
postulantesMultiFiltro
(
TypedParameterValue
nombre
,
Disponibilidad
disponibilidad
,
Long
nivelInges
,
Long
nivel
,
Long
tecnoId
,
Long
instId
,
Long
cargoId
,
Pageable
pageable
,
EstadoPostulante
estado
,
Long
convo
);
" and (conv.id=?9 or ?9 is null ) "
+
"and (p.mesesDeExperiencia >= ?10 or ?10 is null ) "
)
public
Page
<
Postulante
>
postulantesMultiFiltro
(
TypedParameterValue
nombre
,
Disponibilidad
disponibilidad
,
Long
nivelInges
,
Long
nivel
,
Long
tecnoId
,
Long
instId
,
Long
cargoId
,
Pageable
pageable
,
EstadoPostulante
estado
,
Long
convo
,
Long
expInMonths
);
@Transactional
@Modifying
...
...
curriculumsearch/src/main/java/com/roshka/utils/PostulantesExcelExporter.java
View file @
9ef31f8f
...
...
@@ -14,9 +14,7 @@ import javax.servlet.http.HttpServletResponse;
import
com.roshka.DTO.PostulanteListaDTO
;
import
com.roshka.modelo.PostulanteTecnologia
;
import
com.roshka.modelo.Tecnologia
;
import
org.apache.poi.ss.usermodel.Cell
;
import
org.apache.poi.ss.usermodel.CellStyle
;
import
org.apache.poi.ss.usermodel.Row
;
import
org.apache.poi.ss.usermodel.*
;
import
org.apache.poi.xssf.usermodel.XSSFFont
;
import
org.apache.poi.xssf.usermodel.XSSFSheet
;
import
org.apache.poi.xssf.usermodel.XSSFWorkbook
;
...
...
@@ -42,9 +40,16 @@ public class PostulantesExcelExporter {
Row
row
=
sheet
.
createRow
(
0
);
CellStyle
style
=
workbook
.
createCellStyle
();
XSSFFont
font
=
workbook
.
createFont
();
font
.
setFontHeightInPoints
((
short
)
14
);
font
.
setColor
(
IndexedColors
.
WHITE
.
getIndex
());
font
.
setBold
(
true
);
font
.
setFontHeight
(
14
);
font
.
setItalic
(
false
);
style
.
setFillPattern
(
FillPatternType
.
SOLID_FOREGROUND
);
style
.
setAlignment
(
HorizontalAlignment
.
CENTER
);
// Setting font to style
style
.
setFont
(
font
);
createCell
(
row
,
0
,
"Postulantes "
+
currentDateTime
,
style
);
row
=
sheet
.
createRow
(
2
);
...
...
curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp
View file @
9ef31f8f
...
...
@@ -131,24 +131,34 @@
</div>
</div>
<hr>
<div class="row" id="buttonRow" style="display: block">
<div class="col">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#estadoModalLong">Agregar observacion</button>
<button id="pdf" type="button" class="btn btn-primary">PDF</button>
</div>
<c:choose>
<c:when test = "${cvId != null}">
<div class="col">
<a class="btn btn-link" target="__blank" href="/postulantes/cvFile/${cvId}">Descargar CV</a>
<div id="buttonRow" style="display: block">
<div class="row">
<div class="col-4">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#estadoModalLong">Agregar observacion</button>
</div>
<div class="col-4">
<div class="dropdown">
<button class="dropdown-toggle btn btn-light" role="button" data-bs-toggle="dropdown" aria-expanded="false">
PDF
</button>
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li><a id="pdf" type="button" class="dropdown-item">Imagen</a></li>
<li><a class="dropdown-item" target="__blank" href="/postulantes/${postulante.id}/pdf">Info</a></li>
</ul>
</div>
</c:when>
</div>
<c:choose>
</c:choose>
<div class="col">
<a class="btn btn-link" target="__blank" href="/postulantes/${postulante.id}/pdf">Obtener pdf</a>
</div>
<c:when test = "${cvId != null}">
<div class="col-4">
<a class="btn btn-link" target="__blank" href="/postulantes/cvFile/${cvId}">Descargar CV</a>
</div>
</c:when>
</c:choose>
</div>
</div>
</div>
</div>
...
...
@@ -400,7 +410,7 @@
var carousels = document.querySelectorAll(".pdf-carousel");
var hrs = document.querySelectorAll(".lineas-pdf");
var opt = {
margin:
1
,
margin:
[1, 1, 1, 1]
,
filename: 'myfile.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 2 },
...
...
@@ -414,7 +424,6 @@
element.style.display = "block"
});
await html2pdf().set(opt).from(element).toPdf().save();
console.log('xd');
buttonsRow.style.display = "block";
carousels.forEach((element)=>{
element.classList.add('carousel-item')
...
...
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