Reset the failure flag in workers on successful runs. #76
@ -75,6 +75,8 @@
|
||||
<xs:sequence>
|
||||
<xs:element name="level" type="educationalLevel" minOccurs="1">
|
||||
</xs:element>
|
||||
<xs:element name="courseCredits" type="xs:decimal" minOccurs="0">
|
||||
</xs:element>
|
||||
<xs:element name="department" type="serializableUnit" minOccurs="1">
|
||||
</xs:element>
|
||||
</xs:sequence>
|
||||
@ -615,6 +617,8 @@
|
||||
</xs:element>
|
||||
<xs:element name="break" type="xs:boolean" minOccurs="1">
|
||||
</xs:element>
|
||||
<xs:element name="reparticipant" type="xs:boolean" minOccurs="1">
|
||||
</xs:element>
|
||||
<xs:element name="inactive" type="xs:boolean" minOccurs="1">
|
||||
</xs:element>
|
||||
<xs:element name="userName" type="xs:string" minOccurs="0">
|
||||
|
@ -2,9 +2,8 @@ package se.su.dsv.scipro.io.impl;
|
||||
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.core.Response;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import se.su.dsv.scipro.daisyExternal.http.DaisyAPI;
|
||||
@ -13,7 +12,6 @@ import se.su.dsv.scipro.io.dto.*;
|
||||
import se.su.dsv.scipro.io.exceptions.ExternalExportException;
|
||||
import se.su.dsv.scipro.project.Project;
|
||||
import se.su.dsv.scipro.reusable.SciProUtilities;
|
||||
import se.su.dsv.scipro.system.DegreeType;
|
||||
import se.su.dsv.scipro.system.Unit;
|
||||
import se.su.dsv.scipro.system.User;
|
||||
|
||||
@ -23,14 +21,6 @@ public class ExternalExporterDaisyImpl implements ExternalExporter {
|
||||
|
||||
static final int MAX_TITLE_LENGTH = 255;
|
||||
private static final int DSV = 4;
|
||||
private static Map<DegreeType, EducationalLevel> classMap = new HashMap<>() {
|
||||
{
|
||||
put(DegreeType.NONE, EducationalLevel.UNKNOWN);
|
||||
put(DegreeType.BACHELOR, EducationalLevel.FIRST_CYCLE);
|
||||
put(DegreeType.MAGISTER, EducationalLevel.SECOND_CYCLE);
|
||||
put(DegreeType.MASTER, EducationalLevel.SECOND_CYCLE);
|
||||
}
|
||||
};
|
||||
|
||||
private final DaisyAPI api;
|
||||
|
||||
@ -82,7 +72,21 @@ public class ExternalExporterDaisyImpl implements ExternalExporter {
|
||||
}
|
||||
|
||||
private EducationalLevel toDaisyLevel(Project project) {
|
||||
return classMap.get(project.getProjectTypeDegreeType());
|
||||
return switch (project.getProjectTypeDegreeType()) {
|
||||
case NONE -> EducationalLevel.UNKNOWN;
|
||||
case BACHELOR -> EducationalLevel.FIRST_CYCLE;
|
||||
case MAGISTER -> EducationalLevel.SECOND_CYCLE;
|
||||
case MASTER -> EducationalLevel.SECOND_CYCLE;
|
||||
};
|
||||
}
|
||||
|
||||
private static BigDecimal toDaisyCredits(Project project) {
|
||||
return switch (project.getProjectTypeDegreeType()) {
|
||||
case BACHELOR -> BigDecimal.valueOf(15);
|
||||
case MAGISTER -> BigDecimal.valueOf(15);
|
||||
case MASTER -> BigDecimal.valueOf(30);
|
||||
case NONE -> null;
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -95,6 +99,7 @@ public class ExternalExporterDaisyImpl implements ExternalExporter {
|
||||
AddThesisAuthorCourse authorCourse = new AddThesisAuthorCourse();
|
||||
authorCourse.setLevel(toDaisyLevel(project));
|
||||
authorCourse.setDepartment(department);
|
||||
authorCourse.setCourseCredits(toDaisyCredits(project));
|
||||
|
||||
AddThesisAuthor addThesisAuthor = new AddThesisAuthor();
|
||||
addThesisAuthor.setCourse(authorCourse);
|
||||
|
Loading…
x
Reference in New Issue
Block a user