diff --git a/src/main/java/ru/ulstu/grant/service/GrantService.java b/src/main/java/ru/ulstu/grant/service/GrantService.java index 83ef49e..45f9b2f 100644 --- a/src/main/java/ru/ulstu/grant/service/GrantService.java +++ b/src/main/java/ru/ulstu/grant/service/GrantService.java @@ -11,6 +11,7 @@ import ru.ulstu.grant.model.Grant; import ru.ulstu.grant.model.GrantDto; import ru.ulstu.grant.repository.GrantRepository; import ru.ulstu.paper.model.Paper; +import ru.ulstu.paper.model.PaperDto; import ru.ulstu.paper.service.PaperService; import ru.ulstu.project.model.Project; import ru.ulstu.project.model.ProjectDto; @@ -34,7 +35,7 @@ import static ru.ulstu.grant.model.Grant.GrantStatus.APPLICATION; @Service public class GrantService { - private final static int MAX_DISPLAY_SIZE = 40; + private final static int MAX_DISPLAY_SIZE = 50; private final GrantRepository grantRepository; private final ProjectService projectService; @@ -210,17 +211,16 @@ public class GrantService { .collect(toList()); } - public List getGrantPapers(List paperIds) { + public List getGrantPapers(List paperIds) { return paperService.findAllSelect(paperIds); - - } - - public List getAllPapers() { - return paperService.findAll(); } - public List getAllUncompletedPapers() { - return paperService.findAllNotCompleted(); + public List getAllUncompletedPapers() { + List papers = paperService.findAllNotCompleted(); + papers.stream() + .forEach(paper -> + paper.setTitle(StringUtils.abbreviate(paper.getTitle(), MAX_DISPLAY_SIZE))); + return papers; } public void attachPaper(GrantDto grantDto) {