[KC-99] 추론관리 등록 ai api 추가중, spotless 적용

This commit is contained in:
2026-01-09 16:12:21 +09:00
parent 3161b6dea7
commit 11b72e80cd
19 changed files with 355 additions and 77 deletions

View File

@@ -57,9 +57,9 @@ public class InferenceResultCoreService {
public UUID saveInferenceInfo(InferenceResultDto.RegReq req) {
MapSheetLearnEntity mapSheetLearnEntity = new MapSheetLearnEntity();
mapSheetLearnEntity.setTitle(req.getTitle());
mapSheetLearnEntity.setM1ModelUid(req.getModel1Uid());
mapSheetLearnEntity.setM2ModelUid(req.getModel2Uid());
mapSheetLearnEntity.setM3ModelUid(req.getModel3Uid());
mapSheetLearnEntity.setM1ModelUid(req.getModel1Uuid());
mapSheetLearnEntity.setM2ModelUid(req.getModel2Uuid());
mapSheetLearnEntity.setM3ModelUid(req.getModel3Uuid());
mapSheetLearnEntity.setCompareYyyy(req.getCompareYyyy());
mapSheetLearnEntity.setTargetYyyy(req.getTargetYyyy());
mapSheetLearnEntity.setMapSheetScope(req.getMapSheetScope());

View File

@@ -200,4 +200,35 @@ public class MapSheetMngCoreService {
throw new RuntimeException("GeoJSON 파일 생성 실패: " + e.getMessage(), e);
}
}
public void getSceneInference(String yyyy, List<String> scenes) {
try {
List<ImageFeature> sceneInference = mapSheetMngRepository.getSceneInference(yyyy, scenes);
if (sceneInference == null || sceneInference.isEmpty()) {
log.warn("No scene data found for year: {}", yyyy);
return;
}
if (activeEnv.equals("local")) {
syncRootDir = System.getProperty("user.home") + "/geojson";
}
String filename = String.format("%s_%s.geojson", yyyy, activeEnv);
String outputPath = Paths.get(syncRootDir, filename).toString();
// 디렉토리가 없으면 생성
Files.createDirectories(Paths.get(syncRootDir));
// GeoJSON 파일 생성 (EPSG:5186 - Korea 2000 / Central Belt 2010)
GeoJsonFileWriter writer = new GeoJsonFileWriter();
writer.exportToFile(sceneInference, "scene_inference_" + yyyy, 5186, outputPath);
log.info("GeoJSON file created successfully: {}", outputPath);
log.info("Total features exported: {}", sceneInference.size());
} catch (IOException e) {
log.error("Failed to create GeoJSON file for year: {}", yyyy, e);
throw new RuntimeException("GeoJSON 파일 생성 실패: " + e.getMessage(), e);
}
}
}

View File

@@ -3,6 +3,7 @@ package com.kamco.cd.kamcoback.postgres.core;
import com.kamco.cd.kamcoback.model.dto.ModelMngDto;
import com.kamco.cd.kamcoback.postgres.entity.ModelMngEntity;
import com.kamco.cd.kamcoback.postgres.repository.model.ModelMngRepository;
import jakarta.persistence.EntityNotFoundException;
import java.time.LocalDate;
import java.time.ZonedDateTime;
import java.util.UUID;
@@ -82,4 +83,12 @@ public class ModelMngCoreService {
// ModelMngEntity entity = modelMngRepository.save(addEntity);
// return entity.getMetricUid();
}
public ModelMngDto.Basic findByModelUuid(Long id) {
ModelMngEntity entity =
modelMngRepository
.findByModelId(id)
.orElseThrow(() -> new EntityNotFoundException("모델 정보가 없습니다."));
return entity.toDto();
}
}

View File

@@ -1,5 +1,6 @@
package com.kamco.cd.kamcoback.postgres.entity;
import com.kamco.cd.kamcoback.model.dto.ModelMngDto;
import com.kamco.cd.kamcoback.postgres.CommonDateEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -90,8 +91,32 @@ public class ModelMngEntity extends CommonDateEntity {
@Column(name = "priority")
private Double priority;
public void deleted() {
this.deleted = true;
}
public ModelMngDto.Basic toDto() {
return new ModelMngDto.Basic(
this.modelUid,
this.modelVer,
this.createCompleteDttm,
this.recentUseDttm,
this.deleted,
this.getCreatedDate(),
this.createdUid,
this.getModifiedDate(),
this.updatedUid,
this.modelType,
this.filePath,
this.fileName,
this.cdModelPath,
this.cdModelFileName,
this.cdModelConfigPath,
this.cdModelConfigFileName,
this.clsModelPath,
this.clsModelFileName,
this.clsModelVersion,
this.priority,
this.memo);
}
}

View File

@@ -25,4 +25,6 @@ public interface ModelMngRepositoryCustom {
void deleteByModelUuid(UUID uuid);
void insertModelResultMetric(ModelMngDto.ModelMetricAddReq addReq);
Optional<ModelMngEntity> findByModelId(Long id);
}

View File

@@ -89,8 +89,7 @@ public class ModelMngRepositoryImpl extends QuerydslRepositorySupport
modelMngEntity.clsModelPath,
modelMngEntity.clsModelFileName,
modelMngEntity.clsModelVersion,
modelMngEntity.priority
))
modelMngEntity.priority))
.from(modelMngEntity)
.innerJoin(modelResultMetricEntity)
.on(modelMngEntity.modelUid.eq(modelResultMetricEntity.modelUid))
@@ -230,4 +229,10 @@ public class ModelMngRepositoryImpl extends QuerydslRepositorySupport
addReq.getIou())
.execute();
}
@Override
public Optional<ModelMngEntity> findByModelId(Long id) {
return Optional.ofNullable(
queryFactory.selectFrom(modelMngEntity).where(modelMngEntity.modelUid.eq(id)).fetchOne());
}
}