Skip to content

Commit

Permalink
Added debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
arybakov-cgi committed Sep 4, 2024
1 parent a40ad7f commit d247364
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package ca.bc.gov.educ.api.gradstudent.model.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.UUID;

@Data
@EqualsAndHashCode(callSuper = false)
@Entity
@Table(name = "STUDENT_GUID_PEN_XREF")
public class StudentGuidPenXrefEntity extends BaseEntity {

@Id
@Column(name = "STUDENT_GUID", nullable = false)
private UUID studentID;

@Column(name = "STUDENT_PEN", nullable = false)
private String pen;
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ void updateStudentGuidPenXrefRecord(
"where gpx.STUDENT_GUID = :studentGuid", nativeQuery=true)
long countStudentGuidPenXrefRecord(@Param("studentGuid") UUID studentGuid);

@Query(value="select STUDENT_GUID from STUDENT_GUID_PEN_XREF \n"
+ "where STUDENT_PEN in (:pens)", nativeQuery = true)
@Query(value="select e.studentID from StudentGuidPenXrefEntity e where e.pen in (:pens)")
List<UUID> findStudentIDsByPenIn(@Param("pens") List<String> pens);

@Query("select c.studentID from GraduationStudentRecordEntity c where c.studentStatus = :statusCode and c.studentID in :studentIDList")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ public Long countBySchoolOfRecordsAndStudentStatus(List<String> schoolOfRecords,
public Integer archiveStudents(long batchId, List<String> schoolOfRecords, String studentStatus, String user) {
String recordStudentStatus = StringUtils.defaultString(studentStatus, "CUR");
Integer archivedStudentsCount = 0;
Integer historyStudentsCount = 0;
Integer auditHistoryStudentsCount = 0;
List<UUID> graduationStudentRecordGuids = new ArrayList<>();
if(schoolOfRecords != null && !schoolOfRecords.isEmpty()) {
graduationStudentRecordGuids.addAll(graduationStatusRepository.findBySchoolOfRecordInAndStudentStatus(schoolOfRecords, recordStudentStatus));
Expand All @@ -1412,8 +1412,9 @@ public Integer archiveStudents(long batchId, List<String> schoolOfRecords, Strin
}
}
if(archivedStudentsCount > 0) {
historyStudentsCount = historyService.updateStudentRecordHistoryDistributionRun(batchId, user, "USERSTUDARC", graduationStudentRecordGuids);
auditHistoryStudentsCount = historyService.updateStudentRecordHistoryDistributionRun(batchId, user, "USERSTUDARC", graduationStudentRecordGuids);
}
logger.debug("Archived {} students and {} student audit records created", archivedStudentsCount, auditHistoryStudentsCount);
return archivedStudentsCount;
}

Expand Down

0 comments on commit d247364

Please sign in to comment.