Merge pull request '라벨링 추가할당 API 추가, 라벨링툴 목록 도엽순으로 소팅' (#82) from feat/infer_dev_260211 into develop
Reviewed-on: #82
This commit was merged in pull request #82.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
@@ -653,6 +654,7 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
||||
queryFactory
|
||||
.select(
|
||||
labelingAssignmentEntity.assignmentUid,
|
||||
labelingAssignmentEntity.assignGroupId,
|
||||
labelingAssignmentEntity.createdDate,
|
||||
labelingAssignmentEntity.inferenceGeomUid,
|
||||
mapSheetAnalInferenceEntity.targetYyyy,
|
||||
@@ -671,6 +673,7 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
||||
.orderBy(
|
||||
mapSheetAnalInferenceEntity.targetYyyy.asc(),
|
||||
mapSheetAnalInferenceEntity.compareYyyy.asc(),
|
||||
labelingAssignmentEntity.assignGroupId.asc(),
|
||||
labelingAssignmentEntity.createdDate.asc(),
|
||||
labelingAssignmentEntity.inferenceGeomUid.asc())
|
||||
.limit(1)
|
||||
@@ -685,6 +688,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
|
||||
@@ -700,12 +704,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)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user