From 522269898710d546fbba2627d751ef8ea8a33388 Mon Sep 17 00:00:00 2001 From: Joel Date: Tue, 23 Nov 2021 11:50:18 -0300 Subject: [PATCH] json convocatoria y cargo se agrego mas muestras --- curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java | 2 +- curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java | 27 +++------------------------ curriculumsearch/src/main/java/com/roshka/utils/Helper.java | 1 + curriculumsearch/src/main/resources/json/cargo.json | 12 ++++++++++++ curriculumsearch/src/main/resources/json/convocatoria.json | 24 ++++++++++++++++++++---- curriculumsearch/src/main/resources/json/postulante.json | 12 ++++++------ curriculumsearch/src/main/resources/static/Convo.js | 4 ++-- 7 files changed, 45 insertions(+), 37 deletions(-) diff --git a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java index 5ef4d2b..8b4b7aa 100644 --- a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java +++ b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteController.java @@ -104,7 +104,7 @@ public class PostulanteController { Postulante postulantex = post.findByNroDocument(postulante.getNroDocument()); if(postulantex != null){ postulante.setEstadoPostulante(postulantex.getEstadoPostulante()); - postulante.setComentarioRRHH(postulantex.getComentarioRRHH()); + postulante.setComentarioRRHH(postulantex.getComentarioRRHH()); estudioRepository.findByPostulante(postulantex).forEach(x -> estudioRepository.delete(x)); expRepo.findByPostulante(postulantex).forEach(x -> expRepo.delete(x)); postulanteTecnologiaRepository.findByPostulante(postulantex).forEach(x -> postulanteTecnologiaRepository.delete(x)); diff --git a/curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java b/curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java index 2b1cb22..99fdae7 100644 --- a/curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java +++ b/curriculumsearch/src/main/java/com/roshka/modelo/ConvocatoriaCargo.java @@ -12,7 +12,6 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToMany; import javax.persistence.ManyToOne; import javax.persistence.Table; -import javax.persistence.Transient; import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIdentityInfo; @@ -46,15 +45,6 @@ public class ConvocatoriaCargo { @Column(name = "fecha_fin") private Date fechaFin; - - //para deserializar desde el form como string - @Transient - private String fechaFinS; - - //para deserializar desde el form como string - @Transient - private String fechaInicioS; - @ManyToMany(mappedBy = "postulaciones") private List postulantes; @@ -90,20 +80,7 @@ public class ConvocatoriaCargo { public void setCargoId(Long cargoId) { this.cargoId = cargoId; } - public String getFechaFinS() { - return fechaFinS; - } - public String getFechaInicioS() { - return fechaInicioS; - } - public void setFechaFinS(String fechaFinS) { - this.fechaFinS = fechaFinS; - setFechaFin(fechaFinS); - } - public void setFechaInicioS(String fechaInicioS) { - this.fechaInicioS = fechaInicioS; - setFechaInicio(fechaInicioS); - } + public Long getId() { return this.id; @@ -129,4 +106,6 @@ public class ConvocatoriaCargo { this.estado = estado; } + + } diff --git a/curriculumsearch/src/main/java/com/roshka/utils/Helper.java b/curriculumsearch/src/main/java/com/roshka/utils/Helper.java index 426686e..954bdd1 100644 --- a/curriculumsearch/src/main/java/com/roshka/utils/Helper.java +++ b/curriculumsearch/src/main/java/com/roshka/utils/Helper.java @@ -47,6 +47,7 @@ public class Helper { } public static LocalDate convertToLocalDateViaSqlDate(Date dateToConvert) { + if(dateToConvert == null) return null; return new java.sql.Date(dateToConvert.getTime()).toLocalDate(); } diff --git a/curriculumsearch/src/main/resources/json/cargo.json b/curriculumsearch/src/main/resources/json/cargo.json index 24605e2..09246dd 100644 --- a/curriculumsearch/src/main/resources/json/cargo.json +++ b/curriculumsearch/src/main/resources/json/cargo.json @@ -6,5 +6,17 @@ { "id": 2, "nombre": "dev php" + }, + { + "id": 3, + "nombre": "dev python" + }, + { + "id": 4, + "nombre": "dev c" + }, + { + "id": 5, + "nombre": "dev android" } ] \ No newline at end of file diff --git a/curriculumsearch/src/main/resources/json/convocatoria.json b/curriculumsearch/src/main/resources/json/convocatoria.json index 1cc1418..7758c82 100644 --- a/curriculumsearch/src/main/resources/json/convocatoria.json +++ b/curriculumsearch/src/main/resources/json/convocatoria.json @@ -3,14 +3,30 @@ "id": 1, "cargoId": 1, "estado":0, - "fechaInicio": "2021-11-01", - "fechaFin": "2021-11-30" + "fechaInicio": "2021-11-01" }, { "id": 2, "cargoId": 2, "estado":0, - "fechaInicio": "2021-11-01", - "fechaFin": "2021-11-30" + "fechaInicio": "2021-11-01" + }, + { + "id": 3, + "cargoId": 3, + "estado":0, + "fechaInicio": "2021-11-01" + }, + { + "id": 4, + "cargoId": 4, + "estado":0, + "fechaInicio": "2021-11-01" + }, + { + "id": 5, + "cargoId": 5, + "estado":0, + "fechaInicio": "2021-11-01" } ] \ No newline at end of file diff --git a/curriculumsearch/src/main/resources/json/postulante.json b/curriculumsearch/src/main/resources/json/postulante.json index 34e0467..bbbad5d 100644 --- a/curriculumsearch/src/main/resources/json/postulante.json +++ b/curriculumsearch/src/main/resources/json/postulante.json @@ -61,7 +61,7 @@ { "direccion": "Do nostrud aliqua adipisicing in sunt aute id do elit ut dolor ad aliquip.", "nacionalidad": "Paraguaya", - "postulaciones": [{ "id": 1 }], + "postulaciones": [{ "id": 2 }], "estadoCivil": "Soltero", "tipoDocumento": "CI", "nombre": "Hopkins", @@ -108,7 +108,7 @@ { "direccion": "Occaecat non cupidatat amet reprehenderit consectetur ullamco et.", "nacionalidad": "Paraguaya", - "postulaciones": [{ "id": 1 }], + "postulaciones": [{ "id": 3 }], "estadoCivil": "Soltero", "tipoDocumento": "CI", "nombre": "Alejandra", @@ -155,7 +155,7 @@ { "direccion": "Qui ullamco excepteur velit ad ullamco id id nisi irure dolore cupidatat mollit ullamco veniam.", "nacionalidad": "Paraguaya", - "postulaciones": [{ "id": 1 }], + "postulaciones": [{ "id": 4 }], "estadoCivil": "Soltero", "tipoDocumento": "CI", "nombre": "Angelina", @@ -202,7 +202,7 @@ { "direccion": "Deserunt tempor ut et eiusmod et labore Lorem.", "nacionalidad": "Paraguaya", - "postulaciones": [{ "id": 1 }], + "postulaciones": [{ "id": 5 }], "estadoCivil": "Soltero", "tipoDocumento": "CI", "nombre": "Rivas", @@ -249,7 +249,7 @@ { "direccion": "Aliqua est adipisicing do exercitation sit laborum aliquip aliqua adipisicing enim aute.", "nacionalidad": "Paraguaya", - "postulaciones": [{ "id": 1 }], + "postulaciones": [{ "id": 3 }], "estadoCivil": "Soltero", "tipoDocumento": "CI", "nombre": "Estelle", @@ -296,7 +296,7 @@ { "direccion": "Officia eiusmod ut reprehenderit tempor consequat elit amet ex voluptate aute anim do.", "nacionalidad": "Paraguaya", - "postulaciones": [{ "id": 1 }], + "postulaciones": [{ "id": 4 }], "estadoCivil": "Soltero", "tipoDocumento": "CI", "nombre": "Mariana", diff --git a/curriculumsearch/src/main/resources/static/Convo.js b/curriculumsearch/src/main/resources/static/Convo.js index 5125990..2c794d5 100644 --- a/curriculumsearch/src/main/resources/static/Convo.js +++ b/curriculumsearch/src/main/resources/static/Convo.js @@ -12,9 +12,9 @@ function listarConvocatorias(id){ const opt = document.createElement("option"); opt.value = conv.id; if(conv.fechaFin!=null){ - opt.innerHTML ="Desde :"+new Date(conv.fechaInicio)+"-"+" Hasta :"+new Date(conv.fechaFin); + opt.innerHTML ="Desde :"+new Date(conv.fechaInicio).toISOString().slice(0,10)+"-"+" Hasta :"+new Date(conv.fechaFin).toISOString().slice(0,10); }else{ - opt.innerHTML ="Desde :"+new Date(conv.fechaInicio) + opt.innerHTML ="Desde :"+new Date(conv.fechaInicio).toISOString().slice(0,10) } opt.setAttribute("data-CargoId",conv.cargoId); frag.appendChild(opt) -- libgit2 0.26.0