#109 only uncompleted for grant
This commit is contained in:
parent
2dff183662
commit
dffd839905
@ -132,7 +132,7 @@ public class GrantController {
|
|||||||
|
|
||||||
@ModelAttribute("allPapers")
|
@ModelAttribute("allPapers")
|
||||||
public List<Paper> getAllPapers() {
|
public List<Paper> getAllPapers() {
|
||||||
return grantService.getAllPapers();
|
return grantService.getAllUncompletedPapers();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void filterEmptyDeadlines(GrantDto grantDto) {
|
private void filterEmptyDeadlines(GrantDto grantDto) {
|
||||||
|
@ -196,6 +196,10 @@ public class GrantService {
|
|||||||
return paperService.findAll();
|
return paperService.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Paper> getAllUncompletedPapers() {
|
||||||
|
return paperService.findAllNotCompleted();
|
||||||
|
}
|
||||||
|
|
||||||
public void attachPaper(GrantDto grantDto) {
|
public void attachPaper(GrantDto grantDto) {
|
||||||
if (!grantDto.getPaperIds().isEmpty()) {
|
if (!grantDto.getPaperIds().isEmpty()) {
|
||||||
grantDto.getPapers().clear();
|
grantDto.getPapers().clear();
|
||||||
|
@ -18,4 +18,6 @@ public interface PaperRepository extends JpaRepository<Paper, Integer> {
|
|||||||
List<Paper> findAllByIdIn(List<Integer> paperIds);
|
List<Paper> findAllByIdIn(List<Integer> paperIds);
|
||||||
|
|
||||||
List<Paper> findByTypeAndStatus(Paper.PaperType type, Paper.PaperStatus status);
|
List<Paper> findByTypeAndStatus(Paper.PaperType type, Paper.PaperStatus status);
|
||||||
|
|
||||||
|
List<Paper> findByStatusNot(Paper.PaperStatus status);
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,10 @@ public class PaperService {
|
|||||||
} else {
|
} else {
|
||||||
return sortPapers(paperRepository.findAll());
|
return sortPapers(paperRepository.findAll());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Paper> findAllNotCompleted() {
|
||||||
|
return paperRepository.findByStatusNot(COMPLETED);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Paper> findAllSelect(List<Integer> paperIds) {
|
public List<Paper> findAllSelect(List<Integer> paperIds) {
|
||||||
|
Loading…
Reference in New Issue
Block a user