Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Merge pull request #311 from CampusDual/bug-fix-attendance
Browse files Browse the repository at this point in the history
Cambios en attendance -- bug-fix-attendance
  • Loading branch information
marcospaab authored Jan 28, 2025
2 parents 082a00d + a986234 commit eb3cc49
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -110,9 +111,10 @@ public EntityResult attendanceDeleteAll(Map<String,Object> keyMap) throws Ontimi
List<?> attendanceIdList = (List<?>) allAttendancesQuery.get(AttendanceDao.ATTR_ID);
Map<String, Object> attendanceKey = new Hashtable<>();

for (int i = 0; i<attendanceIdList.size();i++){
attendanceKey.put(AttendanceDao.ATTR_ID,attendanceIdList.get(i));
}
if(attendanceIdList == null){
return new EntityResultMapImpl();
}
attendanceKey.put(AttendanceDao.ATTR_ID, new SearchValue(SearchValue.IN,attendanceIdList));
return this.daoHelper.delete(this.attendanceDao,attendanceKey);
}
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,13 @@ public EntityResult studentBootcampInsert(Map<String, Object> attrMap) throws On

@Override
public EntityResult studentsWithBootcampDelete(Map<String, Object> 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<String, Object> 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);
Expand Down

0 comments on commit eb3cc49

Please sign in to comment.