From d10f6506bb88afb219d254ac17f25556f21ee055 Mon Sep 17 00:00:00 2001 From: Giuli1297 Date: Tue, 23 Nov 2021 14:50:48 -0300 Subject: [PATCH] add nuevos routes to security --- curriculumsearch/src/main/java/com/roshka/configuration/WebSecurityConfig.java | 1 + curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java | 3 ++- curriculumsearch/src/main/java/com/roshka/utils/PostulantesExcelExporter.java | 31 ++++++++++++------------------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/curriculumsearch/src/main/java/com/roshka/configuration/WebSecurityConfig.java b/curriculumsearch/src/main/java/com/roshka/configuration/WebSecurityConfig.java index bc82739..219922f 100644 --- a/curriculumsearch/src/main/java/com/roshka/configuration/WebSecurityConfig.java +++ b/curriculumsearch/src/main/java/com/roshka/configuration/WebSecurityConfig.java @@ -56,6 +56,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { .mvcMatchers("/tecnologia*").authenticated() .mvcMatchers("/postulantes","/postulantes/**").authenticated() .mvcMatchers("/edit-user-data").authenticated() + .mvcMatchers("/postulantesExcel*").authenticated() .anyRequest().permitAll() .and() .formLogin() diff --git a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java index 20b20ba..faf1092 100644 --- a/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java +++ b/curriculumsearch/src/main/java/com/roshka/controller/PostulanteRRHHController.java @@ -189,7 +189,7 @@ public class PostulanteRRHHController { response.setHeader(headerKey, headerValue); HashMap filtros = new HashMap(); - filtros.put("nombre", nombre.equals("") ? "-":nombre); + filtros.put("nombre", nombre == null ? "-":nombre); filtros.put("nivelIngles", lvlEng == null ? "-" : lvlEng.toString()); filtros.put("tecnologia", tecId == null ? "-" : tecRepo.findById(tecId).get().getNombre()); filtros.put("nivelTecnologia", lvlTec == null ? "-" : lvlTec.toString()); @@ -197,6 +197,7 @@ public class PostulanteRRHHController { filtros.put("estado", estado == null ? "-" : estado.getEstado()); filtros.put("experienciaEnMeses", expInMonths == null ? "-" : expInMonths.toString()); filtros.put("convocatoria", convId == null ? "-" : cargoRepo.findById(convId).get().getCargo().getNombre()); + filtros.put("convocatoriaFecha", convId == null ? "-" : cargoRepo.findById(convId).get().getFechaInicio().toString()); PostulantesExcelExporter excelExporter = new PostulantesExcelExporter(postulantesDTO, filtros); diff --git a/curriculumsearch/src/main/java/com/roshka/utils/PostulantesExcelExporter.java b/curriculumsearch/src/main/java/com/roshka/utils/PostulantesExcelExporter.java index 4fe21e4..d765f6a 100644 --- a/curriculumsearch/src/main/java/com/roshka/utils/PostulantesExcelExporter.java +++ b/curriculumsearch/src/main/java/com/roshka/utils/PostulantesExcelExporter.java @@ -59,34 +59,16 @@ public class PostulantesExcelExporter { createCell(row, 5, "Institucion", style); createCell(row, 6, "Estado", style); createCell(row, 7, "Convocatoria", style); + createCell(row, 8, "Fecha Inicio Convocatoria", style); row = sheet.createRow(6); - style = workbook.createCellStyle(); - font = workbook.createFont(); - font.setBold(true); - font.setFontHeight(14); - style.setFont(font); - createCell(row, 0, "Nombre", style); createCell(row, 1, "Nivel de Ingles", style); createCell(row, 2, "Experiencia", style); createCell(row, 3, "Tecnologias", style); createCell(row, 4, "Estado", style); - row = sheet.createRow(4); - font.setBold(false); - font.setFontHeight(12); - style.setFont(font); - createCell(row, 0, filtros.get("nombre"), style); - createCell(row, 1, filtros.get("nivelIngles"), style); - createCell(row, 2, filtros.get("experienciaEnMeses"), style); - createCell(row, 3, filtros.get("tecnologia"), style); - createCell(row, 4, filtros.get("nivelTecnologia"), style); - createCell(row, 5, filtros.get("institucion"), style); - createCell(row, 6, filtros.get("estado"), style); - createCell(row, 7, filtros.get("convocatoria"), style); - } private void createCell(Row row, int columnCount, Object value, CellStyle style) { @@ -126,6 +108,17 @@ public class PostulantesExcelExporter { createCell(row, columnCount++, user.getEstado().getEstado(), style); tecno.delete(0, tecno.length()-1); } + + Row row = sheet.createRow(4); + createCell(row, 0, filtros.get("nombre"), style); + createCell(row, 1, filtros.get("nivelIngles"), style); + createCell(row, 2, filtros.get("experienciaEnMeses"), style); + createCell(row, 3, filtros.get("tecnologia"), style); + createCell(row, 4, filtros.get("nivelTecnologia"), style); + createCell(row, 5, filtros.get("institucion"), style); + createCell(row, 6, filtros.get("estado"), style); + createCell(row, 7, filtros.get("convocatoria"), style); + createCell(row, 8, filtros.get("convocatoriaFecha"), style); } public void export(HttpServletResponse response) throws IOException { -- libgit2 0.26.0