라벨링 추가할당 API 추가, 라벨링툴 목록 도엽순으로 소팅

This commit is contained in:
2026-02-20 18:24:40 +09:00
parent b859a56ab0
commit 8d7ddc4c33
7 changed files with 200 additions and 2 deletions

View File

@@ -257,7 +257,9 @@ public class LabelAllocateCoreService {
// 파일이 있는지만 확인
Path path = Paths.get(responsePath).resolve(dto.getLearnUid() + ".zip");
if (!Files.isRegularFile(path)) return false; // exists 포함
if (!Files.isRegularFile(path)) {
return false; // exists 포함
}
String state = dto.getAnalState();
boolean isLabelingIng =
@@ -265,7 +267,9 @@ public class LabelAllocateCoreService {
if (isLabelingIng) {
Long analId = dto.getAnalId();
if (analId == null) return false;
if (analId == null) {
return false;
}
return batchStepHistoryRepository.isDownloadable(analId);
}
@@ -277,4 +281,13 @@ public class LabelAllocateCoreService {
.findLearnUid(uuid)
.orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND));
}
public List<AllocateInfoDto> fetchNextIdsAddStbltYn(
UUID uuid, LocalDate baseDate, Long lastId, Long totalCnt) {
return labelAllocateRepository.fetchNextIdsAddStbltYn(uuid, baseDate, lastId, totalCnt);
}
public Long findAllocateAddCnt(UUID uuid, LocalDate baseDate) {
return labelAllocateRepository.findAllocateAddCnt(uuid, baseDate);
}
}

View File

@@ -110,4 +110,9 @@ public interface LabelAllocateRepositoryCustom {
InferenceLearnDto findLabelingIngProcessId(UUID uuid);
Optional<String> findLearnUid(UUID uuid);
List<AllocateInfoDto> fetchNextIdsAddStbltYn(
UUID uuid, LocalDate baseDate, Long lastId, Long totalCnt);
Long findAllocateAddCnt(UUID uuid, LocalDate baseDate);
}

View File

@@ -1856,4 +1856,56 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
.where(mapSheetAnalInferenceEntity.uuid.eq(uuid))
.fetchOne());
}
@Override
public List<AllocateInfoDto> fetchNextIdsAddStbltYn(
UUID uuid, LocalDate baseDate, Long lastId, Long totalCnt) {
ZoneId zone = ZoneId.of("Asia/Seoul"); // 기준 타임존 명확히
ZonedDateTime nextDayStart = baseDate.plusDays(1).atStartOfDay(zone);
return queryFactory
.select(
Projections.constructor(
AllocateInfoDto.class,
mapSheetAnalDataInferenceGeomEntity.geoUid,
mapSheetAnalDataInferenceGeomEntity.mapSheetNum,
mapSheetAnalDataInferenceGeomEntity.pnu))
.from(mapSheetAnalInferenceEntity)
.innerJoin(mapSheetAnalDataInferenceEntity)
.on(mapSheetAnalInferenceEntity.id.eq(mapSheetAnalDataInferenceEntity.analUid))
.innerJoin(mapSheetAnalDataInferenceGeomEntity)
.on(
mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid),
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0),
mapSheetAnalDataInferenceGeomEntity.fitState.eq(ImageryFitStatus.UNFIT.getId()),
mapSheetAnalDataInferenceGeomEntity.fitStateDttm.lt(nextDayStart),
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
.where(
mapSheetAnalInferenceEntity.uuid.eq(uuid),
lastId == null ? null : mapSheetAnalDataInferenceGeomEntity.geoUid.gt(lastId))
.orderBy(mapSheetAnalDataInferenceGeomEntity.mapSheetNum.asc())
.limit(totalCnt)
.fetch();
}
@Override
public Long findAllocateAddCnt(UUID uuid, LocalDate baseDate) {
ZoneId zone = ZoneId.of("Asia/Seoul"); // 기준 타임존 명확히
ZonedDateTime nextDayStart = baseDate.plusDays(1).atStartOfDay(zone);
return queryFactory
.select(mapSheetAnalDataInferenceGeomEntity.geoUid.count())
.from(mapSheetAnalInferenceEntity)
.innerJoin(mapSheetAnalDataInferenceEntity)
.on(mapSheetAnalInferenceEntity.id.eq(mapSheetAnalDataInferenceEntity.analUid))
.innerJoin(mapSheetAnalDataInferenceGeomEntity)
.on(
mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid),
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0),
mapSheetAnalDataInferenceGeomEntity.fitState.eq(ImageryFitStatus.UNFIT.getId()),
mapSheetAnalDataInferenceGeomEntity.fitStateDttm.lt(nextDayStart),
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
.where(mapSheetAnalInferenceEntity.uuid.eq(uuid))
.fetchOne();
}
}

View File

@@ -120,6 +120,7 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
.orderBy(
mapSheetAnalInferenceEntity.targetYyyy.asc(),
mapSheetAnalInferenceEntity.compareYyyy.asc(),
labelingAssignmentEntity.assignGroupId.asc(),
labelingAssignmentEntity.createdDate.asc(),
labelingAssignmentEntity.inferenceGeomUid.asc())
.fetch();
@@ -641,6 +642,7 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
queryFactory
.select(
labelingAssignmentEntity.assignmentUid,
labelingAssignmentEntity.assignGroupId,
labelingAssignmentEntity.createdDate,
labelingAssignmentEntity.inferenceGeomUid,
mapSheetAnalInferenceEntity.targetYyyy,
@@ -659,6 +661,7 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
.orderBy(
mapSheetAnalInferenceEntity.targetYyyy.asc(),
mapSheetAnalInferenceEntity.compareYyyy.asc(),
labelingAssignmentEntity.assignGroupId.asc(),
labelingAssignmentEntity.createdDate.asc(),
labelingAssignmentEntity.inferenceGeomUid.asc())
.limit(1)
@@ -673,6 +676,7 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
Long inferenceGeomUid = firstAssigned.get(labelingAssignmentEntity.inferenceGeomUid);
Integer targetYyyy = firstAssigned.get(mapSheetAnalInferenceEntity.targetYyyy);
Integer compareYyyy = firstAssigned.get(mapSheetAnalInferenceEntity.compareYyyy);
String assignGroupId = firstAssigned.get(labelingAssignmentEntity.assignGroupId);
BooleanExpression beforeCondition =
mapSheetAnalInferenceEntity
@@ -688,12 +692,20 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
.targetYyyy
.eq(targetYyyy)
.and(mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy))
.and(labelingAssignmentEntity.assignGroupId.lt(assignGroupId)))
.or(
mapSheetAnalInferenceEntity
.targetYyyy
.eq(targetYyyy)
.and(mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy))
.and(labelingAssignmentEntity.assignGroupId.eq(assignGroupId))
.and(labelingAssignmentEntity.createdDate.lt(createdDttm)))
.or(
mapSheetAnalInferenceEntity
.targetYyyy
.eq(targetYyyy)
.and(mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy))
.and(labelingAssignmentEntity.assignGroupId.eq(assignGroupId))
.and(labelingAssignmentEntity.createdDate.eq(createdDttm))
.and(labelingAssignmentEntity.inferenceGeomUid.lt(inferenceGeomUid)));