From be070477bbd13eecc52e00603614a1529b2f28eb Mon Sep 17 00:00:00 2001 From: cabbage16 Date: Sun, 8 Sep 2024 02:55:15 +0900 Subject: [PATCH] =?UTF-8?q?perf(#123):=20=EC=9B=90=EC=84=9C=20PDF=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=20=EC=8B=9C=20=EA=B3=BC=EB=AA=A9=EB=AA=85=20?= =?UTF-8?q?=EC=88=9C=EC=84=9C=20=EC=9C=A0=EC=A7=80=20-=20=EC=9D=B4?= =?UTF-8?q?=EC=A0=84=EC=97=90=EB=8A=94=20=EC=84=B1=EC=A0=81=20=EC=9D=BC?= =?UTF-8?q?=EB=9E=8C=ED=91=9C=EC=97=90=EC=84=9C=20=EA=B3=BC=EB=AA=A9=20?= =?UTF-8?q?=EB=AA=85=EC=9D=B4=20=EC=9E=85=EB=A0=A5=ED=95=9C=20=EC=88=9C?= =?UTF-8?q?=EC=84=9C=EB=8C=80=EB=A1=9C=20=EB=82=98=EC=98=A4=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EC=95=98=EB=8D=98=20=EB=AC=B8=EC=A0=9C=EB=A5=BC=20?= =?UTF-8?q?=EC=9E=85=EB=A0=A5=ED=95=9C=20=EC=88=9C=EC=84=9C=EB=8C=80?= =?UTF-8?q?=EB=A1=9C=20=EB=82=98=EC=98=A4=EB=8F=84=EB=A1=9D=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=ED=96=88=EC=8A=B5=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maru/application/form/ExportFormUseCase.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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);