From a986234596eb5a046abb4b48b764f05893c95648 Mon Sep 17 00:00:00 2001 From: "marcos.padin@outlook.es" Date: Tue, 28 Jan 2025 12:18:27 +0100 Subject: [PATCH] Cambios en attendance --- .../model/core/service/AttendanceService.java | 8 +++++--- .../model/core/service/StudentBootcampService.java | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/AttendanceService.java b/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/AttendanceService.java index 9f98756a..d474926f 100644 --- a/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/AttendanceService.java +++ b/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/AttendanceService.java @@ -8,6 +8,7 @@ import com.ontimize.jee.common.dto.EntityResult; import com.ontimize.jee.common.dto.EntityResultMapImpl; import com.ontimize.jee.common.exceptions.OntimizeJEERuntimeException; +import com.ontimize.jee.common.gui.SearchValue; import com.ontimize.jee.server.dao.DefaultOntimizeDaoHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Lazy; @@ -110,9 +111,10 @@ public EntityResult attendanceDeleteAll(Map keyMap) throws Ontimi List attendanceIdList = (List) allAttendancesQuery.get(AttendanceDao.ATTR_ID); Map attendanceKey = new Hashtable<>(); - for (int i = 0; i attrMap) throws On @Override public EntityResult studentsWithBootcampDelete(Map keyMap) throws OntimizeJEERuntimeException { - EntityResult studentIdQuery = this.daoHelper.query(this.studentBootcampDao,keyMap, Arrays.asList(StudentBootcampDao.STUDENT_ID)); - List studentIdList = (List) studentIdQuery.get(StudentBootcampDao.STUDENT_ID); - Object studentId = studentIdList.get(0); + EntityResult studentIdQuery = this.daoHelper.query(this.studentBootcampDao,keyMap, Arrays.asList(StudentBootcampDao.STUDENT_ID,StudentBootcampDao.BOOTCAMP_ID)); + if(studentIdQuery.isWrong() || studentIdQuery.isEmpty()){ + return studentIdQuery; + } Map studentKey = new HashMap<>(); - studentKey.put(StudentBootcampDao.STUDENT_ID,studentId); + studentKey.put(StudentBootcampDao.STUDENT_ID,studentIdQuery.getRecordValues(0).get(StudentBootcampDao.STUDENT_ID)); + studentKey.put(StudentBootcampDao.BOOTCAMP_ID,studentIdQuery.getRecordValues(0).get(StudentBootcampDao.BOOTCAMP_ID)); attendanceService.attendanceDeleteAll(studentKey); return this.daoHelper.delete(this.studentBootcampDao, keyMap);