From 58280603cee2d5d6ac5d452255ea6f78d4c333a8 Mon Sep 17 00:00:00 2001 From: ArtemEmelyanov Date: Mon, 15 May 2023 19:04:10 +0400 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B3=D0=BE,=20=D0=B2=D0=B0=D1=83,=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D0=B2?= =?UTF-8?q?=D1=81=D1=8E=20=D1=81=D1=82=D1=80=D1=83=D0=BA=D1=82=D1=83=D1=80?= =?UTF-8?q?=D1=83,=20=D0=BC=D0=BD=D0=B5=20=D1=8D=D1=82=D0=BE=20=D0=BE?= =?UTF-8?q?=D1=87=D0=B5=D0=BD=D1=8C=20=D0=BF=D0=BE=D0=BD=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=BB=D0=BE=D1=81=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data.mv.db | Bin 69632 -> 57344 bytes frontend/vue-project/src/models/Group.js | 1 + frontend/vue-project/src/pages/groups.vue | 199 ++++++++++++++++-- frontend/vue-project/src/pages/students.vue | 16 +- frontend/vue-project/src/pages/subjects.vue | 114 ---------- .../IP/University/Contoller/DTO/GroupDTO.java | 9 + .../University/Contoller/DTO/StudentDTO.java | 5 +- .../Contoller/REST/GroupController.java | 22 ++ .../Contoller/REST/StudentController.java | 19 +- .../IP/University/Model/Group.java | 15 ++ .../IP/University/Model/Student.java | 5 +- .../IP/University/Service/GroupService.java | 47 ++++- .../IP/University/Service/StudentService.java | 17 +- 13 files changed, 305 insertions(+), 164 deletions(-) diff --git a/data.mv.db b/data.mv.db index 134e71b381cd0b76fff46544a7d78a92c3ed3885..d3799c19cd18913037449227c8b7bb86575d6deb 100644 GIT binary patch literal 57344 zcmeHQTWlQHd7fQzsSz)dsEBq@81`r_TVhKybIzQZGqbT9ak)#85-$pOsaTEC#awOG z6sb~_V-+c26z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j?l4%z2aS;!&fI5fh;ltaFjaW9iY?BgVcd?SNbbg5#U3wMi2 zAulHF%h#$`uIFM0Kscdz+>QOOcrgwVjUE$031pee9~JrkSZ2SX!Kujq*JW8M+|z`6 z8tW>@e>Gaz|K~R0{d(^4Z^7blEb{+7ly*FE_W!B;&&%JL0ssz1x5!TLCfP2#kf9z! Na?n2V@Ieku{6CSQSP%dJ diff --git a/frontend/vue-project/src/models/Group.js b/frontend/vue-project/src/models/Group.js index 7467db3..5da7745 100644 --- a/frontend/vue-project/src/models/Group.js +++ b/frontend/vue-project/src/models/Group.js @@ -2,5 +2,6 @@ export default class Group{ constructor(data) { this.id = data?.id; this.name = data?.name; + this.subjectIds = data?.subjectIds; } } \ No newline at end of file diff --git a/frontend/vue-project/src/pages/groups.vue b/frontend/vue-project/src/pages/groups.vue index d46c1a4..2825b3e 100644 --- a/frontend/vue-project/src/pages/groups.vue +++ b/frontend/vue-project/src/pages/groups.vue @@ -6,30 +6,102 @@ Имя - + Действия + Работа с группой + Работа с предметами {{ grp.name }} - - - - - - - - - - - - +
+ + +
+ + +
+ + +
+ + +
+ + +
+ + + + - - diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Contoller/DTO/GroupDTO.java b/src/main/java/ru/IP_LabWorks/IP/University/Contoller/DTO/GroupDTO.java index 11714bb..4ad902b 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Contoller/DTO/GroupDTO.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Contoller/DTO/GroupDTO.java @@ -2,16 +2,21 @@ package ru.IP_LabWorks.IP.University.Contoller.DTO; import ru.IP_LabWorks.IP.University.Model.Group; +import java.util.List; + public class GroupDTO { private long id; private String name; + private List subjectIds; + public GroupDTO(){ } public GroupDTO(Group group){ this.id = group.getId(); this.name = group.getName(); + this.subjectIds = group.getSubjectIds(); } public Long getId(){ @@ -29,4 +34,8 @@ public class GroupDTO { public void setName(String name){ this.name = name; } + + public List getSubjectIds(){ + return subjectIds; + } } diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Contoller/DTO/StudentDTO.java b/src/main/java/ru/IP_LabWorks/IP/University/Contoller/DTO/StudentDTO.java index 07a2262..be63849 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Contoller/DTO/StudentDTO.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Contoller/DTO/StudentDTO.java @@ -20,8 +20,9 @@ public class StudentDTO { this.id = student.getId(); this.name = student.getName(); this.birthDate = student.getBirthDate(); - this.groupName = student.getGroup().getName(); - this.groupId = student.getGroup().getId(); + if(student.getGroup() != null){ + this.groupName = student.getGroup().getName(); + } } public String getGroupName() { diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Contoller/REST/GroupController.java b/src/main/java/ru/IP_LabWorks/IP/University/Contoller/REST/GroupController.java index 286941e..8f201ec 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Contoller/REST/GroupController.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Contoller/REST/GroupController.java @@ -59,6 +59,28 @@ public class GroupController { return ResponseEntity.ok(subjects); } + @GetMapping("/getStudentsUndefined") + public ResponseEntity> getStudentsFromUndefinedGroup(){ + List students = groupService.getStudentsUndefined(); + return ResponseEntity.ok(students); + } + + @PostMapping("/{id}/addStudents") + public void addStudentToGroup(@PathVariable Long id, @RequestBody @Valid List studentsIds){ + groupService.addStudentToGroup(id, studentsIds); + } + + @DeleteMapping("deleteStudentFromGroup/{id}") + public void deleteStudentFromGroup(@PathVariable Long id){ + groupService.deleteStudentFromGroup(id); + } + + @PostMapping("/{id}/addSubjectToGroup") + public void addSubjectToGroup(@PathVariable Long id, @RequestBody @Valid List subjectIds){ + groupService.addSubjectToGroup(id, subjectIds); + } + + // @PostMapping("/{id}/student") // public StudentDTO setStudentToGroup(@PathVariable Long id, // @RequestParam("studentId") Long studentId) { diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Contoller/REST/StudentController.java b/src/main/java/ru/IP_LabWorks/IP/University/Contoller/REST/StudentController.java index 38e24ae..a168eda 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Contoller/REST/StudentController.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Contoller/REST/StudentController.java @@ -1,20 +1,24 @@ package ru.IP_LabWorks.IP.University.Contoller.REST; import org.springframework.web.bind.annotation.*; +import ru.IP_LabWorks.IP.University.Contoller.DTO.GroupDTO; import ru.IP_LabWorks.IP.University.Contoller.DTO.StudentDTO; +import ru.IP_LabWorks.IP.University.Service.GroupService; import ru.IP_LabWorks.IP.University.Service.StudentService; import jakarta.validation.Valid; -import java.time.LocalDate; + import java.util.List; @RestController @RequestMapping("/student") public class StudentController { private final StudentService studentService; + private final GroupService groupService; - public StudentController(StudentService studentService) { + public StudentController(StudentService studentService, GroupService groupService) { this.studentService = studentService; + this.groupService = groupService; } @GetMapping("/{id}") @@ -31,12 +35,12 @@ public class StudentController { @PostMapping public StudentDTO createStudent(@RequestBody @Valid StudentDTO studentDTO){ - return new StudentDTO(studentService.addStudent(studentDTO.getName(), studentDTO.getBirthDate(), studentDTO.getGroupId())); + return new StudentDTO(studentService.addStudent(studentDTO.getName(), studentDTO.getBirthDate())); } @PutMapping("/{id}") public StudentDTO updateStudent(@PathVariable Long id, @RequestBody @Valid StudentDTO studentDTO) { - return new StudentDTO(studentService.updateStudent(id, studentDTO.getName(), studentDTO.getBirthDate(), studentDTO.getGroupId())); + return new StudentDTO(studentService.updateStudent(id, studentDTO.getName(), studentDTO.getBirthDate())); } @DeleteMapping("/{id}") @@ -44,4 +48,11 @@ public class StudentController { return new StudentDTO(studentService.deleteStudent(id)); } + @GetMapping("/groups") + public List getGroups() { + return groupService.findAllGroups().stream() + .map(GroupDTO::new) + .toList(); + } + } diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Model/Group.java b/src/main/java/ru/IP_LabWorks/IP/University/Model/Group.java index 44d40de..b840921 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Model/Group.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Model/Group.java @@ -8,6 +8,7 @@ import org.hibernate.annotations.OnDeleteAction; import javax.swing.*; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Objects; @@ -89,4 +90,18 @@ public class Group { subjects.add(subject); subject.getGroups().add(this); } + + public List getSubjectIds() { + if (subjects.isEmpty()) { + return Collections.emptyList(); + } else { + List subjectIds = new ArrayList<>(); + for (Subject subject : subjects) { + if (!subjectIds.contains(subject.getId())) { + subjectIds.add(subject.getId()); + } + } + return subjectIds; + } + } } diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Model/Student.java b/src/main/java/ru/IP_LabWorks/IP/University/Model/Student.java index 2970765..be46044 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Model/Student.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Model/Student.java @@ -25,10 +25,9 @@ public class Student { public Student() { } - public Student(String name, LocalDate birthDate, Group group) { + public Student(String name, LocalDate birthDate) { this.name = name; this.birthDate = birthDate; - this.group = group; } public Long getId() { return id; } @@ -59,11 +58,13 @@ public class Student { @Override public String toString() { + String groupStr = (group != null) ? group.getName() : "No Group"; return "Student{" + "id=" + id + ", name='" + name + '\'' + ", birthDate='" + birthDate + '\'' + ", age='" + getAge() + '\'' + + ", group='" + groupStr + '\'' + '}'; } diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Service/GroupService.java b/src/main/java/ru/IP_LabWorks/IP/University/Service/GroupService.java index 689307e..e7efe57 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Service/GroupService.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Service/GroupService.java @@ -1,6 +1,6 @@ package ru.IP_LabWorks.IP.University.Service; -import jakarta.persistence.EntityNotFoundException; +import org.springframework.context.annotation.Lazy; import org.springframework.transaction.annotation.Transactional; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; @@ -8,10 +8,9 @@ import ru.IP_LabWorks.IP.University.Model.Group; import ru.IP_LabWorks.IP.University.Model.Student; import ru.IP_LabWorks.IP.University.Model.Subject; import ru.IP_LabWorks.IP.University.Repository.GroupRepository; -import ru.IP_LabWorks.IP.University.Repository.StudentRepository; import ru.IP_LabWorks.IP.University.Service.NotFoundException.GroupNotFoundException; -import java.awt.desktop.OpenFilesEvent; +import java.util.ArrayList; import java.util.List; import java.util.Optional; @@ -19,8 +18,13 @@ import java.util.Optional; public class GroupService { private final GroupRepository groupRepository; - public GroupService(GroupRepository groupRepository) { + private final StudentService studentService; + private final SubjectService subjectService; + + public GroupService(GroupRepository groupRepository, StudentService studentService, @Lazy SubjectService subjectService) { this.groupRepository = groupRepository; + this.studentService = studentService; + this.subjectService = subjectService; } @Transactional @@ -87,6 +91,41 @@ public class GroupService { } } + @Transactional + public List getStudentsUndefined(){ + List students = new ArrayList<>(); + for(Student student : studentService.findAllStudents()){ + if(student.getGroup() == null){ + students.add(student); + } + } + return students; + } + + @Transactional + public void addStudentToGroup(Long groupId, List studentIds){ + final Group currentGroup = findGroup(groupId); + for(Long studentId : studentIds) { + studentService.findStudent(studentId).setGroup(currentGroup); + } + groupRepository.save(currentGroup); + } + + @Transactional + public void deleteStudentFromGroup(Long id){ + studentService.findStudent(id).setGroup(null); + } + + @Transactional + public void addSubjectToGroup(Long groupId, List subjectIds){ + final Group currentGroup = findGroup(groupId); + currentGroup.setSubjects(new ArrayList<>()); + for(Long subjectId : subjectIds) { + currentGroup.getSubjects().add(subjectService.findSubject(subjectId)); + } + groupRepository.save(currentGroup); + } + /* @Transactional public Group addStudentToGroup(Long groupId, Long studentId) { Group group = findGroup(groupId); diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Service/StudentService.java b/src/main/java/ru/IP_LabWorks/IP/University/Service/StudentService.java index 9796c4f..4368434 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Service/StudentService.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Service/StudentService.java @@ -1,5 +1,7 @@ package ru.IP_LabWorks.IP.University.Service; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.transaction.annotation.Transactional; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; @@ -17,23 +19,17 @@ public class StudentService { private final StudentRepository studentRepository; private final GroupService groupService; - public StudentService(StudentRepository studentRepository, GroupService groupService) { + public StudentService(StudentRepository studentRepository,@Lazy GroupService groupService) { this.studentRepository = studentRepository; this.groupService = groupService; } @Transactional - public Student addStudent(String name, LocalDate birthDate, Long groupId){ + public Student addStudent(String name, LocalDate birthDate){ if (!StringUtils.hasText(name) || !StringUtils.hasText(String.valueOf(birthDate))) { throw new IllegalArgumentException("Student name or date is null or empty"); } - Group group = null; - try{ - group = groupService.findGroup(groupId); - }catch (Exception ex){ - group = null; - } - final Student student = new Student(name, birthDate,group); + final Student student = new Student(name, birthDate); return studentRepository.save(student); } @@ -49,14 +45,13 @@ public class StudentService { } @Transactional - public Student updateStudent(Long id, String name, LocalDate date, Long groupId) { + public Student updateStudent(Long id, String name, LocalDate date) { if (!StringUtils.hasText(name) || !StringUtils.hasText(String.valueOf(date))) { throw new IllegalArgumentException("Student name or date is null or empty"); } final Student currentStudent = findStudent(id); currentStudent.setName(name); currentStudent.setBirthDate(date); - currentStudent.setGroup(groupService.findGroup(groupId)); return studentRepository.save(currentStudent); }