Skip to content

Commit

Permalink
v2.1.5
Browse files Browse the repository at this point in the history
v2.1.5
  • Loading branch information
mikekks authored Oct 9, 2024
2 parents 4140e83 + f6b549b commit 0fb1894
Show file tree
Hide file tree
Showing 5 changed files with 1,129 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ private BooleanExpression eqStatus(List<String> statues, Time time) {
BooleanExpression condition = meeting.startDate.after(time.now());
conditions.add(condition);
} else if (status == EnMeetingStatus.APPLY_ABLE.getValue()) {
BooleanExpression afterStartDate = meeting.startDate.before(time.now());
BooleanExpression beforeEndDate = meeting.endDate.after(time.now());
BooleanExpression afterStartDate = meeting.startDate.loe(time.now());
BooleanExpression beforeEndDate = meeting.endDate.goe(time.now());
BooleanExpression condition = afterStartDate.and(beforeEndDate);
conditions.add(condition);
} else if (status == EnMeetingStatus.RECRUITMENT_COMPLETE.getValue()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
import static org.sopt.makers.crew.main.global.exception.ErrorStatus.*;
import static org.sopt.makers.crew.main.entity.apply.enums.EnApplyStatus.*;

import java.io.FileWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.time.LocalDateTime;
Expand Down Expand Up @@ -150,7 +152,6 @@ public List<MeetingV2GetMeetingBannerResponseDto> getMeetingBanner() {
return getResponseDto(meetings, postMap, applies);
}


private List<Post> filterLatestPostsByMeetingId(List<Post> posts) {
return posts.stream()
.collect(Collectors.groupingBy(Post::getMeetingId,
Expand Down Expand Up @@ -384,9 +385,15 @@ private void deleteCsvFile(String filePath) {
private String createCsvFile(List<Apply> applies) {
String filePath = UUID.randomUUID() + ".csv";

try (CSVWriter writer = new CSVWriter(new FileWriter(filePath))) {
try (OutputStreamWriter outputStreamWriter = new OutputStreamWriter(
new FileOutputStream(filePath), StandardCharsets.UTF_8);
CSVWriter writer = new CSVWriter(outputStreamWriter)) {

// BOM 추가 (Excel에서 UTF-8 파일을 제대로 처리하기 위함)
outputStreamWriter.write("\uFEFF");

// CSV 파일의 헤더 정의
String[] header = {"이름", "최근 활동 파트", "최근 활동 기수", "전화번호", "신청 날짜 및 시간", "신청 내용", "신청 상태"};
String[] header = {"이름", "최근 활동 파트", "최근 활동 기수", "전화번호", "신청 날짜 및 시간", "신청 상태"};
writer.writeNext(header);

DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
Expand All @@ -400,7 +407,6 @@ private String createCsvFile(List<Apply> applies) {
String.valueOf(activity.getGeneration()),
String.format("\"%s\"", user.getPhone()),
apply.getAppliedDate().format(formatter),
apply.getContent(),
apply.getStatus().getDescription()
};
writer.writeNext(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
public class StubTime implements Time {
@Override
public LocalDateTime now() {
return LocalDateTime.of(2024, 4, 24, 23, 59);
return LocalDateTime.of(2024, 4, 24, 00, 00, 00, 000000000);
}
}
Loading

0 comments on commit 0fb1894

Please sign in to comment.