Cambio patologia

master
LuisCorGon 3 months ago
parent 4cb6c7e021
commit 354131243b

@ -31,10 +31,6 @@ import java.util.*;
@Controller
public class AlumnoController {
@Value("${es.matricula}")
private boolean esMatricula;
@ -112,6 +108,7 @@ public class AlumnoController {
return "redirect:/registro";
}
int idMatricula = matriculacionService.getMatriculacionByIdAlumno(alumnoActual.getId());
if (idMatricula!= 0) {
session.setAttribute("idMatricula", idMatricula);
@ -246,7 +243,12 @@ public class AlumnoController {
} else if (alumnoActual.getMatFamilia().equals("FP")){
String codigoAlumno = filtrarLetras(alumnoActual.getMatActual());
ciclos = cicloService.findCicloByCodigoDos(codigoAlumno);
try {
ciclos = cicloService.findCicloByCodigoDos(codigoAlumno);
} catch (StackOverflowError e){
System.out.println("ERROR CON LOS CICLOS " );
}
model.addAttribute("informacion", "Confirma tu ciclo formativo seleccionándolo.");
if (ciclos == null){
System.out.println("NO SE HAN ENCONTRADO LOS CICLOS");
@ -489,7 +491,7 @@ public class AlumnoController {
private String actualizarAlumno(HttpSession session,
@RequestParam("opcion2") String opcion2, @RequestParam("opcion3") String opcion3,
@RequestParam("limitaciontxt") String limitaciontxt,
@RequestParam("patologiaSeleccionada") String patologiaSeleccionada,
@RequestParam("txtPatologia") String txtPatologia,
@RequestParam("medicaciontxt") String medicaciontxt,
@RequestParam("madretxt") String madretxt,
@RequestParam("parentescotxt") String parentesctotxt
@ -507,7 +509,7 @@ public class AlumnoController {
boolean esLimitacion = opcion3.equals("si");
alumnoActual.setLimitacion(esLimitacion);
alumnoActual.setTxtLimitacion(limitaciontxt);
alumnoActual.setPatologia(patologiaService.getPatologiaByNombre(patologiaSeleccionada));
alumnoActual.setTxtPatologia(txtPatologia);
alumnoActual.setMedicacion(medicaciontxt);
alumnoActual.setNombreApellidoMadre(madretxt);
alumnoActual.setParentesco(parentesctotxt);

@ -1,4 +1,4 @@
#V.1.1
#V.1.2
server.port=8090
spring.datasource.url=jdbc:mysql://localhost/matricula

@ -114,10 +114,8 @@
<label class="form-check-label stretched-link" for="no4">No</label>
</li>
</ul>
<select id="select1" class="form-select form-select-lg" name="patologiaSeleccionada" hidden>
<option hidden="hidden"></option>
<option th:each="patologia : ${patologias}" th:text="${patologia.nombre}"></option>
</select>
<textarea class="form-control mt-2" id="textBox4" rows="1"
name="txtPatologia"></textarea>
</div>
<div class="col-md-6">
<h4>¿Toma alguna medicación?</h4>
@ -168,6 +166,7 @@
const textBox1 = document.getElementById('textBox1');
const textBox2 = document.getElementById('textBox2');
const textBox3 = document.getElementById('textBox3');
const textBox4 = document.getElementById('textBox4');
const select1 = document.getElementById('select1');
const select2 = document.getElementById('select2');
@ -237,7 +236,7 @@
[textBox1, textBox2, textBox3].forEach(textArea => {
[textBox1, textBox2, textBox3, textBox4].forEach(textArea => {
textArea.addEventListener('input', () => ajustarAlturaTextArea(textArea));
});
@ -306,6 +305,11 @@
error = true;
textBox3.style.border = '1px solid red';
}
if (textBox4.value.trim() === '') {
alert('Por favor, completa el campo del texto de la patologia.');
error = true;
textBox4.style.border = '1px solid red';
}
if(select2.value === '') {
alert('Por favor, selecciona el parentesco.');
error = true;

Loading…
Cancel
Save

Powered by INFORMATICA.FP.EDU.ES.