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
4af333a4
Commit
4af333a4
authored
Nov 22, 2021
by
Cesar Giulano Gonzalez Maqueda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generacion de PDF por JS-html2pdf(no se puede seleccionar texto)
parent
f24f57f8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
4 deletions
+44
-4
curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java
+16
-1
curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp
+25
-1
curriculumsearch/src/main/webapp/jsp/detallepostulante2.jsp
+0
-0
curriculumsearch/src/main/webapp/jsp/postulantes.jsp
+3
-2
No files found.
curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java
View file @
4af333a4
...
...
@@ -98,7 +98,11 @@ public class PostulanteRRHHController {
model
.
addAttribute
(
"institucionesEducativas"
,
institucionRepository
.
findAll
());
model
.
addAttribute
(
"estadoP"
,
EstadoPostulante
.
values
());
model
.
addAttribute
(
"convocatoriaC"
,
cargoRepo
.
findAll
());
Page
<
Postulante
>
postulantesPag
=
post
.
postulantesMultiFiltro
(
nombre
==
null
||
nombre
.
trim
().
isEmpty
()
?
new
TypedParameterValue
(
StringType
.
INSTANCE
,
null
)
:
new
TypedParameterValue
(
StringType
.
INSTANCE
,
"%"
+
nombre
+
"%"
),
dispo
,
lvlEng
,
lvlTec
,
tecId
,
instId
,
cargoId
,
page
,
estado
,
convId
);
Page
<
Postulante
>
postulantesPag
=
post
.
postulantesMultiFiltro
(
nombre
==
null
||
nombre
.
trim
().
isEmpty
()
?
new
TypedParameterValue
(
StringType
.
INSTANCE
,
null
)
:
new
TypedParameterValue
(
StringType
.
INSTANCE
,
"%"
+
nombre
+
"%"
),
dispo
,
lvlEng
,
lvlTec
,
tecId
,
instId
,
cargoId
,
page
,
estado
,
convId
);
List
<
Postulante
>
postulantes
=
postulantesPag
.
getContent
();
List
<
PostulanteListaDTO
>
postulantesDTO
=
new
ArrayList
<>();
...
...
@@ -129,6 +133,17 @@ public class PostulanteRRHHController {
return
"detallepostulante"
;
}
// @GetMapping({"/pdfPostulante/{postulanteId}"})
// public String getPostulantePdf(Model model, @PathVariable("postulanteId") Long postulanteId) {
// Postulante p = post.findById(postulanteId).orElse(null);
// model.addAttribute("postulante",p);
// model.addAttribute("cvId", fileRepo.getIdByPostulante(p));
// model.addAttribute("estadoP", EstadoPostulante.values());
// return "detallepostulante2";
//
// }
@PostMapping
({
"/postulantes/{postulanteId}"
})
public
String
setPostulanteEstado
(
@ModelAttribute
Postulante
postulante
,
BindingResult
result
,
@PathVariable
(
"postulanteId"
)
Long
postulanteId
)
{
//post.setPostulanteEstadoAndComentario(postulante.getEstadoPostulante(),postulante.getComentarioRRHH(), postulante.getId());
...
...
curriculumsearch/src/main/webapp/jsp/detallepostulante.jsp
View file @
4af333a4
...
...
@@ -7,6 +7,7 @@
<layout:extends name="layouts/base.jsp">
<layout:put block="contents" type="REPLACE">
<div id="element-to-print">
<h2 style="text-align: center;">
DETALLE POSTULANTE
</h2>
...
...
@@ -130,9 +131,10 @@
</div>
</div>
<hr>
<div class="row
">
<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>
...
...
@@ -382,9 +384,31 @@
</div>
</div>
</div>
</div>
<layout:put block="scripts" type="APPEND">
<script src="../valEdad.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js" integrity="sha512-GsLlZN/3F2ErC5ifS5QtgpiJtWd43JWSuIgh7mbzZ8zBps+dvLusV+eNQATqgA/HdeKFVgA5v3S/cIrLF7QnIg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
document.querySelector('#pdf').addEventListener("click", async ()=>{
var buttonsRow = document.querySelector('#buttonRow');
var element = document.getElementById('element-to-print');
var opt = {
margin: 1,
filename: 'myfile.pdf',
image: { type: 'jpeg', quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: 'in', format: 'a1', orientation: 'portrait' }
};
buttonsRow.style.display = "none";
await html2pdf().set(opt).from(element).toPdf().save();
console.log('xd');
buttonsRow.style.display = "block";
})
<%--location.replace("/postulantes/${postulante.id}/")--%>
</script>
</layout:put>
...
...
curriculumsearch/src/main/webapp/jsp/detallepostulante2.jsp
View file @
4af333a4
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/webapp/jsp/postulantes.jsp
View file @
4af333a4
...
...
@@ -234,12 +234,13 @@
function buscarPagina(nro){
nro--
const aBuscar = 'nroPagina='+nro
if(!location.search) location.search =
"?"+
aBuscar
if(!location.search) location.search = aBuscar
const inicial = location.search.search(aBuscar);
if(inicial==-1){//si no se encuentra y hay otros queries
location.search
= "&"+aBuscar
location.search
+= "&"+aBuscar;
}
location.search.replace('nroPagina=',aBuscar)
console.log(location.search)
}
const tecId = document.querySelector("#tecId");
const lvlTec = document.querySelector("#lvlTec");
...
...
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