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