Merge pull request 'feat/infer_dev_260107' (#299) from feat/infer_dev_260107 into develop

Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/299
This commit is contained in:
2026-01-21 09:54:09 +09:00
6 changed files with 59 additions and 31 deletions

View File

@@ -4,9 +4,6 @@ import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapShe
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelMngState; import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelMngState;
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity; import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity;
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity;
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity;
import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.jpa.impl.JPAQueryFactory;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
import java.util.Optional; import java.util.Optional;
@@ -21,17 +18,6 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
private final JPAQueryFactory queryFactory; private final JPAQueryFactory queryFactory;
private final EntityManager em; private final EntityManager em;
private final QMapSheetAnalInferenceEntity inferenceEntity =
QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
/** tb_map_sheet_anal_data_inference */
private final QMapSheetAnalDataInferenceEntity inferenceDataEntity =
QMapSheetAnalDataInferenceEntity.mapSheetAnalDataInferenceEntity;
/** tb_map_sheet_anal_data_inference_geom */
private final QMapSheetAnalDataInferenceGeomEntity inferenceGeomEntity =
QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
// =============================== // ===============================
// Upsert (Native only) // Upsert (Native only)
// =============================== // ===============================

View File

@@ -616,7 +616,9 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
.select( .select(
labelingAssignmentEntity.assignmentUid, labelingAssignmentEntity.assignmentUid,
labelingAssignmentEntity.createdDate, labelingAssignmentEntity.createdDate,
labelingAssignmentEntity.inferenceGeomUid) labelingAssignmentEntity.inferenceGeomUid,
mapSheetAnalInferenceEntity.targetYyyy,
mapSheetAnalInferenceEntity.compareYyyy)
.from(labelingAssignmentEntity) .from(labelingAssignmentEntity)
.innerJoin(mapSheetAnalInferenceEntity) .innerJoin(mapSheetAnalInferenceEntity)
.on(labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id)) .on(labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id))
@@ -641,21 +643,38 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
UUID firstAssignedUid = firstAssigned.get(labelingAssignmentEntity.assignmentUid); UUID firstAssignedUid = firstAssigned.get(labelingAssignmentEntity.assignmentUid);
ZonedDateTime createdDttm = firstAssigned.get(labelingAssignmentEntity.createdDate); ZonedDateTime createdDttm = firstAssigned.get(labelingAssignmentEntity.createdDate);
Long inferenceGeomUid = firstAssigned.get(labelingAssignmentEntity.inferenceGeomUid); Long inferenceGeomUid = firstAssigned.get(labelingAssignmentEntity.inferenceGeomUid);
Integer targetYyyy = firstAssigned.get(mapSheetAnalInferenceEntity.targetYyyy);
Integer compareYyyy = firstAssigned.get(mapSheetAnalInferenceEntity.compareYyyy);
BooleanExpression beforeCondition = BooleanExpression beforeCondition =
labelingAssignmentEntity mapSheetAnalInferenceEntity
.createdDate .targetYyyy
.lt(createdDttm) .lt(targetYyyy)
.or( .or(
labelingAssignmentEntity mapSheetAnalInferenceEntity
.createdDate .targetYyyy
.eq(createdDttm) .eq(targetYyyy)
.and(mapSheetAnalInferenceEntity.compareYyyy.lt(compareYyyy)))
.or(
mapSheetAnalInferenceEntity
.targetYyyy
.eq(targetYyyy)
.and(mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy))
.and(labelingAssignmentEntity.createdDate.lt(createdDttm)))
.or(
mapSheetAnalInferenceEntity
.targetYyyy
.eq(targetYyyy)
.and(mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy))
.and(labelingAssignmentEntity.createdDate.eq(createdDttm))
.and(labelingAssignmentEntity.inferenceGeomUid.lt(inferenceGeomUid))); .and(labelingAssignmentEntity.inferenceGeomUid.lt(inferenceGeomUid)));
Long beforeCnt = Long beforeCnt =
queryFactory queryFactory
.select(labelingAssignmentEntity.count()) .select(labelingAssignmentEntity.count())
.from(labelingAssignmentEntity) .from(labelingAssignmentEntity)
.innerJoin(mapSheetAnalInferenceEntity)
.on(mapSheetAnalInferenceEntity.id.eq(labelingAssignmentEntity.analUid))
.where( .where(
labelingAssignmentEntity.workerUid.eq(userId), beforeCondition.and(stateCondition)) labelingAssignmentEntity.workerUid.eq(userId), beforeCondition.and(stateCondition))
.fetchOne(); .fetchOne();

View File

