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()) {
|
||||
|
||||
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
|
||||
.stream(programme)
|
||||
.forEach(p -> {
|
||||
CSVProject proj = new CSVProject();
|
||||
proj.setTopics(topic);
|
||||
if (topicdescription != null) {
|
||||
proj.setTopicdescription(topicdescription);
|
||||
}
|
||||
|
||||
proj.setProgramme(p);
|
||||
proj.setId(csvProject.get().getId());
|
||||
csvProjectList.add(proj);
|
||||
|
|
Loading…
Reference in New Issue