spotless 적용
This commit is contained in:
@@ -7,10 +7,6 @@ import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DetectMastDto {
|
||||
|
||||
@Getter
|
||||
@@ -71,21 +67,13 @@ public class DetectMastDto {
|
||||
private String featureId;
|
||||
}
|
||||
|
||||
/** before 연도 */
|
||||
private String cprsBfYr;
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class FeaturePnuDto {
|
||||
|
||||
/** after 연도 */
|
||||
private String cprsAdYr;
|
||||
|
||||
/** 차수 */
|
||||
private Integer dtctSno;
|
||||
|
||||
/** shp 파일경로 */
|
||||
private String pathNm;
|
||||
|
||||
/** 등록한 사람 사번 */
|
||||
private String crtEpno;
|
||||
|
||||
/** 등록한 사람 ip */
|
||||
private String crtIp;
|
||||
private String featureId; // polygon_id
|
||||
private String pnu; // 랜덤 생성
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
package com.kamco.cd.kamcoback.Innopam.service;
|
||||
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.kamco.cd.kamcoback.Innopam.dto.DetectMastDto.Basic;
|
||||
import com.kamco.cd.kamcoback.Innopam.dto.DetectMastDto.DetectMastReq;
|
||||
import com.kamco.cd.kamcoback.Innopam.dto.DetectMastDto.DetectMastSearch;
|
||||
import com.kamco.cd.kamcoback.Innopam.dto.DetectMastDto.FeaturePnuDto;
|
||||
import com.kamco.cd.kamcoback.Innopam.postgres.core.DetectMastCoreService;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -32,21 +37,13 @@ public class DetectMastService {
|
||||
}
|
||||
|
||||
public void findPnuData(DetectMastSearch detectMast) {
|
||||
String pathNm = detectMastCoreService.findPnuData(detectMast);
|
||||
|
||||
File dir = new File(pathNm);
|
||||
if (dir.exists() && dir.isDirectory()) {
|
||||
File[] files = dir.listFiles();
|
||||
|
||||
if (files != null) {
|
||||
for (File file : files) {
|
||||
System.out.println(file.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
// String pathNm = detectMastCoreService.findPnuData(detectMast);
|
||||
String pathNm = "/Users/bokmin/detect/result/2023_2024/4";
|
||||
File geoJson = new File(pathNm);
|
||||
List<FeaturePnuDto> list = this.extractFeaturePnus(geoJson);
|
||||
}
|
||||
|
||||
public static String randomPnu() {
|
||||
private String randomPnu() {
|
||||
ThreadLocalRandom r = ThreadLocalRandom.current();
|
||||
|
||||
String lawCode = String.valueOf(r.nextLong(1000000000L, 9999999999L)); // 10자리
|
||||
@@ -56,4 +53,38 @@ public class DetectMastService {
|
||||
|
||||
return lawCode + sanFlag + bon + bu;
|
||||
}
|
||||
|
||||
private List<FeaturePnuDto> extractFeaturePnus(File geoJsonFile) {
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode root = null;
|
||||
try {
|
||||
mapper.readTree(geoJsonFile);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
JsonNode features = root.get("features");
|
||||
List<FeaturePnuDto> result = new ArrayList<>();
|
||||
|
||||
if (features != null && features.isArray()) {
|
||||
for (JsonNode feature : features) {
|
||||
JsonNode properties = feature.get("properties");
|
||||
if (properties == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String polygonId = properties.path("polygon_id").asText(null);
|
||||
if (polygonId == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String pnu = this.randomPnu();
|
||||
|
||||
result.add(new FeaturePnuDto(polygonId, pnu));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,5 +30,4 @@ public enum SyncStateType implements EnumType {
|
||||
public String getText() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,12 +3,9 @@ package com.kamco.cd.kamcoback.postgres.entity;
|
||||
import com.kamco.cd.kamcoback.postgres.CommonDateEntity;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.JoinColumn;
|
||||
import jakarta.persistence.ManyToOne;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.kamco.cd.kamcoback.postgres.entity.MapSheetMngHstEntity;
|
||||
import com.querydsl.core.BooleanBuilder;
|
||||
import com.querydsl.core.types.Projections;
|
||||
import com.querydsl.core.types.dsl.Expressions;
|
||||
import com.querydsl.core.types.dsl.NumberExpression;
|
||||
import com.querydsl.core.types.dsl.StringExpression;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.mapsheet;
|
||||
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapInkx50kEntity.mapInkx50kEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapInkx5kEntity.mapInkx5kEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngEntity.mapSheetMngEntity;
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetMngFileEntity.mapSheetMngFileEntity;
|
||||
|
||||
Reference in New Issue
Block a user