spotlessApply 적용

This commit is contained in:
2026-01-22 14:09:35 +09:00
parent 83333250b4
commit 6a1091a463
8 changed files with 114 additions and 234 deletions

View File

@@ -1,14 +1,11 @@
package com.kamco.cd.kamcoback.Innopam.dto; package com.kamco.cd.kamcoback.Innopam.dto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.util.List; import java.util.List;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
import org.springframework.web.bind.annotation.RequestParam;
public class ChngDetectMastDto { public class ChngDetectMastDto {
@@ -77,8 +74,6 @@ public class ChngDetectMastDto {
private String reqIp; // 사원아이피 private String reqIp; // 사원아이피
} }
@Getter @Getter
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@@ -111,7 +106,6 @@ public class ChngDetectMastDto {
private String reqIp; // 요청사원아이피 private String reqIp; // 요청사원아이피
} }
@Getter @Getter
@Setter @Setter
@NoArgsConstructor @NoArgsConstructor
@@ -126,7 +120,6 @@ public class ChngDetectMastDto {
private String chnDtctObjtId; // 탐지객체아이디. UUID를 기반으로 '-'를 제거하고 대문자/숫자로 구성 private String chnDtctObjtId; // 탐지객체아이디. UUID를 기반으로 '-'를 제거하고 대문자/숫자로 구성
private String reqEpno; // 사원번호 private String reqEpno; // 사원번호
private String reqIp; private String reqIp;
} }
@Getter @Getter
@@ -140,7 +133,6 @@ public class ChngDetectMastDto {
private String chnDtctSno; private String chnDtctSno;
} }
@Schema(name = "ResReturn", description = "수행 후 리턴") @Schema(name = "ResReturn", description = "수행 후 리턴")
@Getter @Getter
@Setter @Setter
@@ -151,5 +143,4 @@ public class ChngDetectMastDto {
private String flag; private String flag;
private String message; private String message;
} }
} }

View File

@@ -1,49 +1,20 @@
package com.kamco.cd.kamcoback.Innopam.service; package com.kamco.cd.kamcoback.Innopam.service;
import com.fasterxml.jackson.core.JsonFactory; import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.kamco.cd.kamcoback.Innopam.dto.ChngDetectMastDto; import com.kamco.cd.kamcoback.Innopam.dto.ChngDetectMastDto;
import com.kamco.cd.kamcoback.Innopam.dto.ChngDetectMastDto.ChngDetectMastSearchDto;
import com.kamco.cd.kamcoback.Innopam.dto.ChngDetectMastDto.ResReturn; import com.kamco.cd.kamcoback.Innopam.dto.ChngDetectMastDto.ResReturn;
import com.kamco.cd.kamcoback.Innopam.dto.DetectMastDto;
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 com.kamco.cd.kamcoback.Innopam.postgres.core.DetectMastCoreService;
import com.kamco.cd.kamcoback.common.utils.NetUtils; import com.kamco.cd.kamcoback.common.utils.NetUtils;
import com.kamco.cd.kamcoback.common.utils.UserUtil; import com.kamco.cd.kamcoback.common.utils.UserUtil;
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient; import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult; import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.DmlReturn;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.URLEncoder;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod; import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.util.UriComponentsBuilder;
@Service @Service
@Transactional(readOnly = true) @Transactional(readOnly = true)
@@ -59,7 +30,6 @@ public class InnopamApiService {
@Value("${innopam.mast}") @Value("${innopam.mast}")
private String innopamMastUrl; private String innopamMastUrl;
private final DetectMastCoreService detectMastCoreService; private final DetectMastCoreService detectMastCoreService;
private final ExternalHttpClient externalHttpClient; private final ExternalHttpClient externalHttpClient;
@@ -83,7 +53,8 @@ public class InnopamApiService {
System.out.println("url == " + myip); System.out.println("url == " + myip);
ExternalCallResult<String> result = ExternalCallResult<String> result =
externalHttpClient.call(url, HttpMethod.POST, chnDetectMastReq, netUtils.jsonHeaders(), String.class); externalHttpClient.call(
url, HttpMethod.POST, chnDetectMastReq, netUtils.jsonHeaders(), String.class);
System.out.println("result == " + result); System.out.println("result == " + result);
@@ -104,7 +75,8 @@ public class InnopamApiService {
System.out.println("url == " + myip); System.out.println("url == " + myip);
ExternalCallResult<String> result = ExternalCallResult<String> result =
externalHttpClient.call(url, HttpMethod.POST, chnDetectMastReq, netUtils.jsonHeaders(), String.class); externalHttpClient.call(
url, HttpMethod.POST, chnDetectMastReq, netUtils.jsonHeaders(), String.class);
System.out.println("result == " + result); System.out.println("result == " + result);
@@ -125,10 +97,4 @@ public class InnopamApiService {
return masterList; return masterList;
} }
} }

