This commit is contained in:
2026-01-14 17:02:58 +09:00
parent c6c8312d99
commit 318c221266
3 changed files with 16 additions and 26 deletions

View File

@@ -176,7 +176,8 @@ public class LabelAllocateCoreService {
return detail; // analUid 없으면 순위 0으로 반환
}
List<LabelerDetail> allInspectors = labelAllocateRepository.findAllInspectorsForRanking(analUid);
List<LabelerDetail> allInspectors =
labelAllocateRepository.findAllInspectorsForRanking(analUid);
// 3. 순위 계산 (DENSE_RANK 로직: 동점자는 같은 순위, 다음 순위는 연속)
Long lastCompleteCnt = null;

View File

@@ -68,14 +68,10 @@ public interface LabelAllocateRepositoryCustom {
LabelerDetail findLabelerDetail(String userId, String uuid);
/**
* 순위 계산용 - 특정 회차의 모든 라벨러 통계 조회
*/
/** 순위 계산용 - 특정 회차의 모든 라벨러 통계 조회 */
List<LabelerDetail> findAllLabelersForRanking(Long analUid);
/**
* UUID로 analUid 조회
*/
/** UUID로 analUid 조회 */
Long findAnalUidByUuid(String uuid);
Long findMapSheetAnalInferenceUid(Integer compareYyyy, Integer targetYyyy, Integer stage);
@@ -90,9 +86,7 @@ public interface LabelAllocateRepositoryCustom {
LabelerDetail findInspectorDetail(String userId, String uuid);
/**
* 순위 계산용 - 특정 회차의 모든 검수자 통계 조회
*/
/** 순위 계산용 - 특정 회차의 모든 검수자 통계 조회 */
List<LabelerDetail> findAllInspectorsForRanking(Long analUid);
MoveInfo moveAvailUserList(String userId, String uuid);

View File

@@ -848,9 +848,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
.fetchOne();
}
/**
* 특정 회차의 모든 라벨러 통계 조회 (순위 계산용)
*/
/** 특정 회차의 모든 라벨러 통계 조회 (순위 계산용) */
public List<LabelerDetail> findAllLabelersForRanking(Long analUid) {
QMemberEntity worker = QMemberEntity.memberEntity;
@@ -898,9 +896,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
.fetch();
}
/**
* UUID로 analUid 조회
*/
/** UUID로 analUid 조회 */
@Override
public Long findAnalUidByUuid(String uuid) {
return queryFactory
@@ -1355,9 +1351,9 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
inspector.userRole,
inspector.name,
inspector.employeeNo,
assignedCnt, // count (총 배정 건수)
completeCnt, // completeCnt (완료 건수)
skipCnt, // skipCnt (스킵 건수)
assignedCnt, // count (총 배정 건수)
completeCnt, // completeCnt (완료 건수)
skipCnt, // skipCnt (스킵 건수)
percent,
Expressions.constant(0), // 순위는 Service 레이어에서 계산
labelingAssignmentEntity.inspectStatDttm.min(),
@@ -1375,9 +1371,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
.fetchOne();
}
/**
* 순위 계산용 - 특정 회차의 모든 검수자 통계 조회
*/
/** 순위 계산용 - 특정 회차의 모든 검수자 통계 조회 */
public List<LabelerDetail> findAllInspectorsForRanking(Long analUid) {
QMemberEntity inspector = QMemberEntity.memberEntity;
@@ -1403,7 +1397,8 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
.count();
Expression<Long> remainCnt =
Expressions.numberTemplate(Long.class, "({0} - {1} - {2})", assignedCnt, skipCnt, completeCnt);
Expressions.numberTemplate(
Long.class, "({0} - {1} - {2})", assignedCnt, skipCnt, completeCnt);
return queryFactory
.select(
@@ -1412,9 +1407,9 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
inspector.userRole,
inspector.name,
inspector.employeeNo,
assignedCnt, // count (총 배정 건수)
completeCnt, // completeCnt (완료 건수)
skipCnt, // skipCnt (스킵 건수)
assignedCnt, // count (총 배정 건수)
completeCnt, // completeCnt (완료 건수)
skipCnt, // skipCnt (스킵 건수)
Expressions.constant(0.0), // percent
Expressions.constant(0), // ranking
labelingAssignmentEntity.inspectStatDttm.min(),