This commit is contained in:
Maksim Skobaro 2025-06-24 03:16:54 +03:00
parent 6f6b1dce3e
commit 176ab20c2e
2 changed files with 4 additions and 4 deletions

View File

@ -115,6 +115,10 @@ public class ParticipantService {
С уважением, администрация.
""".formatted(participant.getFullName(), participant.getUser().getUsername(), participantSaveDTO.getUserData().getPassword()));
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())
@ -248,7 +252,6 @@ public class ParticipantService {
studentData.setMarks3(participantSaveDTO.getStudentData().getMarks3());
studentData = studentDataRepository.save(studentData);
studentData.setParticipant(participant);
if (participantSaveDTO.getStudentData().getGroupId() != null) {
Group group = groupRepository.findByIdThrow(participantSaveDTO.getStudentData().getGroupId());

View File

@ -229,9 +229,6 @@ ALTER TABLE participant_role
ALTER TABLE participant_role
ADD CONSTRAINT FK_PARROL_ON_ROLE FOREIGN KEY (role_id) REFERENCES role (id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE student_data
ADD CONSTRAINT UC_STUDENT_DATA_PARTIC UNIQUE (partic_id);
ALTER TABLE student_data
ADD CONSTRAINT FK_STUDENT_DATA_ON_ADVISER_TEACHER_PARTIC FOREIGN KEY (adviser_teacher_partic_id) REFERENCES participant (id) ON DELETE SET NULL ON UPDATE CASCADE;