Merge pull request '로그 날짜 검색 조회, 상세 조회 로직 수정' (#323) from feat/infer_dev_260107 into develop

Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/323
This commit is contained in:
2026-01-23 10:42:19 +09:00

View File

@@ -22,7 +22,6 @@ import com.querydsl.core.types.dsl.StringExpression;
import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAQueryFactory;
import io.micrometer.common.util.StringUtils; import io.micrometer.common.util.StringUtils;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.time.ZonedDateTime; import java.time.ZonedDateTime;
import java.util.List; import java.util.List;
@@ -417,12 +416,13 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
if (Objects.isNull(startDate) || Objects.isNull(endDate)) { if (Objects.isNull(startDate) || Objects.isNull(endDate)) {
return null; return null;
} }
LocalDateTime startDateTime = startDate.atStartOfDay(); ZoneId zoneId = ZoneId.of("Asia/Seoul");
LocalDateTime endDateTime = endDate.plusDays(1).atStartOfDay(); ZonedDateTime startDateTime = startDate.atStartOfDay(zoneId);
ZonedDateTime endDateTime = endDate.plusDays(1).atStartOfDay(zoneId);
return auditLogEntity return auditLogEntity
.createdDate .createdDate
.goe(ZonedDateTime.from(startDateTime)) .goe(startDateTime)
.and(auditLogEntity.createdDate.lt(ZonedDateTime.from(endDateTime))); .and(auditLogEntity.createdDate.lt(endDateTime));
} }
private BooleanExpression createdDateBetween(LocalDate startDate, LocalDate endDate) { private BooleanExpression createdDateBetween(LocalDate startDate, LocalDate endDate) {
@@ -471,11 +471,11 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
} }
private BooleanExpression eventEndedAtEqDate(LocalDate logDate) { private BooleanExpression eventEndedAtEqDate(LocalDate logDate) {
StringExpression eventEndedDate = ZoneId zoneId = ZoneId.of("Asia/Seoul");
Expressions.stringTemplate("to_char({0}, 'YYYY-MM-DD')", auditLogEntity.createdDate); ZonedDateTime start = logDate.atStartOfDay(zoneId);
LocalDateTime comparisonDate = logDate.atStartOfDay(); ZonedDateTime end = logDate.plusDays(1).atStartOfDay(zoneId);
return eventEndedDate.eq(comparisonDate.toString()); return auditLogEntity.createdDate.goe(start).and(auditLogEntity.createdDate.lt(end));
} }
private BooleanExpression menuUidEq(String menuUid) { private BooleanExpression menuUidEq(String menuUid) {