diff --git a/data.mv.db b/data.mv.db
index d3799c1..864f2ff 100644
Binary files a/data.mv.db and b/data.mv.db differ
diff --git a/frontend/vue-project/src/pages/groups.vue b/frontend/vue-project/src/pages/groups.vue
index 2825b3e..4e4748b 100644
--- a/frontend/vue-project/src/pages/groups.vue
+++ b/frontend/vue-project/src/pages/groups.vue
@@ -2,6 +2,7 @@
@@ -206,6 +242,7 @@ export default {
created() {
this.getGroups();
this.getSubjects();
+ this.getAll();
},
data() {
return{
@@ -219,9 +256,20 @@ export default {
groupId: undefined,
selectedSubjects: [],
subjectsInGroup: [],
+ getAllInfo: new Object() ,
}
},
methods: {
+ getAll(){
+ axios.get(this.URL + "group/getAll")
+ .then(response => {
+ this.getAllInfo = response.data;
+ console.log(response.data);
+ })
+ .catch(error => {
+ console.log(error);
+ });
+ },
getSubjectsInGroup(id){
axios.get(this.URL + `group/${id}/getAllSubjects`)
.then(response => {
@@ -314,6 +362,12 @@ export default {
CloseModalForAddStudents() {
document.getElementById("ModalForAddStudents").style.display = "none";
},
+ openReport() {
+ document.getElementById("openReport").style.display = "block";
+ },
+ closeReport() {
+ document.getElementById("openReport").style.display = "none";
+ },
saveStudents(id) {
axios.post(this.URL + `group/${id}/addStudents`, this.selectedStudents)
.then(() => {
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 8f201ec..cc78b94 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
@@ -10,6 +10,7 @@ import ru.IP_LabWorks.IP.University.Model.Subject;
import ru.IP_LabWorks.IP.University.Service.GroupService;
import java.util.List;
+import java.util.Map;
@RestController
@RequestMapping("/group")
@@ -79,11 +80,8 @@ public class GroupController {
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) {
-// return new StudentDTO(groupService.addStudentToGroup(id, studentId));
-// }
+ @GetMapping("/getAll")
+ public Map> getAll(){
+ return groupService.getAll();
+ }
}
diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Repository/GroupRepository.java b/src/main/java/ru/IP_LabWorks/IP/University/Repository/GroupRepository.java
index f7a2dbb..904b208 100644
--- a/src/main/java/ru/IP_LabWorks/IP/University/Repository/GroupRepository.java
+++ b/src/main/java/ru/IP_LabWorks/IP/University/Repository/GroupRepository.java
@@ -1,7 +1,15 @@
package ru.IP_LabWorks.IP.University.Repository;
import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
import ru.IP_LabWorks.IP.University.Model.Group;
+import java.util.List;
+
public interface GroupRepository extends JpaRepository {
+ @Query("select g.name as group, s.name as students " +
+ "from Group g " +
+ "join g.students s " +
+ "group by g.id, g.name, s.name")
+ List