Commit 3161d692 by Cesar Giulano Gonzalez Maqueda

Merge con nelson

parents f6d3fba3 c5960f18
File mode changed from 100644 to 100755
......@@ -3,10 +3,13 @@ package com.roshka.controller;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.roshka.modelo.Cargo;
import com.roshka.modelo.ConvocatoriaCargo;
import com.roshka.repositorio.CargoRepository;
import com.roshka.repositorio.ConvocatoriaRepository;
import org.apache.jasper.tagplugins.jstl.core.ForEach;
import org.dom4j.Branch;
import org.hibernate.jpa.TypedParameterValue;
import org.hibernate.type.IntegerType;
import org.hibernate.type.LongType;
......@@ -49,24 +52,48 @@ public class ConvocatoriaController {
@RequestMapping(path = {"/convocatoria","/convocatoria/{id}"})
public String formConvocatoria(Model model,@PathVariable(required = false) Long id) {
model.addAttribute("cargos", cargoRepo.findAll());
if(id == null) model.addAttribute("convocatoria", new ConvocatoriaCargo());
if(id == null){
model.addAttribute("convocatoria", new ConvocatoriaCargo());
model.addAttribute("listaConvocatoria", convoRepo.findAll());
}
else {
ConvocatoriaCargo cc = convoRepo.getById(id);
cc.setFechaFinS(new SimpleDateFormat("yyyy-MM-dd").format((cc.getFechaFin())));
cc.setFechaInicioS(new SimpleDateFormat("yyyy-MM-dd").format((cc.getFechaInicio())));
model.addAttribute("convocatoria", cc);
model.addAttribute("listaConvocatoria", convoRepo.findAll());
}
return "convocatoria-form";
}
@PostMapping(path = {"/convocatoria","/convocatoria/{id}"})
public String guardarConvocatoria(@ModelAttribute ConvocatoriaCargo convocatoria, BindingResult result, @PathVariable(required = false) Long id) {
public String guardarConvocatoria(@ModelAttribute ConvocatoriaCargo convocatoria, BindingResult result, @PathVariable(required = false) Long id,Model model) {
if(result.hasErrors());
if(id != null) convocatoria.setId(id);
convoRepo.save(convocatoria);
System.out.println(convocatoria.getFechaInicio());
//System.out.println(convoRepo.filtrarConvocatoriasPorCargo(convocatoria.getCargoId()));
for(ConvocatoriaCargo c: convoRepo.filtrarConvocatoriasPorCargo(convocatoria.getCargoId())){
if(result.hasErrors() || c.getCargoId()==convocatoria.getCargoId() && c.getFechaFin().after(convocatoria.getFechaInicio()) )
{
model.addAttribute("existeFecha", true);
System.out.println("no debe");
return "convocatoria-form";
}
else{
convoRepo.save(convocatoria);
System.out.println("si anda");
break;
}
}
return "redirect:/convocatorias";
}
}
......@@ -15,4 +15,7 @@ public interface ConvocatoriaRepository extends JpaRepository<ConvocatoriaCargo,
//public List<ConvocatoriaCargo> findConvocatoriaCargoByCargo(Date fechaFinal);
@Query("select c from ConvocatoriaCargo c where ( ?1 is null and ?3 is null) or ( ( ( (c.fechaFin > ?2 and ?3 = 1) or (c.fechaFin < ?2 and ?3 = 0)) or ?3 is null ) and (c.cargoId = ?1 or ?1 is null) )")
public List<ConvocatoriaCargo> f1ndByCargoAndEstado(TypedParameterValue cargoId, Date fecha, TypedParameterValue isOpen);
@Query("SELECT c FROM ConvocatoriaCargo c WHERE (cargoId=?1)")
public List<ConvocatoriaCargo> filtrarConvocatoriasPorCargo(Long cargoId);
}
......@@ -80,4 +80,8 @@ public interface PostulanteRepository extends JpaRepository<Postulante,Long> {
@Query("UPDATE Postulante p SET p.comentarioRRHH = ?1 WHERE p.id = ?2")
void setPostulanteEstadoComentario( String comentario, Long Id);*/
@Query("SELECT p FROM Postulante p JOIN Estudio e ON p.id=e.postulante.id "+
"where e.temaDeEstudio=?1")
public List<Postulante> obtenerPostulantesPorCarrera(String carrera);
}
......@@ -9,13 +9,19 @@
<div class="p-3 mb-2 bg-light text-dark border border-light ">
<form:form action="/convocatoria/${convocatoria.id == null ? '' : convocatoria.id}" method="post" modelAttribute="convocatoria">
<div class="mb-3 col-3">
<form:label path="fechaInicioS" class="form-label">Fecha inicial</form:label>
<form:input type="date" class="form-control" path="fechaInicioS" required="true"/>
<form:label path="fechaInicioS" class="form-label ">Fecha inicial</form:label>
<form:input type="date" path="fechaInicioS" required="true" class="form-control ${ existeFecha ? 'is-invalid' : ''}" placeholder="Fecha requerida" requiered="true" />
<div id="validationServerUsernameFeedback1" class="invalid-feedback">
Esta fecha ya existe
</div>
</div>
<div class="mb-3 col-3">
<form:label path="fechaFinS" class="form-label">Fecha Fin</form:label>
<form:input type="date" class="form-control" path="fechaFinS" required="true"/>
<form:input type="date" path="fechaFinS" required="true" class="form-control ${existeFecha ? 'is-invalid': '' }" placeholder="Fecha requerida" requiered="true" />
<div id="validationServerUsernameFeedback2" class="invalid-feedback">
Esta fecha ya existe
</div>
</div>
<div class="mb-3 col-3">
<form:label path="cupos" class="form-label">Cupos:</form:label>
......@@ -23,7 +29,7 @@
</div>
<div class="mb-3 col-3">
<form:label path="cargoId" class="form-label">Cargo</form:label>
<form:select class="form-select" path="cargoId" required="true">
<form:select class="form-select" path="cargoId">
<c:forEach items="${cargos}" var="cargo">
<form:option value="${cargo.id}">${cargo.nombre} </form:option>
</c:forEach>
......
......@@ -10,8 +10,139 @@
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<<<<<<< HEAD
<title>Curriculum</title>
<link href="../css/formPostulanteStyle.css" rel="stylesheet" type="text/css"/>
=======
<title>Hello, world!</title>
<style type="text/css" media="screen">
body {
background-color: #506BEE
}
.card {
border: none
}
.image {
position: relative
}
.image span {
background-color: #506BEE;
color: #fff;
padding: 6px;
height: 30px;
width: 30px;
border-radius: 50%;
font-size: 13px;
position: absolute;
display: flex;
justify-content: center;
align-items: center;
top: -0px;
right: 0px
}
.user-details h4 {
color: #506BEE
}
.ratings {
font-size: 30px;
font-weight: 600;
display: flex;
justify-content: left;
align-items: center;
color: #f9b43a
}
.user-details span {
text-align: left
}
.inputs label {
display: flex;
margin-left: 3px;
font-weight: 500;
font-size: 13px;
margin-bottom: 4px
}
.inputs input {
font-size: 14px;
height: 40px;
border: 2px solid #ced4da
}
.inputs input:focus {
box-shadow: none;
border: 2px solid #506BEE
}
.about-inputs label {
display: flex;
margin-left: 3px;
font-weight: 500;
font-size: 13px;
margin-bottom: 4px
}
.about-inputs textarea {
font-size: 14px;
height: 100px;
border: 2px solid #ced4da;
resize: none
}
.about-inputs textarea:focus {
box-shadow: none
}
.btn {
font-weight: 600
}
.btn:focus {
box-shadow: none
}
select {
display: block;
width: 100%;
border: 1px solid #ddd;
border-radius: 10px;
height: 40px;
padding: 5px 10px
}
select:focus {
outline: none
}
.add-experience:hover {
background: #506BEE;
color: #fff;
cursor: pointer;
border: solid 1px #506BEE
}
#outer
{
width:100%;
text-align: center;
}
.inner
{
display: inline-block;
}
</style>
>>>>>>> c5960f1813048de41cb9806ad2accf77e4d8aece
</head>
<body class="container">
......@@ -145,23 +276,29 @@
</select> </div>
<div >
<div style="color:blue" class=" inputs d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" class="btn btn-primary" data-toggle="modal" data-target="#cargoForm"><i class="fa fa-plus"></i>&nbsp;Cargo al que postulas</span></div><br>
<div class="inputs p-3 py-5">
<div class=" inputs d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#cargoForm"><i class="fa fa-plus"></i>&nbsp;Cargo al que postulas</span></div><br>
</div>
<div class="mt-3 gap-2 d-flex justify-content-between" id="cargos">
</div>
<div >
<div style="color:blue" class=" inputs d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#experienciaForm"><i class="fa fa-plus"></i>&nbsp;Agregar Experiencia</span></div><br>
<div class="inputs p-3 py-5">
<div class=" inputs d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#experienciaForm"><i class="fa fa-plus"></i>&nbsp;Agregar Experiencia</span></div><br>
</div>
<div class="mt-3 gap-2 d-flex justify-content-between" id="experiencias">
</div>
<div >
<div style="color:blue" class=" inputs d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#estudioForm"><i class="fa fa-plus"></i>&nbsp;Agregar Estudio</span></div><br>
<div class=" p-3 py-5">
<div class=" d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#estudioForm"><i class="fa fa-plus"></i>&nbsp;Agregar Estudio</span></div><br>
</div>
<div class="mt-3 gap-2 d-flex justify-content-between" id="estudios">
......@@ -169,16 +306,19 @@
<div >
<div style="color:blue" class=" inputs d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#tecnologiaForm"><i class="fa fa-plus"></i>&nbsp;Agregar Tecnologia</span></div><br>
<div class=" p-3 py-5">
<div class=" d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#tecnologiaForm"><i class="fa fa-plus"></i>&nbsp;Agregar Tecnologia</span></div><br>
</div>
<div class="mt-3 gap-2 d-flex justify-content-between" id="tecnologias">
</div>
<div >
<div style="color:blue" class=" inputs d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#referenciaForm"><i class="fa fa-plus"></i>&nbsp;Referencias Personales</span></div><br>
<div class=" p-3 py-5">
<div class=" d-flex justify-content-between align-items-center experience"><span class="border px-3 p-1 add-experience" data-toggle="modal" data-target="#referenciaForm"><i class="fa fa-plus"></i>&nbsp;Referencias Personales</span></div><br>
</div>
<div class="mt-3 gap-2 d-flex justify-content-between" id="referencia">
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment