Compare commits
No commits in common. "aspir" and "master" have entirely different histories.
21
README.md
21
README.md
@ -1,20 +1,9 @@
|
|||||||
# Портал для аспирантов
|
# seminar
|
||||||
|
|
||||||
Порядок развертывания проекта разработчиками:
|
JDK: https://download.oracle.com/java/17/archive/jdk-17.0.6_windows-x64_bin.exe
|
||||||
|
|
||||||
1. Скачать и установить JDK (используется 21 LTS
|
IDE: IntelliJIDEA community version https://www.jetbrains.com/ru-ru/idea/download/#section=windows
|
||||||
JDK): https://download.oracle.com/java/21/latest/jdk-21_windows-x64_bin.exe
|
|
||||||
|
|
||||||
2. Проверить установку, набрав в консоли команду "java -version"
|
To run: run project and open http://localhost:8080/
|
||||||
|
|
||||||
3. Скачать и установить IDE: IntelliJIDEA Сommunity
|
Demo: http://seminar.athene.tech
|
||||||
version https://www.jetbrains.com/ru-ru/idea/download/#section=windows
|
|
||||||
|
|
||||||
4. Скачать и открыть проект в IDE:
|
|
||||||
|
|
||||||
![open.png](open.png)
|
|
||||||
5. Сформировать конфигурацию для запуска:
|
|
||||||
![run.png](run.png)
|
|
||||||
6. Запустить проект.
|
|
||||||
7. Открыть страницу в браузере http://localhost:8080/
|
|
||||||
8. Enjoy.
|
|
@ -24,8 +24,5 @@ public class SeminarApplication {
|
|||||||
public void doSomethingAfterStartup() {
|
public void doSomethingAfterStartup() {
|
||||||
System.out.println("hello world, I have just started up");
|
System.out.println("hello world, I have just started up");
|
||||||
userService.initDefaultAdmin();
|
userService.initDefaultAdmin();
|
||||||
userService.initDefaultAspirant();
|
|
||||||
userService.initDefaultHead();
|
|
||||||
userService.initDefaultManager();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,51 +0,0 @@
|
|||||||
package ru.ulstu.admin.controller;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import ru.ulstu.admin.model.AspirantForm;
|
|
||||||
import ru.ulstu.admin.service.AdminAspirantService;
|
|
||||||
import ru.ulstu.aspirant.model.Aspirant;
|
|
||||||
import ru.ulstu.indicator.model.Course;
|
|
||||||
|
|
||||||
@Controller
|
|
||||||
@RequestMapping("admin")
|
|
||||||
public class AdminAspirantController {
|
|
||||||
private final AdminAspirantService adminAspirantService;
|
|
||||||
|
|
||||||
public AdminAspirantController(AdminAspirantService adminAspirantService) {
|
|
||||||
this.adminAspirantService = adminAspirantService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("aspirants")
|
|
||||||
public String getListOfAspirants(Model model) {
|
|
||||||
model.addAttribute("aspirants", adminAspirantService.getAspirants());
|
|
||||||
return "admin/aspirantsList";
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/editAspirant/{aspirantId}")
|
|
||||||
public String editAspirant(@PathVariable(value = "aspirantId") Integer id, Model model) {
|
|
||||||
model.addAttribute("aspirant",
|
|
||||||
new AspirantForm((id != null && id != 0)
|
|
||||||
? adminAspirantService.getAspirantById(id)
|
|
||||||
: new Aspirant()));
|
|
||||||
model.addAttribute("courses", Course.values());
|
|
||||||
model.addAttribute("managers", adminAspirantService.getManagers());
|
|
||||||
return "admin/editAspirant";
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(value = "saveAspirant", params = "save")
|
|
||||||
public String saveAspirant(AspirantForm aspirantForm, Model model) {
|
|
||||||
adminAspirantService.saveAspirant(aspirantForm);
|
|
||||||
return "redirect:/admin/aspirants";
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(value = "saveAspirant", params = "delete")
|
|
||||||
public String deleteIndicator(AspirantForm aspirantForm, Model model) {
|
|
||||||
adminAspirantService.deleteAspirant(aspirantForm);
|
|
||||||
return "redirect:/admin/aspirants";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,53 +0,0 @@
|
|||||||
package ru.ulstu.admin.controller;
|
|
||||||
|
|
||||||
import org.springframework.security.access.annotation.Secured;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import ru.ulstu.admin.model.IndicatorForm;
|
|
||||||
import ru.ulstu.admin.service.AdminIndicatorService;
|
|
||||||
import ru.ulstu.indicator.model.Course;
|
|
||||||
import ru.ulstu.indicator.model.Indicator;
|
|
||||||
import ru.ulstu.model.UserRoleConstants;
|
|
||||||
|
|
||||||
@Controller
|
|
||||||
@RequestMapping("/admin")
|
|
||||||
@Secured({UserRoleConstants.ADMIN})
|
|
||||||
public class AdminIndicatorController {
|
|
||||||
private final AdminIndicatorService adminIndicatorService;
|
|
||||||
|
|
||||||
public AdminIndicatorController(AdminIndicatorService adminIndicatorService) {
|
|
||||||
this.adminIndicatorService = adminIndicatorService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("indicators")
|
|
||||||
public String getListOfIndicators(Model model) {
|
|
||||||
model.addAttribute("indicators", adminIndicatorService.getIndicators());
|
|
||||||
return "admin/indicatorsList";
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/editIndicator/{indicatorId}")
|
|
||||||
public String editIndicator(@PathVariable(value = "indicatorId") Integer id, Model model) {
|
|
||||||
model.addAttribute("indicator",
|
|
||||||
(id != null && id != 0)
|
|
||||||
? adminIndicatorService.getIndicatorById(id)
|
|
||||||
: new Indicator());
|
|
||||||
model.addAttribute("courses", Course.values());
|
|
||||||
return "admin/editIndicator";
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(value = "saveIndicator", params = "save")
|
|
||||||
public String saveIndicator(IndicatorForm indicatorForm, Model model) {
|
|
||||||
adminIndicatorService.saveIndicator(indicatorForm);
|
|
||||||
return "redirect:/admin/indicators";
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(value = "saveIndicator", params = "delete")
|
|
||||||
public String deleteIndicator(IndicatorForm indicatorForm, Model model) {
|
|
||||||
adminIndicatorService.deleteIndicator(indicatorForm);
|
|
||||||
return "redirect:/admin/indicators";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
package ru.ulstu.admin.controller;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import ru.ulstu.admin.model.ManagerForm;
|
|
||||||
import ru.ulstu.admin.service.AdminManagerService;
|
|
||||||
import ru.ulstu.manager.model.Manager;
|
|
||||||
|
|
||||||
@Controller
|
|
||||||
@RequestMapping("admin")
|
|
||||||
public class AdminManagerController {
|
|
||||||
private final AdminManagerService adminManagerService;
|
|
||||||
|
|
||||||
public AdminManagerController(AdminManagerService adminManagerService) {
|
|
||||||
this.adminManagerService = adminManagerService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("managers")
|
|
||||||
public String getListOfManagers(Model model) {
|
|
||||||
model.addAttribute("managers", adminManagerService.getManagers());
|
|
||||||
return "admin/managersList";
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/editManager/{managerId}")
|
|
||||||
public String editManager(@PathVariable(value = "managerId") Integer id, Model model) {
|
|
||||||
model.addAttribute("manager",
|
|
||||||
(id != null && id != 0)
|
|
||||||
? adminManagerService.getManagerById(id)
|
|
||||||
: new Manager());
|
|
||||||
return "admin/editManager";
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(value = "saveManager", params = "save")
|
|
||||||
public String saveManager(ManagerForm managerForm, Model model) {
|
|
||||||
adminManagerService.saveManager(managerForm);
|
|
||||||
return "redirect:/admin/managers";
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping(value = "saveManager", params = "delete")
|
|
||||||
public String deleteIndicator(ManagerForm managerForm, Model model) {
|
|
||||||
adminManagerService.deleteManager(managerForm);
|
|
||||||
return "redirect:/admin/managers";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,137 +0,0 @@
|
|||||||
package ru.ulstu.admin.model;
|
|
||||||
|
|
||||||
import ru.ulstu.aspirant.model.Aspirant;
|
|
||||||
import ru.ulstu.aspirant.model.Base;
|
|
||||||
import ru.ulstu.aspirant.model.Speciality;
|
|
||||||
import ru.ulstu.indicator.model.Course;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class AspirantForm {
|
|
||||||
private Integer id;
|
|
||||||
private String surname;
|
|
||||||
private String name;
|
|
||||||
private String patronymic;
|
|
||||||
private Course course;
|
|
||||||
private Integer managerId;
|
|
||||||
private Date birthDate;
|
|
||||||
private Speciality speciality;
|
|
||||||
private String theme;
|
|
||||||
private Base base;
|
|
||||||
private Integer userId;
|
|
||||||
private String email;
|
|
||||||
|
|
||||||
public AspirantForm() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public AspirantForm(Aspirant aspirant) {
|
|
||||||
this.id = aspirant.getId();
|
|
||||||
this.name = aspirant.getName();
|
|
||||||
this.surname = aspirant.getSurname();
|
|
||||||
this.patronymic = aspirant.getPatronymic();
|
|
||||||
this.base = aspirant.getBase();
|
|
||||||
this.course = aspirant.getCourse();
|
|
||||||
this.managerId = aspirant.getManager() == null ? null : aspirant.getManager().getId();
|
|
||||||
this.birthDate = aspirant.getBirthDate();
|
|
||||||
this.speciality = aspirant.getSpeciality();
|
|
||||||
this.theme = aspirant.getTheme();
|
|
||||||
this.userId = aspirant.getUser() == null ? null : aspirant.getUser().getId();
|
|
||||||
this.email = aspirant.getUser() == null ? null : aspirant.getUser().getLogin();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Integer id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSurname() {
|
|
||||||
return surname;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSurname(String surname) {
|
|
||||||
this.surname = surname;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPatronymic() {
|
|
||||||
return patronymic;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPatronymic(String patronymic) {
|
|
||||||
this.patronymic = patronymic;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Course getCourse() {
|
|
||||||
return course;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCourse(Course course) {
|
|
||||||
this.course = course;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getManagerId() {
|
|
||||||
return managerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setManagerId(Integer managerId) {
|
|
||||||
this.managerId = managerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getBirthDate() {
|
|
||||||
return birthDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBirthDate(Date birthDate) {
|
|
||||||
this.birthDate = birthDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Speciality getSpeciality() {
|
|
||||||
return speciality;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpeciality(Speciality speciality) {
|
|
||||||
this.speciality = speciality;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTheme() {
|
|
||||||
return theme;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTheme(String theme) {
|
|
||||||
this.theme = theme;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Base getBase() {
|
|
||||||
return base;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBase(Base base) {
|
|
||||||
this.base = base;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getUserId() {
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(Integer userId) {
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getEmail() {
|
|
||||||
return email;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEmail(String email) {
|
|
||||||
this.email = email;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,69 +0,0 @@
|
|||||||
package ru.ulstu.admin.model;
|
|
||||||
|
|
||||||
import ru.ulstu.indicator.model.Course;
|
|
||||||
import ru.ulstu.indicator.model.Indicator;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class IndicatorForm {
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private int max;
|
|
||||||
|
|
||||||
private String proofDocuments;
|
|
||||||
|
|
||||||
private List<Course> courses = new ArrayList<>();
|
|
||||||
|
|
||||||
public IndicatorForm() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public IndicatorForm(Indicator indicator) {
|
|
||||||
this.name = indicator.getName();
|
|
||||||
this.max = indicator.getMax();
|
|
||||||
this.proofDocuments = indicator.getProofDocuments();
|
|
||||||
this.courses = indicator.getCourses();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Integer id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMax() {
|
|
||||||
return max;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMax(int max) {
|
|
||||||
this.max = max;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getProofDocuments() {
|
|
||||||
return proofDocuments;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProofDocuments(String proofDocuments) {
|
|
||||||
this.proofDocuments = proofDocuments;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Course> getCourses() {
|
|
||||||
return courses;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCourses(List<Course> courses) {
|
|
||||||
this.courses = courses;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
package ru.ulstu.admin.model;
|
|
||||||
|
|
||||||
import ru.ulstu.manager.model.Manager;
|
|
||||||
|
|
||||||
public class ManagerForm {
|
|
||||||
private Integer id;
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
public ManagerForm() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public ManagerForm(Manager manager) {
|
|
||||||
this.id = manager.getId();
|
|
||||||
this.name = manager.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Integer id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,66 +0,0 @@
|
|||||||
package ru.ulstu.admin.service;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import ru.ulstu.admin.model.AspirantForm;
|
|
||||||
import ru.ulstu.aspirant.model.Aspirant;
|
|
||||||
import ru.ulstu.aspirant.service.AspirantService;
|
|
||||||
import ru.ulstu.manager.model.Manager;
|
|
||||||
import ru.ulstu.manager.service.ManagerService;
|
|
||||||
import ru.ulstu.model.User;
|
|
||||||
import ru.ulstu.user.UserService;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class AdminAspirantService {
|
|
||||||
private final AspirantService aspirantService;
|
|
||||||
private final ManagerService managerService;
|
|
||||||
private final UserService userService;
|
|
||||||
|
|
||||||
public AdminAspirantService(AspirantService aspirantService,
|
|
||||||
ManagerService managerService,
|
|
||||||
UserService userService) {
|
|
||||||
this.aspirantService = aspirantService;
|
|
||||||
this.managerService = managerService;
|
|
||||||
this.userService = userService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Aspirant> getAspirants() {
|
|
||||||
return aspirantService.getAspirants();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Aspirant getAspirantById(Integer id) {
|
|
||||||
return aspirantService.getAspirantById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void saveAspirant(AspirantForm aspirantForm) {
|
|
||||||
Aspirant aspirant = aspirantForm.getId() == null
|
|
||||||
? new Aspirant()
|
|
||||||
: aspirantService.getAspirantById(aspirantForm.getId());
|
|
||||||
aspirant.setName(aspirantForm.getName());
|
|
||||||
aspirant.setSurname(aspirantForm.getSurname());
|
|
||||||
aspirant.setPatronymic(aspirantForm.getPatronymic());
|
|
||||||
aspirant.setBase(aspirantForm.getBase());
|
|
||||||
aspirant.setCourse(aspirantForm.getCourse());
|
|
||||||
aspirant.setManager(managerService.getManagerById(aspirantForm.getManagerId()));
|
|
||||||
aspirant.setBirthDate(aspirantForm.getBirthDate());
|
|
||||||
aspirant.setSpeciality(aspirantForm.getSpeciality());
|
|
||||||
aspirant.setTheme(aspirantForm.getTheme());
|
|
||||||
User user = userService.getUserById(aspirantForm.getUserId());
|
|
||||||
if (!user.getLogin().equals(aspirantForm.getEmail())) {
|
|
||||||
user.setLogin(aspirantForm.getEmail());
|
|
||||||
userService.createUser(user);
|
|
||||||
}
|
|
||||||
aspirant.setUser(user);
|
|
||||||
|
|
||||||
aspirantService.save(aspirant);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteAspirant(AspirantForm aspirantForm) {
|
|
||||||
aspirantService.deleteAspirant(aspirantForm);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Manager> getManagers() {
|
|
||||||
return managerService.getManagers();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,40 +0,0 @@
|
|||||||
package ru.ulstu.admin.service;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import ru.ulstu.admin.model.IndicatorForm;
|
|
||||||
import ru.ulstu.indicator.model.Indicator;
|
|
||||||
import ru.ulstu.indicator.service.IndicatorService;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class AdminIndicatorService {
|
|
||||||
private final IndicatorService indicatorService;
|
|
||||||
|
|
||||||
public AdminIndicatorService(IndicatorService indicatorService) {
|
|
||||||
this.indicatorService = indicatorService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Indicator> getIndicators() {
|
|
||||||
return indicatorService.getIndicatorList();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void saveIndicator(IndicatorForm indicatorForm) {
|
|
||||||
Indicator indicator = indicatorForm.getId() == null
|
|
||||||
? new Indicator()
|
|
||||||
: indicatorService.getIndicatorById(indicatorForm.getId());
|
|
||||||
indicator.setName(indicatorForm.getName());
|
|
||||||
indicator.setMax(indicatorForm.getMax());
|
|
||||||
indicator.setProofDocuments(indicatorForm.getProofDocuments());
|
|
||||||
indicator.setCourses(indicatorForm.getCourses());
|
|
||||||
indicatorService.save(indicator);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Indicator getIndicatorById(Integer id) {
|
|
||||||
return indicatorService.getIndicatorById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteIndicator(IndicatorForm indicatorForm) {
|
|
||||||
indicatorService.deleteIndicator(indicatorForm);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
package ru.ulstu.admin.service;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import ru.ulstu.admin.model.ManagerForm;
|
|
||||||
import ru.ulstu.manager.model.Manager;
|
|
||||||
import ru.ulstu.manager.service.ManagerService;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class AdminManagerService {
|
|
||||||
private final ManagerService managerService;
|
|
||||||
|
|
||||||
public AdminManagerService(ManagerService managerService) {
|
|
||||||
this.managerService = managerService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Manager> getManagers() {
|
|
||||||
return managerService.getManagers();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Manager getManagerById(Integer id) {
|
|
||||||
return managerService.getManagerById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void saveManager(ManagerForm managerForm) {
|
|
||||||
Manager manager = managerForm.getId() == null
|
|
||||||
? new Manager(managerForm)
|
|
||||||
: managerService.getManagerById(managerForm.getId());
|
|
||||||
manager.setName(managerForm.getName());
|
|
||||||
managerService.save(manager);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteManager(ManagerForm managerForm) {
|
|
||||||
managerService.deleteManager(managerForm);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,50 +0,0 @@
|
|||||||
package ru.ulstu.aspirant.controller;
|
|
||||||
|
|
||||||
import org.springframework.data.domain.Page;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import ru.ulstu.aspirant.model.Report;
|
|
||||||
import ru.ulstu.aspirant.service.AspirantService;
|
|
||||||
import ru.ulstu.indicator.model.Indicator;
|
|
||||||
import ru.ulstu.model.OffsetablePageRequest;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.stream.IntStream;
|
|
||||||
|
|
||||||
@Controller
|
|
||||||
@RequestMapping("aspirant")
|
|
||||||
public class AspirantController {
|
|
||||||
private static final Integer DEFAULT_PAGE_SIZE = 1;
|
|
||||||
private static final Integer DEFAULT_PAGE_NUMBER = 1;
|
|
||||||
private final AspirantService aspirantService;
|
|
||||||
|
|
||||||
public AspirantController(AspirantService aspirantService) {
|
|
||||||
this.aspirantService = aspirantService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("aspirantReport")
|
|
||||||
public String createReport(Model model,
|
|
||||||
@RequestParam Optional<Integer> page,
|
|
||||||
@RequestParam Optional<Integer> size) {
|
|
||||||
int currentPage = page.orElse(DEFAULT_PAGE_NUMBER);
|
|
||||||
int pageSize = size.orElse(DEFAULT_PAGE_SIZE);
|
|
||||||
|
|
||||||
Page<Indicator> indicators = aspirantService.getIndicatorsByCourse(new OffsetablePageRequest(currentPage - 1, pageSize));
|
|
||||||
model.addAttribute("indicators", indicators);
|
|
||||||
int totalPages = indicators.getTotalPages();
|
|
||||||
if (totalPages > 0) {
|
|
||||||
List<Integer> pageNumbers = IntStream.rangeClosed(1, totalPages)
|
|
||||||
.boxed()
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
model.addAttribute("pageNumbers", pageNumbers);
|
|
||||||
}
|
|
||||||
|
|
||||||
model.addAttribute("report", new Report());
|
|
||||||
return "aspirant/editReport";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,135 +0,0 @@
|
|||||||
package ru.ulstu.aspirant.model;
|
|
||||||
|
|
||||||
import jakarta.persistence.Entity;
|
|
||||||
import jakarta.persistence.EnumType;
|
|
||||||
import jakarta.persistence.Enumerated;
|
|
||||||
import jakarta.persistence.ManyToOne;
|
|
||||||
import jakarta.persistence.Temporal;
|
|
||||||
import jakarta.persistence.TemporalType;
|
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import ru.ulstu.indicator.model.Course;
|
|
||||||
import ru.ulstu.manager.model.Manager;
|
|
||||||
import ru.ulstu.model.BaseEntity;
|
|
||||||
import ru.ulstu.model.User;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Entity
|
|
||||||
public class Aspirant extends BaseEntity {
|
|
||||||
@NotEmpty
|
|
||||||
private String surname;
|
|
||||||
|
|
||||||
@NotEmpty
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private String patronymic;
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
private Course course;
|
|
||||||
|
|
||||||
@ManyToOne
|
|
||||||
private Manager manager;
|
|
||||||
|
|
||||||
@Temporal(TemporalType.DATE)
|
|
||||||
private Date birthDate;
|
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
private Speciality speciality;
|
|
||||||
|
|
||||||
private String theme;
|
|
||||||
|
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
private Base base;
|
|
||||||
|
|
||||||
@ManyToOne
|
|
||||||
private User user;
|
|
||||||
|
|
||||||
public Aspirant() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public Aspirant(String name, Course course) {
|
|
||||||
this.name = name;
|
|
||||||
this.course = course;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSurname() {
|
|
||||||
return surname;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSurname(String surname) {
|
|
||||||
this.surname = surname;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPatronymic() {
|
|
||||||
return patronymic;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPatronymic(String patronymic) {
|
|
||||||
this.patronymic = patronymic;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Course getCourse() {
|
|
||||||
return course;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCourse(Course course) {
|
|
||||||
this.course = course;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Manager getManager() {
|
|
||||||
return manager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setManager(Manager manager) {
|
|
||||||
this.manager = manager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getBirthDate() {
|
|
||||||
return birthDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBirthDate(Date birthDate) {
|
|
||||||
this.birthDate = birthDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Speciality getSpeciality() {
|
|
||||||
return speciality;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSpeciality(Speciality speciality) {
|
|
||||||
this.speciality = speciality;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTheme() {
|
|
||||||
return theme;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTheme(String theme) {
|
|
||||||
this.theme = theme;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Base getBase() {
|
|
||||||
return base;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBase(Base base) {
|
|
||||||
this.base = base;
|
|
||||||
}
|
|
||||||
|
|
||||||
public User getUser() {
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUser(User user) {
|
|
||||||
this.user = user;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,15 +0,0 @@
|
|||||||
package ru.ulstu.aspirant.model;
|
|
||||||
|
|
||||||
public enum Base {
|
|
||||||
BUDGET("бюджет"), COMMERCE("коммерческая");
|
|
||||||
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
Base(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
package ru.ulstu.aspirant.model;
|
|
||||||
|
|
||||||
import jakarta.persistence.Entity;
|
|
||||||
import jakarta.persistence.OneToMany;
|
|
||||||
import jakarta.persistence.Temporal;
|
|
||||||
import jakarta.persistence.TemporalType;
|
|
||||||
import ru.ulstu.model.BaseEntity;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Entity
|
|
||||||
public class Report extends BaseEntity {
|
|
||||||
@Temporal(TemporalType.TIMESTAMP)
|
|
||||||
private Date createDate = new Date();
|
|
||||||
|
|
||||||
@OneToMany
|
|
||||||
private List<ReportValue> values = new ArrayList<>();
|
|
||||||
|
|
||||||
public List<ReportValue> getValues() {
|
|
||||||
return values;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValues(List<ReportValue> values) {
|
|
||||||
this.values = values;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getCreateDate() {
|
|
||||||
return createDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreateDate(Date createDate) {
|
|
||||||
this.createDate = createDate;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
package ru.ulstu.aspirant.model;
|
|
||||||
|
|
||||||
import jakarta.persistence.Entity;
|
|
||||||
import jakarta.persistence.ManyToOne;
|
|
||||||
import ru.ulstu.indicator.model.Indicator;
|
|
||||||
import ru.ulstu.model.BaseEntity;
|
|
||||||
|
|
||||||
@Entity
|
|
||||||
public class ReportValue extends BaseEntity {
|
|
||||||
@ManyToOne
|
|
||||||
private Indicator indicator;
|
|
||||||
|
|
||||||
private int indicatorValue;
|
|
||||||
|
|
||||||
public Indicator getIndicator() {
|
|
||||||
return indicator;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIndicator(Indicator indicator) {
|
|
||||||
this.indicator = indicator;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getIndicatorValue() {
|
|
||||||
return indicatorValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIndicatorValue(int indicatorValue) {
|
|
||||||
this.indicatorValue = indicatorValue;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,22 +0,0 @@
|
|||||||
package ru.ulstu.aspirant.model;
|
|
||||||
|
|
||||||
public enum Speciality {
|
|
||||||
S_2_3_7("2.3.7", "Системный анализ"),
|
|
||||||
S_2_3_1("2.3.1", "Автоматизация проектирования");
|
|
||||||
|
|
||||||
private final String code;
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
Speciality(String code, String name) {
|
|
||||||
this.code = code;
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCode() {
|
|
||||||
return code;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
package ru.ulstu.aspirant.repository;
|
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import ru.ulstu.aspirant.model.Aspirant;
|
|
||||||
|
|
||||||
public interface AspirantRepository extends JpaRepository<Aspirant, Integer> {
|
|
||||||
}
|
|
@ -1,57 +0,0 @@
|
|||||||
package ru.ulstu.aspirant.service;
|
|
||||||
|
|
||||||
import org.springframework.data.domain.Page;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import ru.ulstu.admin.model.AspirantForm;
|
|
||||||
import ru.ulstu.aspirant.model.Aspirant;
|
|
||||||
import ru.ulstu.aspirant.repository.AspirantRepository;
|
|
||||||
import ru.ulstu.indicator.model.Course;
|
|
||||||
import ru.ulstu.indicator.model.Indicator;
|
|
||||||
import ru.ulstu.indicator.service.IndicatorService;
|
|
||||||
import ru.ulstu.user.UserUtils;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class AspirantService {
|
|
||||||
private final AspirantRepository aspirantRepository;
|
|
||||||
private final IndicatorService indicatorService;
|
|
||||||
|
|
||||||
public AspirantService(AspirantRepository aspirantRepository,
|
|
||||||
IndicatorService indicatorService) {
|
|
||||||
this.aspirantRepository = aspirantRepository;
|
|
||||||
this.indicatorService = indicatorService;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Aspirant> getAspirants() {
|
|
||||||
return aspirantRepository.findAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Aspirant getAspirantById(Integer id) {
|
|
||||||
return aspirantRepository.findById(id).orElseThrow(() -> new RuntimeException("Aspirant not found by id"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void save(Aspirant aspirant) {
|
|
||||||
aspirantRepository.save(aspirant);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteAspirant(AspirantForm aspirantForm) {
|
|
||||||
aspirantRepository.deleteById(aspirantForm.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Aspirant getAspirantByUser(String currentUserLogin) {
|
|
||||||
//return aspirantRepository.getAspirantByLogin();
|
|
||||||
//TODO: read aspirant
|
|
||||||
return aspirantRepository.findAll().stream().findAny().orElse(new Aspirant("default", Course.FIRST));
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Indicator> getIndicatorsByCourse() {
|
|
||||||
Aspirant aspirant = getAspirantByUser(UserUtils.getCurrentUserLogin());
|
|
||||||
return indicatorService.getIndicatorsByCourse(aspirant.getCourse());
|
|
||||||
}
|
|
||||||
|
|
||||||
public Page<Indicator> getIndicatorsByCourse(Pageable pageable) {
|
|
||||||
return indicatorService.getIndicatorsByCourse(pageable);
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,7 +9,7 @@ package ru.ulstu.controller;
|
|||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import ru.ulstu.news.service.NewsService;
|
import ru.ulstu.news.NewsService;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
public class IndexController {
|
public class IndexController {
|
||||||
|
@ -1,18 +0,0 @@
|
|||||||
package ru.ulstu.indicator.model;
|
|
||||||
|
|
||||||
public enum Course {
|
|
||||||
FIRST("первый"),
|
|
||||||
SECOND("второй"),
|
|
||||||
THIRD("третий"),
|
|
||||||
FOURTH("четвертый");
|
|
||||||
|
|
||||||
private final String name;
|
|
||||||
|
|
||||||
Course(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,70 +0,0 @@
|
|||||||
package ru.ulstu.indicator.model;
|
|
||||||
|
|
||||||
import jakarta.persistence.CollectionTable;
|
|
||||||
import jakarta.persistence.ElementCollection;
|
|
||||||
import jakarta.persistence.Entity;
|
|
||||||
import jakarta.persistence.EnumType;
|
|
||||||
import jakarta.persistence.Enumerated;
|
|
||||||
import jakarta.persistence.Lob;
|
|
||||||
import jakarta.validation.constraints.Max;
|
|
||||||
import jakarta.validation.constraints.Min;
|
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import ru.ulstu.model.BaseEntity;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Entity
|
|
||||||
public class Indicator extends BaseEntity {
|
|
||||||
|
|
||||||
@NotBlank
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Min(0)
|
|
||||||
@Max(30)
|
|
||||||
private int max;
|
|
||||||
|
|
||||||
@NotBlank
|
|
||||||
@Lob
|
|
||||||
private String proofDocuments;
|
|
||||||
|
|
||||||
@ElementCollection(targetClass = Course.class)
|
|
||||||
@CollectionTable
|
|
||||||
@Enumerated(EnumType.STRING)
|
|
||||||
private List<Course> courses = new ArrayList<>();
|
|
||||||
|
|
||||||
public Indicator() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getMax() {
|
|
||||||
return max;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMax(int max) {
|
|
||||||
this.max = max;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getProofDocuments() {
|
|
||||||
return proofDocuments;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProofDocuments(String proofDocuments) {
|
|
||||||
this.proofDocuments = proofDocuments;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Course> getCourses() {
|
|
||||||
return courses;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCourses(List<Course> courses) {
|
|
||||||
this.courses = courses;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
package ru.ulstu.indicator.repository;
|
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import org.springframework.data.jpa.repository.Query;
|
|
||||||
import org.springframework.data.repository.query.Param;
|
|
||||||
import ru.ulstu.indicator.model.Course;
|
|
||||||
import ru.ulstu.indicator.model.Indicator;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface IndicatorRepository extends JpaRepository<Indicator, Integer> {
|
|
||||||
Indicator findByName(String name);
|
|
||||||
|
|
||||||
@Query("select i from Indicator i WHERE :course member of i.courses")
|
|
||||||
List<Indicator> findAllByCourse(@Param("course") Course course);
|
|
||||||
}
|
|
@ -1,48 +0,0 @@
|
|||||||
package ru.ulstu.indicator.service;
|
|
||||||
|
|
||||||
import org.springframework.data.domain.Page;
|
|
||||||
import org.springframework.data.domain.Pageable;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import ru.ulstu.admin.model.IndicatorForm;
|
|
||||||
import ru.ulstu.indicator.model.Course;
|
|
||||||
import ru.ulstu.indicator.model.Indicator;
|
|
||||||
import ru.ulstu.indicator.repository.IndicatorRepository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class IndicatorService {
|
|
||||||
private final IndicatorRepository indicatorRepository;
|
|
||||||
|
|
||||||
public IndicatorService(IndicatorRepository indicatorRepository) {
|
|
||||||
this.indicatorRepository = indicatorRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Indicator> getIndicatorList() {
|
|
||||||
return indicatorRepository.findAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void save(Indicator indicator) {
|
|
||||||
indicatorRepository.save(indicator);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Indicator findByName(String name) {
|
|
||||||
return indicatorRepository.findByName(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Indicator getIndicatorById(Integer id) {
|
|
||||||
return indicatorRepository.findById(id).orElseThrow(() -> new RuntimeException("Indicator not found"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteIndicator(IndicatorForm indicatorForm) {
|
|
||||||
indicatorRepository.deleteById(indicatorForm.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Indicator> getIndicatorsByCourse(Course course) {
|
|
||||||
return indicatorRepository.findAllByCourse(course);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Page<Indicator> getIndicatorsByCourse(Pageable pageable) {
|
|
||||||
return indicatorRepository.findAll(pageable);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
package ru.ulstu.manager.model;
|
|
||||||
|
|
||||||
import jakarta.persistence.Entity;
|
|
||||||
import ru.ulstu.admin.model.ManagerForm;
|
|
||||||
import ru.ulstu.model.BaseEntity;
|
|
||||||
|
|
||||||
@Entity
|
|
||||||
public class Manager extends BaseEntity {
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
public Manager() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public Manager(ManagerForm managerForm) {
|
|
||||||
this.name = managerForm.getName();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,7 +0,0 @@
|
|||||||
package ru.ulstu.manager.repository;
|
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
|
||||||
import ru.ulstu.manager.model.Manager;
|
|
||||||
|
|
||||||
public interface ManagerRepository extends JpaRepository<Manager, Integer> {
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
package ru.ulstu.manager.service;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import ru.ulstu.admin.model.ManagerForm;
|
|
||||||
import ru.ulstu.manager.model.Manager;
|
|
||||||
import ru.ulstu.manager.repository.ManagerRepository;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ManagerService {
|
|
||||||
private final ManagerRepository managerRepository;
|
|
||||||
|
|
||||||
public ManagerService(ManagerRepository managerRepository) {
|
|
||||||
this.managerRepository = managerRepository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Manager> getManagers() {
|
|
||||||
return managerRepository.findAll();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Manager getManagerById(Integer id) {
|
|
||||||
return managerRepository.findById(id).orElseThrow(() -> new RuntimeException("Manager not found by id"));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void save(Manager manager) {
|
|
||||||
managerRepository.save(manager);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deleteManager(ManagerForm managerForm) {
|
|
||||||
managerRepository.deleteById(managerForm.getId());
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,7 +9,7 @@ import jakarta.persistence.Transient;
|
|||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
import ru.ulstu.model.BaseEntity;
|
import ru.ulstu.model.BaseEntity;
|
||||||
import ru.ulstu.news.model.News;
|
import ru.ulstu.news.News;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@ import jakarta.validation.constraints.NotNull;
|
|||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import ru.ulstu.news.model.News;
|
import ru.ulstu.news.News;
|
||||||
import ru.ulstu.news.service.NewsService;
|
import ru.ulstu.news.NewsService;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class MeetingService {
|
public class MeetingService {
|
||||||
|
@ -2,7 +2,5 @@ package ru.ulstu.model;
|
|||||||
|
|
||||||
public class UserRoleConstants {
|
public class UserRoleConstants {
|
||||||
public static final String ADMIN = "ROLE_ADMIN";
|
public static final String ADMIN = "ROLE_ADMIN";
|
||||||
public static final String ASPIRANT = "ROLE_ASPIRANT";
|
public static final String USER = "ROLE_USER";
|
||||||
public static final String MANAGER = "ROLE_MANAGER";
|
|
||||||
public static final String HEAD = "ROLE_HEAD";
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package ru.ulstu.news.model;
|
package ru.ulstu.news;
|
||||||
|
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.Lob;
|
import jakarta.persistence.Lob;
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package ru.ulstu.news.controller;
|
package ru.ulstu.news;
|
||||||
|
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
@ -20,8 +20,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import ru.ulstu.model.OffsetablePageRequest;
|
import ru.ulstu.model.OffsetablePageRequest;
|
||||||
import ru.ulstu.model.UserRoleConstants;
|
import ru.ulstu.model.UserRoleConstants;
|
||||||
import ru.ulstu.news.model.News;
|
|
||||||
import ru.ulstu.news.service.NewsService;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
@ -1,9 +1,8 @@
|
|||||||
package ru.ulstu.news.repository;
|
package ru.ulstu.news;
|
||||||
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import ru.ulstu.news.model.News;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package ru.ulstu.news.service;
|
package ru.ulstu.news;
|
||||||
|
|
||||||
import jakarta.transaction.Transactional;
|
import jakarta.transaction.Transactional;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
@ -6,8 +6,6 @@ import org.springframework.data.domain.Page;
|
|||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import ru.ulstu.meeting.Meeting;
|
import ru.ulstu.meeting.Meeting;
|
||||||
import ru.ulstu.news.model.News;
|
|
||||||
import ru.ulstu.news.repository.NewsRepository;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
@ -57,41 +57,18 @@ public class UserService implements UserDetailsService {
|
|||||||
if (getUserByLogin(user.getLogin()) != null) {
|
if (getUserByLogin(user.getLogin()) != null) {
|
||||||
throw new RuntimeException(user.getLogin());
|
throw new RuntimeException(user.getLogin());
|
||||||
}
|
}
|
||||||
User dbUser = (user.getId() == null)
|
|
||||||
? user
|
|
||||||
: getUserById(user.getId());
|
|
||||||
//user.setRoles(Collections.singleton(new UserRole(UserRoleConstants.USER)));
|
//user.setRoles(Collections.singleton(new UserRole(UserRoleConstants.USER)));
|
||||||
dbUser.setPassword(passwordEncoder.encode(user.getPassword()));
|
user.setPassword(passwordEncoder.encode(user.getPassword()));
|
||||||
dbUser.setLogin(user.getLogin());
|
user = userRepository.save(user);
|
||||||
dbUser = userRepository.save(dbUser);
|
log.debug("Created Information for User: {}", user.getLogin());
|
||||||
log.debug("Created Information for User: {}", dbUser.getLogin());
|
return user;
|
||||||
return dbUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
public User getUserById(Integer id) {
|
|
||||||
return userRepository.findById(id).orElseThrow(() -> new RuntimeException("User not found by id"));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createDefaultUser(String login, String userRole) {
|
|
||||||
if (getUserByLogin(login) == null) {
|
|
||||||
UserRole role = userRoleRepository.save(new UserRole(userRole.toString()));
|
|
||||||
createUser(new User(login, login.equals("admin") ? adminPassword : login, Set.of(role)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initDefaultAdmin() {
|
public void initDefaultAdmin() {
|
||||||
createDefaultUser("admin", UserRoleConstants.ADMIN);
|
String adminLogin = "admin";
|
||||||
|
if (getUserByLogin(adminLogin) == null) {
|
||||||
|
UserRole adminRole = userRoleRepository.save(new UserRole(UserRoleConstants.ADMIN));
|
||||||
|
createUser(new User(adminLogin, adminPassword, Set.of(adminRole)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initDefaultAspirant() {
|
|
||||||
createDefaultUser("aspirant", UserRoleConstants.ASPIRANT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initDefaultManager() {
|
|
||||||
createDefaultUser("manager", UserRoleConstants.MANAGER);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initDefaultHead() {
|
|
||||||
createDefaultUser("head", UserRoleConstants.HEAD);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
# You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
# You may use, distribute and modify this code, please write to: romanov73@gmail.com.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
messages.app-name=БРС аспиранта УлГТУ
|
messages.app-name=Cеминар «Анализ данных и процессов». УлГТУ
|
||||||
messages.logo-title=БРС аспиранта УлГТУ
|
messages.logo-title=Cеминар «Анализ данных и процессов»
|
||||||
messages.menu.home=На главную
|
messages.menu.home=На главную
|
Binary file not shown.
@ -1,24 +0,0 @@
|
|||||||
(function($) {
|
|
||||||
$.fn.bootstrapFileInput = function(loadDirectory = false) {
|
|
||||||
var fileInput = $('<input type="file" class="input-ghost" ' + (loadDirectory ? 'webkitdirectory' : '') +' style="visibility:hidden; height:0">');
|
|
||||||
fileInput.change(function() {
|
|
||||||
$('#file-input-list').html('');
|
|
||||||
const files = $(this).prop('files');
|
|
||||||
if (files.length == 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var filesList = '';
|
|
||||||
$.each(files, function(index, file){
|
|
||||||
filesList += '<div style="overflow: hidden"><span id="file-' + index + '"><i class="fa fa-circle-o"></i> ' + file.name + '</span></div>';
|
|
||||||
});
|
|
||||||
$('#file-input-list').html(filesList);
|
|
||||||
});
|
|
||||||
$(this).find('button.btn-choose').click(function() {
|
|
||||||
fileInput.click();
|
|
||||||
});
|
|
||||||
$(this).find('input').mousedown(function() {
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
$(this).append(fileInput);
|
|
||||||
};
|
|
||||||
})(jQuery);
|
|
@ -1,17 +0,0 @@
|
|||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
|
||||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
|
|
||||||
layout:decorate="~{default}">
|
|
||||||
<div class="container" layout:fragment="content">
|
|
||||||
<a href="/admin/editAspirant/0" class="btn btn-outline-dark">
|
|
||||||
<i class="fa fa-plus-square" aria-hidden="true"> Добавить аспиранта</i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li th:each="a : ${aspirants}">
|
|
||||||
<a th:href="@{'/admin/editAspirant/' + ${a.id}}">
|
|
||||||
<span th:text="${a.surname} + ' '+ ${a.name} + ' ' + ${a.patronymic}"></span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</html>
|
|
@ -1,112 +0,0 @@
|
|||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
|
||||||
<html
|
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
|
|
||||||
layout:decorate="~{default}">
|
|
||||||
<div class="container" layout:fragment="content">
|
|
||||||
<h3>Редактирование аспиранта:</h3>
|
|
||||||
<form action="#" th:action="@{/admin/saveAspirant}"
|
|
||||||
th:object="${aspirant}"
|
|
||||||
method="post">
|
|
||||||
<input type="hidden" th:field="*{id}">
|
|
||||||
<input type="hidden" th:field="*{userId}">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="surname">Фамилия</label>
|
|
||||||
<input th:field="*{surname}"
|
|
||||||
id="surname"
|
|
||||||
type="text"
|
|
||||||
required
|
|
||||||
class="form-control"
|
|
||||||
placeholder="Фамилия">
|
|
||||||
<p th:if="${#fields.hasErrors('surname')}"
|
|
||||||
th:class="${#fields.hasErrors('surname')}? error">
|
|
||||||
Не может быть пустым
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="name">Имя</label>
|
|
||||||
<input th:field="*{name}"
|
|
||||||
id="name"
|
|
||||||
type="text"
|
|
||||||
required
|
|
||||||
class="form-control"
|
|
||||||
placeholder="Имя">
|
|
||||||
<p th:if="${#fields.hasErrors('name')}"
|
|
||||||
th:class="${#fields.hasErrors('name')}? error">
|
|
||||||
Не может быть пустым
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="patronymic">Отчество</label>
|
|
||||||
<input th:field="*{patronymic}"
|
|
||||||
id="patronymic"
|
|
||||||
type="text"
|
|
||||||
class="form-control"
|
|
||||||
placeholder="Отчество">
|
|
||||||
<p th:if="${#fields.hasErrors('patronymic')}"
|
|
||||||
th:class="${#fields.hasErrors('patronymic')}? error">
|
|
||||||
Не может быть пустым
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="email">Email</label>
|
|
||||||
<input th:field="*{email}"
|
|
||||||
id="email"
|
|
||||||
required
|
|
||||||
type="email"
|
|
||||||
class="form-control"
|
|
||||||
placeholder="Email">
|
|
||||||
<p th:if="${#fields.hasErrors('email')}"
|
|
||||||
th:class="${#fields.hasErrors('email')}? error">
|
|
||||||
Не может быть пустым
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="course">Курс</label>
|
|
||||||
<select class="form-select form-control"
|
|
||||||
id="course" aria-label="multiple select example"
|
|
||||||
th:field="*{course}">
|
|
||||||
<option th:each="c : ${courses}"
|
|
||||||
th:value="${c}"
|
|
||||||
th:text="${c.name}">
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="theme">Тема</label>
|
|
||||||
<input th:field="*{theme}"
|
|
||||||
id="theme"
|
|
||||||
type="text"
|
|
||||||
class="form-control"
|
|
||||||
placeholder="Тема">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="manager">Научный руководитель</label>
|
|
||||||
<select class="form-select form-control"
|
|
||||||
id="manager" aria-label="select example"
|
|
||||||
th:field="*{managerId}">
|
|
||||||
<option th:each="m : ${managers}"
|
|
||||||
th:value="${m.id}"
|
|
||||||
th:text="${m.name}">
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
|
|
||||||
<button name="delete"
|
|
||||||
type="submit"
|
|
||||||
class="btn btn-outline-dark"
|
|
||||||
onclick="return confirm('Удалить запись?')">
|
|
||||||
Удалить
|
|
||||||
</button>
|
|
||||||
<a href="/admin/aspirants" class="btn btn-outline-dark">Отмена</a>
|
|
||||||
</form>
|
|
||||||
<link rel="stylesheet" href="/webjars/font-awesome/4.7.0/css/font-awesome.min.css"/>
|
|
||||||
<link rel="stylesheet" href="/webjars/bootstrap-glyphicons/bdd2cbfba0/css/bootstrap-glyphicons.css"/>
|
|
||||||
</div>
|
|
||||||
</html>
|
|
@ -1,76 +0,0 @@
|
|||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
|
||||||
<html
|
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
|
|
||||||
layout:decorate="~{default}">
|
|
||||||
<div class="container" layout:fragment="content">
|
|
||||||
<h3>Редактирование показателя:</h3>
|
|
||||||
<form action="#" th:action="@{/admin/saveIndicator}"
|
|
||||||
th:object="${indicator}"
|
|
||||||
method="post"
|
|
||||||
enctype="multipart/form-data">
|
|
||||||
<input type="hidden" th:field="*{id}">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="name">Название</label>
|
|
||||||
<input th:field="*{name}"
|
|
||||||
id="name"
|
|
||||||
type="text"
|
|
||||||
required
|
|
||||||
class="form-control"
|
|
||||||
placeholder="Название показателя">
|
|
||||||
<p th:if="${#fields.hasErrors('name')}"
|
|
||||||
th:class="${#fields.hasErrors('name')}? error">
|
|
||||||
Не может быть пустым
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="name">Максимальная сумма баллов</label>
|
|
||||||
<input th:field="*{max}"
|
|
||||||
required
|
|
||||||
id="max"
|
|
||||||
type="number"
|
|
||||||
class="form-control"
|
|
||||||
min="0"
|
|
||||||
max="30">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="name">Описание подтверждающих документов</label>
|
|
||||||
<textarea th:field="*{proofDocuments}"
|
|
||||||
required
|
|
||||||
id="proofDocuments"
|
|
||||||
class="form-control"
|
|
||||||
placeholder="Описание подтверждающих документов"
|
|
||||||
style="height: 100px">
|
|
||||||
</textarea>
|
|
||||||
<p th:if="${#fields.hasErrors('proofDocuments')}"
|
|
||||||
th:class="${#fields.hasErrors('proofDocuments')}? error">
|
|
||||||
Не может быть пустым
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="courses">Для каких курсов применяется</label>
|
|
||||||
|
|
||||||
<select class="form-select form-control" id="courses" multiple aria-label="multiple select example"
|
|
||||||
th:field="*{courses}"
|
|
||||||
>
|
|
||||||
<option th:each="c : ${courses}"
|
|
||||||
th:value="${c}"
|
|
||||||
th:text="${c.name}">
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
|
|
||||||
<button name="delete"
|
|
||||||
type="submit"
|
|
||||||
class="btn btn-outline-dark"
|
|
||||||
onclick="return confirm('Удалить показатель?')">
|
|
||||||
Удалить
|
|
||||||
</button>
|
|
||||||
<a href="/admin/indicators" class="btn btn-outline-dark">Отмена</a>
|
|
||||||
</form>
|
|
||||||
<link rel="stylesheet" href="/webjars/font-awesome/4.7.0/css/font-awesome.min.css"/>
|
|
||||||
<link rel="stylesheet" href="/webjars/bootstrap-glyphicons/bdd2cbfba0/css/bootstrap-glyphicons.css"/>
|
|
||||||
</div>
|
|
||||||
</html>
|
|
@ -1,37 +0,0 @@
|
|||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
|
||||||
<html
|
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
|
|
||||||
layout:decorate="~{default}">
|
|
||||||
<div class="container" layout:fragment="content">
|
|
||||||
<h3>Редактирование научного руководителя:</h3>
|
|
||||||
<form action="#" th:action="@{/admin/saveManager}"
|
|
||||||
th:object="${manager}"
|
|
||||||
method="post">
|
|
||||||
<input type="hidden" th:field="*{id}">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="name">ФИО</label>
|
|
||||||
<input th:field="*{name}"
|
|
||||||
id="name"
|
|
||||||
type="text"
|
|
||||||
required
|
|
||||||
class="form-control"
|
|
||||||
placeholder="ФИО">
|
|
||||||
<p th:if="${#fields.hasErrors('name')}"
|
|
||||||
th:class="${#fields.hasErrors('name')}? error">
|
|
||||||
Не может быть пустым
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
|
|
||||||
<button name="delete"
|
|
||||||
type="submit"
|
|
||||||
class="btn btn-outline-dark"
|
|
||||||
onclick="return confirm('Удалить запись?')">
|
|
||||||
Удалить
|
|
||||||
</button>
|
|
||||||
<a href="/admin/aspirants" class="btn btn-outline-dark">Отмена</a>
|
|
||||||
</form>
|
|
||||||
<link rel="stylesheet" href="/webjars/font-awesome/4.7.0/css/font-awesome.min.css"/>
|
|
||||||
<link rel="stylesheet" href="/webjars/bootstrap-glyphicons/bdd2cbfba0/css/bootstrap-glyphicons.css"/>
|
|
||||||
</div>
|
|
||||||
</html>
|
|
@ -1,15 +0,0 @@
|
|||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
|
||||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
|
|
||||||
layout:decorate="~{default}">
|
|
||||||
<div class="container" layout:fragment="content">
|
|
||||||
<a href="/admin/editIndicator/0" class="btn btn-outline-dark">
|
|
||||||
<i class="fa fa-plus-square" aria-hidden="true"> Добавить показатель</i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li th:each="i : ${indicators}">
|
|
||||||
<a th:href="@{'/admin/editIndicator/' + ${i.id}}"><span th:text="${i.name}"></span></a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</html>
|
|
@ -1,17 +0,0 @@
|
|||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
|
||||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
|
|
||||||
layout:decorate="~{default}">
|
|
||||||
<div class="container" layout:fragment="content">
|
|
||||||
<a href="/admin/editManager/0" class="btn btn-outline-dark">
|
|
||||||
<i class="fa fa-plus-square" aria-hidden="true"> Добавить научного руководителя</i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<ul>
|
|
||||||
<li th:each="m : ${managers}">
|
|
||||||
<a th:href="@{'/admin/editManager/' + ${m.id}}">
|
|
||||||
<span th:text="${m.name}"></span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</html>
|
|
@ -1,114 +0,0 @@
|
|||||||
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
|
|
||||||
<html
|
|
||||||
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:th="http://www.w3.org/1999/xhtml"
|
|
||||||
layout:decorate="~{default}">
|
|
||||||
<div class="container" layout:fragment="content">
|
|
||||||
<h3 th:text="${'Редактирование отчета аспиранта '} +${report.createDate}"></h3>
|
|
||||||
<form action="#" th:action="@{/aspirant/saveReport}"
|
|
||||||
th:object="${report}"
|
|
||||||
method="post">
|
|
||||||
<input type="hidden" th:field="*{id}">
|
|
||||||
|
|
||||||
<div class="form-group" th:each="i, ind : ${indicators}">
|
|
||||||
<label th:text="${i.name}"></label>
|
|
||||||
<div class="form-group">
|
|
||||||
<button class="form-control btn btn-danger" type="button" onclick="deleteAllFiles();">Удалить все
|
|
||||||
документы
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div id="input-file" class="form-group">
|
|
||||||
<button class="btn btn-primary btn-upload btn-choose pull-right" type="button">Обзор</button>
|
|
||||||
<button class="btn btn-success btn-upload" type="button" onclick="uploadFile();">Загрузить</button>
|
|
||||||
</div>
|
|
||||||
<div id="file-input-list" class="form-group">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<th:block layout:fragment="scripts">
|
|
||||||
<script src="/js/bootstrap.file-input.js"></script>
|
|
||||||
<script th:inline="javascript">
|
|
||||||
/*<![CDATA[*/
|
|
||||||
$(document).ready(function() {
|
|
||||||
uploadFile = function(index = 0) {
|
|
||||||
const files = $('#input-file .input-ghost').prop('files');
|
|
||||||
if (index == 0) {
|
|
||||||
showFeedbackMessage();
|
|
||||||
$('button').prop('disabled', true);
|
|
||||||
}
|
|
||||||
if (index >= files.length) {
|
|
||||||
$('button').prop('disabled', false);
|
|
||||||
$('#input-file .input-ghost').val('');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
$('#file-' + index + ' i').removeClass('fa-circle-o').addClass('fa-circle-o-notch fa-spin');
|
|
||||||
$('#file-' + index).removeClass('alert-danger alert-success');
|
|
||||||
var response = false;
|
|
||||||
var formData = new FormData();
|
|
||||||
formData.append('file', files[index]);
|
|
||||||
uploadAjax('api/1.0/documents.upload', formData,
|
|
||||||
(result) => {
|
|
||||||
if (!result) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
response = result.response;
|
|
||||||
},
|
|
||||||
null,
|
|
||||||
() => {
|
|
||||||
var resultIcon = 'fa-times-circle-o';
|
|
||||||
var resultStyle = 'alert-danger';
|
|
||||||
if (response) {
|
|
||||||
resultIcon = 'fa-check-circle-o';
|
|
||||||
resultStyle = 'alert-success';
|
|
||||||
}
|
|
||||||
$('#file-' + index + ' i').removeClass('fa-circle-o-notch fa-spin').addClass(resultIcon);
|
|
||||||
$('#file-' + index).addClass(resultStyle);
|
|
||||||
uploadFile(index + 1);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
deleteAllFiles = function() {
|
|
||||||
$('#file-input-list').html('');
|
|
||||||
//input.replaceWith(input = input.val('').clone(true));
|
|
||||||
$('#spinner').show()
|
|
||||||
getAjax('api/1.0/documents.delete_all',
|
|
||||||
(result) => {
|
|
||||||
if (result.response) {
|
|
||||||
showFeedbackMessage('Удалено ' + result.response + ' документов');
|
|
||||||
}
|
|
||||||
if (result.error) {
|
|
||||||
showFeedbackMessage(result.error, 'danger');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
null,
|
|
||||||
() => $('#spinner').hide(),
|
|
||||||
'DELETE'
|
|
||||||
);
|
|
||||||
};
|
|
||||||
$('#input-file').bootstrapFileInput(true);
|
|
||||||
});
|
|
||||||
/*]]>*/
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</th:block>
|
|
||||||
|
|
||||||
<button name="save" type="submit" class="btn btn-outline-dark">Сохранить</button>
|
|
||||||
<button name="delete"
|
|
||||||
type="submit"
|
|
||||||
class="btn btn-outline-dark"
|
|
||||||
onclick="return confirm('Удалить запись?')">
|
|
||||||
Удалить
|
|
||||||
</button>
|
|
||||||
<a href="/aspirant/reports" class="btn btn-outline-dark">Отмена</a>
|
|
||||||
</form>
|
|
||||||
<div th:if="${indicators.totalPages > 0}" class="pagination">
|
|
||||||
<span style="float: left; padding: 5px 5px;">Страницы:</span>
|
|
||||||
</div>
|
|
||||||
<div th:if="${indicators.totalPages > 0}" class="pagination"
|
|
||||||
th:each="pageNumber : ${pageNumbers}">
|
|
||||||
<a th:href="@{/aspirant/aspirantReport(size=${indicators.size}, page=${pageNumber})}"
|
|
||||||
th:text=${pageNumber}
|
|
||||||
th:class="${pageNumber == indicators.number+1} ? active"></a>
|
|
||||||
</div>
|
|
||||||
<link rel="stylesheet" href="/webjars/font-awesome/4.7.0/css/font-awesome.min.css"/>
|
|
||||||
<link rel="stylesheet" href="/webjars/bootstrap-glyphicons/bdd2cbfba0/css/bootstrap-glyphicons.css"/>
|
|
||||||
</div>
|
|
||||||
</html>
|
|
@ -30,58 +30,25 @@
|
|||||||
<a class="nav-link" href="/news/news">Новости</a>
|
<a class="nav-link" href="/news/news">Новости</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="/docs">Документы</a>
|
<a class="nav-link" href="/meetings/meetings">Заседания</a>
|
||||||
</li>
|
|
||||||
<li class="nav-item dropdown" sec:authorize="hasRole('ROLE_ASPIRANT')">
|
|
||||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
|
|
||||||
aria-haspopup="true" aria-expanded="false">Аспиранту</a>
|
|
||||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
|
||||||
<a class="dropdown-item" href="/aspirant/aspirantReport">Новый отчет аспиранта по БРС</a>
|
|
||||||
<a class="dropdown-item" href="/aspirant/listAspirantReports">Список отчетов</a>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item dropdown" sec:authorize="hasRole('ROLE_MANAGER')">
|
|
||||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
|
|
||||||
aria-haspopup="true" aria-expanded="false">Руководителю</a>
|
|
||||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
|
||||||
<a class="dropdown-item" href="/aspirantList">Список аспирантов</a>
|
|
||||||
<a class="dropdown-item" href="/listAspirantReports">Список отчетов</a>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item dropdown" sec:authorize="hasRole('ROLE_HEAD')">
|
|
||||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
|
|
||||||
aria-haspopup="true" aria-expanded="false">Аспирантура</a>
|
|
||||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
|
||||||
<a class="dropdown-item" href="/listAspirantReports">Список отчетов</a>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item dropdown" sec:authorize="hasRole('ROLE_ADMIN')">
|
|
||||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-toggle="dropdown"
|
|
||||||
aria-haspopup="true" aria-expanded="false">Администратору</a>
|
|
||||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
|
||||||
<a class="dropdown-item" href="/admin/indicators">Список показателей</a>
|
|
||||||
<a class="dropdown-item" href="/admin/managers">Список научных руководителей</a>
|
|
||||||
<a class="dropdown-item" href="/admin/aspirants">Список аспирантов</a>
|
|
||||||
<a class="dropdown-item" href="/admin">Новости и заседания</a>
|
|
||||||
</div>
|
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link disabled" href="#" sec:authorize="hasRole('ROLE_ADMIN')">Личный кабинет
|
<a class="nav-link" href="/organizers">Организаторы</a>
|
||||||
администратора</a>
|
</li>
|
||||||
<a class="nav-link disabled" href="#" sec:authorize="hasRole('ROLE_ASPIRANT')">Личный кабинет
|
<li class="nav-item">
|
||||||
аспиранта</a>
|
<a class="nav-link" href="/docs">Документы</a>
|
||||||
<a class="nav-link disabled" href="#" sec:authorize="hasRole('ROLE_MANAGER')">Личный кабинет
|
</li>
|
||||||
руководителя аспиранта</a>
|
<li class="nav-item">
|
||||||
<a class="nav-link disabled" href="#" sec:authorize="hasRole('ROLE_HEAD')">Личный кабинет
|
<a class="nav-link" href="/reports">Отчеты</a>
|
||||||
представителя аспирантуры</a>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="/admin">Администратору</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<div sec:authorize="isAuthenticated()">
|
<div sec:authorize="isAuthenticated()">
|
||||||
<a class="nav-link" href="/logout">Выход</a>
|
<a class="nav-link" href="/logout">Выход</a>
|
||||||
</div>
|
</div>
|
||||||
<div sec:authorize="!isAuthenticated()">
|
|
||||||
<a class="nav-link" href="/login">Личный кабинет</a>
|
|
||||||
</div>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -124,7 +91,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<footer>
|
<footer>
|
||||||
2025
|
2022
|
||||||
</footer>
|
</footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -3,8 +3,13 @@
|
|||||||
<div class="container" layout:fragment="content">
|
<div class="container" layout:fragment="content">
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<a class="link-dark" target="_blank" href="/docs/polozh.pdf">
|
<a class="link-dark" href="/docs/polozh.docx">
|
||||||
Положение о балльно-рейтинговой системе оценки успеваемости аспирантов
|
Положение
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<a class="link-dark" href="/docs/plan2022.docx">
|
||||||
|
План заседаний на 2022 год.
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -45,5 +45,6 @@
|
|||||||
th:text=${pageNumber}
|
th:text=${pageNumber}
|
||||||
th:class="${pageNumber == news.number+1} ? active"></a>
|
th:class="${pageNumber == news.number+1} ? active"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</html>
|
</html>
|
||||||
|
BIN
upload/1647261445926
Normal file
BIN
upload/1647261445926
Normal file
Binary file not shown.
After Width: | Height: | Size: 99 KiB |
BIN
upload/1647262081164
Normal file
BIN
upload/1647262081164
Normal file
Binary file not shown.
After Width: | Height: | Size: 182 KiB |
58
upload/1647262775259
Normal file
58
upload/1647262775259
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
version="1.1"
|
||||||
|
width="1000"
|
||||||
|
height="1000"
|
||||||
|
viewBox="0 0 500 500"
|
||||||
|
xml:space="preserve"
|
||||||
|
id="svg45"
|
||||||
|
sodipodi:docname="IS_logo_black.svg"
|
||||||
|
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||||
|
id="namedview47"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pagecheckerboard="true"
|
||||||
|
showgrid="false"
|
||||||
|
showborder="false"
|
||||||
|
inkscape:zoom="0.769"
|
||||||
|
inkscape:cx="500"
|
||||||
|
inkscape:cy="500"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="991"
|
||||||
|
inkscape:window-x="-9"
|
||||||
|
inkscape:window-y="-9"
|
||||||
|
inkscape:window-maximized="1"
|
||||||
|
inkscape:current-layer="svg45" />
|
||||||
|
<desc
|
||||||
|
id="desc29">Created with Fabric.js 4.6.0</desc>
|
||||||
|
<defs
|
||||||
|
id="defs31">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</defs>
|
||||||
|
<path
|
||||||
|
id="path33"
|
||||||
|
style="fill:#000000;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
|
||||||
|
d="M 614.48828 177.41406 C 585.03403 177.64615 555.102 180 528 180 C 509.268 180 474.11592 173.20281 457.41992 181.83789 C 441.12592 190.26483 422.34 188.47467 404 190.33789 C 365.3278 194.26683 326.787 197.16411 288 199.82031 C 261.38 201.64331 230.50279 201.95901 212.77539 226.25781 C 196.16547 249.02541 217.5264 250.08661 219.7832 270.00781 C 223.4616 302.47861 220 337.3084 220 370 C 220 424.688 216.64862 482.378 228.69922 536 C 234.13282 560.178 241.07448 585.21445 258.58008 603.81445 C 286.96128 633.96645 327.183 628.83584 364 632.33984 C 434.958 639.09184 507.266 629.02169 578 624.17969 C 620.728 621.25169 671.094 620.42538 710 600.35938 C 785.886 561.21938 770.028 472.564 770 402 C 769.978 343.7938 783.18837 263.01536 746.73438 213.03516 C 735.77437 198.01096 714.65742 193.13757 698.10742 187.56055 C 672.91842 179.07202 643.94253 177.18197 614.48828 177.41406 z M 451.28516 278.24414 C 508.18157 277.94477 575.51534 292.60888 617.99609 321.03906 C 665.52009 352.84446 673.38009 409.60016 625.99609 446.66016 C 609.19809 459.79816 583.47409 470.56595 561.99609 465.75195 C 553.62409 463.87395 546.58609 456.87805 537.99609 456.49805 C 522.09609 455.79605 512.77609 463.8217 495.99609 456.5957 C 476.36009 448.1397 462.80717 414.5508 471.20117 394.2168 C 474.36317 386.5588 491.70145 379.35103 497.93945 387.20703 C 508.38745 400.36503 494.40964 432.52702 516.18164 440.79102 C 530.60964 446.26702 534.58192 411.00817 555.66992 414.32617 C 563.02792 415.48417 559.99497 424.656 562.04297 430 C 565.00297 437.722 572.19609 445.56767 579.99609 448.51367 C 613.82609 461.29167 642.2743 406.694 629.9043 380 C 614.3683 346.4774 578.65809 326.98059 545.99609 313.90039 C 482.01609 288.27899 396.70598 263.8648 347.51758 330 C 318.46498 369.0616 331.97353 426.708 360.51953 462 C 409.14233 522.116 497.53009 557.79392 573.99609 553.91992 C 589.34209 553.14192 620.65517 534.20281 630.95117 522.88281 C 639.49717 513.48281 642.08522 495.18492 661.69922 503.79492 C 677.95722 510.93492 656.70214 530.07166 649.99414 535.34766 C 623.11814 556.49766 583.00409 562 549.99609 562 C 468.35409 562 372.36956 530.03 324.10156 460 C 268.98216 380.028 324.58909 293.80382 413.99609 280.85742 C 425.58059 279.17993 438.15521 278.31323 451.28516 278.24414 z "
|
||||||
|
transform="scale(0.5)" />
|
||||||
|
|
||||||
|
<path
|
||||||
|
id="path39"
|
||||||
|
style="fill:#000000;fill-rule:nonzero;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0"
|
||||||
|
d="M 668.33594 643.47656 C 662.50706 643.55654 656.40463 644.00634 650 644.84766 C 557.68 656.97566 466.83 659.8418 374 659.8418 C 334.445 659.8418 285.9012 644.14103 248 660.95703 C 236.5832 666.02303 220.35223 674.28205 214.67383 685.99805 C 208.78323 698.15205 227.05259 701.474 224.27539 714 C 219.13139 737.202 163.19081 780.43105 192.00977 796.62305 C 213.03631 808.43705 243.23832 802.31272 265.85352 808.63672 C 272.15212 810.39872 271.30588 817.50928 276.70508 819.36328 C 297.12228 826.37328 330.3592 820 352 820 L 522 820 C 564.108 820 614.34895 827.63112 655.62695 819.70312 C 662.58095 818.36712 661.85506 809.62887 670.03906 808.29688 C 720.71106 800.04488 767.32912 814.45956 813.70312 783.85156 C 829.97513 773.11156 793.83588 738.344 786.17188 726 C 755.44819 676.52238 724.68174 642.70346 668.33594 643.47656 z M 632.96094 696.08594 C 656.9772 696.33526 670.5987 710.58 684.6582 732 C 687.2762 735.988 699.90202 751.25736 696.16602 755.94336 C 692.75802 760.21936 680.742 757.31823 676 757.49023 C 655.976 758.22223 636.016 761.75419 616 761.99219 C 537.304 762.92819 456.724 769.21231 378 763.82031 C 355.2814 762.26631 332.628 759.24231 310 756.57031 C 305.7648 756.07031 289.0863 758.23892 287.8125 752.79492 C 284.9009 740.34892 309.79135 708.10719 322.00195 708.11719 C 423.72835 708.20119 520.668 711.33947 622 696.85547 C 625.88675 696.29997 629.53004 696.05032 632.96094 696.08594 z "
|
||||||
|
transform="scale(0.5)" />
|
||||||
|
|
||||||
|
</svg>
|
After Width: | Height: | Size: 5.1 KiB |
0
upload/1647262911771
Normal file
0
upload/1647262911771
Normal file
0
upload/1647262925015
Normal file
0
upload/1647262925015
Normal file
Loading…
Reference in New Issue
Block a user