@@ -645,8 +645,12 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
.select( .select(
labelingAssignmentEntity.assignmentUid, labelingAssignmentEntity.assignmentUid,
labelingAssignmentEntity.createdDate, labelingAssignmentEntity.createdDate,
labelingAssignmentEntity.inferenceGeomUid) labelingAssignmentEntity.inferenceGeomUid,
mapSheetAnalInferenceEntity.targetYyyy,
mapSheetAnalInferenceEntity.compareYyyy)
.from(labelingAssignmentEntity) .from(labelingAssignmentEntity)
.innerJoin(mapSheetAnalInferenceEntity)
.on(labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id))
.where( .where(
labelingAssignmentEntity.inspectorUid.eq(userId), labelingAssignmentEntity.inspectorUid.eq(userId),
stateCondition, stateCondition,
@@ -654,6 +658,8 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
? labelingAssignmentEntity.inspectState.eq(InspectState.UNCONFIRM.getId()) ? labelingAssignmentEntity.inspectState.eq(InspectState.UNCONFIRM.getId())
: labelingAssignmentEntity.assignmentUid.eq(UUID.fromString(operatorUid))) : labelingAssignmentEntity.assignmentUid.eq(UUID.fromString(operatorUid)))
.orderBy( .orderBy(
mapSheetAnalInferenceEntity.targetYyyy.asc(),
mapSheetAnalInferenceEntity.compareYyyy.asc(),
labelingAssignmentEntity.createdDate.asc(), labelingAssignmentEntity.createdDate.asc(),
labelingAssignmentEntity.inferenceGeomUid.asc()) labelingAssignmentEntity.inferenceGeomUid.asc())
.limit(1) .limit(1)
@@ -666,21 +672,38 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
UUID firstAssignedUid = firstAssigned.get(labelingAssignmentEntity.assignmentUid); UUID firstAssignedUid = firstAssigned.get(labelingAssignmentEntity.assignmentUid);
ZonedDateTime createdDttm = firstAssigned.get(labelingAssignmentEntity.createdDate); ZonedDateTime createdDttm = firstAssigned.get(labelingAssignmentEntity.createdDate);
Long inferenceGeomUid = firstAssigned.get(labelingAssignmentEntity.inferenceGeomUid); Long inferenceGeomUid = firstAssigned.get(labelingAssignmentEntity.inferenceGeomUid);
Integer targetYyyy = firstAssigned.get(mapSheetAnalInferenceEntity.targetYyyy);
Integer compareYyyy = firstAssigned.get(mapSheetAnalInferenceEntity.compareYyyy);
BooleanExpression beforeCondition = BooleanExpression beforeCondition =
labelingAssignmentEntity mapSheetAnalInferenceEntity
.createdDate .targetYyyy
.lt(createdDttm) .lt(targetYyyy)
.or( .or(
labelingAssignmentEntity mapSheetAnalInferenceEntity
.createdDate .targetYyyy
.eq(createdDttm) .eq(targetYyyy)
.and(mapSheetAnalInferenceEntity.compareYyyy.lt(compareYyyy)))
.or(
mapSheetAnalInferenceEntity
.targetYyyy
.eq(targetYyyy)
.and(mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy))
.and(labelingAssignmentEntity.createdDate.lt(createdDttm)))
.or(
mapSheetAnalInferenceEntity
.targetYyyy
.eq(targetYyyy)
.and(mapSheetAnalInferenceEntity.compareYyyy.eq(compareYyyy))
.and(labelingAssignmentEntity.createdDate.eq(createdDttm))
.and(labelingAssignmentEntity.inferenceGeomUid.lt(inferenceGeomUid))); .and(labelingAssignmentEntity.inferenceGeomUid.lt(inferenceGeomUid)));
Long beforeCnt = Long beforeCnt =
queryFactory queryFactory
.select(labelingAssignmentEntity.count()) .select(labelingAssignmentEntity.count())
.from(labelingAssignmentEntity) .from(labelingAssignmentEntity)
.innerJoin(mapSheetAnalInferenceEntity)
.on(mapSheetAnalInferenceEntity.id.eq(labelingAssignmentEntity.analUid))
.where( .where(
labelingAssignmentEntity.inspectorUid.eq(userId), labelingAssignmentEntity.inspectorUid.eq(userId),
beforeCondition.and(stateCondition)) beforeCondition.and(stateCondition))

View File

@@ -60,7 +60,7 @@ public class MapSheetInferenceJobService {
private String datasetDir; private String datasetDir;
/** 추론 진행 배치 1분 60_000 */ /** 추론 진행 배치 1분 60_000 */
@Scheduled(fixedDelay = 30_000) @Scheduled(fixedDelay = 60_000)
public void runBatch() { public void runBatch() {
if (isLocalProfile()) { if (isLocalProfile()) {
return; return;

View File

@@ -105,4 +105,4 @@ inference:
url: http://10.100.0.11:8000/jobs url: http://10.100.0.11:8000/jobs
batch-url: http://10.100.0.11:8000/batches batch-url: http://10.100.0.11:8000/batches
geojson-dir: /kamco-nfs/requests/ geojson-dir: /kamco-nfs/requests/
jar-path: /kamco-nfs/dataset/makeshp-1.0.0.jar jar-path: /kamco-nfs/dataset/shp_exporter-1.0.0.jar

View File

@@ -61,5 +61,5 @@ inference:
url: http://10.100.0.11:8000/jobs url: http://10.100.0.11:8000/jobs
batch-url: http://10.100.0.11:8000/batches batch-url: http://10.100.0.11:8000/batches
geojson-dir: /kamco-nfs/requests/ geojson-dir: /kamco-nfs/requests/
jar-path: jar/makeshp-1.0.0.jar jar-path: /kamco-nfs/dataset/shp_exporter-1.0.0.jar