From e24cf5bd4087c3be8bf042a4371df751a1128d8c Mon Sep 17 00:00:00 2001 From: esoe Date: Thu, 14 Nov 2024 15:42:47 +0300 Subject: [PATCH] qq --- .../main/api/account/AccountFaceController.java | 3 +++ .../gsp/technologies/main/api/target/TargetService.java | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/main/src/main/java/gsp/technologies/main/api/account/AccountFaceController.java b/main/src/main/java/gsp/technologies/main/api/account/AccountFaceController.java index f6d5edb..7a75c6d 100644 --- a/main/src/main/java/gsp/technologies/main/api/account/AccountFaceController.java +++ b/main/src/main/java/gsp/technologies/main/api/account/AccountFaceController.java @@ -15,6 +15,7 @@ import gsp.technologies.main.api.course.CourseEntity; import gsp.technologies.main.api.organization.OrganizationService; import gsp.technologies.main.api.position.PositionEntity; import gsp.technologies.main.api.position.PositionService; +import gsp.technologies.main.api.target.TargetEntity; import gsp.technologies.main.api.target.TargetService; import gsp.technologies.main.code.Code; @@ -78,6 +79,8 @@ public class AccountFaceController { model.addAttribute("account", account); //передаем в модель перечень доступных курсов + Collection targets = targetService.findAllByPositionId(account.getPosition().getId()); + Collection courses = targetService.findAllByPosition(account.getPosition()); model.addAttribute("courses", courses); //передаем в модель статусы прохождения курсов diff --git a/main/src/main/java/gsp/technologies/main/api/target/TargetService.java b/main/src/main/java/gsp/technologies/main/api/target/TargetService.java index e85d528..04d4e5e 100644 --- a/main/src/main/java/gsp/technologies/main/api/target/TargetService.java +++ b/main/src/main/java/gsp/technologies/main/api/target/TargetService.java @@ -24,7 +24,11 @@ public class TargetService { } public Collection findAllByPosition(PositionEntity position) { - repo.findAllByPosition(position); + return repo.findAllByPosition(position); + } + + public Collection findAllByPositionId(Long id) { + return repo.findAllByPositionId(id); } }