|
|
@ -15,12 +15,10 @@ import ru.ulstu.conference.model.ConferenceFilterDto;
|
|
|
|
import ru.ulstu.conference.model.ConferenceUser;
|
|
|
|
import ru.ulstu.conference.model.ConferenceUser;
|
|
|
|
import ru.ulstu.conference.service.ConferenceService;
|
|
|
|
import ru.ulstu.conference.service.ConferenceService;
|
|
|
|
import ru.ulstu.deadline.model.Deadline;
|
|
|
|
import ru.ulstu.deadline.model.Deadline;
|
|
|
|
import ru.ulstu.paper.model.Paper;
|
|
|
|
|
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
import javax.validation.Valid;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
|
@ -49,14 +47,9 @@ public class ConferenceController {
|
|
|
|
@GetMapping("/conference")
|
|
|
|
@GetMapping("/conference")
|
|
|
|
public void getConference(ModelMap modelMap, @RequestParam(value = "id") Integer id) {
|
|
|
|
public void getConference(ModelMap modelMap, @RequestParam(value = "id") Integer id) {
|
|
|
|
if (id != null && id > 0) {
|
|
|
|
if (id != null && id > 0) {
|
|
|
|
ConferenceDto conferenceDto = conferenceService.findOneDto(id);
|
|
|
|
modelMap.put("conferenceDto", conferenceService.getExistConferenceById(id));
|
|
|
|
conferenceDto.setNotSelectedPapers(getNotSelectPapers(conferenceDto.getPaperIds()));
|
|
|
|
|
|
|
|
conferenceDto.setDisabledTakePart(isCurrentUserParticipant(conferenceDto.getUsers()));
|
|
|
|
|
|
|
|
modelMap.put("conferenceDto", conferenceDto);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ConferenceDto conferenceDto = new ConferenceDto();
|
|
|
|
modelMap.put("conferenceDto", conferenceService.getNewConference());
|
|
|
|
conferenceDto.setNotSelectedPapers(getNotSelectPapers(new ArrayList<Integer>()));
|
|
|
|
|
|
|
|
modelMap.put("conferenceDto", conferenceDto);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -116,14 +109,6 @@ public class ConferenceController {
|
|
|
|
return CONFERENCE_PAGE;
|
|
|
|
return CONFERENCE_PAGE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<Paper> getNotSelectPapers(List<Integer> paperIds) {
|
|
|
|
|
|
|
|
return conferenceService.getConferencePapers(paperIds);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isCurrentUserParticipant(List<ConferenceUser> conferenceUsers) {
|
|
|
|
|
|
|
|
return conferenceService.isCurrentUserParticipant(conferenceUsers);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ModelAttribute("allParticipation")
|
|
|
|
@ModelAttribute("allParticipation")
|
|
|
|
public List<ConferenceUser.Participation> getAllParticipation() {
|
|
|
|
public List<ConferenceUser.Participation> getAllParticipation() {
|
|
|
|
return conferenceService.getAllParticipations();
|
|
|
|
return conferenceService.getAllParticipations();
|
|
|
|