From 67eb99e243d74684d5ff0adaeb902f369415dbeb Mon Sep 17 00:00:00 2001 From: DanielLee <198891672+sanghyeonhd@users.noreply.github.com> Date: Mon, 5 Jan 2026 11:41:50 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=EC=9E=91=EC=97=85=ED=98=84=ED=99=A9?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../label/LabelAllocateApiController.java | 18 ++++++---- .../kamcoback/label/dto/WorkerStatsDto.java | 12 +++++++ .../label/service/LabelAllocateService.java | 34 +++++++++++++----- .../core/LabelAllocateCoreService.java | 5 ++- .../label/LabelAllocateRepositoryCustom.java | 2 +- .../label/LabelAllocateRepositoryImpl.java | 36 ++++++++++--------- 6 files changed, 71 insertions(+), 36 deletions(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/label/LabelAllocateApiController.java b/src/main/java/com/kamco/cd/kamcoback/label/LabelAllocateApiController.java index 6869b636..7870a7fc 100644 --- a/src/main/java/com/kamco/cd/kamcoback/label/LabelAllocateApiController.java +++ b/src/main/java/com/kamco/cd/kamcoback/label/LabelAllocateApiController.java @@ -63,7 +63,7 @@ public class LabelAllocateApiController { }) @GetMapping("/admin/workers") public ApiResponseDto getWorkerStatistics( - @Parameter(description = "분석 ID (필수)", required = true, example = "3") @RequestParam + @Parameter(description = "분석 ID (선택)", example = "3") @RequestParam(required = false) Long analUid, @Parameter( description = "작업자 유형 (선택) - 미입력 시 LABELER로 조회", @@ -74,11 +74,9 @@ public class LabelAllocateApiController { defaultValue = "LABELER")) @RequestParam(required = false) String type, - @Parameter(description = "작업자 이름 검색 (부분 일치)", example = "김라벨") @RequestParam(required = false) - String searchName, - @Parameter(description = "작업자 사번 검색 (부분 일치)", example = "1234567") + @Parameter(description = "검색어 (작업자 이름 또는 사번으로 검색, 부분 일치)", example = "김라벨") @RequestParam(required = false) - String searchEmployeeNo, + String search, @Parameter( description = "정렬 조건 (선택) - 미입력 시 이름 오름차순", example = "REMAINING_DESC", @@ -92,14 +90,20 @@ public class LabelAllocateApiController { }, defaultValue = "NAME_ASC")) @RequestParam(required = false) - String sort) { + String sort, + @Parameter(description = "페이지 번호 (0부터 시작)", example = "0") + @RequestParam(defaultValue = "0") + Integer page, + @Parameter(description = "페이지 크기", example = "20") + @RequestParam(defaultValue = "20") + Integer size) { // type이 null이면 기본값으로 LABELER 설정 String workerType = (type == null || type.isEmpty()) ? RoleType.LABELER.name() : type; return ApiResponseDto.ok( labelAllocateService.getWorkerStatistics( - analUid, workerType, searchName, searchEmployeeNo, sort)); + analUid, workerType, search, sort, page, size)); } @Operation(summary = "라벨링작업 관리 > 작업 배정", description = "라벨링작업 관리 > 작업 배정") diff --git a/src/main/java/com/kamco/cd/kamcoback/label/dto/WorkerStatsDto.java b/src/main/java/com/kamco/cd/kamcoback/label/dto/WorkerStatsDto.java index efca81b2..f879f0ee 100644 --- a/src/main/java/com/kamco/cd/kamcoback/label/dto/WorkerStatsDto.java +++ b/src/main/java/com/kamco/cd/kamcoback/label/dto/WorkerStatsDto.java @@ -113,5 +113,17 @@ public class WorkerStatsDto { @Schema(description = "작업자 목록") private List workers; + + @Schema(description = "현재 페이지 번호 (0부터 시작)") + private Integer currentPage; + + @Schema(description = "페이지 크기") + private Integer pageSize; + + @Schema(description = "전체 데이터 수") + private Long totalElements; + + @Schema(description = "전체 페이지 수") + private Integer totalPages; } } diff --git a/src/main/java/com/kamco/cd/kamcoback/label/service/LabelAllocateService.java b/src/main/java/com/kamco/cd/kamcoback/label/service/LabelAllocateService.java index c919a5eb..1954a294 100644 --- a/src/main/java/com/kamco/cd/kamcoback/label/service/LabelAllocateService.java +++ b/src/main/java/com/kamco/cd/kamcoback/label/service/LabelAllocateService.java @@ -107,21 +107,23 @@ public class LabelAllocateService { } /** - * 작업자 목록 및 3일치 통계 조회 + * 작업자 통계 조회 * * @param analUid 분석 ID * @param workerType 작업자 유형 (LABELER/INSPECTOR) - * @param searchName 이름 검색 - * @param searchEmployeeNo 사번 검색 + * @param search 검색어 (이름 또는 사번) * @param sortType 정렬 조건 + * @param page 페이지 번호 (0부터 시작) + * @param size 페이지 크기 * @return 작업자 목록 및 통계 */ public WorkerListResponse getWorkerStatistics( Long analUid, String workerType, - String searchName, - String searchEmployeeNo, - String sortType) { + String search, + String sortType, + Integer page, + Integer size) { // 작업 진행 현황 조회 var progressInfo = labelAllocateCoreService.findWorkProgressInfo(analUid); @@ -129,7 +131,7 @@ public class LabelAllocateService { // 작업자 통계 조회 List workers = labelAllocateCoreService.findWorkerStatistics( - analUid, workerType, searchName, searchEmployeeNo, sortType); + analUid, workerType, search, sortType); // 각 작업자별 3일치 처리량 조회 LocalDate today = LocalDate.now(); @@ -162,7 +164,23 @@ public class LabelAllocateService { } } - return WorkerListResponse.builder().progressInfo(progressInfo).workers(workers).build(); + // 페이징 처리 + long totalElements = workers.size(); + int totalPages = (int) Math.ceil((double) totalElements / size); + int fromIndex = page * size; + int toIndex = Math.min(fromIndex + size, workers.size()); + + List pagedWorkers = + (fromIndex < workers.size()) ? workers.subList(fromIndex, toIndex) : List.of(); + + return WorkerListResponse.builder() + .progressInfo(progressInfo) + .workers(pagedWorkers) + .currentPage(page) + .pageSize(size) + .totalElements(totalElements) + .totalPages(totalPages) + .build(); } public InferenceDetail findInferenceDetail( diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/core/LabelAllocateCoreService.java b/src/main/java/com/kamco/cd/kamcoback/postgres/core/LabelAllocateCoreService.java index 3e16eae5..c7469db6 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/core/LabelAllocateCoreService.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/core/LabelAllocateCoreService.java @@ -57,11 +57,10 @@ public class LabelAllocateCoreService { public List findWorkerStatistics( Long analUid, String workerType, - String searchName, - String searchEmployeeNo, + String search, String sortType) { return labelAllocateRepository.findWorkerStatistics( - analUid, workerType, searchName, searchEmployeeNo, sortType); + analUid, workerType, search, sortType); } public WorkProgressInfo findWorkProgressInfo(Long analUid) { diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryCustom.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryCustom.java index 22988c98..8fb3d96a 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryCustom.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryCustom.java @@ -34,7 +34,7 @@ public interface LabelAllocateRepositoryCustom { // 작업자 통계 조회 List findWorkerStatistics( - Long analUid, String workerType, String searchName, String searchEmployeeNo, String sortType); + Long analUid, String workerType, String search, String sortType); // 작업 진행 현황 조회 WorkProgressInfo findWorkProgressInfo(Long analUid); diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java index 9e52da12..9f92dd3f 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java @@ -206,8 +206,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto public List findWorkerStatistics( Long analUid, String workerType, - String searchName, - String searchEmployeeNo, + String search, String sortType) { // 작업자 유형에 따른 필드 선택 @@ -221,14 +220,11 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto ? labelingAssignmentEntity.inspectorUid.isNotNull() : labelingAssignmentEntity.workerUid.isNotNull(); - // 검색 조건 + // 검색 조건 (이름 또는 사번으로 검색) BooleanExpression searchCondition = null; - if (searchName != null && !searchName.isEmpty()) { - searchCondition = memberEntity.name.contains(searchName); - } - if (searchEmployeeNo != null && !searchEmployeeNo.isEmpty()) { - BooleanExpression empCondition = memberEntity.employeeNo.contains(searchEmployeeNo); - searchCondition = searchCondition == null ? empCondition : searchCondition.and(empCondition); + if (search != null && !search.isEmpty()) { + searchCondition = memberEntity.name.contains(search) + .or(memberEntity.employeeNo.contains(search)); } // 완료, 스킵, 남은 작업 계산 @@ -258,6 +254,8 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .sum(); // 기본 통계 조회 쿼리 + BooleanExpression analUidCondition = analUid != null ? labelingAssignmentEntity.analUid.eq(analUid) : null; + var baseQuery = queryFactory .select( @@ -274,7 +272,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto "REVIEWER".equals(workerType) ? memberEntity.employeeNo.eq(labelingAssignmentEntity.inspectorUid) : memberEntity.employeeNo.eq(labelingAssignmentEntity.workerUid)) - .where(labelingAssignmentEntity.analUid.eq(analUid), workerCondition, searchCondition) + .where(analUidCondition, workerCondition, searchCondition) .groupBy(workerIdField, memberEntity.name); // 정렬 조건 적용 @@ -321,12 +319,14 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto @Override public WorkProgressInfo findWorkProgressInfo(Long analUid) { + BooleanExpression analUidCondition = analUid != null ? labelingAssignmentEntity.analUid.eq(analUid) : null; + // 전체 배정 건수 Long totalAssigned = queryFactory .select(labelingAssignmentEntity.count()) .from(labelingAssignmentEntity) - .where(labelingAssignmentEntity.analUid.eq(analUid)) + .where(analUidCondition) .fetchOne(); // 완료 + 스킵 건수 @@ -335,7 +335,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .select(labelingAssignmentEntity.count()) .from(labelingAssignmentEntity) .where( - labelingAssignmentEntity.analUid.eq(analUid), + analUidCondition, labelingAssignmentEntity.workState.in("DONE", "SKIP")) .fetchOne(); @@ -345,7 +345,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .select(labelingAssignmentEntity.workerUid.countDistinct()) .from(labelingAssignmentEntity) .where( - labelingAssignmentEntity.analUid.eq(analUid), + analUidCondition, labelingAssignmentEntity.workerUid.isNotNull()) .fetchOne(); @@ -355,7 +355,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .select(labelingAssignmentEntity.count()) .from(labelingAssignmentEntity) .where( - labelingAssignmentEntity.analUid.eq(analUid), + analUidCondition, labelingAssignmentEntity.workerUid.isNotNull(), labelingAssignmentEntity.workState.notIn("DONE", "SKIP")) .fetchOne(); @@ -366,7 +366,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .select(labelingAssignmentEntity.inspectorUid.countDistinct()) .from(labelingAssignmentEntity) .where( - labelingAssignmentEntity.analUid.eq(analUid), + analUidCondition, labelingAssignmentEntity.inspectorUid.isNotNull()) .fetchOne(); @@ -376,7 +376,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .select(labelingAssignmentEntity.count()) .from(labelingAssignmentEntity) .where( - labelingAssignmentEntity.analUid.eq(analUid), + analUidCondition, labelingAssignmentEntity.inspectorUid.isNotNull(), labelingAssignmentEntity.workState.notIn("DONE")) .fetchOne(); @@ -416,12 +416,14 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto ? labelingAssignmentEntity.inspectorUid.eq(workerId) : labelingAssignmentEntity.workerUid.eq(workerId); + BooleanExpression analUidCondition = analUid != null ? labelingAssignmentEntity.analUid.eq(analUid) : null; + Long count = queryFactory .select(labelingAssignmentEntity.count()) .from(labelingAssignmentEntity) .where( - labelingAssignmentEntity.analUid.eq(analUid), + analUidCondition, workerCondition, labelingAssignmentEntity.workState.in( LabelState.DONE.getId(), LabelState.SKIP.getId()), From b4ae6e148dcbf54e75ab13d9acc41480480349b4 Mon Sep 17 00:00:00 2001 From: "gayoun.park" Date: Mon, 5 Jan 2026 11:46:21 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=EB=9D=BC=EB=B2=A8=ED=95=A0=EB=8B=B9=20?= =?UTF-8?q?=EA=B2=80=EC=88=98=EC=9E=90=20insert=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../label/LabelAllocateApiController.java | 32 ++--- .../kamcoback/label/dto/LabelAllocateDto.java | 31 +--- .../label/dto/LabelInspectorDto.java | 22 +++ .../label/service/LabelAllocateService.java | 62 ++++---- .../core/LabelAllocateCoreService.java | 36 +++-- .../entity/LabelingInspectorEntity.java | 33 +++++ .../label/LabelAllocateRepositoryCustom.java | 23 ++- .../label/LabelAllocateRepositoryImpl.java | 135 ++++++++---------- 8 files changed, 190 insertions(+), 184 deletions(-) create mode 100644 src/main/java/com/kamco/cd/kamcoback/label/dto/LabelInspectorDto.java create mode 100644 src/main/java/com/kamco/cd/kamcoback/postgres/entity/LabelingInspectorEntity.java diff --git a/src/main/java/com/kamco/cd/kamcoback/label/LabelAllocateApiController.java b/src/main/java/com/kamco/cd/kamcoback/label/LabelAllocateApiController.java index 6869b636..3f2133f7 100644 --- a/src/main/java/com/kamco/cd/kamcoback/label/LabelAllocateApiController.java +++ b/src/main/java/com/kamco/cd/kamcoback/label/LabelAllocateApiController.java @@ -122,8 +122,6 @@ public class LabelAllocateApiController { return ApiResponseDto.okObject( labelAllocateService.allocateAsc( - dto.getLabelerAutoType(), - dto.getInspectorAutoType(), dto.getStage(), dto.getLabelers(), dto.getInspectors(), @@ -140,13 +138,13 @@ public class LabelAllocateApiController { }) @GetMapping("/stage-detail") public ApiResponseDto findInferenceDetail( - @Parameter(description = "비교년도", required = true, example = "2022") @RequestParam - Integer compareYyyy, - @Parameter(description = "기준년도", required = true, example = "2024") @RequestParam - Integer targetYyyy, - @Parameter(description = "회차", required = true, example = "4") @RequestParam Integer stage) { - return ApiResponseDto.ok( - labelAllocateService.findInferenceDetail(compareYyyy, targetYyyy, stage)); + @Parameter( + description = "회차 마스터 key", + required = true, + example = "8584e8d4-53b3-4582-bde2-28a81495a626") + @RequestParam + String uuid) { + return ApiResponseDto.ok(labelAllocateService.findInferenceDetail(uuid)); } @Operation( @@ -154,14 +152,14 @@ public class LabelAllocateApiController { description = "작업현황 관리 > 라벨러 상세 정보, 작업이관 팝업 내 라벨러 상세 정보 동일") @GetMapping("/labeler-detail") public ApiResponseDto findLabelerDetail( - @RequestParam(defaultValue = "01022223333") String userId, - @Parameter(description = "비교년도", required = true, example = "2022") @RequestParam - Integer compareYyyy, - @Parameter(description = "기준년도", required = true, example = "2024") @RequestParam - Integer targetYyyy, - @Parameter(description = "회차", required = true, example = "4") @RequestParam Integer stage) { - return ApiResponseDto.ok( - labelAllocateService.findLabelerDetail(userId, compareYyyy, targetYyyy, stage)); + @RequestParam(defaultValue = "01022223333", required = true) String userId, + @Parameter( + description = "회차 마스터 key", + required = true, + example = "8584e8d4-53b3-4582-bde2-28a81495a626") + @RequestParam + String uuid) { + return ApiResponseDto.ok(labelAllocateService.findLabelerDetail(userId, uuid)); } @Operation(summary = "작업현황 관리 > 상세 > 작업 이관", description = "작업현황 관리 > 상세 > 작업 이관") diff --git a/src/main/java/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto.java b/src/main/java/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto.java index c0dd75a6..f5a060a8 100644 --- a/src/main/java/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto.java +++ b/src/main/java/com/kamco/cd/kamcoback/label/dto/LabelAllocateDto.java @@ -87,22 +87,13 @@ public class LabelAllocateDto { @AllArgsConstructor public static class AllocateDto { - // @Schema(description = "분석 ID", example = "3") - // private Long analUid; - @Schema(description = "비교년도", example = "2022", required = true) private Integer compareYyyy; @Schema(description = "기준년도", example = "2024", required = true) private Integer targetYyyy; - @Schema(description = "라벨러 자동/수동여부(AUTO/MANUAL)", example = "AUTO") - private String labelerAutoType; - - @Schema(description = "검수자 자동/수동여부(AUTO/MANUAL)", example = "AUTO") - private String inspectorAutoType; - - @Schema(description = "회차", example = "4") + @Schema(description = "회차", example = "4", required = true) private Integer stage; @Schema( @@ -130,22 +121,12 @@ public class LabelAllocateDto { description = "검수자 할당 목록", example = """ - [ - { - "inspectorUid": "K20251216001", - "userCount": 1000 - }, - { - "inspectorUid": "01022225555", - "userCount": 340 - }, - { - "inspectorUid": "K20251212001", - "userCount": 500 - } + ["K20251216001", + "01022225555", + "K20251212001" ] """) - private List inspectors; + private List inspectors; } @Getter @@ -273,6 +254,6 @@ public class LabelAllocateDto { public static class AllocateInfoDto { private Long geoUid; - private String mapSheetNum; + private Long mapSheetNum; } } diff --git a/src/main/java/com/kamco/cd/kamcoback/label/dto/LabelInspectorDto.java b/src/main/java/com/kamco/cd/kamcoback/label/dto/LabelInspectorDto.java new file mode 100644 index 00000000..89fd8ef7 --- /dev/null +++ b/src/main/java/com/kamco/cd/kamcoback/label/dto/LabelInspectorDto.java @@ -0,0 +1,22 @@ +package com.kamco.cd.kamcoback.label.dto; + +import java.time.ZonedDateTime; +import java.util.UUID; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +public class LabelInspectorDto { + + @Getter + @Setter + @AllArgsConstructor + public static class Basic { + + private UUID operatorUid; + private Long analUid; + private String inspectorUid; + private ZonedDateTime createdDttm; + private ZonedDateTime updatedDttm; + } +} diff --git a/src/main/java/com/kamco/cd/kamcoback/label/service/LabelAllocateService.java b/src/main/java/com/kamco/cd/kamcoback/label/service/LabelAllocateService.java index c919a5eb..8a994a1f 100644 --- a/src/main/java/com/kamco/cd/kamcoback/label/service/LabelAllocateService.java +++ b/src/main/java/com/kamco/cd/kamcoback/label/service/LabelAllocateService.java @@ -6,7 +6,6 @@ import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto; import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.AllocateInfoDto; import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceDetail; import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelerDetail; -import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.TargetInspector; import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.TargetUser; import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.UserList; import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.DailyHistory; @@ -16,7 +15,6 @@ import com.kamco.cd.kamcoback.postgres.core.LabelAllocateCoreService; import java.time.LocalDate; import java.util.List; import java.util.Objects; -import java.util.UUID; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -38,19 +36,15 @@ public class LabelAllocateService { /** * 도엽 기준 asc sorting 해서 할당 수만큼 배정하는 로직 * - * @param labelerAutoType 라벨러 자동/수동 배정 타입 - * @param inspectorAutoType 검수자 자동/수동 배정 타입 * @param stage 회차 * @param targetUsers 라벨러 목록 * @param targetInspectors 검수자 목록 */ @Transactional public ApiResponseDto.ResponseObj allocateAsc( - String labelerAutoType, - String inspectorAutoType, Integer stage, List targetUsers, - List targetInspectors, + List targetInspectors, Integer compareYyyy, Integer targetYyyy) { Long lastId = null; @@ -70,35 +64,45 @@ public class LabelAllocateService { List allIds = labelAllocateCoreService.fetchNextIds(lastId, chargeCnt, compareYyyy, targetYyyy, stage); + + // MapSheetAnalInferenceEntity analUid 가져오기 + Long analUid = + labelAllocateCoreService.findMapSheetAnalInferenceUid(compareYyyy, targetYyyy, stage); + int index = 0; for (TargetUser target : targetUsers) { int end = index + target.getDemand(); List sub = allIds.subList(index, end); - labelAllocateCoreService.assignOwner(sub, target.getUserId(), compareYyyy, targetYyyy, stage); + labelAllocateCoreService.assignOwner(sub, target.getUserId(), analUid); index = end; } // 검수자에게 userCount명 만큼 할당 - List list = - labelAllocateCoreService.findAssignedLabelerList(compareYyyy, targetYyyy, stage); - int from = 0; + List list = labelAllocateCoreService.findAssignedLabelerList(analUid); - for (TargetInspector inspector : targetInspectors) { - int to = Math.min(from + inspector.getUserCount(), list.size()); - - if (from >= to) { - break; - } - - List assignmentUids = - list.subList(from, to).stream().map(LabelAllocateDto.Basic::getAssignmentUid).toList(); - - labelAllocateCoreService.assignInspectorBulk(assignmentUids, inspector.getInspectorUid()); - - from = to; + 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 assignmentUids = + // list.subList(from, + // to).stream().map(LabelAllocateDto.Basic::getAssignmentUid).toList(); + // + // labelAllocateCoreService.assignInspectorBulk(assignmentUids, + // inspector.getInspectorUid()); + // + // from = to; + // } + return new ApiResponseDto.ResponseObj(ApiResponseCode.OK, "배정이 완료되었습니다."); } @@ -165,9 +169,8 @@ public class LabelAllocateService { return WorkerListResponse.builder().progressInfo(progressInfo).workers(workers).build(); } - public InferenceDetail findInferenceDetail( - Integer compareYyyy, Integer targetYyyy, Integer stage) { - return labelAllocateCoreService.findInferenceDetail(compareYyyy, targetYyyy, stage); + public InferenceDetail findInferenceDetail(String uuid) { + return labelAllocateCoreService.findInferenceDetail(uuid); } public ApiResponseDto.ResponseObj allocateMove( @@ -199,8 +202,7 @@ public class LabelAllocateService { return new ApiResponseDto.ResponseObj(ApiResponseCode.OK, "이관을 완료하였습니다."); } - public LabelerDetail findLabelerDetail( - String userId, Integer compareYyyy, Integer targetYyyy, Integer stage) { - return labelAllocateCoreService.findLabelerDetail(userId, compareYyyy, targetYyyy, stage); + public LabelerDetail findLabelerDetail(String userId, String uuid) { + return labelAllocateCoreService.findLabelerDetail(userId, uuid); } } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/core/LabelAllocateCoreService.java b/src/main/java/com/kamco/cd/kamcoback/postgres/core/LabelAllocateCoreService.java index 3e16eae5..5fd49cf5 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/core/LabelAllocateCoreService.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/core/LabelAllocateCoreService.java @@ -26,18 +26,12 @@ public class LabelAllocateCoreService { return labelAllocateRepository.fetchNextIds(lastId, batchSize, compareYyyy, targetYyyy, stage); } - public void assignOwner( - List ids, - String userId, - Integer compareYyyy, - Integer targetYyyy, - Integer stage) { - labelAllocateRepository.assignOwner(ids, userId, compareYyyy, targetYyyy, stage); + public void assignOwner(List ids, String userId, Long analUid) { + labelAllocateRepository.assignOwner(ids, userId, analUid); } - public List findAssignedLabelerList( - Integer compareYyyy, Integer targetYyyy, Integer stage) { - return labelAllocateRepository.findAssignedLabelerList(compareYyyy, targetYyyy, stage).stream() + public List findAssignedLabelerList(Long analUid) { + return labelAllocateRepository.findAssignedLabelerList(analUid).stream() .map(LabelingAssignmentEntity::toDto) .toList(); } @@ -77,13 +71,8 @@ public class LabelAllocateCoreService { labelAllocateRepository.assignInspectorBulk(assignmentUids, inspectorUid); } - public InferenceDetail findInferenceDetail( - Integer compareYyyy, Integer targetYyyy, Integer stage) { - return labelAllocateRepository.findInferenceDetail(compareYyyy, targetYyyy, stage); - } - - public Long findLabelUnCompleteCnt(Long analUid) { - return labelAllocateRepository.findLabelUnCompleteCnt(analUid); + public InferenceDetail findInferenceDetail(String uuid) { + return labelAllocateRepository.findInferenceDetail(uuid); } public List fetchNextMoveIds( @@ -96,8 +85,15 @@ public class LabelAllocateCoreService { labelAllocateRepository.assignOwnerMove(sub, userId); } - public LabelerDetail findLabelerDetail( - String userId, Integer compareYyyy, Integer targetYyyy, Integer stage) { - return labelAllocateRepository.findLabelerDetail(userId, compareYyyy, targetYyyy, stage); + public LabelerDetail findLabelerDetail(String userId, String uuid) { + return labelAllocateRepository.findLabelerDetail(userId, uuid); + } + + public Long findMapSheetAnalInferenceUid(Integer compareYyyy, Integer targetYyyy, Integer stage) { + return labelAllocateRepository.findMapSheetAnalInferenceUid(compareYyyy, targetYyyy, stage); + } + + public void insertInspector(Long analUid, String inspector) { + labelAllocateRepository.insertInspector(analUid, inspector); } } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/entity/LabelingInspectorEntity.java b/src/main/java/com/kamco/cd/kamcoback/postgres/entity/LabelingInspectorEntity.java new file mode 100644 index 00000000..5da0a685 --- /dev/null +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/entity/LabelingInspectorEntity.java @@ -0,0 +1,33 @@ +package com.kamco.cd.kamcoback.postgres.entity; + +import com.kamco.cd.kamcoback.label.dto.LabelInspectorDto; +import com.kamco.cd.kamcoback.postgres.CommonDateEntity; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import java.util.UUID; + +@Entity +@Table(name = "tb_labeling_inspector") +public class LabelingInspectorEntity extends CommonDateEntity { + + @Id + @Column(name = "operator_uid") + private UUID operatorUid; + + @Column(name = "anal_uid") + private Long analUid; + + @Column(name = "inspector_uid") + private String inspectorUid; + + public LabelInspectorDto.Basic toDto() { + return new LabelInspectorDto.Basic( + this.operatorUid, + this.analUid, + this.inspectorUid, + super.getCreatedDate(), + super.getModifiedDate()); + } +} diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryCustom.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryCustom.java index 22988c98..72a1534e 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryCustom.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryCustom.java @@ -16,15 +16,9 @@ public interface LabelAllocateRepositoryCustom { List fetchNextIds( Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage); - void assignOwner( - List ids, - String userId, - Integer compareYyyy, - Integer targetYyyy, - Integer stage); + void assignOwner(List ids, String userId, Long analUid); - List findAssignedLabelerList( - Integer compareYyyy, Integer targetYyyy, Integer stage); + List findAssignedLabelerList(Long analUid); Long findLabelUnAssignedCnt(Integer stage, Integer compareYyyy, Integer targetYyyy); @@ -44,15 +38,16 @@ public interface LabelAllocateRepositoryCustom { void assignInspectorBulk(List assignmentUids, String inspectorUid); - InferenceDetail findInferenceDetail(Integer compareYyyy, Integer targetYyyy, Integer stage); + InferenceDetail findInferenceDetail(String uuid); - public List fetchNextMoveIds( + List fetchNextMoveIds( Long lastId, Long batchSize, Integer compareYyyy, Integer targetYyyy, Integer stage); - Long findLabelUnCompleteCnt(Long analUid); - void assignOwnerMove(List sub, String userId); - LabelerDetail findLabelerDetail( - String userId, Integer compareYyyy, Integer targetYyyy, Integer stage); + LabelerDetail findLabelerDetail(String userId, String uuid); + + Long findMapSheetAnalInferenceUid(Integer compareYyyy, Integer targetYyyy, Integer stage); + + void insertInspector(Long analUid, String inspector); } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java index 9e52da12..37f54a38 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java @@ -1,9 +1,10 @@ package com.kamco.cd.kamcoback.postgres.repository.label; import static com.kamco.cd.kamcoback.postgres.entity.QLabelingAssignmentEntity.labelingAssignmentEntity; -import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity.mapSheetAnalDataInferenceEntity; +import static com.kamco.cd.kamcoback.postgres.entity.QLabelingInspectorEntity.labelingInspectorEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalEntity.mapSheetAnalEntity; +import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMemberEntity.memberEntity; import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto; @@ -16,8 +17,7 @@ import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.UserList; import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkProgressInfo; import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkerStatistics; import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity; -import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceEntity; -import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalEntity; +import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalInferenceEntity; import com.kamco.cd.kamcoback.postgres.entity.QMemberEntity; import com.querydsl.core.types.Projections; import com.querydsl.core.types.dsl.BooleanExpression; @@ -73,27 +73,17 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto } @Override - public void assignOwner( - List ids, - String userId, - Integer compareYyyy, - Integer targetYyyy, - Integer stage) { + public void assignOwner(List ids, String userId, Long analUid) { // analUid로 분석 정보 조회 - MapSheetAnalDataInferenceEntity analEntity = + MapSheetAnalInferenceEntity analEntity = queryFactory - .selectFrom(mapSheetAnalDataInferenceEntity) - .where( - mapSheetAnalDataInferenceEntity.compareYyyy.eq(compareYyyy), - mapSheetAnalDataInferenceEntity.targetYyyy.eq(targetYyyy), - mapSheetAnalDataInferenceEntity.stage.eq(stage)) - .orderBy(mapSheetAnalDataInferenceEntity.analUid.asc()) - .limit(1) + .selectFrom(mapSheetAnalInferenceEntity) + .where(mapSheetAnalInferenceEntity.id.eq(analUid)) .fetchOne(); if (Objects.isNull(analEntity)) { - throw new EntityNotFoundException("MapSheetAnalEntity not found for analUid: "); + throw new EntityNotFoundException("MapSheetAnalInferenceEntity not found for analUid: "); } // data_geom 테이블에 label state 를 ASSIGNED 로 update @@ -125,7 +115,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .setParameter(3, userId) .setParameter(4, LabelState.ASSIGNED.getId()) .setParameter(5, info.getMapSheetNum()) - .setParameter(6, analEntity.getAnalUid()) + .setParameter(6, analEntity.getId()) .executeUpdate(); } @@ -134,28 +124,22 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto } @Override - public List findAssignedLabelerList( - Integer compareYyyy, Integer targetYyyy, Integer stage) { + public List findAssignedLabelerList(Long analUid) { // analUid로 분석 정보 조회 - MapSheetAnalDataInferenceEntity analEntity = + MapSheetAnalInferenceEntity analEntity = queryFactory - .selectFrom(mapSheetAnalDataInferenceEntity) - .where( - mapSheetAnalDataInferenceEntity.compareYyyy.eq(compareYyyy), - mapSheetAnalDataInferenceEntity.targetYyyy.eq(targetYyyy), - mapSheetAnalDataInferenceEntity.stage.eq(stage)) - .orderBy(mapSheetAnalDataInferenceEntity.analUid.asc()) - .limit(1) + .selectFrom(mapSheetAnalInferenceEntity) + .where(mapSheetAnalInferenceEntity.id.eq(analUid)) .fetchOne(); if (Objects.isNull(analEntity)) { - throw new EntityNotFoundException("MapSheetAnalEntity not found for analUid: "); + throw new EntityNotFoundException("mapSheetAnalInferenceEntity not found for analUid: "); } return queryFactory .selectFrom(labelingAssignmentEntity) .where( - labelingAssignmentEntity.analUid.eq(analEntity.getAnalUid()), + labelingAssignmentEntity.analUid.eq(analEntity.getId()), labelingAssignmentEntity.workState.eq(LabelState.ASSIGNED.getId()), labelingAssignmentEntity.inspectorUid.isNull()) .orderBy(labelingAssignmentEntity.workerUid.asc()) @@ -443,20 +427,18 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto } @Override - public InferenceDetail findInferenceDetail( - Integer compareYyyy, Integer targetYyyy, Integer stage) { + public InferenceDetail findInferenceDetail(String uuid) { // analUid로 분석 정보 조회 - MapSheetAnalDataInferenceEntity analEntity = + MapSheetAnalInferenceEntity analEntity = queryFactory - .selectFrom(mapSheetAnalDataInferenceEntity) - .where( - mapSheetAnalDataInferenceEntity.compareYyyy.eq(compareYyyy), - mapSheetAnalDataInferenceEntity.targetYyyy.eq(targetYyyy), - mapSheetAnalDataInferenceEntity.stage.eq(stage)) - .orderBy(mapSheetAnalDataInferenceEntity.analUid.asc()) - .limit(1) + .selectFrom(mapSheetAnalInferenceEntity) + .where(mapSheetAnalInferenceEntity.uuid.eq(UUID.fromString(uuid))) .fetchOne(); + if (Objects.isNull(analEntity)) { + throw new EntityNotFoundException("MapSheetAnalInferenceEntity not found for analUid: "); + } + return queryFactory .select( Projections.constructor( @@ -470,7 +452,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .from(mapSheetAnalEntity) .innerJoin(labelingAssignmentEntity) .on(mapSheetAnalEntity.id.eq(labelingAssignmentEntity.analUid)) - .where(mapSheetAnalEntity.id.eq(analEntity.getAnalUid())) + .where(mapSheetAnalEntity.id.eq(analEntity.getId())) .groupBy( mapSheetAnalEntity.analTitle, mapSheetAnalEntity.gukyuinApplyDttm, @@ -498,30 +480,6 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .fetch(); } - @Override - public Long findLabelUnCompleteCnt(Long analUid) { - MapSheetAnalEntity entity = - queryFactory - .selectFrom(mapSheetAnalEntity) - .where(mapSheetAnalEntity.id.eq(analUid)) - .fetchOne(); - - if (Objects.isNull(entity)) { - throw new EntityNotFoundException(); - } - - return queryFactory - .select(mapSheetAnalDataInferenceGeomEntity.geoUid.count()) - .from(mapSheetAnalDataInferenceGeomEntity) - .where( - mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(entity.getCompareYyyy()), - mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(entity.getTargetYyyy()), - mapSheetAnalDataInferenceGeomEntity.stage.eq(4), // TODO: 회차 컬럼을 가져와야 할 듯? - mapSheetAnalDataInferenceGeomEntity.labelState.in( - LabelState.ASSIGNED.getId(), LabelState.SKIP.getId())) - .fetchOne(); - } - @Transactional @Override public void assignOwnerMove(List sub, String userId) { @@ -535,8 +493,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto } @Override - public LabelerDetail findLabelerDetail( - String userId, Integer compareYyyy, Integer targetYyyy, Integer stage) { + public LabelerDetail findLabelerDetail(String userId, String uuid) { NumberExpression assignedCnt = new CaseBuilder() .when(labelingAssignmentEntity.workState.eq(LabelState.ASSIGNED.getId())) @@ -570,19 +527,14 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto completeCnt)); // analUid로 분석 정보 조회 - MapSheetAnalDataInferenceEntity analEntity = + MapSheetAnalInferenceEntity analEntity = queryFactory - .selectFrom(mapSheetAnalDataInferenceEntity) - .where( - mapSheetAnalDataInferenceEntity.compareYyyy.eq(compareYyyy), - mapSheetAnalDataInferenceEntity.targetYyyy.eq(targetYyyy), - mapSheetAnalDataInferenceEntity.stage.eq(stage)) - .orderBy(mapSheetAnalDataInferenceEntity.analUid.asc()) - .limit(1) + .selectFrom(mapSheetAnalInferenceEntity) + .where(mapSheetAnalInferenceEntity.uuid.eq(UUID.fromString(uuid))) .fetchOne(); if (Objects.isNull(analEntity)) { - throw new EntityNotFoundException("MapSheetAnalEntity not found for analUid: "); + throw new EntityNotFoundException("MapSheetAnalInferenceEntity not found for analUid: "); } QMemberEntity worker = QMemberEntity.memberEntity; @@ -606,11 +558,38 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .innerJoin(labelingAssignmentEntity) .on( worker.employeeNo.eq(labelingAssignmentEntity.workerUid), - labelingAssignmentEntity.analUid.eq(analEntity.getAnalUid())) + labelingAssignmentEntity.analUid.eq(analEntity.getId())) .leftJoin(inspector) .on(labelingAssignmentEntity.inspectorUid.eq(inspector.employeeNo)) .where(worker.employeeNo.eq(userId)) .groupBy(worker.userRole, worker.name, worker.employeeNo) .fetchOne(); } + + @Override + public Long findMapSheetAnalInferenceUid(Integer compareYyyy, Integer targetYyyy, Integer stage) { + return queryFactory + .select(mapSheetAnalInferenceEntity.id) + .from(mapSheetAnalInferenceEntity) + .where( + mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy), + mapSheetAnalInferenceEntity.targetYyyy.eq(targetYyyy), + mapSheetAnalInferenceEntity.stage.eq(stage)) + .fetchOne(); + } + + @Override + public void insertInspector(Long analUid, String inspector) { + queryFactory + .insert(labelingInspectorEntity) + .columns( + labelingInspectorEntity.operatorUid, + labelingInspectorEntity.analUid, + labelingInspectorEntity.inspectorUid) + .values(UUID.randomUUID(), analUid, inspector) + .execute(); + + em.flush(); + em.clear(); + } } From 96f5a87b1a7173288f9625c18b8e393c7a9d7e6e Mon Sep 17 00:00:00 2001 From: DanielLee <198891672+sanghyeonhd@users.noreply.github.com> Date: Mon, 5 Jan 2026 12:33:48 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EC=9E=91=EC=97=85=ED=98=84=ED=99=A9?= =?UTF-8?q?=EA=B4=80=EB=A6=AC=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EB=B0=98?= =?UTF-8?q?=ED=99=98=EA=B0=92=20=EC=B6=94=EA=B0=80=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../label/LabelAllocateApiController.java | 2 + .../kamcoback/label/dto/WorkerStatsDto.java | 87 +++++++++++++++++-- .../label/LabelAllocateRepositoryImpl.java | 6 ++ 3 files changed, 86 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/kamco/cd/kamcoback/label/LabelAllocateApiController.java b/src/main/java/com/kamco/cd/kamcoback/label/LabelAllocateApiController.java index 1395f42b..4e0f9373 100644 --- a/src/main/java/com/kamco/cd/kamcoback/label/LabelAllocateApiController.java +++ b/src/main/java/com/kamco/cd/kamcoback/label/LabelAllocateApiController.java @@ -85,6 +85,8 @@ public class LabelAllocateApiController { allowableValues = { "REMAINING_DESC", "REMAINING_ASC", + "COMPLETED_DESC", + "COMPLETED_ASC", "NAME_ASC", "NAME_DESC" }, diff --git a/src/main/java/com/kamco/cd/kamcoback/label/dto/WorkerStatsDto.java b/src/main/java/com/kamco/cd/kamcoback/label/dto/WorkerStatsDto.java index f879f0ee..e95dd346 100644 --- a/src/main/java/com/kamco/cd/kamcoback/label/dto/WorkerStatsDto.java +++ b/src/main/java/com/kamco/cd/kamcoback/label/dto/WorkerStatsDto.java @@ -10,6 +10,27 @@ import lombok.Setter; public class WorkerStatsDto { + @Getter + @Setter + @Builder + @NoArgsConstructor + @AllArgsConstructor + @Schema(description = "프로젝트 기본 정보 (상단 표시용)") + public static class ProjectInfo { + + @Schema(description = "변화탐지년도 (예: 2026-2025)") + private String detectionYear; + + @Schema(description = "회차 (예: 8)") + private String round; + + @Schema(description = "국유인 반영일 (예: 2026-03-31)") + private String reflectionDate; + + @Schema(description = "작업 시작일 (예: 2026-04-06)") + private String startDate; + } + @Getter @Setter @Builder @@ -75,29 +96,74 @@ public class WorkerStatsDto { @Schema(description = "작업 진행 현황 정보") public static class WorkProgressInfo { + // === 라벨링 관련 === @Schema(description = "라벨링 진행률 (완료건+스킵건)/배정건") private Double labelingProgressRate; - @Schema(description = "작업 상태 (진행중/종료)") - private String workStatus; + @Schema(description = "라벨링 작업 상태 (진행중/완료)") + private String labelingStatus; - @Schema(description = "진행률 수치 (완료+스킵)") - private Long completedCount; + @Schema(description = "라벨링 전체 배정 건수") + private Long labelingTotalCount; - @Schema(description = "전체 배정 건수") - private Long totalAssignedCount; + @Schema(description = "라벨링 완료 건수 (LABEL_FIN + TEST_ING + DONE)") + private Long labelingCompletedCount; + + @Schema(description = "라벨링 스킵 건수 (SKIP)") + private Long labelingSkipCount; + + @Schema(description = "라벨링 남은 작업 건수") + private Long labelingRemainingCount; @Schema(description = "투입된 라벨러 수") private Long labelerCount; - @Schema(description = "남은 라벨링 작업 데이터 수") - private Long remainingLabelCount; + // === 검수(Inspection) 관련 (신규 추가) === + @Schema(description = "검수 진행률 (완료건/대상건)") + private Double inspectionProgressRate; + + @Schema(description = "검수 작업 상태 (진행중/완료)") + private String inspectionStatus; + + @Schema(description = "검수 전체 대상 건수") + private Long inspectionTotalCount; + + @Schema(description = "검수 완료 건수 (DONE)") + private Long inspectionCompletedCount; + + @Schema(description = "검수 제외 건수 (라벨링 스킵과 동일)") + private Long inspectionSkipCount; + + @Schema(description = "검수 남은 작업 건수") + private Long inspectionRemainingCount; @Schema(description = "투입된 검수자 수") private Long inspectorCount; - @Schema(description = "남은 검수 작업 데이터 수") + // === 레거시 호환 필드 (Deprecated) === + @Deprecated + @Schema(description = "[Deprecated] labelingProgressRate 사용 권장") + private Double progressRate; + + @Deprecated + @Schema(description = "[Deprecated] labelingTotalCount 사용 권장") + private Long totalAssignedCount; + + @Deprecated + @Schema(description = "[Deprecated] labelingCompletedCount 사용 권장") + private Long completedCount; + + @Deprecated + @Schema(description = "[Deprecated] labelingRemainingCount 사용 권장") + private Long remainingLabelCount; + + @Deprecated + @Schema(description = "[Deprecated] inspectionRemainingCount 사용 권장") private Long remainingInspectCount; + + @Deprecated + @Schema(description = "[Deprecated] labelingStatus/inspectionStatus 사용 권장") + private String workStatus; } @Getter @@ -108,6 +174,9 @@ public class WorkerStatsDto { @Schema(description = "작업자 목록 응답 (작업 정보 포함)") public static class WorkerListResponse { + @Schema(description = "프로젝트 기본 정보 (상단 표시용)") + private ProjectInfo projectInfo; + @Schema(description = "작업 진행 현황 정보") private WorkProgressInfo progressInfo; diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java index 6d973dad..d6ceeb0f 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java @@ -268,6 +268,12 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto case "REMAINING_ASC": baseQuery.orderBy(remainingSum.asc()); break; + case "COMPLETED_DESC": + baseQuery.orderBy(completedSum.desc()); + break; + case "COMPLETED_ASC": + baseQuery.orderBy(completedSum.asc()); + break; case "NAME_ASC": baseQuery.orderBy(memberEntity.name.asc()); break;