jwt 미적용으로 수정, spotlessApply 적용
This commit is contained in:
@@ -28,7 +28,7 @@ public class GeoJsonDataService {
|
||||
|
||||
/** GeoJSON 파일들을 데이터베이스에 저장 */
|
||||
public List<Long> processGeoJsonFiles(
|
||||
Map<String, String> geoJsonContents, String archiveFileName) {
|
||||
Map<String, String> geoJsonContents, String archiveFileName) {
|
||||
List<Long> savedIds = new ArrayList<>();
|
||||
|
||||
log.info("GeoJSON 파일 처리 시작: {} ({}개 파일)", archiveFileName, geoJsonContents.size());
|
||||
@@ -54,10 +54,10 @@ public class GeoJsonDataService {
|
||||
}
|
||||
|
||||
log.info(
|
||||
"GeoJSON 파일 처리 완료: {} (성공: {}개, 전체: {}개)",
|
||||
archiveFileName,
|
||||
savedIds.size(),
|
||||
geoJsonContents.size());
|
||||
"GeoJSON 파일 처리 완료: {} (성공: {}개, 전체: {}개)",
|
||||
archiveFileName,
|
||||
savedIds.size(),
|
||||
geoJsonContents.size());
|
||||
|
||||
return savedIds;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class GeoJsonDataService {
|
||||
/** 개별 파일을 별도 트랜잭션으로 처리 */
|
||||
@Transactional
|
||||
public Long processGeoJsonFileWithTransaction(
|
||||
String fileName, String geoJsonContent, String archiveFileName) {
|
||||
String fileName, String geoJsonContent, String archiveFileName) {
|
||||
try {
|
||||
Long savedId = processGeoJsonFile(fileName, geoJsonContent, archiveFileName);
|
||||
if (savedId != null && isLearningModelResult(fileName, geoJsonContent)) {
|
||||
@@ -88,7 +88,7 @@ public class GeoJsonDataService {
|
||||
// 파일이 이미 처리되었는지 확인
|
||||
String dataPath = generateDataPath(archiveFileName, fileName);
|
||||
Optional<MapSheetLearnDataEntity> existingData =
|
||||
mapSheetLearnDataRepository.findByDataPath(dataPath);
|
||||
mapSheetLearnDataRepository.findByDataPath(dataPath);
|
||||
|
||||
if (existingData.isPresent()) {
|
||||
log.warn("이미 처리된 파일입니다: {}", dataPath);
|
||||
@@ -97,7 +97,7 @@ public class GeoJsonDataService {
|
||||
|
||||
// 새 엔티티 생성 및 저장
|
||||
MapSheetLearnDataEntity entity =
|
||||
createMapSheetLearnDataEntity(fileName, geoJsonContent, archiveFileName, geoJsonNode);
|
||||
createMapSheetLearnDataEntity(fileName, geoJsonContent, archiveFileName, geoJsonNode);
|
||||
MapSheetLearnDataEntity savedEntity = mapSheetLearnDataRepository.save(entity);
|
||||
|
||||
return savedEntity.getId();
|
||||
@@ -122,7 +122,7 @@ public class GeoJsonDataService {
|
||||
|
||||
/** MapSheetLearnDataEntity 생성 */
|
||||
private MapSheetLearnDataEntity createMapSheetLearnDataEntity(
|
||||
String fileName, String geoJsonContent, String archiveFileName, JsonNode geoJsonNode) {
|
||||
String fileName, String geoJsonContent, String archiveFileName, JsonNode geoJsonNode) {
|
||||
|
||||
MapSheetLearnDataEntity entity = new MapSheetLearnDataEntity();
|
||||
|
||||
@@ -287,8 +287,8 @@ public class GeoJsonDataService {
|
||||
JsonNode properties = firstFeature.get("properties");
|
||||
// 학습 모델 특화 필드 확인
|
||||
return properties.has("cd_prob")
|
||||
|| properties.has("class")
|
||||
|| (properties.has("before") && properties.has("after"));
|
||||
|| properties.has("class")
|
||||
|| (properties.has("before") && properties.has("after"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -301,7 +301,7 @@ public class GeoJsonDataService {
|
||||
|
||||
/** 학습 모델 결과의 geometry 데이터 처리 - 최적화된 배치 처리 */
|
||||
public void processLearningModelGeometryOptimized(
|
||||
Long dataUid, String geoJsonContent, String fileName) {
|
||||
Long dataUid, String geoJsonContent, String fileName) {
|
||||
try {
|
||||
log.info("학습 모델 geometry 데이터 처리 시작: {} (dataUid: {})", fileName, dataUid);
|
||||
|
||||
@@ -309,7 +309,7 @@ public class GeoJsonDataService {
|
||||
|
||||
// 메타데이터 추출
|
||||
String mapSheetName =
|
||||
rootNode.has("name") ? rootNode.get("name").asText() : fileName.replace(".geojson", "");
|
||||
rootNode.has("name") ? rootNode.get("name").asText() : fileName.replace(".geojson", "");
|
||||
|
||||
// 파일명에서 연도 및 지도번호 추출 (캠코_2021_2022_35813023)
|
||||
String[] parts = mapSheetName.split("_");
|
||||
@@ -347,7 +347,7 @@ public class GeoJsonDataService {
|
||||
try {
|
||||
JsonNode feature = features.get(j);
|
||||
MapSheetLearnDataGeomEntity geomEntity =
|
||||
createGeometryEntity(feature, dataUid, beforeYear, afterYear, mapSheetNum);
|
||||
createGeometryEntity(feature, dataUid, beforeYear, afterYear, mapSheetNum);
|
||||
if (geomEntity != null) {
|
||||
batch.add(geomEntity);
|
||||
}
|
||||
@@ -400,7 +400,7 @@ public class GeoJsonDataService {
|
||||
|
||||
/** 개별 feature에서 geometry entity 생성 */
|
||||
private MapSheetLearnDataGeomEntity createGeometryEntity(
|
||||
JsonNode feature, Long dataUid, String beforeYear, String afterYear, String mapSheetNum) {
|
||||
JsonNode feature, Long dataUid, String beforeYear, String afterYear, String mapSheetNum) {
|
||||
|
||||
JsonNode properties = feature.get("properties");
|
||||
JsonNode geometry = feature.get("geometry");
|
||||
|
||||
Reference in New Issue
Block a user