Skip to content

Commit

Permalink
feat(#148): 수험표 양식 변경 및 Schedule 상수 추가
Browse files Browse the repository at this point in the history
- 수험표의 양식을 변경했어요.
- Schedule 에 입학 등록기간, 마이스터 인재전형 입실시간, 나머지 전형 입실시간을 상수로 추가했어요.
- Schedule 에 새로운 format 메서드를 만들었어요.
- GenerateAdmissionTicketUseCase 에서 Map.of() 메서드는 10개의 요소만 들어갈 수 있어, Map.ofEntries() 메서드를 사용하도록 변경했어요.
  • Loading branch information
jyj1289 committed Oct 12, 2024
1 parent 4845a10 commit ffc58ab
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,19 @@ public ByteArrayResource execute(User user) {
Form form = formFacade.getForm(user);
validateFormStatus(form);

Map<String, Object> formMap = Map.of(
"form", form,
"year", Schedule.getAdmissionYear(),
"codingTest", Schedule.toLocaleString(CODING_TEST),
"ncs", Schedule.toLocaleString(NCS),
"depthInterview", Schedule.toLocaleString(DEPTH_INTERVIEW),
"physicalExamination", Schedule.toLocaleString(PHYSICAL_EXAMINATION),
"announcementOfSecondPass", Schedule.toLocaleString(ANNOUNCEMENT_OF_SECOND_PASS),
"identificationPictureUri", fileService.getPresignedUrl(FolderConstant.IDENTIFICATION_PICTURE, user.getUuid().toString()).getDownloadUrl()
);
Map<String, Object> formMap = Map.ofEntries(
Map.entry("form", form),
Map.entry("year", Schedule.getAdmissionYear()),
Map.entry("codingTest", Schedule.toLocaleString(CODING_TEST)),
Map.entry("ncs", Schedule.toLocaleString(NCS)),
Map.entry("depthInterview", Schedule.toLocaleString(DEPTH_INTERVIEW)),
Map.entry("physicalExamination", Schedule.toLocaleString(PHYSICAL_EXAMINATION)),
Map.entry("announcementOfSecondPass", Schedule.toLocaleString(ANNOUNCEMENT_OF_SECOND_PASS)),
Map.entry("meisterTalentEntranceTime", Schedule.toLocaleString(MEISTER_TALENT_ENTRANCE_TIME)),
Map.entry("meisterTalentExclusionEntranceTime", Schedule.toLocaleString(MEISTER_TALENT_EXCLUSION_ENTRANCE_TIME)),
Map.entry("entranceRegistrationTime", Schedule.toLocaleString(ENTRANCE_REGISTRATION_PERIOD_START, ENTRANCE_REGISTRATION_PERIOD_END)),
Map.entry("identificationPictureUri", fileService.getPresignedUrl(FolderConstant.IDENTIFICATION_PICTURE, user.getUuid().toString()).getDownloadUrl())
);
String html = processTemplateService.execute(Templates.ADMISSION_TICKET, formMap);
ByteArrayOutputStream outputStream = generatePdfService.execute(html);

Expand Down
11 changes: 11 additions & 0 deletions src/main/java/com/bamdoliro/maru/shared/constants/Schedule.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public class Schedule {
public static final LocalDateTime NCS = LocalDateTime.of(2024, 10, 25, 11, 0);
public static final LocalDateTime DEPTH_INTERVIEW = LocalDateTime.of(2024, 10, 25, 13, 0);
public static final LocalDateTime PHYSICAL_EXAMINATION = LocalDateTime.of(2024, 10, 25, 15, 0);
public static final LocalDateTime ENTRANCE_REGISTRATION_PERIOD_START = LocalDateTime.of(2024, 12, 16, 0, 0);
public static final LocalDateTime ENTRANCE_REGISTRATION_PERIOD_END = LocalDateTime.of(2024, 12, 18, 0, 0);
public static final LocalDateTime MEISTER_TALENT_ENTRANCE_TIME = LocalDateTime.of(2024, 10, 25, 9, 0);
public static final LocalDateTime MEISTER_TALENT_EXCLUSION_ENTRANCE_TIME = LocalDateTime.of(2024, 10, 25, 10, 30);

public static final String SELECT_FIRST_PASS_CRON = "0 0 1 20 10 ?";

public static int getAdmissionYear() {
Expand All @@ -27,4 +32,10 @@ public String toLocaleString(LocalDateTime datetime) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy.MM.dd (E) HH:mm", Locale.KOREA);
return formatter.format(datetime);
}

public String toLocaleString(LocalDateTime startTime, LocalDateTime endTime) {
DateTimeFormatter startTimeFormatter = DateTimeFormatter.ofPattern("yyyy.MM.dd (E)", Locale.KOREA);
DateTimeFormatter endTimeFormatter = DateTimeFormatter.ofPattern(" ~ MM.dd (E)", Locale.KOREA);
return startTimeFormatter.format(startTime) + endTimeFormatter.format(endTime);
}
}
18 changes: 9 additions & 9 deletions src/main/resources/templates/admission-ticket.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
}

.admission-ticket-container {
width: 55%;
width: 60%;
margin: 0 auto;
}

Expand Down Expand Up @@ -195,7 +195,7 @@
</tr>
<tr style="height: 53px">
<td style="border-left: none">코딩 테스트<br>(마이스터인재전형 지원자)</td>
<td>2024. 10. 25.(금) 09:30</td>
<td th:text="${codingTest}">2024. 10. 25.(금) 09:30</td>
<td>본교 평가장</td>
<td style="border-right: none" rowspan="4">
<div class="left" style="margin-bottom: 10px">• 코딩 테스트는 '마이스터인재전형' 지원자만 실시함</div>
Expand All @@ -205,30 +205,30 @@
</tr>
<tr style="height: 35px">
<td style="border-left: none">NCS 인적성검사</td>
<td>2024. 10. 25.(금) 11:00</td>
<td th:text="${ncs}">2024. 10. 25.(금) 11:00</td>
<td>본교 평가장</td>
</tr>
<tr style="height: 35px">
<td style="border-left: none">심층면접</td>
<td>2024. 10. 25.(금) 13:00</td>
<td th:text="${depthInterview}">2024. 10. 25.(금) 13:00</td>
<td>본교 평가장</td>
</tr>
<tr style="height: 35px">
<td style="border-left: none">신체검사</td>
<td>2024. 10. 25.(금) 15:00</td>
<td th:text="${physicalExamination}">2024. 10. 25.(금) 15:00</td>
<td>본교 평가장</td>
</tr>
<tr style="height: 35px">
<td class="background-blue" style="border-left: none">합격자 발표</td>
<td class="background-blue">2024. 10. 31.(목) 15:00</td>
<td class="background-blue" th:text="${announcementOfSecondPass}">2024. 10. 31.(목) 15:00</td>
<td class="background-blue">본교 홈페이지</td>
<td class="background-blue" style="border-right: none">
<div class="left">• 예비소집일 별도 안내 예정</div>
</td>
</tr>
<tr style="height: 35px">
<td class="background-blue" style="border-left: none">입학등록기간</td>
<td class="background-blue">2024. 12. 16.(월)-12. 18.(수)</td>
<td class="background-blue" th:text="${entranceRegistrationTime}">2024. 12. 16.(월)-12. 18.(수)</td>
<td class="background-blue">본교 행정실</td>
<td class="background-blue" style="border-right: none">
<div class="left">• 우편, 등기, 직접 제출</div>
Expand All @@ -254,13 +254,13 @@
</tr>
<tr style="height: 27px">
<td style="border-left: none">마이스터인재전형</td>
<td>2024. 10. 25.(금) 09:00</td>
<td th:text="${meisterTalentEntranceTime}">2024. 10. 25.(금) 09:00</td>
<td>본교 평가장</td>
<td style="border-right: none"></td>
</tr>
<tr style="height: 27px">
<td style="border-left: none">일반 전형, 사회통합전형</td>
<td>2024. 10. 25.(금) 10:30</td>
<td th:text="${meisterTalentExclusionEntranceTime}">2024. 10. 25.(금) 10:30</td>
<td>본교 평가장</td>
<td style="border-right: none"></td>
</tr>
Expand Down

0 comments on commit ffc58ab

Please sign in to comment.