From ea8da0933d140abc9528e649963097eccbb33df4 Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 23 Nov 2021 11:04:26 -0300 Subject: [PATCH] otras tecnologia en el form postulante. --- curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java | 1 + curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java | 5 +---- curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java | 2 +- curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java | 2 +- curriculumsearch/src/main/resources/json/postulante.json | 18 +++++++++--------- curriculumsearch/src/main/resources/json/tecnologia.json | 12 ++++++++++++ 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java b/curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java index 173a835..ef85ce3 100644 --- a/curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java +++ b/curriculumsearch/src/main/java/com/roshka/CurriculumsearchApplication.java @@ -42,6 +42,7 @@ public class CurriculumsearchApplication { guardarJson(convR,"/json/convocatoria.json",ConvocatoriaCargo.class); guardarJson(depR,"/json/Departamento.json",Departamento.class); guardarJson(ciudR,"/json/Ciudad.json",Ciudad.class); + guardarJson(tecRepo,"/json/tecnologia.json",Tecnologia.class); guardarJson(postRepo,"/json/postulante.json",Postulante.class); String password = new BCryptPasswordEncoder().encode("test"); diff --git a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java index 2e15e7e..5ef4d2b 100644 --- a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java +++ b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java @@ -114,10 +114,7 @@ public class PostulanteController { DBFile cv = Helper.createFile(file); if(cv!=null) cv.setPostulante(postulante); postulante.setCvFile(cv); - } - postulante.getTecnologias().stream().filter(tec -> tec.getTecnologia().getId() != 0) - .forEach(tec -> tec.setTecnologia(tecRepo.getById(tec.getTecnologia().getId()))); - + } for(Estudio estudio: postulante.getEstudios()){ String nombreIns = ""; nombreIns = estudio.getInstitucion().getNombre().toLowerCase(); diff --git a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java index 12856e1..a8c4b2e 100644 --- a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java +++ b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java @@ -182,7 +182,7 @@ public class PostulanteRRHHController { .orElseThrow(() -> new Exception("Postulante no encontrado")); return ResponseEntity.ok() .contentType(MediaType.parseMediaType("application/pdf")) - .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + "aver.pdf" + "\"") + .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + postulante.getNroDocument() + ".pdf" + "\"") .body(new ByteArrayResource(pdf.generatePdfReport(postulante))); } catch (Exception e) { // TODO Auto-generated catch block diff --git a/curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java b/curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java index 4224e07..771a35c 100644 --- a/curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java +++ b/curriculumsearch/src/main/java/com/roshka/modelo/PostulanteTecnologia.java @@ -31,7 +31,7 @@ public class PostulanteTecnologia { @Min(value = 1) @Max(value = 5) private Long nivel; - @ManyToOne(cascade = {CascadeType.PERSIST},optional = false) + @ManyToOne() @JoinColumn private Tecnologia tecnologia; diff --git a/curriculumsearch/src/main/resources/json/postulante.json b/curriculumsearch/src/main/resources/json/postulante.json index e3f9e2a..34e0467 100644 --- a/curriculumsearch/src/main/resources/json/postulante.json +++ b/curriculumsearch/src/main/resources/json/postulante.json @@ -40,19 +40,19 @@ "tecnologias": [ { "tecnologia": { - "nombre": "JAVA" + "id": 1 }, "nivel": 5 }, { "tecnologia": { - "nombre": "Python" + "id": 2 }, "nivel": 4 }, { "tecnologia": { - "nombre": "C" + "id": 3 }, "nivel": 5 } @@ -99,7 +99,7 @@ "tecnologias": [ { "tecnologia": { - "nombre": "Spring" + "id": 4 }, "nivel": 2 } @@ -146,7 +146,7 @@ "tecnologias": [ { "tecnologia": { - "nombre": "Django" + "id": 5 }, "nivel": 3 } @@ -193,7 +193,7 @@ "tecnologias": [ { "tecnologia": { - "nombre": "Flutter" + "id": 6 }, "nivel": 2 } @@ -240,7 +240,7 @@ "tecnologias": [ { "tecnologia": { - "nombre": "Switf" + "id": 3 }, "nivel": 5 } @@ -287,7 +287,7 @@ "tecnologias": [ { "tecnologia": { - "nombre": "SL" + "id": 2 }, "nivel": 4 } @@ -334,7 +334,7 @@ "tecnologias": [ { "tecnologia": { - "nombre": "Scala" + "id": 5 }, "nivel": 5 } diff --git a/curriculumsearch/src/main/resources/json/tecnologia.json b/curriculumsearch/src/main/resources/json/tecnologia.json index fb148bf..70e424e 100644 --- a/curriculumsearch/src/main/resources/json/tecnologia.json +++ b/curriculumsearch/src/main/resources/json/tecnologia.json @@ -18,5 +18,17 @@ { "id": 5, "nombre": "spring" + }, + { + "id": 6, + "nombre": "php" + }, + { + "id": 7, + "nombre": "laravel" + }, + { + "id": 8, + "nombre": "sqlserver" } ] \ No newline at end of file -- libgit2 0.26.0