|
|
@ -19,7 +19,6 @@ import ru.ulstu.user.model.User;
|
|
|
|
import ru.ulstu.user.service.UserService;
|
|
|
|
import ru.ulstu.user.service.UserService;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
@ -209,16 +208,11 @@ public class GrantService {
|
|
|
|
|
|
|
|
|
|
|
|
private List<User> getCompletedPapersAuthors(Paper.PaperType type) {
|
|
|
|
private List<User> getCompletedPapersAuthors(Paper.PaperType type) {
|
|
|
|
List<Paper> papers = paperService.findAllCompletedByType(type);
|
|
|
|
List<Paper> papers = paperService.findAllCompletedByType(type);
|
|
|
|
papers.stream()
|
|
|
|
return papers.stream()
|
|
|
|
.filter(paper -> paper.getAuthors() != null)
|
|
|
|
.filter(paper -> paper.getAuthors() != null)
|
|
|
|
|
|
|
|
.flatMap(paper -> paper.getAuthors().stream())
|
|
|
|
.collect(toList());
|
|
|
|
.collect(toList());
|
|
|
|
List<User> users = new ArrayList<>();
|
|
|
|
|
|
|
|
for (Paper p : papers) {
|
|
|
|
|
|
|
|
p.getAuthors()
|
|
|
|
|
|
|
|
.stream()
|
|
|
|
|
|
|
|
.forEach(users::add);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return users;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<User> getBAKAuthors() {
|
|
|
|
private List<User> getBAKAuthors() {
|
|
|
@ -229,14 +223,10 @@ public class GrantService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private List<User> getScopusAuthors() {
|
|
|
|
private List<User> getScopusAuthors() {
|
|
|
|
List<User> oldAuthors = getCompletedPapersAuthors(Paper.PaperType.SCOPUS);
|
|
|
|
List<User> authors = getCompletedPapersAuthors(Paper.PaperType.SCOPUS);
|
|
|
|
List<User> newAuthors = new ArrayList<>();
|
|
|
|
return authors
|
|
|
|
oldAuthors.forEach(author -> {
|
|
|
|
.stream()
|
|
|
|
int count = Collections.frequency(oldAuthors, author);
|
|
|
|
.filter(author -> Collections.frequency(authors, author) > 3)
|
|
|
|
if (count > 3) {
|
|
|
|
.collect(toList());
|
|
|
|
newAuthors.add(author);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return newAuthors;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|