diff --git a/src/main/java/com/bamdoliro/maru/application/form/ExportFormUseCase.java b/src/main/java/com/bamdoliro/maru/application/form/ExportFormUseCase.java index aef37bf7..7bbd667a 100644 --- a/src/main/java/com/bamdoliro/maru/application/form/ExportFormUseCase.java +++ b/src/main/java/com/bamdoliro/maru/application/form/ExportFormUseCase.java @@ -24,10 +24,7 @@ import org.springframework.core.io.ByteArrayResource; import java.io.ByteArrayOutputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; @Slf4j @@ -75,7 +72,12 @@ private List getSubjectList(Form form) { Map> subjectMap = form.getGrade() .getSubjectListValue() .stream() - .collect(Collectors.groupingBy(Subject::getSubjectName)); + .collect(Collectors.groupingBy( + Subject::getSubjectName, + LinkedHashMap::new, + Collectors.toList() + )); + subjectMap.forEach((key, values) -> { SubjectVO subject = new SubjectVO(key); @@ -84,7 +86,7 @@ private List getSubjectList(Form form) { subject.score = v.getOriginalScore(); } else { try { - SubjectVO.class.getField("achievementLevel" + v.toString()) + SubjectVO.class.getField("achievementLevel" + v) .set(subject, v.getAchievementLevel()); } catch (IllegalAccessException | NoSuchFieldException e) { throw new RuntimeException(e);