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:
2026-01-05 11:46:43 +09:00
6 changed files with 71 additions and 36 deletions

View File

@@ -51,11 +51,10 @@ public class LabelAllocateCoreService {
public List<WorkerStatistics> 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) {

View File

@@ -28,7 +28,7 @@ public interface LabelAllocateRepositoryCustom {
// 작업자 통계 조회
List<WorkerStatistics> findWorkerStatistics(
Long analUid, String workerType, String searchName, String searchEmployeeNo, String sortType);
Long analUid, String workerType, String search, String sortType);
// 작업 진행 현황 조회
WorkProgressInfo findWorkProgressInfo(Long analUid);

View File

@@ -190,8 +190,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
public List<WorkerStatistics> findWorkerStatistics(
Long analUid,
String workerType,
String searchName,
String searchEmployeeNo,
String search,
String sortType) {
// 작업자 유형에 따른 필드 선택
@@ -205,14 +204,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));
}
// 완료, 스킵, 남은 작업 계산
@@ -242,6 +238,8 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
.sum();
// 기본 통계 조회 쿼리
BooleanExpression analUidCondition = analUid != null ? labelingAssignmentEntity.analUid.eq(analUid) : null;
var baseQuery =
queryFactory
.select(
@@ -258,7 +256,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);
// 정렬 조건 적용
@@ -305,12 +303,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();
// 완료 + 스킵 건수
@@ -319,7 +319,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
.select(labelingAssignmentEntity.count())
.from(labelingAssignmentEntity)
.where(
labelingAssignmentEntity.analUid.eq(analUid),
analUidCondition,
labelingAssignmentEntity.workState.in("DONE", "SKIP"))
.fetchOne();
@@ -329,7 +329,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
.select(labelingAssignmentEntity.workerUid.countDistinct())
.from(labelingAssignmentEntity)
.where(
labelingAssignmentEntity.analUid.eq(analUid),
analUidCondition,
labelingAssignmentEntity.workerUid.isNotNull())
.fetchOne();
@@ -339,7 +339,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();
@@ -350,7 +350,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
.select(labelingAssignmentEntity.inspectorUid.countDistinct())
.from(labelingAssignmentEntity)
.where(
labelingAssignmentEntity.analUid.eq(analUid),
analUidCondition,
labelingAssignmentEntity.inspectorUid.isNotNull())
.fetchOne();
@@ -360,7 +360,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();
@@ -400,12 +400,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()),