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

Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/293
This commit is contained in:
2026-01-20 16:28:36 +09:00
5 changed files with 32 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.postgres.repository.Inference;
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity; import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelMngState;
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity; import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
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.QMapSheetAnalDataInferenceEntity;
@@ -66,7 +67,7 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
r.m2_model_batch_id, r.m2_model_batch_id,
r.m3_model_batch_id, r.m3_model_batch_id,
r.id, r.id,
LabelMngState.PENDING.getId() :pendingStateId
FROM tb_map_sheet_learn r FROM tb_map_sheet_learn r
WHERE r.id = :id WHERE r.id = :id
ON CONFLICT (stage, compare_yyyy, target_yyyy) ON CONFLICT (stage, compare_yyyy, target_yyyy)
@@ -78,7 +79,11 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
RETURNING anal_uid RETURNING anal_uid
"""; """;
Object result = em.createNativeQuery(sql).setParameter("id", id).getSingleResult(); Object result =
em.createNativeQuery(sql)
.setParameter("id", id)
.setParameter("pendingStateId", LabelMngState.PENDING.getId())
.getSingleResult();
return ((Number) result).longValue(); return ((Number) result).longValue();
} }

View File

@@ -165,6 +165,9 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
.set(mapSheetMngHstEntity.syncCheckState, "NOTYET") .set(mapSheetMngHstEntity.syncCheckState, "NOTYET")
.set(mapSheetMngHstEntity.syncCheckStrtDttm, now) .set(mapSheetMngHstEntity.syncCheckStrtDttm, now)
.set(mapSheetMngHstEntity.syncCheckEndDttm, now) .set(mapSheetMngHstEntity.syncCheckEndDttm, now)
.set(mapSheetMngHstEntity.mapSheetPath, updateReq.getMapSheetPath())
.set(mapSheetMngHstEntity.syncTfwFileName, updateReq.getSyncTfwFileName())
.set(mapSheetMngHstEntity.syncTifFileName, updateReq.getSyncTifFileName())
.where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid())) .where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid()))
.execute(); .execute();
} else { } else {
@@ -179,6 +182,9 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
.set(mapSheetMngHstEntity.syncCheckState, "NOTYET") .set(mapSheetMngHstEntity.syncCheckState, "NOTYET")
.set(mapSheetMngHstEntity.syncCheckStrtDttm, now) .set(mapSheetMngHstEntity.syncCheckStrtDttm, now)
.set(mapSheetMngHstEntity.syncCheckEndDttm, now) .set(mapSheetMngHstEntity.syncCheckEndDttm, now)
.set(mapSheetMngHstEntity.mapSheetPath, updateReq.getMapSheetPath())
.set(mapSheetMngHstEntity.syncTfwFileName, updateReq.getSyncTfwFileName())
.set(mapSheetMngHstEntity.syncTifFileName, updateReq.getSyncTifFileName())
.where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid())) .where(mapSheetMngHstEntity.hstUid.eq(updateReq.getHstUid()))
.execute(); .execute();
} }
@@ -204,6 +210,9 @@ public class MapSheetMngFileJobRepositoryImpl extends QuerydslRepositorySupport
mapSheetMngHstEntity.syncEndDttm, mapSheetMngHstEntity.syncEndDttm,
mapSheetMngHstEntity.syncCheckStrtDttm, mapSheetMngHstEntity.syncCheckStrtDttm,
mapSheetMngHstEntity.syncCheckEndDttm, mapSheetMngHstEntity.syncCheckEndDttm,
mapSheetMngHstEntity.mapSheetPath,
mapSheetMngHstEntity.syncCheckTfwFileName,
mapSheetMngHstEntity.syncCheckTifFileName,
mapSheetMngEntity.mngPath)) mapSheetMngEntity.mngPath))
.from(mapSheetMngHstEntity) .from(mapSheetMngHstEntity)
.join(mapSheetMngEntity) .join(mapSheetMngEntity)

View File

@@ -18,7 +18,7 @@ public class MapSheetMngFileJobController {
@Getter private int mngSyncPageSize = 20; @Getter private int mngSyncPageSize = 20;
// 파일싱크 진행여부 확인하기 // 파일싱크 진행여부 확인하기
@Scheduled(fixedDelay = 1000 * 30) @Scheduled(fixedDelay = 1000 * 10)
public void checkMngFileSync() { public void checkMngFileSync() {
if (!isSchedulerEnabled) return; if (!isSchedulerEnabled) return;
@@ -50,6 +50,7 @@ public class MapSheetMngFileJobController {
mapSheetMngFileJobService.checkMapSheetFileProcess(0, mngSyncPageSize); mapSheetMngFileJobService.checkMapSheetFileProcess(0, mngSyncPageSize);
} }
@Scheduled(fixedDelay = 1000 * 5) @Scheduled(fixedDelay = 1000 * 5)
public void mngFileSyncJob01() { public void mngFileSyncJob01() {
if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return; if (!isSchedulerEnabled || !isFileSyncSchedulerEnabled) return;
@@ -122,6 +123,8 @@ public class MapSheetMngFileJobController {
mapSheetMngFileJobService.checkMapSheetFileProcess(9, mngSyncPageSize); mapSheetMngFileJobService.checkMapSheetFileProcess(9, mngSyncPageSize);
} }
// 3. 외부에서 플래그를 변경할 수 있는 Setter 메서드 // 3. 외부에서 플래그를 변경할 수 있는 Setter 메서드
public void setSchedulerEnabled(boolean enabled) { public void setSchedulerEnabled(boolean enabled) {
this.isSchedulerEnabled = enabled; this.isSchedulerEnabled = enabled;

View File

@@ -73,7 +73,12 @@ public class MapSheetMngDto {
@JsonFormatDttm private ZonedDateTime syncCheckStrtDttm; @JsonFormatDttm private ZonedDateTime syncCheckStrtDttm;
@JsonFormatDttm private ZonedDateTime syncCheckEndDttm; @JsonFormatDttm private ZonedDateTime syncCheckEndDttm;
private String mapSheetPath;
private String syncTifFileName;
private String syncTfwFileName;
private String syncMngPath; private String syncMngPath;
} }
@Schema(name = "MngFileAddReq", description = "영상관리파일 등록 요청") @Schema(name = "MngFileAddReq", description = "영상관리파일 등록 요청")

View File

@@ -151,6 +151,10 @@ public class MapSheetMngFileJobService {
fileState = "TYPEERROR"; fileState = "TYPEERROR";
syncState = fileState; syncState = fileState;
} }
item.setMapSheetPath(item2.getParentPath());
item.setSyncTfwFileName(item2.getFileNm());
} else if (item2.getExtension().equals("tif")) { } else if (item2.getExtension().equals("tif")) {
if (tfwCnt == 0) { if (tfwCnt == 0) {
fileState = "NOTPAIR"; fileState = "NOTPAIR";
@@ -165,6 +169,9 @@ public class MapSheetMngFileJobService {
fileState = "TYPEERROR"; fileState = "TYPEERROR";
syncState = fileState; syncState = fileState;
} }
item.setMapSheetPath(item2.getParentPath());
item.setSyncTifFileName(item2.getFileNm());
} }
addReq.setFileState(fileState); addReq.setFileState(fileState);