From e54c2dc46ebc41db49daa2fa38e449e89908ca88 Mon Sep 17 00:00:00 2001 From: ArtemEmelyanov Date: Fri, 12 May 2023 21:23:55 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D1=81=D0=B2=D1=8F=D0=B7=D1=8C=20-=20=D0=BC?= =?UTF-8?q?=D0=BD=D0=BE=D0=B3=D0=B8=D0=B5=20=D0=BA=D0=BE=20=D0=BC=D0=BD?= =?UTF-8?q?=D0=BE=D0=B3=D0=B8=D0=BC,=20=D0=B5=D1=81=D1=82=D1=8C=20=D0=B1?= =?UTF-8?q?=D0=B0=D0=B3=20=D1=81=20=D0=B3=D0=B0=D0=BB=D0=BE=D1=87=D0=BA?= =?UTF-8?q?=D0=B0=D0=BC=D0=B8))?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data.mv.db | Bin 73728 -> 69632 bytes frontend/vue-project/src/models/Subject.js | 1 + frontend/vue-project/src/pages/subjects.vue | 103 +++++++++++++++++- .../University/Contoller/DTO/SubjectDTO.java | 11 +- .../Contoller/REST/SubjectController.java | 11 ++ .../IP/University/Model/Group.java | 5 + .../IP/University/Model/Subject.java | 11 ++ .../Repository/SubjectRepository.java | 5 + .../IP/University/Service/SubjectService.java | 31 +++++- 9 files changed, 169 insertions(+), 9 deletions(-) diff --git a/data.mv.db b/data.mv.db index 17aec5151e17d7b402ee772a7bbc1ad7b31c522a..6ef2fa8538479ce32c0f5addd57908ddfd03e89d 100644 GIT binary patch literal 69632 zcmeHQ&2t>bb)Q{e$sq`kqA03l$Bsu3B@#9Wb@xoqOs^-m&u zfdE5+GMSWPCgqAwhY$|X7Hl2crHGu=Hi z`vojOPy)r?0(PcnduHCee%;gW_3ynmUnP_N`eyK6mGN!k#_vT{j1Za(-o3N&UKM+I zGPoUiTTxiWuEUTUo7kn3@#gKD-WHtwL3I258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BqsIKYD>e-Jp0Tu6Gx%>`pQ_rZ{x?G{mQ|bCN|M{35}QFaT!+u zK0LH|iTbY||3}j}Dr?)}KoFbYNGuV#jl^=BBtRi__p~Q}DwsrM<~0g(*0U|CL>T53 zdw~dudORS?D6$|>iU6;gvmyc`o8#KHq!JMU(!Q!^P;jpZ`35X#3Ym)vEr*vD(ncJ% zjYOihsLeJMp}V8>ZCRc#3+KkPpHGe?inLKKEd&^`BCSQfCv-~!AuTH_kMfdy%Rn77 zR9bLdR&vd0PAOyAu2ZNsv}hFXOtm0O7LWE5m@LKdotqp6@m(ov%w=WtHzSDZ^`*t9 zi~-GsmY2N%{H{P&Q_?Gh$+zqUB+f(P_6U{hNbZYjf*fn%BKS{K2IOovOdFh}k3lkk`X=_pZcdO| zv0ONZ|6lJ|?`-eYp53$V8a)S=n!U52G|m5)PlXXWl1+m+kQm`fWli({sd!lt zt~<%5jr7J%sB5qs-kk26Pz#jMiG0uN8xfQ{$oCR4!0C6w>rDY6dO_@!#b<_}tdZ|_ zXFb_i+IVxOiqnO`w7f$VkPADg^IbAJUROQrp`9jc{y%tOYyQ8c=KoWslnB+3O48!#PVD@HC%=_c(ggL^g<2T;9 zy}5CV&Hyra<<9l%S3`h<36$z65T*UN&z^%r_WXnz|F7}?@KEl$4D#rhevSVxGVXS* vc8&k + + + + + + diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Contoller/DTO/SubjectDTO.java b/src/main/java/ru/IP_LabWorks/IP/University/Contoller/DTO/SubjectDTO.java index 67f772e..a3f851b 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Contoller/DTO/SubjectDTO.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Contoller/DTO/SubjectDTO.java @@ -2,16 +2,20 @@ package ru.IP_LabWorks.IP.University.Contoller.DTO; import ru.IP_LabWorks.IP.University.Model.Subject; +import java.util.List; +import java.util.stream.Collectors; + public class SubjectDTO { private long id; private String name; - + private List groupIds; public SubjectDTO(){ } public SubjectDTO(Subject subject){ this.id = subject.getId(); this.name = subject.getName(); + this.groupIds = subject.getGroupIds(); } public Long getId(){ @@ -21,4 +25,9 @@ public class SubjectDTO { public String getName(){ return name; } + + public List getGroupIds(){ + return groupIds; + } + } diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Contoller/REST/SubjectController.java b/src/main/java/ru/IP_LabWorks/IP/University/Contoller/REST/SubjectController.java index 4b7fb58..17d936c 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Contoller/REST/SubjectController.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Contoller/REST/SubjectController.java @@ -8,6 +8,7 @@ import ru.IP_LabWorks.IP.University.Service.GroupService; import ru.IP_LabWorks.IP.University.Service.SubjectService; import java.util.List; +import java.util.Objects; @RestController @RequestMapping("/subject") @@ -44,4 +45,14 @@ public class SubjectController { public SubjectDTO deleteSubject(@PathVariable Long id){ return new SubjectDTO(subjectService.deleteSubject(id)); } + + @GetMapping("/getAllSubjectGroup") + public List getAllSubjectGroup(){ + return subjectService.getAllSubjectGroup(); + } + + @PostMapping("/{id}/addSubjectToGroup") + public void addSubjectToGroup(@PathVariable Long id, @RequestBody @Valid List groupsIds){ + subjectService.addSubjectToGroup(id, groupsIds); + } } 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 e041ae6..d41beb7 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 @@ -85,4 +85,9 @@ public class Group { public void setSubjects(List subjects) { this.subjects = subjects; } + + public void addSubject(Subject subject) { + subjects.add(subject); + subject.getGroups().add(this); + } } diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Model/Subject.java b/src/main/java/ru/IP_LabWorks/IP/University/Model/Subject.java index 95702b4..bcf7904 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Model/Subject.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Model/Subject.java @@ -6,6 +6,7 @@ import org.hibernate.annotations.OnDelete; import org.hibernate.annotations.OnDeleteAction; import javax.swing.*; +import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -61,4 +62,14 @@ public class Subject { public void setGroups(List groups) { this.groups = groups; } + + public List getGroupIds(){ + List GroupsIds = new ArrayList<>(); + for(Group group : groups){ + if(!GroupsIds.contains(group.getId())){ + GroupsIds.add(group.getId()); + } + } + return GroupsIds; + } } diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Repository/SubjectRepository.java b/src/main/java/ru/IP_LabWorks/IP/University/Repository/SubjectRepository.java index 98360b9..1d29413 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Repository/SubjectRepository.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Repository/SubjectRepository.java @@ -1,7 +1,12 @@ 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.Subject; +import java.util.List; + public interface SubjectRepository extends JpaRepository { + @Query(value = "SELECT * FROM subject_group", nativeQuery = true) + List getAllSubjectGroup(); } diff --git a/src/main/java/ru/IP_LabWorks/IP/University/Service/SubjectService.java b/src/main/java/ru/IP_LabWorks/IP/University/Service/SubjectService.java index fe4d443..27b8202 100644 --- a/src/main/java/ru/IP_LabWorks/IP/University/Service/SubjectService.java +++ b/src/main/java/ru/IP_LabWorks/IP/University/Service/SubjectService.java @@ -1,24 +1,25 @@ package ru.IP_LabWorks.IP.University.Service; -import jakarta.persistence.EntityNotFoundException; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.StringUtils; import ru.IP_LabWorks.IP.University.Model.Group; import ru.IP_LabWorks.IP.University.Model.Subject; import ru.IP_LabWorks.IP.University.Repository.SubjectRepository; -import ru.IP_LabWorks.IP.University.Service.NotFoundException.GroupNotFoundException; import ru.IP_LabWorks.IP.University.Service.NotFoundException.SubjectNotFoundException; +import java.util.ArrayList; import java.util.List; import java.util.Optional; @Service public class SubjectService { private final SubjectRepository subjectRepository; + private final GroupService groupService; - public SubjectService(SubjectRepository subjectRepository) { + public SubjectService(SubjectRepository subjectRepository, GroupService groupService) { this.subjectRepository = subjectRepository; + this.groupService = groupService; } @Transactional @@ -63,6 +64,30 @@ public class SubjectService { subjectRepository.deleteAll(); } + @Transactional + public List getAllSubjectGroup(){ + return subjectRepository.getAllSubjectGroup(); + } + + @Transactional + public void addSubjectToGroup(Long subjectId, List groupIds){ + final Subject currentSubject = findSubject(subjectId); + currentSubject.setGroups(new ArrayList<>()); + for(Long groupId : groupIds) { + currentSubject.getGroups().add(groupService.findGroup(groupId)); + } + subjectRepository.save(currentSubject); + } + +// @Transactional +// public void addSubjectToGroup(List groupsId, Subject subject) { +// List groups = groupRepository.findAllById(groupsId); +// for (Group group : groups) { +// group.addSubject(subject); +// } +// groupRepository.saveAll(groups); +// } + // @Transactional // public void addGroupToSubject(Long subjectId, Long groupId) { // Subject subject = findSubject(subjectId);