diff --git a/src/main/java/com/kamco/cd/kamcoback/label/dto/WorkerStatsDto.java b/src/main/java/com/kamco/cd/kamcoback/label/dto/WorkerStatsDto.java index 42d924d5..0bf6924b 100644 --- a/src/main/java/com/kamco/cd/kamcoback/label/dto/WorkerStatsDto.java +++ b/src/main/java/com/kamco/cd/kamcoback/label/dto/WorkerStatsDto.java @@ -219,6 +219,9 @@ public class WorkerStatsDto { @Deprecated @Schema(description = "[Deprecated] inspectionRemainingCount 사용 권장") private Long remainingInspectCount; + + @Schema(description = "파일 다운로드 가능한 폴리곤 수") + private Long downloadPolygonCnt; } @Getter 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 82cc330d..0bbb7962 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 @@ -6,6 +6,7 @@ import static com.kamco.cd.kamcoback.postgres.entity.QLabelingLabelerEntity.labe import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity.mapSheetAnalDataInferenceEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity; +import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnDataGeomEntity.mapSheetLearnDataGeomEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMemberEntity.memberEntity; @@ -388,12 +389,8 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(analEntity.getCompareYyyy()), mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(analEntity.getTargetYyyy()), mapSheetAnalDataInferenceGeomEntity.stage.eq(analEntity.getStage()), - // mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull() mapSheetAnalDataInferenceGeomEntity.pnu.gt(0L), - mapSheetAnalDataInferenceGeomEntity.fitState.eq( - ImageryFitStatus.UNFIT.getId()) // TODO: - // 추후 라벨링 대상 조건 수정하기 - ) + mapSheetAnalDataInferenceGeomEntity.fitState.eq(ImageryFitStatus.UNFIT.getId())) .fetchOne(); } @@ -493,6 +490,19 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto inspectionStatus = inspectionRemaining > 0 ? "진행중" : "완료"; } + Long downloadPolygonCnt = + queryFactory + .select(mapSheetLearnDataGeomEntity.geoUid.count()) + .from(mapSheetLearnDataGeomEntity) + .innerJoin(labelingAssignmentEntity) + .on(labelingAssignmentEntity.inferenceGeomUid.eq(mapSheetLearnDataGeomEntity.geoUid)) + .innerJoin(mapSheetAnalInferenceEntity) + .on( + labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id), + mapSheetAnalInferenceEntity.id.eq(analUid)) + .where(mapSheetLearnDataGeomEntity.fileCreateYn.isTrue()) + .fetchOne(); + return WorkProgressInfo.builder() // 라벨링 (pass_yn = false인 부적합 데이터 기준) .labelingProgressRate(labelingRate) @@ -516,6 +526,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .completedCount(labelCompleted) .remainingLabelCount(labelingRemaining) .remainingInspectCount(inspectionRemaining) + .downloadPolygonCnt(downloadPolygonCnt) .build(); } @@ -659,6 +670,19 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto inspectionStatus = inspectionRemaining > 0 ? "진행중" : "완료"; } + Long downloadPolygonCnt = + queryFactory + .select(mapSheetLearnDataGeomEntity.geoUid.count()) + .from(mapSheetLearnDataGeomEntity) + .innerJoin(labelingAssignmentEntity) + .on(labelingAssignmentEntity.inferenceGeomUid.eq(mapSheetLearnDataGeomEntity.geoUid)) + .innerJoin(mapSheetAnalInferenceEntity) + .on( + labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id), + mapSheetAnalInferenceEntity.uuid.eq(targetUuid)) + .where(mapSheetLearnDataGeomEntity.fileCreateYn.isTrue()) + .fetchOne(); + return WorkProgressInfo.builder() .labelingProgressRate(labelingRate) .labelingStatus(labelingStatus) @@ -679,6 +703,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto .completedCount(labelCompleted) .remainingLabelCount(labelingRemaining) .remainingInspectCount(inspectionRemaining) + .downloadPolygonCnt(downloadPolygonCnt) .build(); }