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
0
Merge Requests
0
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
Amparo Oliver
th-app-java
Commits
620489c0
Commit
620489c0
authored
Nov 24, 2021
by
Joel Florentin
Browse files
Options
Browse Files
Download
Plain Diff
merge william. cargo bug y form postulante required
parents
874ea5af
33a11167
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
53 additions
and
45 deletions
+53
-45
curriculumsearch/src/main/java/com/roshka/configuration/WebSecurityConfig.java
+1
-0
curriculumsearch/src/main/java/com/roshka/controller/CargoController.java
+4
-1
curriculumsearch/src/main/java/com/roshka/controller/ConvocatoriaController.java
+14
-6
curriculumsearch/src/main/java/com/roshka/modelo/Cargo.java
+12
-0
curriculumsearch/src/main/java/com/roshka/repositorio/CargoRepository.java
+3
-2
curriculumsearch/src/main/resources/json/cargo.json
+11
-5
curriculumsearch/src/main/webapp/jsp/cargos.jsp
+5
-0
curriculumsearch/src/main/webapp/jsp/convocatoria-form.jsp
+0
-26
curriculumsearch/src/main/webapp/jsp/convocatorias.jsp
+1
-1
curriculumsearch/src/main/webapp/jsp/detallepostulante2.jsp
+0
-0
curriculumsearch/src/main/webapp/jsp/header.jsp
+0
-1
curriculumsearch/src/main/webapp/jsp/layouts/base.jsp
+0
-1
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
+2
-2
No files found.
curriculumsearch/src/main/java/com/roshka/configuration/WebSecurityConfig.java
View file @
620489c0
...
...
@@ -53,6 +53,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.
mvcMatchers
(
"/home"
).
authenticated
()
.
mvcMatchers
(
"/cargo*"
).
authenticated
()
.
mvcMatchers
(
"/convocatoria*"
).
authenticated
()
.
mvcMatchers
(
"/convocatoria/crear/*"
).
authenticated
()
.
mvcMatchers
(
"/tecnologia*"
).
authenticated
()
.
mvcMatchers
(
"/postulantes"
,
"/postulantes/**"
).
authenticated
()
.
mvcMatchers
(
"/edit-user-data"
).
authenticated
()
...
...
curriculumsearch/src/main/java/com/roshka/controller/CargoController.java
View file @
620489c0
...
...
@@ -63,7 +63,10 @@ public class CargoController {
model
.
addAttribute
(
"mismoNombre"
,
true
);
return
"cargo-form"
;
};
if
(
id
!=
null
)
cargo
.
setId
(
id
);
if
(
id
!=
null
){
cargo
.
setId
(
id
);
cargo
.
setExisteConvocatoria
(
cargoRepo
.
getById
(
id
).
isExisteConvocatoria
());
}
cargoRepo
.
save
(
cargo
);
System
.
out
.
println
(
cargo
.
getNombre
());
return
"redirect:/cargos"
;
...
...
curriculumsearch/src/main/java/com/roshka/controller/ConvocatoriaController.java
View file @
620489c0
...
...
@@ -62,12 +62,6 @@ public class ConvocatoriaController {
//model.addAttribute("convocatorias",cargoId==null? convoRepo.findAll() : convoRepo.findByCargoId(cargoId));
return
"convocatorias"
;
}
@RequestMapping
(
"/convocatoria"
)
public
String
formConvocatoria
(
Model
model
)
{
model
.
addAttribute
(
"cargos"
,
cargoRepo
.
findAll
());
model
.
addAttribute
(
"convocatoria"
,
new
ConvocatoriaCargo
());
return
"convocatoria-form"
;
}
@PostMapping
(
"/convocatoria"
)
public
String
guardarConvocatoria
(
@ModelAttribute
ConvocatoriaCargo
convocatoria
,
BindingResult
result
,
RedirectAttributes
redirectAttributes
)
{
...
...
@@ -84,7 +78,20 @@ public class ConvocatoriaController {
System
.
out
.
println
(
convocatoria
.
getFechaInicio
());
return
"redirect:/convocatorias"
;
}
@RequestMapping
(
"/convocatoria/crear/{id}"
)
public
String
guardarConvocatoriaa
(
@PathVariable
(
required
=
false
)
Long
id
)
{
ConvocatoriaCargo
convocatoria
=
new
ConvocatoriaCargo
();
convocatoria
.
setCargo
(
cargoRepo
.
findByIdCargo
(
id
));
convocatoria
.
setCargoId
(
cargoRepo
.
findByIdCargo
(
id
).
getId
());
System
.
out
.
println
(
cargoRepo
.
findByIdCargo
(
id
).
getNombre
());
convocatoria
.
setFechaInicio
(
new
Date
());
convocatoria
.
setEstado
(
EstadoConvocatoria
.
abierto
);
convocatoria
.
getCargo
().
setExisteConvocatoria
(
true
);
convoRepo
.
save
(
convocatoria
);
System
.
out
.
println
(
convocatoria
.
getFechaInicio
());
return
"redirect:/convocatorias"
;
}
/* @RequestMapping("/convocatoria/{id}")
public String formConvocatoria(Model model,@PathVariable(required = false) Long id) {
...
...
@@ -111,6 +118,7 @@ public class ConvocatoriaController {
convocatoria
=
convoRepo
.
findByIdConvocatoriaCargo
(
id
);
convocatoria
.
setEstado
(
EstadoConvocatoria
.
cerrado
);
convocatoria
.
setFechaFin
(
new
Date
());
convocatoria
.
getCargo
().
setExisteConvocatoria
(
false
);
convoRepo
.
save
(
convocatoria
);
/*if(id != null) convocatoria.setId(id);
//System.out.println(convoRepo.filtrarConvocatoriasPorCargo(convocatoria.getCargoId()));
...
...
curriculumsearch/src/main/java/com/roshka/modelo/Cargo.java
View file @
620489c0
...
...
@@ -30,6 +30,9 @@ public class Cargo {
@JsonManagedReference
private
List
<
ConvocatoriaCargo
>
convocatorias
;
@Column
(
name
=
"existe_convocatoria"
)
private
boolean
existeConvocatoria
=
false
;
public
List
<
ConvocatoriaCargo
>
getConvocatorias
()
{
return
convocatorias
;
}
...
...
@@ -39,4 +42,13 @@ public class Cargo {
public
static
Object
values
()
{
return
null
;
}
public
boolean
isExisteConvocatoria
()
{
return
this
.
existeConvocatoria
;
}
public
void
setExisteConvocatoria
(
boolean
existeConvocatoria
)
{
this
.
existeConvocatoria
=
existeConvocatoria
;
}
}
curriculumsearch/src/main/java/com/roshka/repositorio/CargoRepository.java
View file @
620489c0
...
...
@@ -11,9 +11,10 @@ import org.springframework.data.jpa.repository.Query;
public
interface
CargoRepository
extends
JpaRepository
<
Cargo
,
Long
>{
public
Page
<
Cargo
>
findByNombreContainingIgnoreCase
(
String
nombre
,
Pageable
pageable
);
@Query
(
value
=
"SELECT c FROM Cargo c WHERE c.id=?1"
)
public
Cargo
findByIdCargo
(
Long
id
);
public
boolean
existsByNombreIgnoreCase
(
String
nombre
);
public
List
<
Cargo
>
findByexisteConvocatoriaFalse
();
@Query
(
value
=
"SELECT * FROM cargo"
,
nativeQuery
=
true
)
public
Page
<
Cargo
>
findAllCargo
(
Pageable
pageable
);
}
curriculumsearch/src/main/resources/json/cargo.json
View file @
620489c0
[
{
"id"
:
1
,
"nombre"
:
"dev java"
"nombre"
:
"dev java"
,
"existeConvocatoria"
:
true
},
{
"id"
:
2
,
"nombre"
:
"dev php"
"nombre"
:
"dev php"
,
"existeConvocatoria"
:
true
},
{
"id"
:
3
,
"nombre"
:
"dev python"
"nombre"
:
"dev python"
,
"existeConvocatoria"
:
true
},
{
"id"
:
4
,
"nombre"
:
"dev c"
"nombre"
:
"dev c"
,
"existeConvocatoria"
:
true
},
{
"id"
:
5
,
"nombre"
:
"dev android"
"nombre"
:
"dev android"
,
"existeConvocatoria"
:
true
}
]
\ No newline at end of file
curriculumsearch/src/main/webapp/jsp/cargos.jsp
View file @
620489c0
...
...
@@ -51,6 +51,11 @@ contentType="text/html;charset=UTF-8" language="java" %>
>
</td>
<td><a href="/cargo/${cargo.id}">Editar cargo</a></td>
<td>
<c:if test="${!cargo.isExisteConvocatoria()}">
<a class="btn btn-secondary" href="/convocatoria/crear/${cargo.id}">abrirConvocatoria</a>
</c:if>
</td>
</tr>
</c:forEach>
</tbody>
...
...
curriculumsearch/src/main/webapp/jsp/convocatoria-form.jsp
deleted
100644 → 0
View file @
874ea5af
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://kwonnam.pe.kr/jsp/template-inheritance" prefix="layout"%>
<layout:extends name="layouts/base.jsp">
<layout:put block="cssDeclaracion" type="APPEND"></layout:put>
<layout:put block="contents" type="REPLACE">
<h2>${convocatoria.id == null ? "Agregar" : "Modificar"} Convocatoria</h2>
<div class="p-3 mb-2 bg-light text-dark bg-transparent ">
<form:form action="/convocatoria/${convocatoria.id == null ? '' : convocatoria.id}" method="post" modelAttribute="convocatoria">
<div class="mb-3 col-3">
<form:label path="cargoId" class="form-label">Cargo</form:label>
<form:select class="form-select" path="cargoId">
<c:forEach items="${cargos}" var="cargo">
<form:option value="${cargo.id}">${cargo.nombre} </form:option>
</c:forEach>
</form:select>
</div>
<button type="submit" class="btn btn-primary">Abrir Convocatoria</button>
</form:form>
</div>
</layout:put>
<layout:put block="scripts" type="APPEND">
</layout:put>
</layout:extends>
curriculumsearch/src/main/webapp/jsp/convocatorias.jsp
View file @
620489c0
...
...
@@ -48,7 +48,7 @@
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" id="${estado}" name="estado" value="${estado}">
<label class="form-check-label" for="
abierto
">${estado}</label><br>
<label class="form-check-label" for="
${estado}
">${estado}</label><br>
</div>
</c:forEach>
...
...
curriculumsearch/src/main/webapp/jsp/detallepostulante2.jsp
deleted
100644 → 0
View file @
874ea5af
This diff is collapsed.
Click to expand it.
curriculumsearch/src/main/webapp/jsp/header.jsp
View file @
620489c0
...
...
@@ -25,7 +25,6 @@
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
<li><a class="dropdown-item" href="/cargo">Agregar Cargo</a></li>
<li><a class="dropdown-item" href="/convocatoria">Agregar Convocatoria</a></li>
<li><a class="dropdown-item" href="/cargos">Listar cargos</a></li>
<li><a class="dropdown-item" href="/convocatorias">Listar convocatorias</a></li>
</ul>
...
...
curriculumsearch/src/main/webapp/jsp/layouts/base.jsp
View file @
620489c0
...
...
@@ -39,7 +39,6 @@
</a>
<ul
class=
"dropdown-menu"
aria-labelledby=
"navbarDropdownMenuLink"
>
<li><a
class=
"dropdown-item"
href=
"/cargo"
>
Agregar Cargo
</a></li>
<li><a
class=
"dropdown-item"
href=
"/convocatoria"
>
Agregar Convocatoria
</a></li>
<li><a
class=
"dropdown-item"
href=
"/cargos"
>
Listar cargos
</a></li>
<li><a
class=
"dropdown-item"
href=
"/convocatorias"
>
Listar convocatorias
</a></li>
</ul>
...
...
curriculumsearch/src/main/webapp/jsp/postulante-form.jsp
View file @
620489c0
...
...
@@ -334,11 +334,11 @@
</div>
<div
class=
"inputs"
>
<label
for=
"refNombre"
class=
"form-label"
>
Nombre de la referencia
</label>
<input
placeholder=
" Ingrese el nombre de su referencia"
type=
"text"
class=
"form-control FA "
name=
"nombreReferencia"
id=
"refNombre"
>
<input
placeholder=
" Ingrese el nombre de su referencia"
type=
"text"
class=
"form-control FA "
name=
"nombreReferencia"
id=
"refNombre"
required
>
</div>
<div
class=
"inputs"
>
<label
for=
"refTel"
class=
"form-label"
>
Teléfono de la referencia
</label>
<input
placeholder=
" Ingrese el teléfono de su referencia"
type=
"number"
class=
"form-control FA"
name=
"telefonoReferencia"
id=
"refTel"
>
<input
placeholder=
" Ingrese el teléfono de su referencia"
type=
"number"
class=
"form-control FA"
name=
"telefonoReferencia"
id=
"refTel"
required
>
</div>
<div
class=
"inputs"
>
...
...
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