라벨작업관리 목록 API 날짜 수정, 에러로그 날짜 변환 수정

This commit is contained in:
2026-01-06 12:12:35 +09:00
parent bb920c6ca8
commit 91ebcc9551
5 changed files with 22 additions and 51 deletions

View File

@@ -16,6 +16,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.time.LocalDate;
import java.util.List;
import java.util.UUID;
import lombok.RequiredArgsConstructor;
@@ -71,10 +72,10 @@ public class LabelWorkerApiController {
public ApiResponseDto<Page<LabelWorkMng>> labelWorkMngList(
@Parameter(description = "변화탐지년도", example = "2022-2024") @RequestParam(required = false)
String detectYear,
@Parameter(description = "시작일", example = "20220101") @RequestParam(required = false)
String strtDttm,
@Parameter(description = "종료일", example = "20261201") @RequestParam(required = false)
String endDttm,
@Parameter(description = "시작일", example = "2022-01-01") @RequestParam(required = false)
LocalDate strtDttm,
@Parameter(description = "종료일", example = "2026-12-01") @RequestParam(required = false)
LocalDate endDttm,
@Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0")
int page,
@Parameter(description = "페이지 크기", example = "20") @RequestParam(defaultValue = "20")

View File

@@ -5,6 +5,7 @@ import com.kamco.cd.kamcoback.common.utils.enums.Enums;
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelMngState;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDate;
import java.time.ZonedDateTime;
import java.util.UUID;
import lombok.AllArgsConstructor;
@@ -120,11 +121,11 @@ public class LabelWorkDto {
@Schema(description = "변화탐지년도", example = "2024")
private String detectYear;
@Schema(description = "시작일", example = "20260101")
private String strtDttm;
@Schema(description = "시작일", example = "2026-01-01")
private LocalDate strtDttm;
@Schema(description = "종료일", example = "20261201")
private String endDttm;
@Schema(description = "종료일", example = "2026-12-01")
private LocalDate endDttm;
public Pageable toPageable() {

View File

@@ -74,31 +74,11 @@ public class LabelAllocateService {
index = end;
}
// 검수자에게 userCount명 만큼 할당
List<LabelAllocateDto.Basic> list = labelAllocateCoreService.findAssignedLabelerList(analUid);
// 검수자 할당 테이블에 insert. TODO: 익일 배치로 라벨링 완료된 내역을 검수자에게 할당해야 함
for (String inspector : targetInspectors) {
labelAllocateCoreService.insertInspector(analUid, inspector);
}
// int from = 0;
// for (TargetInspector inspector : targetInspectors) {
// int to = Math.min(from + inspector.getUserCount(), list.size());
//
// if (from >= to) {
// break;
// }
//
// List<UUID> assignmentUids =
// list.subList(from,
// to).stream().map(LabelAllocateDto.Basic::getAssignmentUid).toList();
//
// labelAllocateCoreService.assignInspectorBulk(assignmentUids,
// inspector.getInspectorUid());
//
// from = to;
// }
return new ApiResponseDto.ResponseObj(ApiResponseCode.OK, "배정이 완료되었습니다.");
}

View File

@@ -114,21 +114,13 @@ public class LabelWorkRepositoryImpl extends QuerydslRepositorySupport
whereSubBuilder.and(
mapSheetAnalDataInferenceGeomEntity.dataUid.eq(mapSheetAnalDataInferenceEntity.id));
if (searchReq.getStrtDttm() != null
&& !searchReq.getStrtDttm().isEmpty()
&& searchReq.getEndDttm() != null
&& !searchReq.getEndDttm().isEmpty()) {
if (searchReq.getStrtDttm() != null && searchReq.getEndDttm() != null) {
ZoneId zoneId = ZoneId.of("Asia/Seoul");
ZonedDateTime start =
LocalDate.parse(searchReq.getStrtDttm(), DateTimeFormatter.BASIC_ISO_DATE)
.atStartOfDay(zoneId);
ZonedDateTime start = searchReq.getStrtDttm().atStartOfDay(zoneId);
ZonedDateTime end =
LocalDate.parse(searchReq.getEndDttm(), DateTimeFormatter.BASIC_ISO_DATE)
.plusDays(1)
.atStartOfDay(zoneId);
ZonedDateTime end = searchReq.getEndDttm().plusDays(1).atStartOfDay(zoneId);
whereSubBuilder.and(
mapSheetAnalDataInferenceGeomEntity
@@ -402,12 +394,7 @@ public class LabelWorkRepositoryImpl extends QuerydslRepositorySupport
}
public NumberExpression<Long> caseSumExpression(BooleanExpression condition) {
NumberExpression<Long> sumExp =
new CaseBuilder()
.when(condition)
.then(1L)
.otherwise(0L)
.sum();
NumberExpression<Long> sumExp = new CaseBuilder().when(condition).then(1L).otherwise(0L).sum();
return sumExp;
}

View File

@@ -15,7 +15,7 @@ import com.querydsl.core.types.dsl.Expressions;
import com.querydsl.core.types.dsl.StringExpression;
import com.querydsl.jpa.impl.JPAQueryFactory;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.List;
import java.util.Objects;
@@ -98,12 +98,14 @@ public class ErrorLogRepositoryImpl extends QuerydslRepositorySupport
if (Objects.isNull(startDate) || Objects.isNull(endDate)) {
return null;
}
LocalDateTime startDateTime = startDate.atStartOfDay();
LocalDateTime endDateTime = endDate.plusDays(1).atStartOfDay();
ZoneId zoneId = ZoneId.of("Asia/Seoul");
ZonedDateTime startDateTime = startDate.atStartOfDay(zoneId);
ZonedDateTime endDateTime = endDate.plusDays(1).atStartOfDay(zoneId);
return auditLogEntity
.createdDate
.goe(ZonedDateTime.from(startDateTime))
.and(auditLogEntity.createdDate.lt(ZonedDateTime.from(endDateTime)));
.goe(startDateTime)
.and(auditLogEntity.createdDate.lt(endDateTime));
}
private BooleanExpression eventStatusEqFailed() {