Compare commits
68 Commits
feat/infer
...
fffc2efd96
| Author | SHA1 | Date | |
|---|---|---|---|
| fffc2efd96 | |||
| 82e3250fd4 | |||
| cf6b1323d8 | |||
| 470f2191b7 | |||
| 5377294e6e | |||
| c127531412 | |||
| 4e3e2a0181 | |||
| 61cfd8240a | |||
| 57a2ec8367 | |||
| 54b6712273 | |||
| fe6edbb19f | |||
| b2141e98c0 | |||
| 0e45adc52e | |||
| 581b8c968e | |||
| bdce18119f | |||
| 3b5536a57e | |||
| 9dd03f3c52 | |||
| 796591eca6 | |||
| 825e393e05 | |||
| 1410333829 | |||
| d63980476f | |||
| ae1693a33c | |||
| 8dfae65bcc | |||
| 872df11844 | |||
| f992bbe9ca | |||
| 643ea5cf9a | |||
| bc4b2dbac1 | |||
| 694b2fc31e | |||
| fbdda6477c | |||
| a572089dff | |||
| c6abf7a935 | |||
| a9348d9a66 | |||
| b877d2a8c9 | |||
| 151012ea28 | |||
| 68c68082cf | |||
| 4ce96b72aa | |||
| 0a5c5dfd7d | |||
| 7442e4ee09 | |||
| d278baed96 | |||
| 6b0074316f | |||
| f921ef5d0d | |||
| 7667620395 | |||
| 527acc9839 | |||
| 407f14d230 | |||
| 4a91d61b7d | |||
| 9d7bbc1b63 | |||
| f46ea62761 | |||
| 1abc0b93c0 | |||
| 4204e48d88 | |||
| fa41d41739 | |||
| ee28edd9d0 | |||
| 8555897b77 | |||
| fe7b1ed0bd | |||
| 064c02e21b | |||
| fd3499a5ec | |||
| 686cf03524 | |||
| ee9914a5f3 | |||
| b3e90c9f2b | |||
| 156b7a312d | |||
| cfed31656a | |||
| 14e8a6476f | |||
| ae6de0c030 | |||
| 4036f88296 | |||
| 28718c4218 | |||
| 54c92842d4 | |||
| c83c540dfb | |||
| dd1284f5c0 | |||
| 385ada3291 |
24
Dockerfile-prod
Normal file
24
Dockerfile-prod
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# 1단계에서 만든 로컬 베이스 이미지를 사용
|
||||||
|
FROM 192.168.2.73:18082/kamco-cd/base-java21-gdal:1.0
|
||||||
|
FROM 192.168.2.73:18082/kamco-cd/base-java21-gdal:1.0
|
||||||
|
|
||||||
|
# 사용자 설정 (앱 별로 다를 수 있으므로 여기에 유지)
|
||||||
|
ARG UID=1000
|
||||||
|
ARG GID=1000
|
||||||
|
|
||||||
|
RUN groupadd -g ${GID} kcomu \
|
||||||
|
&& useradd -u ${UID} -g ${GID} -m kcomu
|
||||||
|
|
||||||
|
USER kcomu
|
||||||
|
|
||||||
|
# 작업 디렉토리 설정
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# JAR 파일 복사 (Jenkins에서 빌드된 ROOT.jar)
|
||||||
|
COPY build/libs/ROOT.jar app.jar
|
||||||
|
|
||||||
|
# 포트 노출
|
||||||
|
EXPOSE 8080
|
||||||
|
# 애플리케이션 실행
|
||||||
|
# dev 프로파일로 실행
|
||||||
|
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=prod", "app.jar"]
|
||||||
35
docker-compose-prod.yml
Normal file
35
docker-compose-prod.yml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
services:
|
||||||
|
kamco-changedetection-api:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile-prod
|
||||||
|
args:
|
||||||
|
UID: 1000 # manager01 UID
|
||||||
|
GID: 1000 # manager01 GID
|
||||||
|
image: kamco-changedetection-api:${IMAGE_TAG:-latest}
|
||||||
|
container_name: kamco-changedetection-api
|
||||||
|
user: "1000:1000"
|
||||||
|
ports:
|
||||||
|
- "7100:8080"
|
||||||
|
environment:
|
||||||
|
- SPRING_PROFILES_ACTIVE=dev
|
||||||
|
- TZ=Asia/Seoul
|
||||||
|
volumes:
|
||||||
|
- /mnt/nfs_share/images:/app/original-images
|
||||||
|
- /mnt/nfs_share/model_output:/app/model-outputs
|
||||||
|
- /mnt/nfs_share/train_dataset:/app/train-dataset
|
||||||
|
- /mnt/nfs_share/tmp:/app/tmp
|
||||||
|
- /kamco-nfs:/kamco-nfs
|
||||||
|
networks:
|
||||||
|
- kamco-cds
|
||||||
|
restart: unless-stopped
|
||||||
|
healthcheck:
|
||||||
|
test: [ "CMD", "curl", "-f", "http://localhost:8080/monitor/health" ]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
start_period: 40s
|
||||||
|
|
||||||
|
networks:
|
||||||
|
kamco-cds:
|
||||||
|
external: true
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.kamco.cd.kamcoback.config;
|
package com.kamco.cd.kamcoback.config.swagger;
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
|
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
|
||||||
import io.swagger.v3.oas.annotations.security.SecurityScheme;
|
import io.swagger.v3.oas.annotations.security.SecurityScheme;
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package com.kamco.cd.kamcoback.config.swagger;
|
||||||
|
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import org.springdoc.core.properties.SwaggerUiConfigProperties;
|
||||||
|
import org.springdoc.core.properties.SwaggerUiOAuthProperties;
|
||||||
|
import org.springdoc.core.providers.ObjectMapperProvider;
|
||||||
|
import org.springdoc.webmvc.ui.SwaggerIndexPageTransformer;
|
||||||
|
import org.springdoc.webmvc.ui.SwaggerIndexTransformer;
|
||||||
|
import org.springdoc.webmvc.ui.SwaggerWelcomeCommon;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.context.annotation.Profile;
|
||||||
|
import org.springframework.core.io.Resource;
|
||||||
|
import org.springframework.web.servlet.resource.ResourceTransformerChain;
|
||||||
|
import org.springframework.web.servlet.resource.TransformedResource;
|
||||||
|
|
||||||
|
@Profile({"local", "dev"})
|
||||||
|
@Configuration
|
||||||
|
public class SwaggerUiAutoAuthConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@Primary
|
||||||
|
public SwaggerIndexTransformer swaggerIndexTransformer(
|
||||||
|
SwaggerUiConfigProperties swaggerUiConfigProperties,
|
||||||
|
SwaggerUiOAuthProperties swaggerUiOAuthProperties,
|
||||||
|
SwaggerWelcomeCommon swaggerWelcomeCommon,
|
||||||
|
ObjectMapperProvider objectMapperProvider) {
|
||||||
|
|
||||||
|
SwaggerIndexPageTransformer delegate =
|
||||||
|
new SwaggerIndexPageTransformer(
|
||||||
|
swaggerUiConfigProperties,
|
||||||
|
swaggerUiOAuthProperties,
|
||||||
|
swaggerWelcomeCommon,
|
||||||
|
objectMapperProvider);
|
||||||
|
|
||||||
|
return new SwaggerIndexTransformer() {
|
||||||
|
private static final String TOKEN_KEY = "SWAGGER_ACCESS_TOKEN";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Resource transform(
|
||||||
|
HttpServletRequest request, Resource resource, ResourceTransformerChain chain) {
|
||||||
|
try {
|
||||||
|
// 1) springdoc 기본 변환 먼저 적용
|
||||||
|
Resource transformed = delegate.transform(request, resource, chain);
|
||||||
|
|
||||||
|
String html =
|
||||||
|
new String(transformed.getInputStream().readAllBytes(), StandardCharsets.UTF_8);
|
||||||
|
|
||||||
|
String loginPathContains = "/api/auth/signin";
|
||||||
|
|
||||||
|
String inject =
|
||||||
|
"""
|
||||||
|
tagsSorter: (a, b) => {
|
||||||
|
const TOP = '인증(Auth)';
|
||||||
|
if (a === TOP && b !== TOP) return -1;
|
||||||
|
if (b === TOP && a !== TOP) return 1;
|
||||||
|
return a.localeCompare(b);
|
||||||
|
},
|
||||||
|
requestInterceptor: (req) => {
|
||||||
|
const token = localStorage.getItem('%s');
|
||||||
|
if (token) {
|
||||||
|
req.headers = req.headers || {};
|
||||||
|
req.headers['Authorization'] = 'Bearer ' + token;
|
||||||
|
}
|
||||||
|
return req;
|
||||||
|
},
|
||||||
|
responseInterceptor: async (res) => {
|
||||||
|
try {
|
||||||
|
const isLogin = (res?.url?.includes('%s') && res?.status === 200);
|
||||||
|
if (isLogin) {
|
||||||
|
const text = (typeof res.data === 'string') ? res.data : JSON.stringify(res.data);
|
||||||
|
const json = JSON.parse(text);
|
||||||
|
const token = json?.data?.accessToken;
|
||||||
|
|
||||||
|
if (token) {
|
||||||
|
localStorage.setItem('%s', token);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (e) {}
|
||||||
|
return res;
|
||||||
|
},
|
||||||
|
"""
|
||||||
|
.formatted(TOKEN_KEY, loginPathContains, TOKEN_KEY);
|
||||||
|
|
||||||
|
html = html.replace("SwaggerUIBundle({", "SwaggerUIBundle({\n" + inject);
|
||||||
|
|
||||||
|
return new TransformedResource(transformed, html.getBytes(StandardCharsets.UTF_8));
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 실패 시 원본 반환(문서 깨짐 방지)
|
||||||
|
return resource;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -137,4 +137,15 @@ public class ChngDetectContDto {
|
|||||||
private String reqIp;
|
private String reqIp;
|
||||||
private String reqEpno;
|
private String reqEpno;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class StbltResult {
|
||||||
|
|
||||||
|
private String stbltYn;
|
||||||
|
private String incyCd;
|
||||||
|
private String incyCmnt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -452,20 +452,15 @@ public class GukYuinApiService {
|
|||||||
return new ResponseObj(ApiResponseCode.DUPLICATE_DATA, "이미 국유인 연동을 한 회차입니다.");
|
return new ResponseObj(ApiResponseCode.DUPLICATE_DATA, "이미 국유인 연동을 한 회차입니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!Files.isDirectory(Path.of("/kamco-nfs/dataset/export/" + info.getUid()))) {
|
||||||
|
return new ResponseObj(
|
||||||
|
ApiResponseCode.NOT_FOUND_DATA, "파일 경로에 회차 실행 파일이 생성되지 않았습니다. 확인 부탁드립니다.");
|
||||||
|
}
|
||||||
|
|
||||||
// 비교년도,기준년도로 전송한 데이터 있는지 확인 후 회차 번호 생성
|
// 비교년도,기준년도로 전송한 데이터 있는지 확인 후 회차 번호 생성
|
||||||
Integer maxStage =
|
Integer maxStage =
|
||||||
gukyuinCoreService.findMapSheetLearnYearStage(info.getCompareYyyy(), info.getTargetYyyy());
|
gukyuinCoreService.findMapSheetLearnYearStage(info.getCompareYyyy(), info.getTargetYyyy());
|
||||||
|
|
||||||
// 1회차를 종료 상태로 처리하고 2회차를 보내야 함
|
|
||||||
// 추론(learn), 학습데이터(inference) 둘 다 종료 처리
|
|
||||||
if (maxStage > 0) {
|
|
||||||
Long learnId =
|
|
||||||
gukyuinCoreService.findMapSheetLearnInfoByYyyy(
|
|
||||||
info.getCompareYyyy(), info.getTargetYyyy(), maxStage);
|
|
||||||
gukyuinCoreService.updateMapSheetLearnGukyuinEndStatus(learnId);
|
|
||||||
gukyuinCoreService.updateMapSheetInferenceLabelEndStatus(learnId);
|
|
||||||
}
|
|
||||||
|
|
||||||
// reqDto 셋팅
|
// reqDto 셋팅
|
||||||
ChnDetectMastReqDto reqDto = new ChnDetectMastReqDto();
|
ChnDetectMastReqDto reqDto = new ChnDetectMastReqDto();
|
||||||
reqDto.setCprsYr(String.valueOf(info.getCompareYyyy()));
|
reqDto.setCprsYr(String.valueOf(info.getCompareYyyy()));
|
||||||
@@ -474,9 +469,14 @@ public class GukYuinApiService {
|
|||||||
reqDto.setChnDtctId(info.getUid());
|
reqDto.setChnDtctId(info.getUid());
|
||||||
reqDto.setPathNm("/kamco-nfs/dataset/export/" + info.getUid());
|
reqDto.setPathNm("/kamco-nfs/dataset/export/" + info.getUid());
|
||||||
|
|
||||||
if (!Files.isDirectory(Path.of("/kamco-nfs/dataset/export/" + info.getUid()))) {
|
// 1회차를 종료 상태로 처리하고 2회차를 보내야 함
|
||||||
return new ResponseObj(
|
// 추론(learn), 학습데이터(inference) 둘 다 종료 처리
|
||||||
ApiResponseCode.NOT_FOUND_DATA, "파일 경로에 회차 실행 파일이 생성되지 않았습니다. 확인 부탁드립니다.");
|
if (maxStage > 0) {
|
||||||
|
Long learnId =
|
||||||
|
gukyuinCoreService.findMapSheetLearnInfoByYyyy(
|
||||||
|
info.getCompareYyyy(), info.getTargetYyyy(), maxStage);
|
||||||
|
gukyuinCoreService.updateMapSheetLearnGukyuinEndStatus(learnId);
|
||||||
|
gukyuinCoreService.updateMapSheetInferenceLabelEndStatus(learnId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 국유인 /chn/mast/regist 전송
|
// 국유인 /chn/mast/regist 전송
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ public class LayerDto {
|
|||||||
@Schema(description = "uuid")
|
@Schema(description = "uuid")
|
||||||
private UUID uuid;
|
private UUID uuid;
|
||||||
|
|
||||||
|
@Schema(description = "레이어명")
|
||||||
|
private String layerName;
|
||||||
|
|
||||||
@Schema(example = "WMTS", description = "유형 (TILE/GEOJSON/WMTS/WMS)")
|
@Schema(example = "WMTS", description = "유형 (TILE/GEOJSON/WMTS/WMS)")
|
||||||
private String layerType;
|
private String layerType;
|
||||||
|
|
||||||
@@ -63,6 +66,9 @@ public class LayerDto {
|
|||||||
@Schema(description = "uuid")
|
@Schema(description = "uuid")
|
||||||
private UUID uuid;
|
private UUID uuid;
|
||||||
|
|
||||||
|
@Schema(description = "레이어명")
|
||||||
|
private String layerName;
|
||||||
|
|
||||||
@Schema(description = "유형 (TILE/GEOJSON/WMTS/WMS)")
|
@Schema(description = "유형 (TILE/GEOJSON/WMTS/WMS)")
|
||||||
private String layerType;
|
private String layerType;
|
||||||
|
|
||||||
@@ -119,6 +125,9 @@ public class LayerDto {
|
|||||||
@Schema(name = "LayerAddReq")
|
@Schema(name = "LayerAddReq")
|
||||||
public static class AddReq {
|
public static class AddReq {
|
||||||
|
|
||||||
|
@Schema(description = "레이어명")
|
||||||
|
private String layerName;
|
||||||
|
|
||||||
@Schema(description = "title WMS, WMTS 선택한 tile")
|
@Schema(description = "title WMS, WMTS 선택한 tile")
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
@@ -215,6 +224,9 @@ public class LayerDto {
|
|||||||
@Schema(name = "LayerMapDto")
|
@Schema(name = "LayerMapDto")
|
||||||
public static class LayerMapDto {
|
public static class LayerMapDto {
|
||||||
|
|
||||||
|
@Schema(description = "레이어명")
|
||||||
|
private String layerName;
|
||||||
|
|
||||||
@Schema(example = "WMTS", description = "유형 (TILE/GEOJSON/WMTS/WMS)")
|
@Schema(example = "WMTS", description = "유형 (TILE/GEOJSON/WMTS/WMS)")
|
||||||
private String layerType;
|
private String layerType;
|
||||||
|
|
||||||
@@ -268,6 +280,7 @@ public class LayerDto {
|
|||||||
private String crs;
|
private String crs;
|
||||||
|
|
||||||
public LayerMapDto(
|
public LayerMapDto(
|
||||||
|
String layerName,
|
||||||
String layerType,
|
String layerType,
|
||||||
String tag,
|
String tag,
|
||||||
Long sortOrder,
|
Long sortOrder,
|
||||||
@@ -282,6 +295,7 @@ public class LayerDto {
|
|||||||
UUID uuid,
|
UUID uuid,
|
||||||
String rawJsonString,
|
String rawJsonString,
|
||||||
String crs) {
|
String crs) {
|
||||||
|
this.layerName = layerName;
|
||||||
this.layerType = layerType;
|
this.layerType = layerType;
|
||||||
this.tag = tag;
|
this.tag = tag;
|
||||||
this.sortOrder = sortOrder;
|
this.sortOrder = sortOrder;
|
||||||
|
|||||||
@@ -26,5 +26,6 @@ public class WmsDto {
|
|||||||
private String title;
|
private String title;
|
||||||
private String description;
|
private String description;
|
||||||
private String tag;
|
private String tag;
|
||||||
|
private String layerName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,5 +26,6 @@ public class WmtsDto {
|
|||||||
private String title;
|
private String title;
|
||||||
private String description;
|
private String description;
|
||||||
private String tag;
|
private String tag;
|
||||||
|
private String layerName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import com.kamco.cd.kamcoback.layer.dto.LayerDto.LayerMapDto;
|
|||||||
import com.kamco.cd.kamcoback.layer.dto.LayerDto.OrderReq;
|
import com.kamco.cd.kamcoback.layer.dto.LayerDto.OrderReq;
|
||||||
import com.kamco.cd.kamcoback.layer.dto.LayerDto.TileUrlDto;
|
import com.kamco.cd.kamcoback.layer.dto.LayerDto.TileUrlDto;
|
||||||
import com.kamco.cd.kamcoback.layer.dto.WmsDto.WmsAddDto;
|
import com.kamco.cd.kamcoback.layer.dto.WmsDto.WmsAddDto;
|
||||||
import com.kamco.cd.kamcoback.layer.dto.WmsDto.WmsAddReqDto;
|
|
||||||
import com.kamco.cd.kamcoback.layer.dto.WmsLayerInfo;
|
import com.kamco.cd.kamcoback.layer.dto.WmsLayerInfo;
|
||||||
import com.kamco.cd.kamcoback.layer.dto.WmtsDto.WmtsAddDto;
|
import com.kamco.cd.kamcoback.layer.dto.WmtsDto.WmtsAddDto;
|
||||||
import com.kamco.cd.kamcoback.layer.dto.WmtsLayerInfo;
|
import com.kamco.cd.kamcoback.layer.dto.WmtsLayerInfo;
|
||||||
@@ -79,6 +78,7 @@ public class LayerService {
|
|||||||
addDto.setDescription(dto.getDescription());
|
addDto.setDescription(dto.getDescription());
|
||||||
addDto.setTitle(dto.getTitle());
|
addDto.setTitle(dto.getTitle());
|
||||||
addDto.setTag(dto.getTag());
|
addDto.setTag(dto.getTag());
|
||||||
|
addDto.setLayerName(dto.getLayerName());
|
||||||
return mapLayerCoreService.saveWmts(addDto);
|
return mapLayerCoreService.saveWmts(addDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,6 +89,7 @@ public class LayerService {
|
|||||||
addDto.setDescription(dto.getDescription());
|
addDto.setDescription(dto.getDescription());
|
||||||
addDto.setTitle(dto.getTitle());
|
addDto.setTitle(dto.getTitle());
|
||||||
addDto.setTag(dto.getTag());
|
addDto.setTag(dto.getTag());
|
||||||
|
addDto.setLayerName(dto.getLayerName());
|
||||||
return mapLayerCoreService.saveWms(addDto);
|
return mapLayerCoreService.saveWms(addDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,24 +166,6 @@ public class LayerService {
|
|||||||
return wmsService.getTile();
|
return wmsService.getTile();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* wms 저장
|
|
||||||
*
|
|
||||||
* @param dto
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Transactional
|
|
||||||
public UUID saveWms(WmsAddReqDto dto) {
|
|
||||||
// 선택한 tile 상세정보 조회
|
|
||||||
WmsLayerInfo info = wmsService.getDetail(dto.getTitle());
|
|
||||||
WmsAddDto addDto = new WmsAddDto();
|
|
||||||
addDto.setWmsLayerInfo(info);
|
|
||||||
addDto.setDescription(dto.getDescription());
|
|
||||||
addDto.setTitle(dto.getTitle());
|
|
||||||
addDto.setTag(dto.getTag());
|
|
||||||
return mapLayerCoreService.saveWms(addDto);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<LayerMapDto> findLayerMapList(String type) {
|
public List<LayerMapDto> findLayerMapList(String type) {
|
||||||
List<LayerMapDto> layerMapDtoList = mapLayerCoreService.findLayerMapList(type);
|
List<LayerMapDto> layerMapDtoList = mapLayerCoreService.findLayerMapList(type);
|
||||||
layerMapDtoList.forEach(
|
layerMapDtoList.forEach(
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.core;
|
package com.kamco.cd.kamcoback.postgres.core;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.StbltResult;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LearnKeyDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LearnKeyDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctMastDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctMastDto;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.PnuEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.PnuEntity;
|
||||||
@@ -24,13 +25,10 @@ public class GukYuinStbltJobCoreService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateGukYuinEligibleForSurvey(String resultUid, RlbDtctMastDto stbltDto) {
|
public void updateGukYuinEligibleForSurvey(String resultUid, RlbDtctMastDto stbltDto) {
|
||||||
String chnDtctObjtId = "";
|
|
||||||
PnuEntity entity =
|
PnuEntity entity =
|
||||||
gukYuinStbltRepository.findPnuEntityByResultUid(resultUid, stbltDto.getPnu());
|
gukYuinStbltRepository.findPnuEntityByResultUid(resultUid, stbltDto.getPnu());
|
||||||
|
|
||||||
if (entity != null) {
|
if (entity != null) {
|
||||||
chnDtctObjtId = resultUid;
|
|
||||||
|
|
||||||
entity.setPnuDtctId(stbltDto.getPnuDtctId());
|
entity.setPnuDtctId(stbltDto.getPnuDtctId());
|
||||||
entity.setPnu(stbltDto.getPnu());
|
entity.setPnu(stbltDto.getPnu());
|
||||||
entity.setLrmSyncYmd(stbltDto.getLrmSyncYmd());
|
entity.setLrmSyncYmd(stbltDto.getLrmSyncYmd());
|
||||||
@@ -68,8 +66,11 @@ public class GukYuinStbltJobCoreService {
|
|||||||
|
|
||||||
entity.setCreatedDttm(ZonedDateTime.now());
|
entity.setCreatedDttm(ZonedDateTime.now());
|
||||||
gukYuinStbltRepository.save(entity);
|
gukYuinStbltRepository.save(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
@Transactional
|
||||||
}
|
public void updateGukYuinObjectStbltYn(String resultUid, StbltResult stbResult) {
|
||||||
|
gukYuinStbltRepository.updateGukYuinObjectStbltYn(resultUid, stbResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,6 +87,10 @@ public class MapLayerCoreService {
|
|||||||
entity.setDescription(dto.getDescription());
|
entity.setDescription(dto.getDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dto.getLayerName() != null) {
|
||||||
|
entity.setLayerName(dto.getLayerName());
|
||||||
|
}
|
||||||
|
|
||||||
if (dto.getUrl() != null) {
|
if (dto.getUrl() != null) {
|
||||||
entity.setUrl(dto.getUrl());
|
entity.setUrl(dto.getUrl());
|
||||||
}
|
}
|
||||||
@@ -213,6 +217,7 @@ public class MapLayerCoreService {
|
|||||||
Long order = mapLayerRepository.findSortOrderDesc();
|
Long order = mapLayerRepository.findSortOrderDesc();
|
||||||
|
|
||||||
MapLayerEntity mapLayerEntity = new MapLayerEntity();
|
MapLayerEntity mapLayerEntity = new MapLayerEntity();
|
||||||
|
mapLayerEntity.setLayerName(dto.getLayerName());
|
||||||
mapLayerEntity.setDescription(dto.getDescription());
|
mapLayerEntity.setDescription(dto.getDescription());
|
||||||
mapLayerEntity.setUrl(dto.getUrl());
|
mapLayerEntity.setUrl(dto.getUrl());
|
||||||
mapLayerEntity.setTag(dto.getTag());
|
mapLayerEntity.setTag(dto.getTag());
|
||||||
@@ -243,6 +248,7 @@ public class MapLayerCoreService {
|
|||||||
Long order = mapLayerRepository.findSortOrderDesc();
|
Long order = mapLayerRepository.findSortOrderDesc();
|
||||||
|
|
||||||
MapLayerEntity mapLayerEntity = new MapLayerEntity();
|
MapLayerEntity mapLayerEntity = new MapLayerEntity();
|
||||||
|
mapLayerEntity.setLayerName(addDto.getLayerName());
|
||||||
mapLayerEntity.setDescription(addDto.getDescription());
|
mapLayerEntity.setDescription(addDto.getDescription());
|
||||||
mapLayerEntity.setUrl(addDto.getUrl());
|
mapLayerEntity.setUrl(addDto.getUrl());
|
||||||
mapLayerEntity.setTag(addDto.getTag());
|
mapLayerEntity.setTag(addDto.getTag());
|
||||||
@@ -273,6 +279,7 @@ public class MapLayerCoreService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MapLayerEntity mapLayerEntity = new MapLayerEntity();
|
MapLayerEntity mapLayerEntity = new MapLayerEntity();
|
||||||
|
mapLayerEntity.setLayerName(addDto.getLayerName());
|
||||||
mapLayerEntity.setTitle(addDto.getTitle());
|
mapLayerEntity.setTitle(addDto.getTitle());
|
||||||
mapLayerEntity.setDescription(addDto.getDescription());
|
mapLayerEntity.setDescription(addDto.getDescription());
|
||||||
mapLayerEntity.setCreatedUid(userUtil.getId());
|
mapLayerEntity.setCreatedUid(userUtil.getId());
|
||||||
@@ -305,6 +312,7 @@ public class MapLayerCoreService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MapLayerEntity mapLayerEntity = new MapLayerEntity();
|
MapLayerEntity mapLayerEntity = new MapLayerEntity();
|
||||||
|
mapLayerEntity.setLayerName(addDto.getLayerName());
|
||||||
mapLayerEntity.setTitle(addDto.getTitle());
|
mapLayerEntity.setTitle(addDto.getTitle());
|
||||||
mapLayerEntity.setDescription(addDto.getDescription());
|
mapLayerEntity.setDescription(addDto.getDescription());
|
||||||
mapLayerEntity.setCreatedUid(userUtil.getId());
|
mapLayerEntity.setCreatedUid(userUtil.getId());
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ public class MapLayerEntity {
|
|||||||
@Column(name = "title", length = 200)
|
@Column(name = "title", length = 200)
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
|
@Size(max = 255)
|
||||||
|
@Column(name = "layer_name")
|
||||||
|
private String layerName;
|
||||||
|
|
||||||
@Column(name = "description", length = Integer.MAX_VALUE)
|
@Column(name = "description", length = Integer.MAX_VALUE)
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
@@ -109,6 +113,7 @@ public class MapLayerEntity {
|
|||||||
public LayerDto.Detail toDto() {
|
public LayerDto.Detail toDto() {
|
||||||
return new LayerDto.Detail(
|
return new LayerDto.Detail(
|
||||||
this.uuid,
|
this.uuid,
|
||||||
|
this.layerName,
|
||||||
this.layerType,
|
this.layerType,
|
||||||
this.title,
|
this.title,
|
||||||
this.description,
|
this.description,
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.repository.gukyuin;
|
package com.kamco.cd.kamcoback.postgres.repository.gukyuin;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.StbltResult;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LearnKeyDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LearnKeyDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctMastDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctMastDto;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.PnuEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.PnuEntity;
|
||||||
@@ -12,4 +13,6 @@ public interface GukYuinStbltJobRepositoryCustom {
|
|||||||
void updateGukYuinEligibleForSurvey(String resultUid, RlbDtctMastDto stbltDto);
|
void updateGukYuinEligibleForSurvey(String resultUid, RlbDtctMastDto stbltDto);
|
||||||
|
|
||||||
PnuEntity findPnuEntityByResultUid(String resultUid, String pnu);
|
PnuEntity findPnuEntityByResultUid(String resultUid, String pnu);
|
||||||
|
|
||||||
|
void updateGukYuinObjectStbltYn(String resultUid, StbltResult stbResult);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapShe
|
|||||||
import static com.kamco.cd.kamcoback.postgres.entity.QPnuEntity.pnuEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QPnuEntity.pnuEntity;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.enums.ImageryFitStatus;
|
import com.kamco.cd.kamcoback.common.enums.ImageryFitStatus;
|
||||||
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.StbltResult;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LearnKeyDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LearnKeyDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctMastDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctMastDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
@@ -90,4 +91,19 @@ public class GukYuinStbltJobRepositoryImpl implements GukYuinStbltJobRepositoryC
|
|||||||
.where(pnuEntity.pnu.eq(pnu), pnuEntity.chnDtctObjtId.eq(resultUid))
|
.where(pnuEntity.pnu.eq(pnu), pnuEntity.chnDtctObjtId.eq(resultUid))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateGukYuinObjectStbltYn(String resultUid, StbltResult stbResult) {
|
||||||
|
queryFactory
|
||||||
|
.update(mapSheetAnalDataInferenceGeomEntity)
|
||||||
|
.set(
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.fitState,
|
||||||
|
stbResult.getStbltYn().equals("Y")
|
||||||
|
? ImageryFitStatus.UNFIT.getId()
|
||||||
|
: ImageryFitStatus.FIT.getId()) // 적합여부가 Y 이면 부적합인 것, N 이면 적합한 것이라고 함
|
||||||
|
.set(mapSheetAnalDataInferenceGeomEntity.fitStateDttm, ZonedDateTime.now())
|
||||||
|
.set(mapSheetAnalDataInferenceGeomEntity.fitStateCmmnt, stbResult.getIncyCmnt())
|
||||||
|
.where(mapSheetAnalDataInferenceGeomEntity.resultUid.eq(resultUid))
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -134,20 +134,16 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
.and(mapSheetAnalDataInferenceGeomEntity.labelStateDttm.lt(end)));
|
.and(mapSheetAnalDataInferenceGeomEntity.labelStateDttm.lt(end)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// labelTotCnt: pnu가 있고 pass_yn = false (부적합)인 건수만 라벨링 대상
|
// labelTotCnt: pnu가 있고 fitState = UNFIT 인 건수만 라벨링 대상
|
||||||
NumberExpression<Long> labelTotCntExpr =
|
NumberExpression<Long> labelTotCntExpr =
|
||||||
new CaseBuilder()
|
new CaseBuilder()
|
||||||
.when(
|
.when(
|
||||||
mapSheetAnalDataInferenceGeomEntity
|
mapSheetAnalDataInferenceGeomEntity
|
||||||
.pnu
|
.pnu
|
||||||
.isNotNull()
|
.gt(0)
|
||||||
.and(
|
.and(
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu
|
mapSheetAnalDataInferenceGeomEntity.fitState.eq(
|
||||||
.isNotNull()) // TODO: 이노팸 연동 후 0 이상이라고 해야할 듯
|
ImageryFitStatus.UNFIT.getId())))
|
||||||
//
|
|
||||||
// .and(mapSheetAnalDataInferenceGeomEntity.passYn.eq(Boolean.FALSE)) //TODO: 추후
|
|
||||||
// 라벨링 대상 조건 수정하기
|
|
||||||
)
|
|
||||||
.then(1L)
|
.then(1L)
|
||||||
.otherwise(0L)
|
.otherwise(0L)
|
||||||
.sum();
|
.sum();
|
||||||
@@ -201,7 +197,7 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
new CaseBuilder()
|
new CaseBuilder()
|
||||||
.when(
|
.when(
|
||||||
mapSheetAnalDataInferenceGeomEntity.labelState.eq(
|
mapSheetAnalDataInferenceGeomEntity.labelState.eq(
|
||||||
LabelState.DONE.getId())) // "LABEL_COMPLETE"?
|
LabelState.DONE.getId()))
|
||||||
.then(1L)
|
.then(1L)
|
||||||
.otherwise(0L)
|
.otherwise(0L)
|
||||||
.sum(),
|
.sum(),
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
|
|||||||
if (searchReq.getTag() != null) {
|
if (searchReq.getTag() != null) {
|
||||||
whereBuilder.and(mapLayerEntity.tag.toLowerCase().eq(searchReq.getTag().toLowerCase()));
|
whereBuilder.and(mapLayerEntity.tag.toLowerCase().eq(searchReq.getTag().toLowerCase()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (searchReq.getLayerType() != null) {
|
if (searchReq.getLayerType() != null) {
|
||||||
whereBuilder.and(
|
whereBuilder.and(
|
||||||
mapLayerEntity.layerType.toLowerCase().eq(searchReq.getLayerType().toLowerCase()));
|
mapLayerEntity.layerType.toLowerCase().eq(searchReq.getLayerType().toLowerCase()));
|
||||||
@@ -57,6 +58,7 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
|
|||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
LayerDto.Basic.class,
|
LayerDto.Basic.class,
|
||||||
mapLayerEntity.uuid,
|
mapLayerEntity.uuid,
|
||||||
|
mapLayerEntity.layerName,
|
||||||
mapLayerEntity.layerType,
|
mapLayerEntity.layerType,
|
||||||
mapLayerEntity.description,
|
mapLayerEntity.description,
|
||||||
mapLayerEntity.tag,
|
mapLayerEntity.tag,
|
||||||
@@ -101,6 +103,7 @@ public class MapLayerRepositoryImpl implements MapLayerRepositoryCustom {
|
|||||||
.select(
|
.select(
|
||||||
Projections.constructor(
|
Projections.constructor(
|
||||||
LayerMapDto.class,
|
LayerMapDto.class,
|
||||||
|
mapLayerEntity.layerName,
|
||||||
mapLayerEntity.layerType,
|
mapLayerEntity.layerType,
|
||||||
mapLayerEntity.tag,
|
mapLayerEntity.tag,
|
||||||
mapLayerEntity.order,
|
mapLayerEntity.order,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import static com.kamco.cd.kamcoback.postgres.entity.QPnuEntity.pnuEntity;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.kamco.cd.kamcoback.common.enums.DetectionClassification;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelMngState;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelMngState;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelState;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelState;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity;
|
||||||
@@ -492,6 +493,9 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeCd() != null
|
mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeCd() != null
|
||||||
? mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeCd()
|
? mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeCd()
|
||||||
: "")
|
: "")
|
||||||
|
.classificationName(
|
||||||
|
DetectionClassification.fromStrDesc(
|
||||||
|
mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterCd()))
|
||||||
.probability(
|
.probability(
|
||||||
mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeProb() != null
|
mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeProb() != null
|
||||||
? mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeProb()
|
? mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeProb()
|
||||||
@@ -503,6 +507,9 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterCd() != null
|
mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterCd() != null
|
||||||
? mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterCd()
|
? mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterCd()
|
||||||
: "")
|
: "")
|
||||||
|
.classificationName(
|
||||||
|
DetectionClassification.fromStrDesc(
|
||||||
|
mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterCd()))
|
||||||
.probability(
|
.probability(
|
||||||
mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterProb() != null
|
mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterProb() != null
|
||||||
? mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterProb()
|
? mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterProb()
|
||||||
@@ -524,12 +531,17 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
var inspectionResultInfo =
|
var inspectionResultInfo =
|
||||||
InspectionResultInfo.builder()
|
queryFactory
|
||||||
.verificationResult(convertInspectState(assignment.toDto().getInspectState()))
|
.select(
|
||||||
.inappropriateReason("")
|
Projections.constructor(
|
||||||
// .memo(assignment.toDto().getInspectMemo() != null ?
|
InspectionResultInfo.class,
|
||||||
// assignment.toDto().getInspectMemo() : "")
|
mapSheetAnalDataInferenceGeomEntity.fitState,
|
||||||
.build();
|
mapSheetAnalDataInferenceGeomEntity.fitStateCmmnt))
|
||||||
|
.from(mapSheetAnalDataInferenceGeomEntity)
|
||||||
|
.where(
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.geoUid.eq(
|
||||||
|
mapSheetAnalDataInferenceGeomEntityEntity.getGeoUid()))
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
// 6. Geometry를 GeoJSON으로 변환
|
// 6. Geometry를 GeoJSON으로 변환
|
||||||
InferenceDataGeometry inferData =
|
InferenceDataGeometry inferData =
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import static com.kamco.cd.kamcoback.postgres.entity.QPnuEntity.pnuEntity;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.kamco.cd.kamcoback.common.enums.DetectionClassification;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InspectState;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InspectState;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelMngState;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelMngState;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity;
|
||||||
@@ -24,7 +25,6 @@ import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.DetailRes;
|
|||||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.GeoFeatureRequest.Properties;
|
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.GeoFeatureRequest.Properties;
|
||||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.InferenceDataGeometry;
|
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.InferenceDataGeometry;
|
||||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.InferenceDataGeometry.InferenceProperties;
|
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.InferenceDataGeometry.InferenceProperties;
|
||||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.InspectionResultInfo;
|
|
||||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.LearnDataGeometry;
|
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.LearnDataGeometry;
|
||||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.LearnDataGeometry.LearnProperties;
|
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.LearnDataGeometry.LearnProperties;
|
||||||
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.ReviewGeometryInfo;
|
import com.kamco.cd.kamcoback.trainingdata.dto.TrainingDataReviewDto.ReviewGeometryInfo;
|
||||||
@@ -520,6 +520,9 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeCd() != null
|
mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeCd() != null
|
||||||
? mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeCd()
|
? mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeCd()
|
||||||
: "")
|
: "")
|
||||||
|
.classificationName(
|
||||||
|
DetectionClassification.fromStrDesc(
|
||||||
|
mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterCd()))
|
||||||
.probability(
|
.probability(
|
||||||
mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeProb() != null
|
mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeProb() != null
|
||||||
? mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeProb()
|
? mapSheetAnalDataInferenceGeomEntityEntity.getClassBeforeProb()
|
||||||
@@ -531,6 +534,9 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterCd() != null
|
mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterCd() != null
|
||||||
? mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterCd()
|
? mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterCd()
|
||||||
: "")
|
: "")
|
||||||
|
.classificationName(
|
||||||
|
DetectionClassification.fromStrDesc(
|
||||||
|
mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterCd()))
|
||||||
.probability(
|
.probability(
|
||||||
mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterProb() != null
|
mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterProb() != null
|
||||||
? mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterProb()
|
? mapSheetAnalDataInferenceGeomEntityEntity.getClassAfterProb()
|
||||||
@@ -553,11 +559,17 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
var inspectionResultInfo =
|
var inspectionResultInfo =
|
||||||
InspectionResultInfo.builder()
|
queryFactory
|
||||||
.verificationResult(convertInspectState(assignment.toDto().getInspectState()))
|
.select(
|
||||||
.inappropriateReason("")
|
Projections.constructor(
|
||||||
.memo("")
|
TrainingDataReviewDto.InspectionResultInfo.class,
|
||||||
.build();
|
mapSheetAnalDataInferenceGeomEntity.fitState,
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.fitStateCmmnt))
|
||||||
|
.from(mapSheetAnalDataInferenceGeomEntity)
|
||||||
|
.where(
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.geoUid.eq(
|
||||||
|
mapSheetAnalDataInferenceGeomEntityEntity.getGeoUid()))
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
// 6. Geometry를 GeoJSON으로 변환
|
// 6. Geometry를 GeoJSON으로 변환
|
||||||
InferenceDataGeometry inferData =
|
InferenceDataGeometry inferData =
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.kamco.cd.kamcoback.scheduler.service;
|
package com.kamco.cd.kamcoback.scheduler.service;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.StbltResult;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LearnKeyDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LearnKeyDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctMastDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.RlbDtctMastDto;
|
||||||
@@ -10,6 +11,8 @@ import java.time.LocalDate;
|
|||||||
import java.time.ZoneId;
|
import java.time.ZoneId;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -37,7 +40,7 @@ public class GukYuinApiStbltJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 국유인 연동 후, 실태조사 적합여부 확인하여 update */
|
/** 국유인 연동 후, 실태조사 적합여부 확인하여 update */
|
||||||
@Scheduled(cron = "0 0 3 * * *") // 0 0 3 * * *
|
@Scheduled(cron = "0 0 3 * * *")
|
||||||
public void findGukYuinEligibleForSurvey() {
|
public void findGukYuinEligibleForSurvey() {
|
||||||
if (isLocalProfile()) {
|
if (isLocalProfile()) {
|
||||||
return;
|
return;
|
||||||
@@ -68,6 +71,42 @@ public class GukYuinApiStbltJobService {
|
|||||||
gukYuinStbltJobCoreService.updateGukYuinEligibleForSurvey(resultUid, stbltDto);
|
gukYuinStbltJobCoreService.updateGukYuinEligibleForSurvey(resultUid, stbltDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String, StbltResult> resultMap =
|
||||||
|
result.getResult().stream()
|
||||||
|
.collect(Collectors.groupingBy(RlbDtctMastDto::getChnDtctObjtId))
|
||||||
|
.entrySet()
|
||||||
|
.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.toMap(
|
||||||
|
Map.Entry::getKey,
|
||||||
|
e -> {
|
||||||
|
List<RlbDtctMastDto> pnuList = e.getValue();
|
||||||
|
|
||||||
|
boolean hasY = pnuList.stream().anyMatch(v -> "Y".equals(v.getStbltYn()));
|
||||||
|
|
||||||
|
String fitYn = hasY ? "Y" : "N";
|
||||||
|
|
||||||
|
RlbDtctMastDto selected =
|
||||||
|
hasY
|
||||||
|
? pnuList.stream()
|
||||||
|
.filter(v -> "Y".equals(v.getStbltYn()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null)
|
||||||
|
: pnuList.stream()
|
||||||
|
.filter(v -> "N".equals(v.getStbltYn()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
|
||||||
|
if (selected == null) {
|
||||||
|
return null; // 방어 코드
|
||||||
|
}
|
||||||
|
|
||||||
|
return new StbltResult(
|
||||||
|
fitYn, selected.getIncyCd(), selected.getIncyRsnCont());
|
||||||
|
}));
|
||||||
|
|
||||||
|
resultMap.forEach(gukYuinStbltJobCoreService::updateGukYuinObjectStbltYn);
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("[GUKYUIN] failed uid={}", dto.getChnDtctMstId(), e);
|
log.error("[GUKYUIN] failed uid={}", dto.getChnDtctMstId(), e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
|
import com.kamco.cd.kamcoback.common.enums.ImageryFitStatus;
|
||||||
import com.kamco.cd.kamcoback.common.utils.geometry.GeometryDeserializer;
|
import com.kamco.cd.kamcoback.common.utils.geometry.GeometryDeserializer;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -372,9 +373,12 @@ public class TrainingDataLabelDto {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class ClassificationInfo {
|
public static class ClassificationInfo {
|
||||||
|
|
||||||
@Schema(description = "분류", example = "일반토지")
|
@Schema(description = "분류", example = "land")
|
||||||
private String classification;
|
private String classification;
|
||||||
|
|
||||||
|
@Schema(description = "분류 한글명", example = "일반토지")
|
||||||
|
private String classificationName;
|
||||||
|
|
||||||
@Schema(description = "확률", example = "80.0")
|
@Schema(description = "확률", example = "80.0")
|
||||||
private Double probability;
|
private Double probability;
|
||||||
}
|
}
|
||||||
@@ -382,9 +386,7 @@ public class TrainingDataLabelDto {
|
|||||||
@Schema(name = "InspectionResultInfo", description = "실태조사결과정보")
|
@Schema(name = "InspectionResultInfo", description = "실태조사결과정보")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
|
||||||
public static class InspectionResultInfo {
|
public static class InspectionResultInfo {
|
||||||
|
|
||||||
@Schema(description = "검증결과 (미확인/제외/완료)", example = "미확인")
|
@Schema(description = "검증결과 (미확인/제외/완료)", example = "미확인")
|
||||||
@@ -395,6 +397,11 @@ public class TrainingDataLabelDto {
|
|||||||
|
|
||||||
@Schema(description = "메모")
|
@Schema(description = "메모")
|
||||||
private String memo;
|
private String memo;
|
||||||
|
|
||||||
|
public InspectionResultInfo(String verificationResult, String inappropriateReason) {
|
||||||
|
this.verificationResult = ImageryFitStatus.fromCode(verificationResult).getText();
|
||||||
|
this.inappropriateReason = inappropriateReason;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Schema(name = "SummaryRes", description = "작업 통계 응답")
|
@Schema(name = "SummaryRes", description = "작업 통계 응답")
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.JsonNode;
|
|||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||||
|
import com.kamco.cd.kamcoback.common.enums.ImageryFitStatus;
|
||||||
import com.kamco.cd.kamcoback.common.utils.geometry.GeometryDeserializer;
|
import com.kamco.cd.kamcoback.common.utils.geometry.GeometryDeserializer;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -368,9 +369,12 @@ public class TrainingDataReviewDto {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class ClassificationInfo {
|
public static class ClassificationInfo {
|
||||||
|
|
||||||
@Schema(description = "분류", example = "일반토지")
|
@Schema(description = "분류", example = "land")
|
||||||
private String classification;
|
private String classification;
|
||||||
|
|
||||||
|
@Schema(description = "분류한글명", example = "일반토지")
|
||||||
|
private String classificationName;
|
||||||
|
|
||||||
@Schema(description = "확률", example = "80.0")
|
@Schema(description = "확률", example = "80.0")
|
||||||
private Double probability;
|
private Double probability;
|
||||||
}
|
}
|
||||||
@@ -378,9 +382,7 @@ public class TrainingDataReviewDto {
|
|||||||
@Schema(name = "InspectionResultInfo", description = "실태조사결과정보")
|
@Schema(name = "InspectionResultInfo", description = "실태조사결과정보")
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
|
||||||
public static class InspectionResultInfo {
|
public static class InspectionResultInfo {
|
||||||
|
|
||||||
@Schema(description = "검증결과 (미확인/제외/완료)", example = "미확인")
|
@Schema(description = "검증결과 (미확인/제외/완료)", example = "미확인")
|
||||||
@@ -391,6 +393,11 @@ public class TrainingDataReviewDto {
|
|||||||
|
|
||||||
@Schema(description = "메모")
|
@Schema(description = "메모")
|
||||||
private String memo;
|
private String memo;
|
||||||
|
|
||||||
|
public InspectionResultInfo(String verificationResult, String inappropriateReason) {
|
||||||
|
this.verificationResult = ImageryFitStatus.fromCode(verificationResult).getText();
|
||||||
|
this.inappropriateReason = inappropriateReason;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Schema(name = "SummaryRes", description = "작업 통계 응답")
|
@Schema(name = "SummaryRes", description = "작업 통계 응답")
|
||||||
|
|||||||
@@ -18,9 +18,10 @@ spring:
|
|||||||
batch_size: 1000 # ✅ 추가 (JDBC batch)
|
batch_size: 1000 # ✅ 추가 (JDBC batch)
|
||||||
|
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:postgresql://10.100.0.10:25432/temp
|
url: jdbc:postgresql://127.0.0.1:15432/kamco_cds
|
||||||
username: temp
|
#url: jdbc:postgresql://localhost:15432/kamco_cds
|
||||||
password: temp123!
|
username: kamco_cds
|
||||||
|
password: kamco_cds_Q!W@E#R$
|
||||||
hikari:
|
hikari:
|
||||||
minimum-idle: 10
|
minimum-idle: 10
|
||||||
maximum-pool-size: 20
|
maximum-pool-size: 20
|
||||||
@@ -50,8 +51,8 @@ file:
|
|||||||
sync-auto-exception-start-year: 2025
|
sync-auto-exception-start-year: 2025
|
||||||
sync-auto-exception-before-year-cnt: 3
|
sync-auto-exception-before-year-cnt: 3
|
||||||
|
|
||||||
#dataset-dir: D:/kamco-nfs/dataset/
|
#dataset-dir: D:/kamco-nfs/dataset/ #으로 변경 model_output
|
||||||
dataset-dir: /kamco-nfs/dataset/export/
|
dataset-dir: /kamco-nfs/model_output/export/
|
||||||
dataset-tmp-dir: ${file.dataset-dir}tmp/
|
dataset-tmp-dir: ${file.dataset-dir}tmp/
|
||||||
|
|
||||||
#model-dir: D:/kamco-nfs/ckpt/model/
|
#model-dir: D:/kamco-nfs/ckpt/model/
|
||||||
@@ -63,10 +64,10 @@ file:
|
|||||||
pt-FileName: yolov8_6th-6m.pt
|
pt-FileName: yolov8_6th-6m.pt
|
||||||
|
|
||||||
inference:
|
inference:
|
||||||
url: http://192.168.2.183:8000/jobs
|
url: http://127.0.0.1:8000/jobs
|
||||||
batch-url: http://192.168.2.183:8000/batches
|
batch-url: http://127.0.0.1:8000/batches
|
||||||
geojson-dir: /kamco-nfs/requests/
|
geojson-dir: /kamco-nfs/requests/
|
||||||
jar-path: /kamco-nfs/dataset/shp/shp-exporter.jar
|
jar-path: /kamco-nfs/repo/shp/shp-exporter.jar
|
||||||
inference-server-name: server1,server2,server3,server4
|
inference-server-name: server1,server2,server3,server4
|
||||||
|
|
||||||
gukyuin:
|
gukyuin:
|
||||||
@@ -75,7 +76,7 @@ gukyuin:
|
|||||||
cdi: ${gukyuin.url}/api/kcd/cdi
|
cdi: ${gukyuin.url}/api/kcd/cdi
|
||||||
|
|
||||||
training-data:
|
training-data:
|
||||||
geojson-dir: /kamco-nfs/model_output/labeling/
|
geojson-dir: /kamco-nfs/dataset/request/
|
||||||
|
|
||||||
layer:
|
layer:
|
||||||
geoserver-url: https://kamco.geo-dev.gs.dabeeo.com
|
geoserver-url: https://kamco.geo-dev.gs.dabeeo.com
|
||||||
|
|||||||
Reference in New Issue
Block a user