esoe 1 week ago
parent
commit
e24cf5bd40
  1. 3
      main/src/main/java/gsp/technologies/main/api/account/AccountFaceController.java
  2. 6
      main/src/main/java/gsp/technologies/main/api/target/TargetService.java

3
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.organization.OrganizationService;
import gsp.technologies.main.api.position.PositionEntity; import gsp.technologies.main.api.position.PositionEntity;
import gsp.technologies.main.api.position.PositionService; 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.api.target.TargetService;
import gsp.technologies.main.code.Code; import gsp.technologies.main.code.Code;
@ -78,6 +79,8 @@ public class AccountFaceController {
model.addAttribute("account", account); model.addAttribute("account", account);
//передаем в модель перечень доступных курсов //передаем в модель перечень доступных курсов
Collection<TargetEntity> targets = targetService.findAllByPositionId(account.getPosition().getId());
Collection<CourseEntity> courses = targetService.findAllByPosition(account.getPosition()); Collection<CourseEntity> courses = targetService.findAllByPosition(account.getPosition());
model.addAttribute("courses", courses); model.addAttribute("courses", courses);
//передаем в модель статусы прохождения курсов //передаем в модель статусы прохождения курсов

6
main/src/main/java/gsp/technologies/main/api/target/TargetService.java

@ -24,7 +24,11 @@ public class TargetService {
} }
public Collection<CourseEntity> findAllByPosition(PositionEntity position) { public Collection<CourseEntity> findAllByPosition(PositionEntity position) {
repo.findAllByPosition(position); return repo.findAllByPosition(position);
}
public Collection<TargetEntity> findAllByPositionId(Long id) {
return repo.findAllByPositionId(id);
} }
} }

Loading…
Cancel
Save