#121 reduce paper title

This commit is contained in:
T-Midnight 2019-05-12 15:30:09 +04:00
parent e1907d3169
commit 99ec7af319

View File

@ -11,6 +11,7 @@ import ru.ulstu.grant.model.Grant;
import ru.ulstu.grant.model.GrantDto; import ru.ulstu.grant.model.GrantDto;
import ru.ulstu.grant.repository.GrantRepository; import ru.ulstu.grant.repository.GrantRepository;
import ru.ulstu.paper.model.Paper; import ru.ulstu.paper.model.Paper;
import ru.ulstu.paper.model.PaperDto;
import ru.ulstu.paper.service.PaperService; import ru.ulstu.paper.service.PaperService;
import ru.ulstu.project.model.Project; import ru.ulstu.project.model.Project;
import ru.ulstu.project.model.ProjectDto; import ru.ulstu.project.model.ProjectDto;
@ -34,7 +35,7 @@ import static ru.ulstu.grant.model.Grant.GrantStatus.APPLICATION;
@Service @Service
public class GrantService { 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 GrantRepository grantRepository;
private final ProjectService projectService; private final ProjectService projectService;
@ -210,17 +211,16 @@ public class GrantService {
.collect(toList()); .collect(toList());
} }
public List<Paper> getGrantPapers(List<Integer> paperIds) { public List<PaperDto> getGrantPapers(List<Integer> paperIds) {
return paperService.findAllSelect(paperIds); return paperService.findAllSelect(paperIds);
} }
public List<Paper> getAllPapers() { public List<PaperDto> getAllUncompletedPapers() {
return paperService.findAll(); List<PaperDto> papers = paperService.findAllNotCompleted();
} papers.stream()
.forEach(paper ->
public List<Paper> getAllUncompletedPapers() { paper.setTitle(StringUtils.abbreviate(paper.getTitle(), MAX_DISPLAY_SIZE)));
return paperService.findAllNotCompleted(); return papers;
} }
public void attachPaper(GrantDto grantDto) { public void attachPaper(GrantDto grantDto) {