#121 reduce paper title
This commit is contained in:
parent
e1907d3169
commit
99ec7af319
@ -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<Paper> getGrantPapers(List<Integer> paperIds) {
|
||||
public List<PaperDto> getGrantPapers(List<Integer> paperIds) {
|
||||
return paperService.findAllSelect(paperIds);
|
||||
|
||||
}
|
||||
|
||||
public List<Paper> getAllPapers() {
|
||||
return paperService.findAll();
|
||||
}
|
||||
|
||||
public List<Paper> getAllUncompletedPapers() {
|
||||
return paperService.findAllNotCompleted();
|
||||
public List<PaperDto> getAllUncompletedPapers() {
|
||||
List<PaperDto> papers = paperService.findAllNotCompleted();
|
||||
papers.stream()
|
||||
.forEach(paper ->
|
||||
paper.setTitle(StringUtils.abbreviate(paper.getTitle(), MAX_DISPLAY_SIZE)));
|
||||
return papers;
|
||||
}
|
||||
|
||||
public void attachPaper(GrantDto grantDto) {
|
||||
|
Loading…
Reference in New Issue
Block a user