Skip to content

Commit

Permalink
perf: 결과 엑셀에 생년월일 추가
Browse files Browse the repository at this point in the history
- 전형별 결과 엑셀에 생년월일을 -을 제외한 형식으로 추가했어요.
  • Loading branch information
jyj1289 committed Oct 21, 2024
1 parent d2c96a6 commit e613f63
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.springframework.core.io.Resource;

import java.io.IOException;
import java.time.format.DateTimeFormatter;
import java.util.List;

@RequiredArgsConstructor
Expand Down Expand Up @@ -71,7 +72,7 @@ public Resource execute() throws IOException {
genderCell.setCellStyle(defaultCellStyle);

Cell birthdayCell = row.createCell(8);
birthdayCell.setCellValue(form.getApplicant().getBirthday());
birthdayCell.setCellValue(form.getApplicant().getBirthday().format(DateTimeFormatter.BASIC_ISO_DATE));
birthdayCell.setCellStyle(dateCellStyle);

Cell locationCell = row.createCell(9);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.springframework.core.io.Resource;

import java.io.IOException;
import java.time.format.DateTimeFormatter;
import java.util.List;

@RequiredArgsConstructor
Expand Down Expand Up @@ -73,39 +74,43 @@ public Resource execute() throws IOException {
genderCell.setCellValue(form.getApplicant().getGender().getDescription());
genderCell.setCellStyle(defaultCellStyle);

Cell locationCell = row.createCell(7);
Cell birthdayCell = row.createCell(7);
birthdayCell.setCellValue(form.getApplicant().getBirthday().format(DateTimeFormatter.BASIC_ISO_DATE));
birthdayCell.setCellStyle(defaultCellStyle);

Cell locationCell = row.createCell(8);
locationCell.setCellValue(form.getEducation().getSchool().getLocation());
locationCell.setCellStyle(defaultCellStyle);

Cell graduationCell = row.createCell(8);
Cell graduationCell = row.createCell(9);
graduationCell.setCellValue(form.getEducation().getGraduationTypeToString());
graduationCell.setCellStyle(defaultCellStyle);

Cell schoolCell = row.createCell(9);
Cell schoolCell = row.createCell(10);
schoolCell.setCellValue(form.getEducation().getSchool().getName());
schoolCell.setCellStyle(defaultCellStyle);

Cell schoolCodeCell = row.createCell(10);
Cell schoolCodeCell = row.createCell(11);
schoolCodeCell.setCellValue(form.getEducation().getSchool().getCode());
schoolCodeCell.setCellStyle(defaultCellStyle);

Cell subjectGradeScoreCell = row.createCell(11);
Cell subjectGradeScoreCell = row.createCell(12);
subjectGradeScoreCell.setCellValue(MathUtil.roundTo(form.getScore().getSubjectGradeScore(), 3));
subjectGradeScoreCell.setCellStyle(rightCellStyle);

Cell attendanceScoreCell = row.createCell(12);
Cell attendanceScoreCell = row.createCell(13);
attendanceScoreCell.setCellValue(form.getScore().getAttendanceScore());
attendanceScoreCell.setCellStyle(rightCellStyle);

Cell volunteerScoreCell = row.createCell(13);
Cell volunteerScoreCell = row.createCell(14);
volunteerScoreCell.setCellValue(form.getScore().getVolunteerScore());
volunteerScoreCell.setCellStyle(rightCellStyle);

Cell bonusScoreCell = row.createCell(14);
Cell bonusScoreCell = row.createCell(15);
bonusScoreCell.setCellValue(form.getScore().getBonusScore());
bonusScoreCell.setCellStyle(rightCellStyle);

Cell totalScoreCell = row.createCell(15);
Cell totalScoreCell = row.createCell(16);
totalScoreCell.setCellValue(MathUtil.roundTo(form.getScore().getFirstRoundScore(), 3));
totalScoreCell.setCellStyle(rightCellStyle);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.springframework.core.io.Resource;

import java.io.IOException;
import java.time.format.DateTimeFormatter;
import java.util.List;

@RequiredArgsConstructor
Expand Down Expand Up @@ -68,66 +69,70 @@ public Resource execute() throws IOException {
genderCell.setCellValue(form.getApplicant().getGender().getDescription());
genderCell.setCellStyle(defaultCellStyle);

Cell locationCell = row.createCell(7);
Cell birthdayCell = row.createCell(7);
birthdayCell.setCellValue(form.getApplicant().getBirthday().format(DateTimeFormatter.BASIC_ISO_DATE));
birthdayCell.setCellStyle(defaultCellStyle);

Cell locationCell = row.createCell(8);
locationCell.setCellValue(form.getEducation().getSchool().getLocation());
locationCell.setCellStyle(defaultCellStyle);

Cell graduationCell = row.createCell(8);
Cell graduationCell = row.createCell(9);
graduationCell.setCellValue(form.getEducation().getGraduationTypeToString());
graduationCell.setCellStyle(defaultCellStyle);

Cell schoolCell = row.createCell(9);
Cell schoolCell = row.createCell(10);
schoolCell.setCellValue(form.getEducation().getSchool().getName());
schoolCell.setCellStyle(defaultCellStyle);

Cell schoolCodeCell = row.createCell(10);
Cell schoolCodeCell = row.createCell(11);
schoolCodeCell.setCellValue(form.getEducation().getSchool().getCode());
schoolCodeCell.setCellStyle(defaultCellStyle);

Cell subjectCount21 = row.createCell(11);
Cell subjectCount21 = row.createCell(12);
subjectCount21.setCellValue(subjectMap.getSubjectListOf(2,1).size());
subjectCount21.setCellStyle(defaultCellStyle);

Cell subjectTotalScore21 = row.createCell(12);
Cell subjectTotalScore21 = row.createCell(13);
subjectTotalScore21.setCellValue(subjectMap.getSubjectListOf(2,1).totalScore());
subjectTotalScore21.setCellStyle(defaultCellStyle);

Cell subjectCount22 = row.createCell(13);
Cell subjectCount22 = row.createCell(14);
subjectCount22.setCellValue(subjectMap.getSubjectListOf(2,2).size());
subjectCount22.setCellStyle(defaultCellStyle);

Cell subjectTotalScore22 = row.createCell(14);
Cell subjectTotalScore22 = row.createCell(15);
subjectTotalScore22.setCellValue(subjectMap.getSubjectListOf(2,2).totalScore());
subjectTotalScore22.setCellStyle(defaultCellStyle);

Cell subjectCount31 = row.createCell(15);
Cell subjectCount31 = row.createCell(16);
subjectCount31.setCellValue(subjectMap.getSubjectListOf(3,1).size());
subjectCount31.setCellStyle(defaultCellStyle);

Cell subjectTotalScore31 = row.createCell(16);
Cell subjectTotalScore31 = row.createCell(17);
subjectTotalScore31.setCellValue(subjectMap.getSubjectListOf(3,1).totalScore());
subjectTotalScore31.setCellStyle(defaultCellStyle);

Cell subjectGradeScoreCell = row.createCell(17);
Cell subjectGradeScoreCell = row.createCell(18);
subjectGradeScoreCell.setCellValue(MathUtil.roundTo(form.getScore().getSubjectGradeScore(), 3));
subjectGradeScoreCell.setCellStyle(rightCellStyle);

Cell attendanceScoreCell = row.createCell(18);
Cell attendanceScoreCell = row.createCell(19);
attendanceScoreCell.setCellValue(form.getScore().getAttendanceScore());
attendanceScoreCell.setCellStyle(rightCellStyle);

Cell volunteerScoreCell = row.createCell(19);
Cell volunteerScoreCell = row.createCell(20);
volunteerScoreCell.setCellValue(form.getScore().getVolunteerScore());
volunteerScoreCell.setCellStyle(rightCellStyle);

Cell bonusScoreCell = row.createCell(20);
Cell bonusScoreCell = row.createCell(21);
bonusScoreCell.setCellValue(form.getScore().getBonusScore());
bonusScoreCell.setCellStyle(rightCellStyle);

Cell depthInterviewScoreCell = row.createCell(21);
Cell ncsScoreCell = row.createCell(22);
Cell codingTestScoreCell = row.createCell(23);
Cell totalScoreCell = row.createCell(24);
Cell depthInterviewScoreCell = row.createCell(22);
Cell ncsScoreCell = row.createCell(23);
Cell codingTestScoreCell = row.createCell(24);
Cell totalScoreCell = row.createCell(25);
totalScoreCell.setCellStyle(rightCellStyle);

if (form.tookSecondRound()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.springframework.core.io.Resource;

import java.io.IOException;
import java.time.format.DateTimeFormatter;
import java.util.List;

@RequiredArgsConstructor
Expand Down Expand Up @@ -54,71 +55,79 @@ public Resource execute() throws IOException {
examinationNumberCell.setCellValue(form.getExaminationNumber());
examinationNumberCell.setCellStyle(defaultCellStyle);

Cell typeCell = row.createCell(2);
Cell originalTypeCell = row.createCell(2);
originalTypeCell.setCellValue(form.getOriginalType().getDescription());
originalTypeCell.setCellStyle(defaultCellStyle);

Cell typeCell = row.createCell(3);
typeCell.setCellValue(form.getType().getDescription());
typeCell.setCellStyle(defaultCellStyle);

Cell resultCell = row.createCell(3);
Cell resultCell = row.createCell(4);
resultCell.setCellValue(form.getStatus().getDescription());
resultCell.setCellStyle(defaultCellStyle);

Cell nameCell = row.createCell(4);
Cell nameCell = row.createCell(5);
nameCell.setCellValue(form.getApplicant().getName());
nameCell.setCellStyle(defaultCellStyle);

Cell genderCell = row.createCell(5);
Cell genderCell = row.createCell(6);
genderCell.setCellValue(form.getApplicant().getGender().getDescription());
genderCell.setCellStyle(defaultCellStyle);

Cell locationCell = row.createCell(6);
Cell birthdayCell = row.createCell(7);
birthdayCell.setCellValue(form.getApplicant().getBirthday().format(DateTimeFormatter.BASIC_ISO_DATE));
birthdayCell.setCellStyle(defaultCellStyle);

Cell locationCell = row.createCell(8);
locationCell.setCellValue(form.getEducation().getSchool().getLocation());
locationCell.setCellStyle(defaultCellStyle);

Cell graduationCell = row.createCell(7);
Cell graduationCell = row.createCell(9);
graduationCell.setCellValue(form.getEducation().getGraduationTypeToString());
graduationCell.setCellStyle(defaultCellStyle);

Cell schoolCell = row.createCell(8);
Cell schoolCell = row.createCell(10);
schoolCell.setCellValue(form.getEducation().getSchool().getName());
schoolCell.setCellStyle(defaultCellStyle);

Cell schoolCodeCell = row.createCell(9);
Cell schoolCodeCell = row.createCell(11);
schoolCodeCell.setCellValue(form.getEducation().getSchool().getCode());
schoolCodeCell.setCellStyle(defaultCellStyle);

Cell subjectGradeScoreCell = row.createCell(10);
Cell subjectGradeScoreCell = row.createCell(12);
subjectGradeScoreCell.setCellValue(MathUtil.roundTo(form.getScore().getSubjectGradeScore(), 3));
subjectGradeScoreCell.setCellStyle(rightCellStyle);

Cell attendanceScoreCell = row.createCell(11);
Cell attendanceScoreCell = row.createCell(13);
attendanceScoreCell.setCellValue(form.getScore().getAttendanceScore());
attendanceScoreCell.setCellStyle(rightCellStyle);

Cell volunteerScoreCell = row.createCell(12);
Cell volunteerScoreCell = row.createCell(14);
volunteerScoreCell.setCellValue(form.getScore().getVolunteerScore());
volunteerScoreCell.setCellStyle(rightCellStyle);

Cell bonusScoreCell = row.createCell(13);
Cell bonusScoreCell = row.createCell(15);
bonusScoreCell.setCellValue(form.getScore().getBonusScore());
bonusScoreCell.setCellStyle(rightCellStyle);

Cell depthInterviewScoreCell = row.createCell(14);
Cell depthInterviewScoreCell = row.createCell(16);
depthInterviewScoreCell.setCellValue(form.getScore().getDepthInterviewScore());
depthInterviewScoreCell.setCellStyle(rightCellStyle);

Cell ncsScoreCell = row.createCell(15);
Cell ncsScoreCell = row.createCell(17);
ncsScoreCell.setCellValue(form.getScore().getNcsScore());
ncsScoreCell.setCellStyle(rightCellStyle);

Cell codingTestScoreCell = row.createCell(16);
Cell codingTestScoreCell = row.createCell(18);
if (form.getType().isMeister()) {
codingTestScoreCell.setCellValue(form.getScore().getCodingTestScore());
codingTestScoreCell.setCellStyle(rightCellStyle);
} else {
codingTestScoreCell.setCellStyle(emptyCellStyle);
}

Cell totalScoreCell = row.createCell(17);
Cell totalScoreCell = row.createCell(19);
totalScoreCell.setCellValue(MathUtil.roundTo(form.getScore().getTotalScore(), 3));
totalScoreCell.setCellStyle(rightCellStyle);
}
Expand Down
Binary file modified src/main/resources/templates/xlsx/1차전형결과.xlsx
Binary file not shown.
Binary file modified src/main/resources/templates/xlsx/2차전형결과.xlsx
Binary file not shown.
Binary file modified src/main/resources/templates/xlsx/전체결과.xlsx
Binary file not shown.

0 comments on commit e613f63

Please sign in to comment.