작업현황관리 수정

This commit is contained in:
DanielLee
2026-01-05 11:41:50 +09:00
parent 88cf9a4487
commit 67eb99e243
6 changed files with 71 additions and 36 deletions

View File

@@ -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<WorkerStatistics> 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<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(