This commit is contained in:
Maksim Skobaro 2025-06-24 04:12:04 +03:00
parent 2d0e41846c
commit 8504dd2d84

View File

@ -119,24 +119,25 @@ public class ParticipantService {
С уважением, администрация.
""".formatted(participant.getFullName(), participant.getUser().getUsername(), participantSaveDTO.getUserData().getPassword()));
}
if (studentData != null) {
studentData.setParticipant(saved);
if (studentData != null) {
studentData.setParticipant(saved);
}
if (studentData != null && studentData.getGroup() != null) {
List<Defense> defenses = entityManager.createQuery("select distinct d from Defense d inner join fetch d.groups g where g.id = :id", Defense.class)
.setParameter("id", studentData.getGroup().getId())
.getResultList();
Defense defense = null;
if (defenses != null && !defenses.isEmpty()) {
defense = defenses.get(0);
}
if (studentData != null && studentData.getGroup() != null) {
List<Defense> defenses = entityManager.createQuery("select distinct d from Defense d inner join fetch d.groups g where g.id = :id", Defense.class)
.setParameter("id", studentData.getGroup().getId())
.getResultList();
Defense defense = null;
if (defenses != null && !defenses.isEmpty()) {
defense = defenses.get(0);
}
if (defense != null && defense.isStateShouldBeProcessed(Defense.Status.TOPIC_CHOOSING)) {
taskService.checkAndCreateTopicChoosingTasksAndSendEmail(Collections.singletonList(studentData), defense);
}
if (defense != null && defense.isStateShouldBeProcessed(Defense.Status.TOPIC_CHOOSING)) {
taskService.checkAndCreateTopicChoosingTasksAndSendEmail(Collections.singletonList(studentData), defense);
}
}
log.info("Participant saved: {}", saved.getFullName());
}