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 60120b9e..e4358daa 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 @@ -556,8 +556,8 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto mapSheetAnalInferenceEntity.uuid.eq(targetUuid), mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull() // mapSheetAnalDataInferenceGeomEntity.pnu.gt(0L), - // mapSheetAnalDataInferenceGeomEntity.passYn.isFalse() //TODO: 추후 라벨링 - // 대상 조건 수정하기 + // + // mapSheetAnalDataInferenceGeomEntity.fitState.eq(ImageryFitStatus.UNFIT.getId()) ) .fetchOne(); } @@ -575,8 +575,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto queryFactory .select(labelingAssignmentEntity.count()) .from(labelingAssignmentEntity) - .where( - analUidCondition, labelingAssignmentEntity.workState.in("ASSIGNED", "SKIP", "DONE")) + .where(analUidCondition, labelingAssignmentEntity.workState.in("SKIP", "DONE")) .fetchOne(); Long skipCount = @@ -601,6 +600,13 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .where(analUidCondition, labelingAssignmentEntity.inspectState.eq("COMPLETE")) .fetchOne(); + Long inspectionExcept = + queryFactory + .select(labelingAssignmentEntity.count()) + .from(labelingAssignmentEntity) + .where(analUidCondition, labelingAssignmentEntity.inspectState.eq("EXCEPT")) + .fetchOne(); + Long inspectorCount = queryFactory .select(labelingAssignmentEntity.inspectorUid.countDistinct()) @@ -613,6 +619,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto long labelCompleted = labelingCompleted != null ? labelingCompleted : 0L; long inspectCompleted = inspectionCompleted != null ? inspectionCompleted : 0L; long skipped = skipCount != null ? skipCount : 0L; + long inspectExcepted = inspectionExcept != null ? inspectionExcept : 0L; long labelingRemaining = labelingTotal - labelCompleted - skipped; if (labelingRemaining < 0) { @@ -620,7 +627,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto } long inspectionTotal = labelingTotal; - long inspectionRemaining = inspectionTotal - inspectCompleted - skipped; + long inspectionRemaining = inspectionTotal - inspectCompleted - inspectExcepted; if (inspectionRemaining < 0) { inspectionRemaining = 0; } @@ -657,7 +664,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .inspectionStatus(inspectionStatus) .inspectionTotalCount(inspectionTotal) .inspectionCompletedCount(inspectCompleted) - .inspectionSkipCount(skipped) // TODO + .inspectionSkipCount(inspectExcepted) .inspectionRemainingCount(inspectionRemaining) .inspectorCount(inspectorCount != null ? inspectorCount : 0L) .progressRate(labelingRate) diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelWorkRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelWorkRepositoryImpl.java index 4dc4cdab..9a1cc9e0 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelWorkRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelWorkRepositoryImpl.java @@ -294,14 +294,14 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom { if (searchReq.getSearchVal() != null && !searchReq.getSearchVal().isEmpty()) { whereSubBuilder.and( - Expressions.stringTemplate("{0}", memberEntity.userId) + Expressions.stringTemplate("{0}", memberEntity.employeeNo) .likeIgnoreCase("%" + searchReq.getSearchVal() + "%") .or( Expressions.stringTemplate("{0}", memberEntity.name) .likeIgnoreCase("%" + searchReq.getSearchVal() + "%"))); } - whereSubBuilder.and(labelingAssignmentEntity.workerUid.eq(memberEntity.userId)); + whereSubBuilder.and(labelingAssignmentEntity.workerUid.eq(memberEntity.employeeNo)); // 공통 조건 추출 BooleanExpression doneStateCondition = @@ -344,7 +344,7 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom { WorkerState.class, memberEntity.userRole, memberEntity.name, - memberEntity.userId, + memberEntity.employeeNo, assignedCnt.as("assignedCnt"), doneCnt.as("doneCnt"), skipCnt.as("skipCnt"), @@ -363,7 +363,10 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom { .on(whereSubBuilder) .where(whereBuilder) .groupBy( - memberEntity.userRole, memberEntity.name, memberEntity.userId, memberEntity.status) + memberEntity.userRole, + memberEntity.name, + memberEntity.employeeNo, + memberEntity.status) .orderBy(orderSpecifiers.toArray(new OrderSpecifier[0])) .offset(pageable.getOffset()) .limit(pageable.getPageSize()) @@ -441,14 +444,14 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom { if (searchReq.getSearchVal() != null && !searchReq.getSearchVal().isEmpty()) { whereSubBuilder.and( - Expressions.stringTemplate("{0}", memberEntity.userId) + Expressions.stringTemplate("{0}", memberEntity.employeeNo) .likeIgnoreCase("%" + searchReq.getSearchVal() + "%") .or( Expressions.stringTemplate("{0}", memberEntity.name) .likeIgnoreCase("%" + searchReq.getSearchVal() + "%"))); } - whereSubBuilder.and(labelingAssignmentEntity.inspectorUid.eq(memberEntity.userId)); + whereSubBuilder.and(labelingAssignmentEntity.inspectorUid.eq(memberEntity.employeeNo)); // 공통 조건 추출 BooleanExpression doneStateCondition = @@ -492,7 +495,7 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom { WorkerState.class, memberEntity.userRole, memberEntity.name, - memberEntity.userId, + memberEntity.employeeNo, assignedCnt.as("assignedCnt"), doneCnt.as("doneCnt"), skipCnt.as("skipCnt"), @@ -511,7 +514,10 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom { .on(whereSubBuilder) .where(whereBuilder) .groupBy( - memberEntity.userRole, memberEntity.name, memberEntity.userId, memberEntity.status) + memberEntity.userRole, + memberEntity.name, + memberEntity.employeeNo, + memberEntity.status) .orderBy(orderSpecifiers.toArray(new OrderSpecifier[0])) .offset(pageable.getOffset()) .limit(pageable.getPageSize())