View File

@@ -7,9 +7,7 @@ import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.mindrot.jbcrypt.BCrypt;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
@@ -30,15 +28,18 @@ public class NetUtils {
return ip; return ip;
} }
public String dtoToQueryString(Object dto, String queryString) { public String dtoToQueryString(Object dto, String queryString) {
ObjectMapper objectMapper = new ObjectMapper(); ObjectMapper objectMapper = new ObjectMapper();
Map<String, Object> map = objectMapper.convertValue(dto, Map.class); Map<String, Object> map = objectMapper.convertValue(dto, Map.class);
String qStr = map.entrySet().stream() String qStr =
map.entrySet().stream()
.filter(entry -> entry.getValue() != null) // null 제외 .filter(entry -> entry.getValue() != null) // null 제외
.map(entry -> String.format("%s=%s", .map(
entry ->
String.format(
"%s=%s",
entry.getKey(), entry.getKey(),
URLEncoder.encode(entry.getValue().toString(), StandardCharsets.UTF_8))) URLEncoder.encode(entry.getValue().toString(), StandardCharsets.UTF_8)))
.collect(Collectors.joining("&")); .collect(Collectors.joining("&"));
@@ -60,5 +61,4 @@ public class NetUtils {
return headers; return headers;
} }
} }

View File

