forked from D-Net/dnet-hadoop
modified to consider the topic information
This commit is contained in:
parent
609ff17cfc
commit
15af1f527e
|
@ -97,10 +97,26 @@ public class PrepareProjects {
|
||||||
if (csvProject.isPresent()) {
|
if (csvProject.isPresent()) {
|
||||||
|
|
||||||
String[] programme = csvProject.get().getProgramme().split(";");
|
String[] programme = csvProject.get().getProgramme().split(";");
|
||||||
|
String topic = csvProject.get().getTopics();
|
||||||
|
String topicdescription = Optional
|
||||||
|
.ofNullable(csvProject.get().getTopics())
|
||||||
|
.map(topics -> {
|
||||||
|
if (topic.equalsIgnoreCase(value._1().getTopiccode())) {
|
||||||
|
return value._1().getTopicdescription();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
})
|
||||||
|
.orElse(null);
|
||||||
|
|
||||||
Arrays
|
Arrays
|
||||||
.stream(programme)
|
.stream(programme)
|
||||||
.forEach(p -> {
|
.forEach(p -> {
|
||||||
CSVProject proj = new CSVProject();
|
CSVProject proj = new CSVProject();
|
||||||
|
proj.setTopics(topic);
|
||||||
|
if (topicdescription != null) {
|
||||||
|
proj.setTopicdescription(topicdescription);
|
||||||
|
}
|
||||||
|
|
||||||
proj.setProgramme(p);
|
proj.setProgramme(p);
|
||||||
proj.setId(csvProject.get().getId());
|
proj.setId(csvProject.get().getId());
|
||||||
csvProjectList.add(proj);
|
csvProjectList.add(proj);
|
||||||
|
|
Loading…
Reference in New Issue