Merge branch 'feat/dev_251201' of https://10.100.0.10:3210/dabeeo/kamco-dabeeo-backoffice into feat/dev_251201
This commit is contained in:
@@ -63,7 +63,7 @@ public class LabelAllocateApiController {
|
||||
})
|
||||
@GetMapping("/admin/workers")
|
||||
public ApiResponseDto<WorkerListResponse> 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 = "라벨링작업 관리 > 작업 배정")
|
||||
|
||||
@@ -113,5 +113,17 @@ public class WorkerStatsDto {
|
||||
|
||||
@Schema(description = "작업자 목록")
|
||||
private List<WorkerStatistics> workers;
|
||||
|
||||
@Schema(description = "현재 페이지 번호 (0부터 시작)")
|
||||
private Integer currentPage;
|
||||
|
||||
@Schema(description = "페이지 크기")
|
||||
private Integer pageSize;
|
||||
|
||||
@Schema(description = "전체 데이터 수")
|
||||
private Long totalElements;
|
||||
|
||||
@Schema(description = "전체 페이지 수")
|
||||
private Integer totalPages;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,21 +111,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);
|
||||
@@ -133,7 +135,7 @@ public class LabelAllocateService {
|
||||
// 작업자 통계 조회
|
||||
List<WorkerStatistics> workers =
|
||||
labelAllocateCoreService.findWorkerStatistics(
|
||||
analUid, workerType, searchName, searchEmployeeNo, sortType);
|
||||
analUid, workerType, search, sortType);
|
||||
|
||||
// 각 작업자별 3일치 처리량 조회
|
||||
LocalDate today = LocalDate.now();
|
||||
@@ -166,7 +168,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<WorkerStatistics> 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(String uuid) {
|
||||
|
||||
Reference in New Issue
Block a user