@@ -204,80 +204,6 @@ public class InferenceResultApiController {
return ApiResponseDto.ok(result); return ApiResponseDto.ok(result);
} }
// @ApiResponses(
// value = {
// @ApiResponse(
// responseCode = "200",
// description = "검색 성공",
// content =
// @Content(
// mediaType = "application/json",
// schema = @Schema(implementation = InferenceDetailDto.AnalResSummary.class))),
// @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
// @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
// })
// @GetMapping("/summary/{id}")
// public ApiResponseDto<InferenceDetailDto.AnalResSummary> getInferenceResultSummary(
// @Parameter(description = "목록 id", example = "53") @PathVariable Long id) {
// return ApiResponseDto.ok(inferenceResultService.getInferenceResultSummary(id));
// }
//
// @Operation(summary = "추론관리 분석결과 상세", description = "분석결과 상제 정보 Summary, DashBoard")
// @ApiResponses(
// value = {
// @ApiResponse(
// responseCode = "200",
// description = "검색 성공",
// content =
// @Content(
// mediaType = "application/json",
// schema = @Schema(implementation = InferenceDetailDto.Detail.class))),
// @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
// @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
// })
// @GetMapping("/detail/{id}")
// public ApiResponseDto<InferenceDetailDto.Detail> getInferenceDetail(
// @Parameter(description = "목록 id", example = "53") @PathVariable Long id) {
// return ApiResponseDto.ok(inferenceResultService.getDetail(id));
// }
//
// @Operation(summary = "추론관리 분석결과 상세 목록", description = "추론관리 분석결과 상세 목록 geojson 데이터 조회")
// @ApiResponses(
// value = {
// @ApiResponse(
// responseCode = "200",
// description = "검색 성공",
// content =
// @Content(
// mediaType = "application/json",
// schema = @Schema(implementation = Page.class))),
// @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
// @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
// })
// @GetMapping("/geom/{id}")
// public ApiResponseDto<Page<InferenceDetailDto.Geom>> getInferenceResultGeomList(
// @Parameter(description = "분석결과 id", example = "53") @PathVariable Long id,
// @Parameter(description = "기준년도 분류", example = "land") @RequestParam(required = false)
// String targetClass,
// @Parameter(description = "비교년도 분류", example = "waste") @RequestParam(required = false)
// String compareClass,
// @Parameter(description = "5000:1 도협번호 37801011,37801012") @RequestParam(required = false)
// List<Long> mapSheetNum,
// @Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0")
// int page,
// @Parameter(description = "페이지 크기", example = "20") @RequestParam(defaultValue = "20")
// int size,
// @Parameter(description = "정렬 조건 (형식: 필드명,방향)", example = "name,asc")
// @RequestParam(required = false)
// String sort) {
// InferenceDetailDto.SearchGeoReq searchGeoReq =
// new InferenceDetailDto.SearchGeoReq(
// targetClass, compareClass, mapSheetNum, page, size, sort);
// Page<InferenceDetailDto.Geom> geomList =
// inferenceResultService.getInferenceResultGeomList(id, searchGeoReq);
// return ApiResponseDto.ok(geomList);
// }
@Operation(summary = "추론관리 추론진행 서버 현황", description = "추론관리 추론진행 서버 현황") @Operation(summary = "추론관리 추론진행 서버 현황", description = "추론관리 추론진행 서버 현황")
@ApiResponses( @ApiResponses(
value = { value = {

View File

@@ -308,16 +308,16 @@ public class InferenceDetailDto {
String mapSheetName; String mapSheetName;
String subUid; String subUid;
String pnu; String pnu;
String passYn; String fitState;
@JsonProperty("passYn") @JsonProperty("fitState")
public String getPassYn() { public String getFitState() {
return this.passYn == null ? null : this.passYn; return this.fitState == null ? null : this.fitState;
} }
@JsonProperty("passYnName") @JsonProperty("fitStateName")
public String getPassYnName() { public String fitStateName() {
return ImageryFitStatus.getDescByCode(this.passYn); return ImageryFitStatus.getDescByCode(this.fitState);
} }
// @JsonIgnore String gemoStr; // @JsonIgnore String gemoStr;
@@ -339,7 +339,7 @@ public class InferenceDetailDto {
String mapSheetName, String mapSheetName,
String subUid, String subUid,
String pnu, String pnu,
String passYn) { String fitState) {
this.uuid = uuid; this.uuid = uuid;
this.uid = uid; this.uid = uid;
this.compareYyyy = compareYyyy; this.compareYyyy = compareYyyy;
@@ -355,7 +355,7 @@ public class InferenceDetailDto {
this.mapSheetName = mapSheetName; this.mapSheetName = mapSheetName;
this.subUid = subUid; this.subUid = subUid;
this.pnu = pnu; this.pnu = pnu;
this.passYn = passYn; this.fitState = fitState;
} }
} }

View File

@@ -90,7 +90,6 @@ public class MapSheetAnalDataInferenceGeomEntity {
private Long pnu; private Long pnu;
@Size(max = 20) @Size(max = 20)
@ColumnDefault("'0'")
@Column(name = "fit_state", length = 20) @Column(name = "fit_state", length = 20)
private String fitState; private String fitState;
@@ -150,12 +149,6 @@ public class MapSheetAnalDataInferenceGeomEntity {
@Column(name = "file_created_dttm") @Column(name = "file_created_dttm")
private ZonedDateTime fileCreatedDttm; private ZonedDateTime fileCreatedDttm;
@Column(name = "pass_yn")
private String passYn;
@Column(name = "pass_yn_dttm")
private ZonedDateTime passYnDttm;
@Column(name = "result_uid") @Column(name = "result_uid")
private String resultUid; private String resultUid;

View File

@@ -446,7 +446,7 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
"substring({0} from 1 for 8)", "substring({0} from 1 for 8)",
mapSheetAnalDataInferenceGeomEntity.resultUid), mapSheetAnalDataInferenceGeomEntity.resultUid),
pnu, pnu,
mapSheetAnalDataInferenceGeomEntity.passYn)) mapSheetAnalDataInferenceGeomEntity.fitState))
.from(mapSheetAnalInferenceEntity) .from(mapSheetAnalInferenceEntity)
.join(mapSheetAnalDataInferenceEntity) .join(mapSheetAnalDataInferenceEntity)
.on(mapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id)) .on(mapSheetAnalDataInferenceEntity.analUid.eq(mapSheetAnalInferenceEntity.id))

View File

@@ -63,3 +63,7 @@ inference:
geojson-dir: /kamco-nfs/requests/ geojson-dir: /kamco-nfs/requests/
jar-path: /kamco-nfs/dataset/shp_exporter-1.0.0.jar jar-path: /kamco-nfs/dataset/shp_exporter-1.0.0.jar
innopam:
#url: http://localhost:8080
url: http://192.168.2.129:5301
mast: ${innopam.url}/api/kcd/cdi/chn/mast