Compare commits
32 Commits
872df11844
...
feat/infer
| Author | SHA1 | Date | |
|---|---|---|---|
| a2bb1b2442 | |||
| 80b037a9cb | |||
| 298b90a289 | |||
| 985e1789d2 | |||
| 2d86fab030 | |||
| cf6b1323d8 | |||
| 5377294e6e | |||
| 4e3e2a0181 | |||
| 57a2ec8367 | |||
| fe6edbb19f | |||
| 0e45adc52e | |||
| 581b8c968e | |||
| e88ffd1260 | |||
| bdce18119f | |||
| 533d97a573 | |||
| 3b5536a57e | |||
| 3237863542 | |||
| 9dd03f3c52 | |||
| 41b227de3f | |||
| 796591eca6 | |||
| 83e02c4498 | |||
| 825e393e05 | |||
| d8804e7c9a | |||
| 1410333829 | |||
| f326b5f651 | |||
| d63980476f | |||
| c1b6061e3e | |||
| ae1693a33c | |||
| 71a8f27afc | |||
| 8dfae65bcc | |||
| 299d1b09a0 | |||
| 3461376b35 |
@@ -0,0 +1,48 @@
|
|||||||
|
package com.kamco.cd.kamcoback.common.download;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.common.download.dto.DownloadSpec;
|
||||||
|
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DownloadExecutor {
|
||||||
|
|
||||||
|
private final UserUtil userUtil;
|
||||||
|
|
||||||
|
public ResponseEntity<StreamingResponseBody> stream(DownloadSpec spec) throws IOException {
|
||||||
|
|
||||||
|
if (!Files.isReadable(spec.filePath())) {
|
||||||
|
return ResponseEntity.notFound().build();
|
||||||
|
}
|
||||||
|
|
||||||
|
StreamingResponseBody body =
|
||||||
|
os -> {
|
||||||
|
try (InputStream in = Files.newInputStream(spec.filePath())) {
|
||||||
|
in.transferTo(os);
|
||||||
|
os.flush();
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 고용량은 중간 끊김 흔하니까 throw 금지
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
String fileName =
|
||||||
|
spec.downloadName() != null
|
||||||
|
? spec.downloadName()
|
||||||
|
: spec.filePath().getFileName().toString();
|
||||||
|
|
||||||
|
return ResponseEntity.ok()
|
||||||
|
.contentType(
|
||||||
|
spec.contentType() != null ? spec.contentType() : MediaType.APPLICATION_OCTET_STREAM)
|
||||||
|
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + fileName + "\"")
|
||||||
|
.body(body);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.kamco.cd.kamcoback.common.download;
|
||||||
|
|
||||||
|
import org.springframework.util.AntPathMatcher;
|
||||||
|
|
||||||
|
public final class DownloadPaths {
|
||||||
|
private DownloadPaths() {}
|
||||||
|
|
||||||
|
public static final String[] PATTERNS = {
|
||||||
|
"/api/inference/download/**", "/api/training-data/stage/download/**"
|
||||||
|
};
|
||||||
|
|
||||||
|
public static boolean matches(String uri) {
|
||||||
|
AntPathMatcher m = new AntPathMatcher();
|
||||||
|
for (String p : PATTERNS) {
|
||||||
|
if (m.match(p, uri)) return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package com.kamco.cd.kamcoback.common.download.dto;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.util.UUID;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
|
||||||
|
public record DownloadSpec(
|
||||||
|
UUID uuid, // 다운로드 식별(로그/정책용)
|
||||||
|
Path filePath, // 실제 파일 경로
|
||||||
|
String downloadName, // 사용자에게 보일 파일명
|
||||||
|
MediaType contentType // 보통 OCTET_STREAM
|
||||||
|
) {}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package com.kamco.cd.kamcoback.config;
|
package com.kamco.cd.kamcoback.config;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.kamco.cd.kamcoback.auth.CustomUserDetails;
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.HeaderUtil;
|
import com.kamco.cd.kamcoback.common.utils.HeaderUtil;
|
||||||
|
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiLogFunction;
|
import com.kamco.cd.kamcoback.config.api.ApiLogFunction;
|
||||||
import com.kamco.cd.kamcoback.menu.dto.MenuDto;
|
import com.kamco.cd.kamcoback.menu.dto.MenuDto;
|
||||||
import com.kamco.cd.kamcoback.menu.service.MenuService;
|
import com.kamco.cd.kamcoback.menu.service.MenuService;
|
||||||
@@ -17,7 +17,6 @@ import java.util.Objects;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.servlet.HandlerInterceptor;
|
import org.springframework.web.servlet.HandlerInterceptor;
|
||||||
|
|
||||||
@@ -27,24 +26,39 @@ public class FileDownloadInteceptor implements HandlerInterceptor {
|
|||||||
|
|
||||||
private final AuditLogRepository auditLogRepository;
|
private final AuditLogRepository auditLogRepository;
|
||||||
private final MenuService menuService;
|
private final MenuService menuService;
|
||||||
|
private final UserUtil userUtil;
|
||||||
|
|
||||||
@Autowired private ObjectMapper objectMapper;
|
@Autowired private ObjectMapper objectMapper;
|
||||||
|
|
||||||
public FileDownloadInteceptor(AuditLogRepository auditLogRepository, MenuService menuService) {
|
public FileDownloadInteceptor(
|
||||||
|
AuditLogRepository auditLogRepository, MenuService menuService, UserUtil userUtil) {
|
||||||
this.auditLogRepository = auditLogRepository;
|
this.auditLogRepository = auditLogRepository;
|
||||||
this.menuService = menuService;
|
this.menuService = menuService;
|
||||||
|
this.userUtil = userUtil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterCompletion(
|
public boolean preHandle(
|
||||||
HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) {
|
HttpServletRequest request, HttpServletResponse response, Object handler) {
|
||||||
|
|
||||||
|
if (!request.getRequestURI().contains("/download")) return true;
|
||||||
|
|
||||||
|
if (request.getDispatcherType() != jakarta.servlet.DispatcherType.REQUEST) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
saveLog(request, response);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveLog(HttpServletRequest request, HttpServletResponse response) {
|
||||||
// 파일 다운로드 API만 필터링
|
// 파일 다운로드 API만 필터링
|
||||||
if (!request.getRequestURI().contains("/download")) {
|
if (!request.getRequestURI().contains("/download")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Long userId = extractUserId(request);
|
Long userId = userUtil.getId();
|
||||||
String ip = ApiLogFunction.getClientIp(request);
|
String ip = ApiLogFunction.getClientIp(request);
|
||||||
|
|
||||||
List<?> list = menuService.getFindAll();
|
List<?> list = menuService.getFindAll();
|
||||||
@@ -81,12 +95,4 @@ public class FileDownloadInteceptor implements HandlerInterceptor {
|
|||||||
|
|
||||||
auditLogRepository.save(log);
|
auditLogRepository.save(log);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Long extractUserId(HttpServletRequest request) {
|
|
||||||
if (request.getUserPrincipal() instanceof UsernamePasswordAuthenticationToken auth
|
|
||||||
&& auth.getPrincipal() instanceof CustomUserDetails userDetails) {
|
|
||||||
return userDetails.getMember().getId();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.kamco.cd.kamcoback.config;
|
|||||||
import com.kamco.cd.kamcoback.auth.CustomAuthenticationProvider;
|
import com.kamco.cd.kamcoback.auth.CustomAuthenticationProvider;
|
||||||
import com.kamco.cd.kamcoback.auth.JwtAuthenticationFilter;
|
import com.kamco.cd.kamcoback.auth.JwtAuthenticationFilter;
|
||||||
import com.kamco.cd.kamcoback.auth.MenuAuthorizationManager;
|
import com.kamco.cd.kamcoback.auth.MenuAuthorizationManager;
|
||||||
|
import com.kamco.cd.kamcoback.common.download.DownloadPaths;
|
||||||
|
import jakarta.servlet.DispatcherType;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
@@ -44,9 +46,11 @@ public class SecurityConfig {
|
|||||||
.authorizeHttpRequests(
|
.authorizeHttpRequests(
|
||||||
auth ->
|
auth ->
|
||||||
auth
|
auth
|
||||||
|
|
||||||
// .requestMatchers("/chunk_upload_test.html").authenticated()
|
// .requestMatchers("/chunk_upload_test.html").authenticated()
|
||||||
.requestMatchers("/monitor/health", "/monitor/health/**")
|
.requestMatchers("/monitor/health", "/monitor/health/**")
|
||||||
.permitAll()
|
.permitAll()
|
||||||
|
|
||||||
// 맵시트 영역 전체 허용 (우선순위 최상단)
|
// 맵시트 영역 전체 허용 (우선순위 최상단)
|
||||||
.requestMatchers("/api/mapsheet/**")
|
.requestMatchers("/api/mapsheet/**")
|
||||||
.permitAll()
|
.permitAll()
|
||||||
@@ -67,13 +71,25 @@ public class SecurityConfig {
|
|||||||
.requestMatchers("/api/test/review")
|
.requestMatchers("/api/test/review")
|
||||||
.hasAnyRole("ADMIN", "REVIEWER")
|
.hasAnyRole("ADMIN", "REVIEWER")
|
||||||
|
|
||||||
|
// ASYNC/ERROR 재디스패치는 막지 않기 (다운로드/스트리밍에서 필수)
|
||||||
|
.dispatcherTypeMatchers(DispatcherType.ASYNC, DispatcherType.ERROR)
|
||||||
|
.permitAll()
|
||||||
|
|
||||||
|
// 다운로드는 인증 필요
|
||||||
|
.requestMatchers(HttpMethod.GET, DownloadPaths.PATTERNS)
|
||||||
|
.authenticated()
|
||||||
|
|
||||||
// 메뉴 등록 ADMIN만 가능
|
// 메뉴 등록 ADMIN만 가능
|
||||||
.requestMatchers(HttpMethod.POST, "/api/menu/auth")
|
.requestMatchers(HttpMethod.POST, "/api/menu/auth")
|
||||||
.hasAnyRole("ADMIN")
|
.hasAnyRole("ADMIN")
|
||||||
|
|
||||||
|
// 에러 경로는 항상 허용 (이미 있지만 유지)
|
||||||
.requestMatchers("/error")
|
.requestMatchers("/error")
|
||||||
.permitAll()
|
.permitAll()
|
||||||
|
|
||||||
|
// preflight 허용
|
||||||
.requestMatchers(HttpMethod.OPTIONS, "/**")
|
.requestMatchers(HttpMethod.OPTIONS, "/**")
|
||||||
.permitAll() // preflight 허용
|
.permitAll()
|
||||||
.requestMatchers(
|
.requestMatchers(
|
||||||
"/api/auth/signin",
|
"/api/auth/signin",
|
||||||
"/api/auth/refresh",
|
"/api/auth/refresh",
|
||||||
@@ -90,6 +106,7 @@ public class SecurityConfig {
|
|||||||
"/api/layer/tile-url",
|
"/api/layer/tile-url",
|
||||||
"/api/layer/tile-url-year")
|
"/api/layer/tile-url-year")
|
||||||
.permitAll()
|
.permitAll()
|
||||||
|
|
||||||
// 로그인한 사용자만 가능 IAM
|
// 로그인한 사용자만 가능 IAM
|
||||||
.requestMatchers(
|
.requestMatchers(
|
||||||
"/api/user/**",
|
"/api/user/**",
|
||||||
@@ -98,16 +115,11 @@ public class SecurityConfig {
|
|||||||
"/api/training-data/label/**",
|
"/api/training-data/label/**",
|
||||||
"/api/training-data/review/**")
|
"/api/training-data/review/**")
|
||||||
.authenticated()
|
.authenticated()
|
||||||
.anyRequest()
|
|
||||||
.access(menuAuthorizationManager)
|
|
||||||
|
|
||||||
// .authenticated()
|
// 나머지는 메뉴권한
|
||||||
)
|
.anyRequest()
|
||||||
.addFilterBefore(
|
.access(menuAuthorizationManager))
|
||||||
jwtAuthenticationFilter,
|
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
|
||||||
UsernamePasswordAuthenticationFilter
|
|
||||||
.class) // 요청 들어오면 먼저 JWT 토큰 검사 후 security context 에 사용자 정보 저장.
|
|
||||||
;
|
|
||||||
|
|
||||||
return http.build();
|
return http.build();
|
||||||
}
|
}
|
||||||
@@ -118,23 +130,18 @@ public class SecurityConfig {
|
|||||||
return configuration.getAuthenticationManager();
|
return configuration.getAuthenticationManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** CORS 설정 */
|
||||||
* CORS 설정
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Bean
|
@Bean
|
||||||
public CorsConfigurationSource corsConfigurationSource() {
|
public CorsConfigurationSource corsConfigurationSource() {
|
||||||
CorsConfiguration config = new CorsConfiguration(); // CORS 객체 생성
|
CorsConfiguration config = new CorsConfiguration();
|
||||||
config.setAllowedOriginPatterns(List.of("*")); // 도메인 허용
|
config.setAllowedOriginPatterns(List.of("*"));
|
||||||
config.setAllowedMethods(List.of("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"));
|
config.setAllowedMethods(List.of("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"));
|
||||||
config.setAllowedHeaders(List.of("*")); // 헤더요청 Authorization, Content-Type, X-Custom-Header
|
config.setAllowedHeaders(List.of("*"));
|
||||||
config.setAllowCredentials(true); // 쿠키, Authorization 헤더, Bearer Token 등 자격증명 포함 요청을 허용할지 설정
|
config.setAllowCredentials(true);
|
||||||
config.setExposedHeaders(List.of("Content-Disposition"));
|
config.setExposedHeaders(List.of("Content-Disposition"));
|
||||||
|
|
||||||
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||||
/** "/**" → 모든 API 경로에 대해 이 CORS 규칙을 적용 /api/** 같이 특정 경로만 지정 가능. */
|
source.registerCorsConfiguration("/**", config);
|
||||||
source.registerCorsConfiguration("/**", config); // CORS 정책을 등록
|
|
||||||
return source;
|
return source;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.config;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.module.SimpleModule;
|
import com.fasterxml.jackson.databind.module.SimpleModule;
|
||||||
|
import com.kamco.cd.kamcoback.common.download.DownloadPaths;
|
||||||
import com.kamco.cd.kamcoback.common.utils.geometry.GeometryDeserializer;
|
import com.kamco.cd.kamcoback.common.utils.geometry.GeometryDeserializer;
|
||||||
import com.kamco.cd.kamcoback.common.utils.geometry.GeometrySerializer;
|
import com.kamco.cd.kamcoback.common.utils.geometry.GeometrySerializer;
|
||||||
import org.locationtech.jts.geom.Geometry;
|
import org.locationtech.jts.geom.Geometry;
|
||||||
@@ -39,9 +40,6 @@ public class WebConfig implements WebMvcConfigurer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInterceptors(InterceptorRegistry registry) {
|
public void addInterceptors(InterceptorRegistry registry) {
|
||||||
registry
|
registry.addInterceptor(fileDownloadInteceptor).addPathPatterns(DownloadPaths.PATTERNS);
|
||||||
.addInterceptor(fileDownloadInteceptor)
|
|
||||||
.addPathPatterns("/api/inference/download/**") // 추론 파일 다운로드
|
|
||||||
.addPathPatterns("/api/training-data/stage/download/**"); // 학습데이터 다운로드
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.kamco.cd.kamcoback.config.api;
|
package com.kamco.cd.kamcoback.config.api;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.common.download.DownloadPaths;
|
||||||
import jakarta.servlet.FilterChain;
|
import jakarta.servlet.FilterChain;
|
||||||
import jakarta.servlet.ServletException;
|
import jakarta.servlet.ServletException;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
@@ -16,6 +17,14 @@ public class ApiLogFilter extends OncePerRequestFilter {
|
|||||||
protected void doFilterInternal(
|
protected void doFilterInternal(
|
||||||
HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
|
HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
|
||||||
throws ServletException, IOException {
|
throws ServletException, IOException {
|
||||||
|
|
||||||
|
String uri = request.getRequestURI();
|
||||||
|
|
||||||
|
if (DownloadPaths.matches(uri)) {
|
||||||
|
filterChain.doFilter(request, response);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ContentCachingRequestWrapper wrappedRequest = new ContentCachingRequestWrapper(request);
|
ContentCachingRequestWrapper wrappedRequest = new ContentCachingRequestWrapper(request);
|
||||||
|
|
||||||
ContentCachingResponseWrapper wrappedResponse = new ContentCachingResponseWrapper(response);
|
ContentCachingResponseWrapper wrappedResponse = new ContentCachingResponseWrapper(response);
|
||||||
|
|||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,11 +7,15 @@ import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
|||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ChnDetectMastReqDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ChnDetectMastReqDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ChngDetectMastSearchDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ChngDetectMastSearchDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LabelSendDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LabelSendDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ResReturn;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.DetectMastDto.Basic;
|
import com.kamco.cd.kamcoback.gukyuin.dto.DetectMastDto.Basic;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.DetectMastDto.DetectMastReq;
|
import com.kamco.cd.kamcoback.gukyuin.dto.DetectMastDto.DetectMastReq;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkableRes;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkableRes;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
||||||
|
import com.kamco.cd.kamcoback.scheduler.service.GukYuinApiLabelJobService;
|
||||||
|
import com.kamco.cd.kamcoback.scheduler.service.GukYuinApiPnuJobService;
|
||||||
|
import com.kamco.cd.kamcoback.scheduler.service.GukYuinApiStatusJobService;
|
||||||
|
import com.kamco.cd.kamcoback.scheduler.service.GukYuinApiStbltJobService;
|
||||||
|
import io.swagger.v3.oas.annotations.Hidden;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
@@ -39,6 +43,10 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
public class GukYuinApiController {
|
public class GukYuinApiController {
|
||||||
|
|
||||||
private final GukYuinApiService gukYuinApiService;
|
private final GukYuinApiService gukYuinApiService;
|
||||||
|
private final GukYuinApiPnuJobService gukYuinApiPnuJobService;
|
||||||
|
private final GukYuinApiStatusJobService gukYuinApiStatusJobService;
|
||||||
|
private final GukYuinApiLabelJobService gukYuinApiLabelJobService;
|
||||||
|
private final GukYuinApiStbltJobService gukYuinApiStbltJobService;
|
||||||
|
|
||||||
/** 탐지결과 등록 */
|
/** 탐지결과 등록 */
|
||||||
@Operation(summary = "탐지결과 등록", description = "탐지결과 등록")
|
@Operation(summary = "탐지결과 등록", description = "탐지결과 등록")
|
||||||
@@ -74,7 +82,7 @@ public class GukYuinApiController {
|
|||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
})
|
})
|
||||||
@PostMapping("/chn/mast/remove")
|
@PostMapping("/chn/mast/remove")
|
||||||
public ApiResponseDto<ResReturn> remove(
|
public ApiResponseDto<ChngDetectMastDto.RemoveResDto> remove(
|
||||||
@RequestBody @Valid ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
@RequestBody @Valid ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
||||||
return ApiResponseDto.ok(gukYuinApiService.remove(chnDetectMastReq));
|
return ApiResponseDto.ok(gukYuinApiService.remove(chnDetectMastReq));
|
||||||
}
|
}
|
||||||
@@ -262,7 +270,7 @@ public class GukYuinApiController {
|
|||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
})
|
})
|
||||||
@PostMapping("/rlb/objt/{chnDtctObjtId}/lbl/{lblYn}")
|
@PostMapping("/rlb/objt/{chnDtctObjtId}/lbl/{lblYn}")
|
||||||
public ApiResponseDto<ResReturn> updateChnDtctObjtLabelingYn(
|
public ApiResponseDto<ChngDetectContDto.ResultLabelDto> updateChnDtctObjtLabelingYn(
|
||||||
@PathVariable String chnDtctObjtId, @PathVariable String lblYn) {
|
@PathVariable String chnDtctObjtId, @PathVariable String lblYn) {
|
||||||
return ApiResponseDto.ok(gukYuinApiService.updateChnDtctObjtLabelingYn(chnDtctObjtId, lblYn));
|
return ApiResponseDto.ok(gukYuinApiService.updateChnDtctObjtLabelingYn(chnDtctObjtId, lblYn));
|
||||||
}
|
}
|
||||||
@@ -298,8 +306,10 @@ public class GukYuinApiController {
|
|||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
})
|
})
|
||||||
public ApiResponseDto<ChngDetectMastDto.RlbDtctDto> findRlbDtctList(
|
public ApiResponseDto<ChngDetectMastDto.RlbDtctDto> findRlbDtctList(
|
||||||
@PathVariable String chnDtctId) {
|
@PathVariable String chnDtctId,
|
||||||
return ApiResponseDto.ok(gukYuinApiService.findRlbDtctList(chnDtctId));
|
@Parameter(description = "날짜(기본은 어제 날짜)") @RequestParam(defaultValue = "20260205")
|
||||||
|
String yyyymmdd) {
|
||||||
|
return ApiResponseDto.ok(gukYuinApiService.findRlbDtctList(chnDtctId, yyyymmdd));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "탐지객체 적합여부 조회 (객체별 조회)", description = "탐지객체 적합여부 조회 (객체별 조회)")
|
@Operation(summary = "탐지객체 적합여부 조회 (객체별 조회)", description = "탐지객체 적합여부 조회 (객체별 조회)")
|
||||||
@@ -320,4 +330,36 @@ public class GukYuinApiController {
|
|||||||
@PathVariable String chnDtctObjtId) {
|
@PathVariable String chnDtctObjtId) {
|
||||||
return ApiResponseDto.ok(gukYuinApiService.findRlbDtctObject(chnDtctObjtId));
|
return ApiResponseDto.ok(gukYuinApiService.findRlbDtctObject(chnDtctObjtId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Hidden
|
||||||
|
@Operation(summary = "job test pnu", description = "job test pnu")
|
||||||
|
@GetMapping("/job-test/pnu")
|
||||||
|
public ApiResponseDto<Void> findGukYuinContListPnuUpdate() {
|
||||||
|
gukYuinApiPnuJobService.findGukYuinContListPnuUpdate();
|
||||||
|
return ApiResponseDto.ok(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Hidden
|
||||||
|
@Operation(summary = "job test status", description = "job test status")
|
||||||
|
@GetMapping("/job-test/status")
|
||||||
|
public ApiResponseDto<Void> findGukYuinMastCompleteYn() {
|
||||||
|
gukYuinApiStatusJobService.findGukYuinMastCompleteYn();
|
||||||
|
return ApiResponseDto.ok(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Hidden
|
||||||
|
@Operation(summary = "job test label", description = "job test label")
|
||||||
|
@GetMapping("/job-test/label")
|
||||||
|
public ApiResponseDto<Void> findLabelingCompleteSend() {
|
||||||
|
gukYuinApiLabelJobService.findLabelingCompleteSend();
|
||||||
|
return ApiResponseDto.ok(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Hidden
|
||||||
|
@Operation(summary = "job test stblt", description = "job test stblt")
|
||||||
|
@GetMapping("/job-test/stblt")
|
||||||
|
public ApiResponseDto<Void> findGukYuinEligibleForSurvey() {
|
||||||
|
gukYuinApiStbltJobService.findGukYuinEligibleForSurvey();
|
||||||
|
return ApiResponseDto.ok(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,4 +114,38 @@ public class ChngDetectContDto {
|
|||||||
private List<DtoPnuDetectMpng> result;
|
private List<DtoPnuDetectMpng> result;
|
||||||
private Boolean success;
|
private Boolean success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Schema(name = "ResultLabelDto", description = "ResultLabelDto list 리턴 형태")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class ResultLabelDto {
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String message;
|
||||||
|
private DtoPnuDetectMpng result;
|
||||||
|
private Boolean success;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class ReqInfo {
|
||||||
|
|
||||||
|
private String reqIp;
|
||||||
|
private String reqEpno;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class StbltResult {
|
||||||
|
|
||||||
|
private String stbltYn;
|
||||||
|
private String incyCd;
|
||||||
|
private String incyCmnt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -247,45 +247,58 @@ public class ChngDetectMastDto {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class RlbDtctMastDto {
|
public static class RlbDtctMastDto {
|
||||||
|
|
||||||
private String pnuDtctId;
|
private String pnuDtctId; // PNU탐지ID
|
||||||
private String pnu;
|
private String pnu; // PNU코드(19자리)
|
||||||
private String lrmSyncYmd;
|
private String lrmSyncYmd; // 지적도동기화일자(YYYYMMDD)
|
||||||
private String pnuSyncYmd;
|
private String pnuSyncYmd; // PNU동기화일자(YYYYMMDD)
|
||||||
private String mpqdNo; // 도엽번호
|
private String mpqdNo; // 도곽번호
|
||||||
private String cprsYr; // 비교년도
|
private String cprsYr; // 비교년도
|
||||||
private String crtrYr; // 기준년도
|
private String crtrYr; // 기준년도
|
||||||
private String chnDtctSno; // 회차
|
private String chnDtctSno; // 회차, 변화탐지순번
|
||||||
private String chnDtctId;
|
private String chnDtctId; // 변화탐지ID(UUID)
|
||||||
|
|
||||||
private String chnDtctMstId;
|
private String chnDtctMstId; // 변화탐지마스터ID
|
||||||
private String chnDtctObjtId;
|
private String chnDtctObjtId; // 변화탐지객체ID
|
||||||
private String chnDtctContId;
|
private String chnDtctContId; // 변화탐지내용ID
|
||||||
private String chnCd;
|
private String chnCd; // 변화코드
|
||||||
private String chnDtctProb;
|
private String chnDtctProb; // 변화탐지정확도(0~1)
|
||||||
|
|
||||||
private String bfClsCd; // 이전분류코드
|
private String bfClsCd; // 이전분류코드
|
||||||
private String bfClsProb; // 이전분류정확도
|
private String bfClsProb; // 이전분류정확도(0~1)
|
||||||
private String afClsCd; // 이후분류코드
|
private String afClsCd; // 이후분류코드
|
||||||
private String afClsProb; // 이후분류정확도
|
private String afClsProb; // 이후분류정확도(0~1)
|
||||||
|
|
||||||
private String pnuSqms;
|
private String pnuSqms; // PNU면적(㎡)
|
||||||
private String pnuDtctSqms;
|
private String pnuDtctSqms; // PNU탐지면적(㎡)
|
||||||
private String chnDtctSqms;
|
private String chnDtctSqms; // 변화탐지면적(㎡)
|
||||||
private String stbltYn;
|
private String stbltYn; // 적합여부(Y/N) - 안정성 (Y:부적합, N:적합)
|
||||||
private String incyCd;
|
private String incyCd; // 부적합코드
|
||||||
private String incyRsnCont;
|
private String incyRsnCont; // 부적합사유내용
|
||||||
private String lockYn;
|
private String lockYn; // 잠금여부(Y/N)
|
||||||
private String lblYn;
|
private String lblYn; // 라벨여부(Y/N)
|
||||||
private String chgYn;
|
private String chgYn; // 변경여부(Y/N)
|
||||||
private String rsatctNo;
|
private String rsatctNo; // 부동산등기번호
|
||||||
private String rmk;
|
private String rmk; // 비고
|
||||||
|
|
||||||
private String crtDt; // 생성일시
|
private String crtDt; // 생성일시
|
||||||
private String crtEpno; // 생성사원번호
|
private String crtEpno; // 생성사원번호
|
||||||
private String crtIp; // 생성사원아이피
|
private String crtIp; // 생성사원아이피
|
||||||
private String chgDt;
|
private String chgDt; // 변경일시
|
||||||
private String chgEpno;
|
private String chgEpno; // 변경자사번
|
||||||
private String chgIp;
|
private String chgIp; // 변경자IP
|
||||||
private String delYn; // 삭제여부
|
private String delYn; // 삭제여부
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Schema(name = "RemoveResDto", description = "remove 후 리턴 형태")
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public static class RemoveResDto {
|
||||||
|
|
||||||
|
private Integer code;
|
||||||
|
private String message;
|
||||||
|
private Boolean result;
|
||||||
|
private Boolean success;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,13 +11,13 @@ 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.gukyuin.dto.ChngDetectContDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ContBasic;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ContBasic;
|
||||||
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ReqInfo;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultContDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultContDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultPnuDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultPnuDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ChnDetectMastReqDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ChnDetectMastReqDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ErrorResDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ErrorResDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LabelSendDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.LabelSendDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ResReturn;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ResultDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ResultDto;
|
||||||
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.GukYuinDto.GukYuinLinkFacts;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GukYuinLinkFacts;
|
||||||
@@ -55,6 +55,7 @@ public class GukYuinApiService {
|
|||||||
private final UserUtil userUtil;
|
private final UserUtil userUtil;
|
||||||
private final AuditLogRepository auditLogRepository;
|
private final AuditLogRepository auditLogRepository;
|
||||||
private final ObjectMapper objectMapper;
|
private final ObjectMapper objectMapper;
|
||||||
|
private final String myip = netUtils.getLocalIP();
|
||||||
|
|
||||||
@Value("${spring.profiles.active:local}")
|
@Value("${spring.profiles.active:local}")
|
||||||
private String profile;
|
private String profile;
|
||||||
@@ -65,13 +66,15 @@ public class GukYuinApiService {
|
|||||||
@Value("${gukyuin.cdi}")
|
@Value("${gukyuin.cdi}")
|
||||||
private String gukyuinCdiUrl;
|
private String gukyuinCdiUrl;
|
||||||
|
|
||||||
|
@Value("${file.dataset-dir}")
|
||||||
|
private String datasetDir;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ChngDetectMastDto.RegistResDto regist(
|
public ChngDetectMastDto.RegistResDto regist(
|
||||||
ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
||||||
|
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/regist";
|
String url = gukyuinCdiUrl + "/chn/mast/regist";
|
||||||
|
|
||||||
String myip = netUtils.getLocalIP();
|
|
||||||
chnDetectMastReq.setReqIp(myip);
|
chnDetectMastReq.setReqIp(myip);
|
||||||
chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo());
|
chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo());
|
||||||
|
|
||||||
@@ -89,6 +92,12 @@ public class GukYuinApiService {
|
|||||||
ChngDetectMastDto.Basic registRes = resultBody.getResult();
|
ChngDetectMastDto.Basic registRes = resultBody.getResult();
|
||||||
|
|
||||||
success = resultBody.getSuccess();
|
success = resultBody.getSuccess();
|
||||||
|
|
||||||
|
// 이미 등록한 경우에는 result가 없음
|
||||||
|
if (resultBody.getResult() == null) {
|
||||||
|
return resultBody;
|
||||||
|
}
|
||||||
|
|
||||||
// 추론 회차에 applyStatus, applyStatusDttm 업데이트
|
// 추론 회차에 applyStatus, applyStatusDttm 업데이트
|
||||||
gukyuinCoreService.updateGukYuinMastRegResult(registRes);
|
gukyuinCoreService.updateGukYuinMastRegResult(registRes);
|
||||||
|
|
||||||
@@ -122,23 +131,30 @@ public class GukYuinApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public ResReturn remove(ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
public ChngDetectMastDto.RemoveResDto remove(
|
||||||
|
ChngDetectMastDto.ChnDetectMastReqDto chnDetectMastReq) {
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/remove";
|
String url = gukyuinCdiUrl + "/chn/mast/remove";
|
||||||
|
|
||||||
String myip = netUtils.getLocalIP();
|
|
||||||
chnDetectMastReq.setReqIp(myip);
|
chnDetectMastReq.setReqIp(myip);
|
||||||
chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo());
|
chnDetectMastReq.setReqEpno(userUtil.getEmployeeNo());
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.Basic> result =
|
boolean success = false;
|
||||||
|
ExternalCallResult<ChngDetectMastDto.RemoveResDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url,
|
url,
|
||||||
HttpMethod.POST,
|
HttpMethod.POST,
|
||||||
chnDetectMastReq,
|
chnDetectMastReq,
|
||||||
netUtils.jsonHeaders(),
|
netUtils.jsonHeaders(),
|
||||||
ChngDetectMastDto.Basic.class);
|
ChngDetectMastDto.RemoveResDto.class);
|
||||||
|
|
||||||
ChngDetectMastDto.Basic resultBody = result.body();
|
ChngDetectMastDto.RemoveResDto resultBody = result.body();
|
||||||
gukyuinCoreService.updateGukYuinMastRegRemove(resultBody);
|
if (resultBody != null && resultBody.getSuccess() != null) {
|
||||||
|
|
||||||
|
success = resultBody.getSuccess();
|
||||||
|
if (resultBody.getSuccess()) {
|
||||||
|
gukyuinCoreService.updateGukYuinMastRegRemove(chnDetectMastReq.getChnDtctId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.REMOVE.getId(),
|
EventType.REMOVE.getId(),
|
||||||
@@ -146,14 +162,22 @@ public class GukYuinApiService {
|
|||||||
userUtil.getId(),
|
userUtil.getId(),
|
||||||
url.replace(gukyuinUrl, ""),
|
url.replace(gukyuinUrl, ""),
|
||||||
chnDetectMastReq,
|
chnDetectMastReq,
|
||||||
true); // TODO : successFail 여부
|
success);
|
||||||
return new ResReturn("success", "탐지결과 삭제 되었습니다.");
|
|
||||||
|
return resultBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 등록목록 1개 확인
|
// 등록목록 1개 확인
|
||||||
public ChngDetectMastDto.ResultDto detail(String chnDtctMstId) {
|
public ChngDetectMastDto.ResultDto detail(String chnDtctMstId) {
|
||||||
|
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/list/" + chnDtctMstId;
|
String url =
|
||||||
|
gukyuinCdiUrl
|
||||||
|
+ "/chn/mast/list/"
|
||||||
|
+ chnDtctMstId
|
||||||
|
+ "?reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -172,9 +196,15 @@ public class GukYuinApiService {
|
|||||||
// 등록목록 비교년도,기준년도,차수 조합해서 n개 확인
|
// 등록목록 비교년도,기준년도,차수 조합해서 n개 확인
|
||||||
public ChngDetectMastDto.ResultDto listYearStage(
|
public ChngDetectMastDto.ResultDto listYearStage(
|
||||||
ChngDetectMastDto.ChngDetectMastSearchDto searchDto) {
|
ChngDetectMastDto.ChngDetectMastSearchDto searchDto) {
|
||||||
|
|
||||||
String queryString = netUtils.dtoToQueryString(searchDto, null);
|
String queryString = netUtils.dtoToQueryString(searchDto, null);
|
||||||
String url = gukyuinCdiUrl + "/chn/mast" + queryString;
|
String url =
|
||||||
|
gukyuinCdiUrl
|
||||||
|
+ "/chn/mast"
|
||||||
|
+ queryString
|
||||||
|
+ "&reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -238,7 +268,11 @@ public class GukYuinApiService {
|
|||||||
+ "?pageIndex="
|
+ "?pageIndex="
|
||||||
+ pageIndex
|
+ pageIndex
|
||||||
+ "&pageSize="
|
+ "&pageSize="
|
||||||
+ pageSize;
|
+ pageSize
|
||||||
|
+ "&reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -257,20 +291,6 @@ public class GukYuinApiService {
|
|||||||
result.body().getSuccess());
|
result.body().getSuccess());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ContBasic cont : contList) {
|
|
||||||
String[] pnuList = cont.getPnuList();
|
|
||||||
long pnuCnt = pnuList == null ? 0 : pnuList.length;
|
|
||||||
if (cont.getChnDtctObjtId() != null) {
|
|
||||||
gukyuinCoreService.updateInferenceGeomDataPnuCnt(cont.getChnDtctObjtId(), pnuCnt);
|
|
||||||
|
|
||||||
if (pnuCnt > 0) {
|
|
||||||
Long geoUid =
|
|
||||||
gukyuinCoreService.findMapSheetAnalDataInferenceGeomUid(cont.getChnDtctObjtId());
|
|
||||||
gukyuinCoreService.insertGeoUidPnuData(geoUid, pnuList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.LIST.getId(),
|
EventType.LIST.getId(),
|
||||||
netUtils.getLocalIP(),
|
netUtils.getLocalIP(),
|
||||||
@@ -283,7 +303,16 @@ public class GukYuinApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ResultPnuDto findPnuObjMgmtList(String chnDtctId, String chnDtctObjtId) {
|
public ResultPnuDto findPnuObjMgmtList(String chnDtctId, String chnDtctObjtId) {
|
||||||
String url = gukyuinCdiUrl + "/chn/pnu/" + chnDtctId + "/objt/" + chnDtctObjtId;
|
String url =
|
||||||
|
gukyuinCdiUrl
|
||||||
|
+ "/chn/pnu/"
|
||||||
|
+ chnDtctId
|
||||||
|
+ "/objt/"
|
||||||
|
+ chnDtctObjtId
|
||||||
|
+ "?reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -304,18 +333,21 @@ public class GukYuinApiService {
|
|||||||
return result.body();
|
return result.body();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResReturn updateChnDtctObjtLabelingYn(String chnDtctObjtId, String lblYn) {
|
public ChngDetectContDto.ResultLabelDto updateChnDtctObjtLabelingYn(
|
||||||
|
String chnDtctObjtId, String lblYn) {
|
||||||
String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId + "/lbl/" + lblYn;
|
String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId + "/lbl/" + lblYn;
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultPnuDto> result =
|
ReqInfo info = new ReqInfo();
|
||||||
|
info.setReqIp(myip);
|
||||||
|
info.setReqEpno(userUtil.getEmployeeNo());
|
||||||
|
|
||||||
|
ExternalCallResult<ChngDetectContDto.ResultLabelDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
url,
|
url,
|
||||||
HttpMethod.POST,
|
HttpMethod.POST,
|
||||||
null,
|
info,
|
||||||
netUtils.jsonHeaders(),
|
netUtils.jsonHeaders(),
|
||||||
ChngDetectContDto.ResultPnuDto.class);
|
ChngDetectContDto.ResultLabelDto.class);
|
||||||
|
|
||||||
ChngDetectContDto.ResultPnuDto dto = result.body();
|
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
this.insertGukyuinAuditLog(
|
||||||
EventType.MODIFIED.getId(),
|
EventType.MODIFIED.getId(),
|
||||||
@@ -325,11 +357,21 @@ public class GukYuinApiService {
|
|||||||
null,
|
null,
|
||||||
result.body().getSuccess());
|
result.body().getSuccess());
|
||||||
|
|
||||||
return new ResReturn(dto.getCode() > 200000 ? "fail" : "success", dto.getMessage());
|
return result.body();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultContDto findChnPnuToContList(String chnDtctId, String pnu) {
|
public ResultContDto findChnPnuToContList(String chnDtctId, String pnu) {
|
||||||
String url = gukyuinCdiUrl + "/chn/cont/" + chnDtctId + "/pnu/" + pnu;
|
|
||||||
|
String url =
|
||||||
|
gukyuinCdiUrl
|
||||||
|
+ "/chn/cont/"
|
||||||
|
+ chnDtctId
|
||||||
|
+ "/pnu/"
|
||||||
|
+ pnu
|
||||||
|
+ "?reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -350,7 +392,14 @@ public class GukYuinApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ResultDto listChnDtctId(String chnDtctId) {
|
public ResultDto listChnDtctId(String chnDtctId) {
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/" + chnDtctId;
|
String url =
|
||||||
|
gukyuinCdiUrl
|
||||||
|
+ "/chn/mast/"
|
||||||
|
+ chnDtctId
|
||||||
|
+ "?reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
ExternalCallResult<ChngDetectMastDto.ResultDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -403,6 +452,11 @@ 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());
|
||||||
@@ -415,12 +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());
|
||||||
|
|
||||||
log.info("reqDto.setPathNm: {} ", Path.of("/kamco-nfs/dataset/export/" + reqDto.getPathNm()));
|
// 1회차를 종료 상태로 처리하고 2회차를 보내야 함
|
||||||
log.info("Path of: {} ", Path.of("/kamco-nfs/dataset/export/" + info.getUid()));
|
// 추론(learn), 학습데이터(inference) 둘 다 종료 처리
|
||||||
|
if (maxStage > 0) {
|
||||||
if (Files.isDirectory(Path.of("/kamco-nfs/dataset/export/" + info.getUid()))) {
|
Long learnId =
|
||||||
return new ResponseObj(
|
gukyuinCoreService.findMapSheetLearnInfoByYyyy(
|
||||||
ApiResponseCode.NOT_FOUND_DATA, "파일 경로에 회차 실행 파일이 생성되지 않았습니다. 확인 부탁드립니다.");
|
info.getCompareYyyy(), info.getTargetYyyy(), maxStage);
|
||||||
|
gukyuinCoreService.updateMapSheetLearnGukyuinEndStatus(learnId);
|
||||||
|
gukyuinCoreService.updateMapSheetInferenceLabelEndStatus(learnId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 국유인 /chn/mast/regist 전송
|
// 국유인 /chn/mast/regist 전송
|
||||||
@@ -448,7 +504,11 @@ public class GukYuinApiService {
|
|||||||
+ "?pageIndex="
|
+ "?pageIndex="
|
||||||
+ pageIndex
|
+ pageIndex
|
||||||
+ "&pageSize="
|
+ "&pageSize="
|
||||||
+ pageSize;
|
+ pageSize
|
||||||
|
+ "&reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
ExternalCallResult<ChngDetectContDto.ResultContDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -468,9 +528,18 @@ public class GukYuinApiService {
|
|||||||
return result.body();
|
return result.body();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ChngDetectMastDto.RlbDtctDto findRlbDtctList(String chnDtctId) {
|
public ChngDetectMastDto.RlbDtctDto findRlbDtctList(String chnDtctId, String yyyymmdd) {
|
||||||
|
|
||||||
String url = gukyuinCdiUrl + "/rlb/dtct/" + chnDtctId;
|
String url =
|
||||||
|
gukyuinCdiUrl
|
||||||
|
+ "/rlb/dtct/"
|
||||||
|
+ chnDtctId
|
||||||
|
+ "?reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo()
|
||||||
|
+ "&yyyymmdd="
|
||||||
|
+ yyyymmdd;
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.RlbDtctDto> result =
|
ExternalCallResult<ChngDetectMastDto.RlbDtctDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
@@ -487,8 +556,14 @@ public class GukYuinApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public RlbDtctDto findRlbDtctObject(String chnDtctObjtId) {
|
public RlbDtctDto findRlbDtctObject(String chnDtctObjtId) {
|
||||||
|
String url =
|
||||||
String url = gukyuinCdiUrl + "/rlb/objt/" + chnDtctObjtId;
|
gukyuinCdiUrl
|
||||||
|
+ "/rlb/objt/"
|
||||||
|
+ chnDtctObjtId
|
||||||
|
+ "?reqIp="
|
||||||
|
+ myip
|
||||||
|
+ "&reqEpno="
|
||||||
|
+ userUtil.getEmployeeNo();
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectMastDto.RlbDtctDto> result =
|
ExternalCallResult<ChngDetectMastDto.RlbDtctDto> result =
|
||||||
externalHttpClient.call(
|
externalHttpClient.call(
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kamco.cd.kamcoback.inference;
|
package com.kamco.cd.kamcoback.inference;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.common.download.DownloadExecutor;
|
||||||
|
import com.kamco.cd.kamcoback.common.download.dto.DownloadSpec;
|
||||||
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
|
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
|
||||||
@@ -17,6 +19,7 @@ import com.kamco.cd.kamcoback.model.dto.ModelMngDto;
|
|||||||
import com.kamco.cd.kamcoback.model.service.ModelMngService;
|
import com.kamco.cd.kamcoback.model.service.ModelMngService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||||
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
import io.swagger.v3.oas.annotations.media.ArraySchema;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
@@ -25,17 +28,13 @@ import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
|||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.core.io.FileSystemResource;
|
|
||||||
import org.springframework.core.io.Resource;
|
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.http.HttpHeaders;
|
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
@@ -46,6 +45,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
|
||||||
|
|
||||||
@Tag(name = "추론관리", description = "추론관리 API")
|
@Tag(name = "추론관리", description = "추론관리 API")
|
||||||
@RequestMapping("/api/inference")
|
@RequestMapping("/api/inference")
|
||||||
@@ -56,6 +56,7 @@ public class InferenceResultApiController {
|
|||||||
private final InferenceResultService inferenceResultService;
|
private final InferenceResultService inferenceResultService;
|
||||||
private final MapSheetMngService mapSheetMngService;
|
private final MapSheetMngService mapSheetMngService;
|
||||||
private final ModelMngService modelMngService;
|
private final ModelMngService modelMngService;
|
||||||
|
private final DownloadExecutor downloadExecutor;
|
||||||
|
|
||||||
@Operation(summary = "추론관리 목록", description = "어드민 홈 > 추론관리 > 추론관리 > 추론관리 목록")
|
@Operation(summary = "추론관리 목록", description = "어드민 홈 > 추론관리 > 추론관리 > 추론관리 목록")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
@@ -328,7 +329,21 @@ public class InferenceResultApiController {
|
|||||||
return ApiResponseDto.ok(geomList);
|
return ApiResponseDto.ok(geomList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "shp 파일 다운로드", description = "추론관리 분석결과 shp 파일 다운로드")
|
@Operation(
|
||||||
|
summary = "shp 파일 다운로드",
|
||||||
|
description = "추론관리 분석결과 shp 파일 다운로드",
|
||||||
|
parameters = {
|
||||||
|
@Parameter(
|
||||||
|
name = "kamco-download-uuid",
|
||||||
|
in = ParameterIn.HEADER,
|
||||||
|
required = true,
|
||||||
|
description = "다운로드 요청 UUID",
|
||||||
|
schema =
|
||||||
|
@Schema(
|
||||||
|
type = "string",
|
||||||
|
format = "uuid",
|
||||||
|
example = "69c4e56c-e0bf-4742-9225-bba9aae39052"))
|
||||||
|
})
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
@ApiResponse(
|
@ApiResponse(
|
||||||
@@ -341,15 +356,14 @@ public class InferenceResultApiController {
|
|||||||
@ApiResponse(responseCode = "404", description = "파일 없음", content = @Content),
|
@ApiResponse(responseCode = "404", description = "파일 없음", content = @Content),
|
||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
})
|
})
|
||||||
@GetMapping(value = "/download/{uuid}", produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
|
@GetMapping(value = "/download/{uuid}")
|
||||||
public ResponseEntity<Resource> downloadShp(
|
public ResponseEntity<StreamingResponseBody> download(
|
||||||
@Parameter(description = "uuid", example = "0192efc6-9ec2-43ee-9a90-5b73e763c09f")
|
@Parameter(example = "69c4e56c-e0bf-4742-9225-bba9aae39052") @PathVariable UUID uuid)
|
||||||
@PathVariable
|
|
||||||
UUID uuid)
|
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
String path;
|
String path;
|
||||||
String uid;
|
String uid;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Map<String, Object> map = inferenceResultService.shpDownloadPath(uuid);
|
Map<String, Object> map = inferenceResultService.shpDownloadPath(uuid);
|
||||||
path = String.valueOf(map.get("path"));
|
path = String.valueOf(map.get("path"));
|
||||||
@@ -360,24 +374,11 @@ public class InferenceResultApiController {
|
|||||||
|
|
||||||
Path zipPath = Path.of(path);
|
Path zipPath = Path.of(path);
|
||||||
|
|
||||||
if (!Files.exists(zipPath) || !Files.isReadable(zipPath)) {
|
return downloadExecutor.stream(
|
||||||
return ResponseEntity.notFound().build();
|
new DownloadSpec(uuid, zipPath, uid + ".zip", MediaType.APPLICATION_OCTET_STREAM));
|
||||||
}
|
|
||||||
|
|
||||||
FileSystemResource resource = new FileSystemResource(zipPath);
|
|
||||||
|
|
||||||
String filename = uid + ".zip";
|
|
||||||
|
|
||||||
long fileSize = Files.size(zipPath);
|
|
||||||
|
|
||||||
return ResponseEntity.ok()
|
|
||||||
.contentType(MediaType.APPLICATION_OCTET_STREAM)
|
|
||||||
.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"" + filename + "\"")
|
|
||||||
.contentLength(fileSize)
|
|
||||||
.body(resource);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "shp 파일 다운로드 이력", description = "추론관리 분석결과 shp 파일 다운로드 이력")
|
@Operation(summary = "shp 파일 다운로드 이력 조회", description = "추론관리 분석결과 shp 파일 다운로드 이력 조회")
|
||||||
@GetMapping(value = "/download-audit/{uuid}")
|
@GetMapping(value = "/download-audit/{uuid}")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
value = {
|
value = {
|
||||||
@@ -392,19 +393,20 @@ public class InferenceResultApiController {
|
|||||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
})
|
})
|
||||||
public ApiResponseDto<Page<AuditLogDto.DownloadRes>> downloadAudit(
|
public ApiResponseDto<Page<AuditLogDto.DownloadRes>> downloadAudit(
|
||||||
@Parameter(description = "UUID", example = "0192efc6-9ec2-43ee-9a90-5b73e763c09f")
|
@Parameter(description = "UUID", example = "69c4e56c-e0bf-4742-9225-bba9aae39052")
|
||||||
@PathVariable
|
@PathVariable
|
||||||
UUID uuid,
|
UUID uuid,
|
||||||
@Parameter(description = "다운로드일 시작", example = "2025-01-01") @RequestParam(required = false)
|
@Parameter(description = "다운로드일 시작", example = "2025-01-01") @RequestParam(required = false)
|
||||||
LocalDate strtDttm,
|
LocalDate strtDttm,
|
||||||
@Parameter(description = "다운로드일 종료", example = "2026-01-01") @RequestParam(required = false)
|
@Parameter(description = "다운로드일 종료", example = "2026-04-01") @RequestParam(required = false)
|
||||||
LocalDate endDttm,
|
LocalDate endDttm,
|
||||||
@Parameter(description = "키워드", example = "관리자") @RequestParam(required = false)
|
@Parameter(description = "키워드", example = "") @RequestParam(required = false)
|
||||||
String searchValue,
|
String searchValue,
|
||||||
@Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0")
|
@Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0")
|
||||||
int page,
|
int page,
|
||||||
@Parameter(description = "페이지 크기", example = "20") @RequestParam(defaultValue = "20")
|
@Parameter(description = "페이지 크기", example = "20") @RequestParam(defaultValue = "20")
|
||||||
int size) {
|
int size) {
|
||||||
|
|
||||||
AuditLogDto.searchReq searchReq = new searchReq();
|
AuditLogDto.searchReq searchReq = new searchReq();
|
||||||
searchReq.setPage(page);
|
searchReq.setPage(page);
|
||||||
searchReq.setSize(size);
|
searchReq.setSize(size);
|
||||||
@@ -413,8 +415,7 @@ public class InferenceResultApiController {
|
|||||||
downloadReq.setStartDate(strtDttm);
|
downloadReq.setStartDate(strtDttm);
|
||||||
downloadReq.setEndDate(endDttm);
|
downloadReq.setEndDate(endDttm);
|
||||||
downloadReq.setSearchValue(searchValue);
|
downloadReq.setSearchValue(searchValue);
|
||||||
downloadReq.setMenuId("22");
|
downloadReq.setRequestUri("/api/inference/download-audit/download/" + uuid);
|
||||||
downloadReq.setRequestUri("/api/inference/download-audit");
|
|
||||||
|
|
||||||
return ApiResponseDto.ok(inferenceResultService.getDownloadAudit(searchReq, downloadReq));
|
return ApiResponseDto.ok(inferenceResultService.getDownloadAudit(searchReq, downloadReq));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kamco.cd.kamcoback.label;
|
package com.kamco.cd.kamcoback.label;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.common.download.DownloadExecutor;
|
||||||
|
import com.kamco.cd.kamcoback.common.download.dto.DownloadSpec;
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceDetail;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceDetail;
|
||||||
@@ -9,25 +11,39 @@ import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.WorkHistoryDto;
|
|||||||
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.UpdateClosedRequest;
|
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.UpdateClosedRequest;
|
||||||
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkerListResponse;
|
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkerListResponse;
|
||||||
import com.kamco.cd.kamcoback.label.service.LabelAllocateService;
|
import com.kamco.cd.kamcoback.label.service.LabelAllocateService;
|
||||||
|
import com.kamco.cd.kamcoback.log.dto.AuditLogDto;
|
||||||
|
import com.kamco.cd.kamcoback.log.dto.AuditLogDto.DownloadReq;
|
||||||
|
import com.kamco.cd.kamcoback.log.dto.AuditLogDto.searchReq;
|
||||||
import io.swagger.v3.oas.annotations.Hidden;
|
import io.swagger.v3.oas.annotations.Hidden;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||||
import io.swagger.v3.oas.annotations.media.Content;
|
import io.swagger.v3.oas.annotations.media.Content;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||||
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
import io.swagger.v3.oas.annotations.responses.ApiResponses;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.coyote.BadRequestException;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.http.MediaType;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Tag(name = "라벨링 작업 관리", description = "라벨링 작업 배정 및 통계 조회 API")
|
@Tag(name = "라벨링 작업 관리", description = "라벨링 작업 배정 및 통계 조회 API")
|
||||||
@@ -37,6 +53,10 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
public class LabelAllocateApiController {
|
public class LabelAllocateApiController {
|
||||||
|
|
||||||
private final LabelAllocateService labelAllocateService;
|
private final LabelAllocateService labelAllocateService;
|
||||||
|
private final DownloadExecutor downloadExecutor;
|
||||||
|
|
||||||
|
@Value("${file.dataset-response}")
|
||||||
|
private String responsePath;
|
||||||
|
|
||||||
@Operation(summary = "배정 가능한 사용자 목록 조회", description = "라벨링 작업 배정을 위한 활성 상태의 사용자 목록을 조회합니다.")
|
@Operation(summary = "배정 가능한 사용자 목록 조회", description = "라벨링 작업 배정을 위한 활성 상태의 사용자 목록을 조회합니다.")
|
||||||
@ApiResponses(
|
@ApiResponses(
|
||||||
@@ -333,4 +353,112 @@ public class LabelAllocateApiController {
|
|||||||
public ApiResponseDto<Long> labelingIngProcessCnt() {
|
public ApiResponseDto<Long> labelingIngProcessCnt() {
|
||||||
return ApiResponseDto.ok(labelAllocateService.findLabelingIngProcessCnt());
|
return ApiResponseDto.ok(labelAllocateService.findLabelingIngProcessCnt());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(
|
||||||
|
summary = "라벨 파일 다운로드",
|
||||||
|
description = "라벨 파일 다운로드",
|
||||||
|
parameters = {
|
||||||
|
@Parameter(
|
||||||
|
name = "kamco-download-uuid",
|
||||||
|
in = ParameterIn.HEADER,
|
||||||
|
required = true,
|
||||||
|
description = "다운로드 요청 UUID",
|
||||||
|
schema =
|
||||||
|
@Schema(
|
||||||
|
type = "string",
|
||||||
|
format = "uuid",
|
||||||
|
example = "6d8d49dc-0c9d-4124-adc7-b9ca610cc394"))
|
||||||
|
})
|
||||||
|
@ApiResponses(
|
||||||
|
value = {
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = "200",
|
||||||
|
description = "라벨 zip파일 다운로드",
|
||||||
|
content =
|
||||||
|
@Content(
|
||||||
|
mediaType = "application/octet-stream",
|
||||||
|
schema = @Schema(type = "string", format = "binary"))),
|
||||||
|
@ApiResponse(responseCode = "404", description = "파일 없음", content = @Content),
|
||||||
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
|
})
|
||||||
|
@GetMapping("/download/{uuid}")
|
||||||
|
public ResponseEntity<StreamingResponseBody> download(
|
||||||
|
@Parameter(example = "6d8d49dc-0c9d-4124-adc7-b9ca610cc394") @PathVariable UUID uuid)
|
||||||
|
throws IOException {
|
||||||
|
|
||||||
|
if (!labelAllocateService.isDownloadable(uuid)) {
|
||||||
|
throw new BadRequestException();
|
||||||
|
}
|
||||||
|
|
||||||
|
String uid = labelAllocateService.findLearnUid(uuid);
|
||||||
|
Path zipPath = Paths.get(responsePath).resolve(uid + ".zip");
|
||||||
|
|
||||||
|
return downloadExecutor.stream(
|
||||||
|
new DownloadSpec(uuid, zipPath, uid + ".zip", MediaType.APPLICATION_OCTET_STREAM));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "라벨 파일 다운로드 이력 조회", description = "라벨 파일 다운로드 이력 조회")
|
||||||
|
@GetMapping(value = "/download-audit/{uuid}")
|
||||||
|
@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)
|
||||||
|
})
|
||||||
|
public ApiResponseDto<Page<AuditLogDto.DownloadRes>> downloadAudit(
|
||||||
|
@Parameter(description = "UUID", example = "6d8d49dc-0c9d-4124-adc7-b9ca610cc394")
|
||||||
|
@PathVariable
|
||||||
|
UUID uuid,
|
||||||
|
// @Parameter(description = "다운로드일 시작", example = "2025-01-01") @RequestParam(required =
|
||||||
|
// false)
|
||||||
|
// LocalDate strtDttm,
|
||||||
|
// @Parameter(description = "다운로드일 종료", example = "2026-04-01") @RequestParam(required =
|
||||||
|
// false)
|
||||||
|
// LocalDate endDttm,
|
||||||
|
// @Parameter(description = "키워드", example = "") @RequestParam(required = false)
|
||||||
|
// String searchValue,
|
||||||
|
@Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0")
|
||||||
|
int page,
|
||||||
|
@Parameter(description = "페이지 크기", example = "20") @RequestParam(defaultValue = "20")
|
||||||
|
int size) {
|
||||||
|
|
||||||
|
AuditLogDto.searchReq searchReq = new searchReq();
|
||||||
|
searchReq.setPage(page);
|
||||||
|
searchReq.setSize(size);
|
||||||
|
DownloadReq downloadReq = new DownloadReq();
|
||||||
|
downloadReq.setUuid(uuid);
|
||||||
|
// downloadReq.setStartDate(strtDttm);
|
||||||
|
// downloadReq.setEndDate(endDttm);
|
||||||
|
// downloadReq.setSearchValue(searchValue);
|
||||||
|
downloadReq.setRequestUri("/api/training-data/stage/download/" + uuid);
|
||||||
|
|
||||||
|
return ApiResponseDto.ok(labelAllocateService.getDownloadAudit(searchReq, downloadReq));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "다운로드 가능여부 조회", description = "다운로드 가능여부 조회 API")
|
||||||
|
@GetMapping(value = "/download-check/{uuid}")
|
||||||
|
@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)
|
||||||
|
})
|
||||||
|
public ApiResponseDto<Boolean> isDownloadable(
|
||||||
|
@Parameter(description = "UUID", example = "6d8d49dc-0c9d-4124-adc7-b9ca610cc394")
|
||||||
|
@PathVariable
|
||||||
|
UUID uuid) {
|
||||||
|
return ApiResponseDto.ok(labelAllocateService.isDownloadable(uuid));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -359,4 +359,15 @@ public class LabelAllocateDto {
|
|||||||
@Schema(description = "작업기간 종료일")
|
@Schema(description = "작업기간 종료일")
|
||||||
private ZonedDateTime projectCloseDttm;
|
private ZonedDateTime projectCloseDttm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public static class InferenceLearnDto {
|
||||||
|
private UUID analUuid;
|
||||||
|
private String learnUid;
|
||||||
|
private String analState;
|
||||||
|
private Long analId;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,10 +16,14 @@ import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.searchReq;
|
|||||||
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.ProjectInfo;
|
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.ProjectInfo;
|
||||||
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkProgressInfo;
|
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkProgressInfo;
|
||||||
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkerListResponse;
|
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkerListResponse;
|
||||||
|
import com.kamco.cd.kamcoback.log.dto.AuditLogDto;
|
||||||
|
import com.kamco.cd.kamcoback.log.dto.AuditLogDto.DownloadReq;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.core.AuditLogCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.core.LabelAllocateCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.LabelAllocateCoreService;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -28,13 +32,11 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@Transactional
|
@Transactional
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class LabelAllocateService {
|
public class LabelAllocateService {
|
||||||
|
|
||||||
private final LabelAllocateCoreService labelAllocateCoreService;
|
private final LabelAllocateCoreService labelAllocateCoreService;
|
||||||
|
private final AuditLogCoreService auditLogCoreService;
|
||||||
public LabelAllocateService(LabelAllocateCoreService labelAllocateCoreService) {
|
|
||||||
this.labelAllocateCoreService = labelAllocateCoreService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 도엽 기준 asc sorting 해서 할당 수만큼 배정하는 로직
|
* 도엽 기준 asc sorting 해서 할당 수만큼 배정하는 로직
|
||||||
@@ -273,4 +275,29 @@ public class LabelAllocateService {
|
|||||||
public Long findLabelingIngProcessCnt() {
|
public Long findLabelingIngProcessCnt() {
|
||||||
return labelAllocateCoreService.findLabelingIngProcessCnt();
|
return labelAllocateCoreService.findLabelingIngProcessCnt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String findLearnUid(UUID uuid) {
|
||||||
|
return labelAllocateCoreService.findLearnUid(uuid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 이력 조회
|
||||||
|
*
|
||||||
|
* @param searchReq 페이징
|
||||||
|
* @param downloadReq 조회조건
|
||||||
|
*/
|
||||||
|
public Page<AuditLogDto.DownloadRes> getDownloadAudit(
|
||||||
|
AuditLogDto.searchReq searchReq, DownloadReq downloadReq) {
|
||||||
|
return auditLogCoreService.findLogByAccount(searchReq, downloadReq);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 다운로드 가능 여부 조회
|
||||||
|
*
|
||||||
|
* @param uuid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean isDownloadable(UUID uuid) {
|
||||||
|
return labelAllocateCoreService.isDownloadable(uuid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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(
|
||||||
|
|||||||
@@ -9,8 +9,10 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
|
@Transactional(readOnly = true)
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class MenuService {
|
public class MenuService {
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ public class GukYuinCoreService {
|
|||||||
gukYuinRepository.updateGukYuinMastRegResult(resultBody);
|
gukYuinRepository.updateGukYuinMastRegResult(resultBody);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateGukYuinMastRegRemove(Basic resultBody) {
|
public void updateGukYuinMastRegRemove(String chnDtctId) {
|
||||||
gukYuinRepository.updateGukYuinMastRegRemove(resultBody);
|
gukYuinRepository.updateGukYuinMastRegRemove(chnDtctId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt) {
|
public void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt) {
|
||||||
@@ -45,8 +45,8 @@ public class GukYuinCoreService {
|
|||||||
return gukYuinRepository.findMapSheetAnalDataInferenceGeomUid(chnDtctObjtId);
|
return gukYuinRepository.findMapSheetAnalDataInferenceGeomUid(chnDtctObjtId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insertGeoUidPnuData(Long geoUid, String[] pnuList) {
|
public void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId) {
|
||||||
gukYuinRepository.insertGeoUidPnuData(geoUid, pnuList);
|
gukYuinRepository.insertGeoUidPnuData(geoUid, pnuList, chnDtctObjtId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LearnInfo findMapSheetLearnInfo(UUID uuid) {
|
public LearnInfo findMapSheetLearnInfo(UUID uuid) {
|
||||||
@@ -64,4 +64,17 @@ public class GukYuinCoreService {
|
|||||||
public List<LabelSendDto> findLabelingCompleteSendList(LocalDate yesterday) {
|
public List<LabelSendDto> findLabelingCompleteSendList(LocalDate yesterday) {
|
||||||
return gukYuinRepository.findLabelingCompleteSendList(yesterday);
|
return gukYuinRepository.findLabelingCompleteSendList(yesterday);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long findMapSheetLearnInfoByYyyy(
|
||||||
|
Integer compareYyyy, Integer targetYyyy, Integer maxStage) {
|
||||||
|
return gukYuinRepository.findMapSheetLearnInfoByYyyy(compareYyyy, targetYyyy, maxStage);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateMapSheetLearnGukyuinEndStatus(Long learnId) {
|
||||||
|
gukYuinRepository.updateMapSheetLearnGukyuinEndStatus(learnId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateMapSheetInferenceLabelEndStatus(Long learnId) {
|
||||||
|
gukYuinRepository.updateMapSheetInferenceLabelEndStatus(learnId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
|||||||
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinRepository;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class GukYuinJobCoreService {
|
public class GukYuinJobCoreService {
|
||||||
@@ -15,6 +16,7 @@ public class GukYuinJobCoreService {
|
|||||||
this.gukYuinRepository = gukYuinRepository;
|
this.gukYuinRepository = gukYuinRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
public void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status) {
|
public void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status) {
|
||||||
gukYuinRepository.updateGukYuinApplyStateComplete(id, status);
|
gukYuinRepository.updateGukYuinApplyStateComplete(id, status);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GeomUidDto;
|
|||||||
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinLabelJobRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinLabelJobRepository;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class GukYuinLabelJobCoreService {
|
public class GukYuinLabelJobCoreService {
|
||||||
@@ -18,6 +19,7 @@ public class GukYuinLabelJobCoreService {
|
|||||||
return gukYuinLabelRepository.findYesterdayLabelingCompleteList();
|
return gukYuinLabelRepository.findYesterdayLabelingCompleteList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
public void updateAnalDataInferenceGeomSendDttm(Long geoUid) {
|
public void updateAnalDataInferenceGeomSendDttm(Long geoUid) {
|
||||||
gukYuinLabelRepository.updateAnalDataInferenceGeomSendDttm(geoUid);
|
gukYuinLabelRepository.updateAnalDataInferenceGeomSendDttm(geoUid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
|||||||
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinPnuJobRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinPnuJobRepository;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class GukYuinPnuJobCoreService {
|
public class GukYuinPnuJobCoreService {
|
||||||
@@ -27,6 +28,7 @@ public class GukYuinPnuJobCoreService {
|
|||||||
return gukYuinPnuRepository.upsertMapSheetDataAnalGeomPnu(chnDtctObjtId, pnuList);
|
return gukYuinPnuRepository.upsertMapSheetDataAnalGeomPnu(chnDtctObjtId, pnuList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
public void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt) {
|
public void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt) {
|
||||||
gukYuinPnuRepository.updateInferenceGeomDataPnuCnt(chnDtctObjtId, pnuCnt);
|
gukYuinPnuRepository.updateInferenceGeomDataPnuCnt(chnDtctObjtId, pnuCnt);
|
||||||
}
|
}
|
||||||
@@ -35,7 +37,8 @@ public class GukYuinPnuJobCoreService {
|
|||||||
return gukYuinPnuRepository.findMapSheetAnalDataInferenceGeomUid(chnDtctObjtId);
|
return gukYuinPnuRepository.findMapSheetAnalDataInferenceGeomUid(chnDtctObjtId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void insertGeoUidPnuData(Long geoUid, String[] pnuList) {
|
@Transactional
|
||||||
gukYuinPnuRepository.insertGeoUidPnuData(geoUid, pnuList);
|
public void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId) {
|
||||||
|
gukYuinPnuRepository.insertGeoUidPnuData(geoUid, pnuList, chnDtctObjtId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,14 @@
|
|||||||
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.postgres.entity.PnuEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinStbltJobRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.gukyuin.GukYuinStbltJobRepository;
|
||||||
|
import java.time.ZonedDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class GukYuinStbltJobCoreService {
|
public class GukYuinStbltJobCoreService {
|
||||||
@@ -18,7 +23,54 @@ public class GukYuinStbltJobCoreService {
|
|||||||
return gukYuinStbltRepository.findGukYuinEligibleForSurveyList(status);
|
return gukYuinStbltRepository.findGukYuinEligibleForSurveyList(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateGukYuinEligibleForSurvey(String resultUid, String stbltYn, String lockYn) {
|
@Transactional
|
||||||
gukYuinStbltRepository.updateGukYuinEligibleForSurvey(resultUid, stbltYn, lockYn);
|
public void updateGukYuinEligibleForSurvey(String resultUid, RlbDtctMastDto stbltDto) {
|
||||||
|
PnuEntity entity =
|
||||||
|
gukYuinStbltRepository.findPnuEntityByResultUid(resultUid, stbltDto.getPnu());
|
||||||
|
|
||||||
|
if (entity != null) {
|
||||||
|
entity.setPnuDtctId(stbltDto.getPnuDtctId());
|
||||||
|
entity.setPnu(stbltDto.getPnu());
|
||||||
|
entity.setLrmSyncYmd(stbltDto.getLrmSyncYmd());
|
||||||
|
entity.setPnuSyncYmd(stbltDto.getPnuSyncYmd());
|
||||||
|
entity.setMpqdNo(stbltDto.getMpqdNo());
|
||||||
|
entity.setCprsYr(stbltDto.getCprsYr());
|
||||||
|
entity.setCrtrYr(stbltDto.getCrtrYr());
|
||||||
|
entity.setChnDtctSno(stbltDto.getChnDtctSno());
|
||||||
|
entity.setChnDtctId(stbltDto.getChnDtctId());
|
||||||
|
entity.setChnDtctMstId(stbltDto.getChnDtctMstId());
|
||||||
|
entity.setChnDtctObjtId(stbltDto.getChnDtctObjtId());
|
||||||
|
entity.setChnDtctContId(stbltDto.getChnDtctContId());
|
||||||
|
entity.setChnCd(stbltDto.getChnCd());
|
||||||
|
entity.setBfClsCd(stbltDto.getBfClsCd());
|
||||||
|
entity.setBfClsProb(stbltDto.getBfClsProb());
|
||||||
|
entity.setAfClsCd(stbltDto.getAfClsCd());
|
||||||
|
entity.setAfClsProb(stbltDto.getAfClsProb());
|
||||||
|
entity.setPnuSqms(stbltDto.getPnuSqms());
|
||||||
|
entity.setPnuDtctSqms(stbltDto.getPnuDtctSqms());
|
||||||
|
entity.setChnDtctSqms(stbltDto.getChnDtctSqms());
|
||||||
|
entity.setStbltYn(stbltDto.getStbltYn());
|
||||||
|
entity.setIncyCd(stbltDto.getIncyCd());
|
||||||
|
entity.setIncyRsnCont(stbltDto.getIncyRsnCont());
|
||||||
|
entity.setLockYn(stbltDto.getLockYn());
|
||||||
|
entity.setLblYn(stbltDto.getLblYn());
|
||||||
|
entity.setChgYn(stbltDto.getChgYn());
|
||||||
|
entity.setRsatctNo(stbltDto.getRsatctNo());
|
||||||
|
entity.setRmk(stbltDto.getRmk());
|
||||||
|
entity.setCrtDt(stbltDto.getCrtDt());
|
||||||
|
entity.setCrtEpno(stbltDto.getCrtEpno());
|
||||||
|
entity.setCrtIp(stbltDto.getCrtIp());
|
||||||
|
entity.setChgDt(stbltDto.getChgDt());
|
||||||
|
entity.setChgIp(stbltDto.getChgIp());
|
||||||
|
entity.setDelYn(stbltDto.getDelYn().equals("Y"));
|
||||||
|
|
||||||
|
entity.setCreatedDttm(ZonedDateTime.now());
|
||||||
|
gukYuinStbltRepository.save(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
public void updateGukYuinObjectStbltYn(String resultUid, StbltResult stbResult) {
|
||||||
|
gukYuinStbltRepository.updateGukYuinObjectStbltYn(resultUid, stbResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.core;
|
package com.kamco.cd.kamcoback.postgres.core;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.AllocateInfoDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.AllocateInfoDto;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceDetail;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceDetail;
|
||||||
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceLearnDto;
|
||||||
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelMngState;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelerDetail;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelerDetail;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelingStatDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelingStatDto;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.MoveInfo;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.MoveInfo;
|
||||||
@@ -13,12 +16,18 @@ import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.ProjectInfo;
|
|||||||
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkProgressInfo;
|
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkProgressInfo;
|
||||||
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkerStatistics;
|
import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkerStatistics;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.repository.batch.BatchStepHistoryRepository;
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.label.LabelAllocateRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.label.LabelAllocateRepository;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -26,6 +35,10 @@ import org.springframework.stereotype.Service;
|
|||||||
public class LabelAllocateCoreService {
|
public class LabelAllocateCoreService {
|
||||||
|
|
||||||
private final LabelAllocateRepository labelAllocateRepository;
|
private final LabelAllocateRepository labelAllocateRepository;
|
||||||
|
private final BatchStepHistoryRepository batchStepHistoryRepository;
|
||||||
|
|
||||||
|
@Value("${file.dataset-response}")
|
||||||
|
private String responsePath;
|
||||||
|
|
||||||
public List<AllocateInfoDto> fetchNextIds(Long lastId, Long batchSize, UUID uuid) {
|
public List<AllocateInfoDto> fetchNextIds(Long lastId, Long batchSize, UUID uuid) {
|
||||||
return labelAllocateRepository.fetchNextIds(lastId, batchSize, uuid);
|
return labelAllocateRepository.fetchNextIds(lastId, batchSize, uuid);
|
||||||
@@ -234,4 +247,34 @@ public class LabelAllocateCoreService {
|
|||||||
public Long findLabelingIngProcessCnt() {
|
public Long findLabelingIngProcessCnt() {
|
||||||
return labelAllocateRepository.findLabelingIngProcessCnt();
|
return labelAllocateRepository.findLabelingIngProcessCnt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isDownloadable(UUID uuid) {
|
||||||
|
InferenceLearnDto dto = labelAllocateRepository.findLabelingIngProcessId(uuid);
|
||||||
|
|
||||||
|
if (dto == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 파일이 있는지만 확인
|
||||||
|
Path path = Paths.get(responsePath).resolve(dto.getLearnUid() + ".zip");
|
||||||
|
|
||||||
|
if (!Files.exists(path) || !Files.isRegularFile(path)) {
|
||||||
|
// 실제 파일만 true (디렉터리는 제외)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 다운로드 확인할 학습데이터가 라벨링중인 경우 파일 생성여부가 정상인지 확인
|
||||||
|
if (dto.getAnalState().equals(LabelMngState.ASSIGNED.getId())
|
||||||
|
|| dto.getAnalState().equals(LabelMngState.ING.getId())) {
|
||||||
|
return batchStepHistoryRepository.isDownloadable(dto.getAnalId());
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String findLearnUid(UUID uuid) {
|
||||||
|
return labelAllocateRepository
|
||||||
|
.findLearnUid(uuid)
|
||||||
|
.orElseThrow(() -> new CustomApiException("NOT_FOUND_DATA", HttpStatus.NOT_FOUND));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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());
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.kamco.cd.kamcoback.postgres.entity;
|
||||||
|
|
||||||
|
import jakarta.persistence.Column;
|
||||||
|
import jakarta.persistence.Entity;
|
||||||
|
import jakarta.persistence.GeneratedValue;
|
||||||
|
import jakarta.persistence.GenerationType;
|
||||||
|
import jakarta.persistence.Id;
|
||||||
|
import jakarta.persistence.Table;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
import jakarta.validation.constraints.Size;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Entity
|
||||||
|
@Table(name = "batch_step_history")
|
||||||
|
public class BatchStepHistoryEntity {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
|
@Column(name = "id", nullable = false)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "anal_uid", nullable = false)
|
||||||
|
private Long analUid;
|
||||||
|
|
||||||
|
@Size(max = 255)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "result_uid", nullable = false)
|
||||||
|
private String resultUid;
|
||||||
|
|
||||||
|
@Size(max = 100)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "step_name", nullable = false, length = 100)
|
||||||
|
private String stepName;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "status", nullable = false, length = 50)
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@Column(name = "error_message", length = Integer.MAX_VALUE)
|
||||||
|
private String errorMessage;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "started_dttm", nullable = false)
|
||||||
|
private LocalDateTime startedDttm;
|
||||||
|
|
||||||
|
@Column(name = "completed_dttm")
|
||||||
|
private LocalDateTime completedDttm;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "created_dttm", nullable = false)
|
||||||
|
private LocalDateTime createdDttm;
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Column(name = "updated_dttm", nullable = false)
|
||||||
|
private LocalDateTime updatedDttm;
|
||||||
|
}
|
||||||
@@ -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,
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import jakarta.persistence.SequenceGenerator;
|
|||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import java.time.OffsetDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
@@ -39,7 +39,7 @@ public class PnuEntity {
|
|||||||
private String pnu;
|
private String pnu;
|
||||||
|
|
||||||
@Column(name = "created_dttm")
|
@Column(name = "created_dttm")
|
||||||
private OffsetDateTime createdDttm;
|
private ZonedDateTime createdDttm;
|
||||||
|
|
||||||
@Column(name = "created_uid")
|
@Column(name = "created_uid")
|
||||||
private Long createdUid;
|
private Long createdUid;
|
||||||
@@ -47,4 +47,140 @@ public class PnuEntity {
|
|||||||
@ColumnDefault("false")
|
@ColumnDefault("false")
|
||||||
@Column(name = "del_yn")
|
@Column(name = "del_yn")
|
||||||
private Boolean delYn;
|
private Boolean delYn;
|
||||||
|
|
||||||
|
@Size(max = 40)
|
||||||
|
@Column(name = "pnu_dtct_id", length = 40)
|
||||||
|
private String pnuDtctId;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "lrm_sync_ymd", length = 10)
|
||||||
|
private String lrmSyncYmd;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "pnu_sync_ymd", length = 10)
|
||||||
|
private String pnuSyncYmd;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "mpqd_no", length = 20)
|
||||||
|
private String mpqdNo;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "cprs_yr", length = 10)
|
||||||
|
private String cprsYr;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "crtr_yr", length = 10)
|
||||||
|
private String crtrYr;
|
||||||
|
|
||||||
|
@Size(max = 255)
|
||||||
|
@Column(name = "chn_dtct_id")
|
||||||
|
private String chnDtctId;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "chn_dtct_mst_id", length = 10)
|
||||||
|
private String chnDtctMstId;
|
||||||
|
|
||||||
|
@Size(max = 255)
|
||||||
|
@Column(name = "chn_dtct_objt_id")
|
||||||
|
private String chnDtctObjtId;
|
||||||
|
|
||||||
|
@Size(max = 255)
|
||||||
|
@Column(name = "chn_dtct_cont_id")
|
||||||
|
private String chnDtctContId;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "chn_cd", length = 50)
|
||||||
|
private String chnCd;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "chn_dtct_prob", length = 50)
|
||||||
|
private String chnDtctProb;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "bf_cls_cd", length = 50)
|
||||||
|
private String bfClsCd;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "bf_cls_prob", length = 50)
|
||||||
|
private String bfClsProb;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "af_cls_cd", length = 50)
|
||||||
|
private String afClsCd;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "af_cls_prob", length = 50)
|
||||||
|
private String afClsProb;
|
||||||
|
|
||||||
|
@Size(max = 100)
|
||||||
|
@Column(name = "pnu_sqms", length = 100)
|
||||||
|
private String pnuSqms;
|
||||||
|
|
||||||
|
@Size(max = 100)
|
||||||
|
@Column(name = "pnu_dtct_sqms", length = 100)
|
||||||
|
private String pnuDtctSqms;
|
||||||
|
|
||||||
|
@Size(max = 100)
|
||||||
|
@Column(name = "chn_dtct_sqms", length = 100)
|
||||||
|
private String chnDtctSqms;
|
||||||
|
|
||||||
|
@Size(max = 1)
|
||||||
|
@Column(name = "stblt_yn", length = 1)
|
||||||
|
private String stbltYn;
|
||||||
|
|
||||||
|
@Size(max = 30)
|
||||||
|
@Column(name = "incy_cd", length = 30)
|
||||||
|
private String incyCd;
|
||||||
|
|
||||||
|
@Size(max = 255)
|
||||||
|
@Column(name = "incy_rsn_cont")
|
||||||
|
private String incyRsnCont;
|
||||||
|
|
||||||
|
@Size(max = 1)
|
||||||
|
@Column(name = "lock_yn", length = 1)
|
||||||
|
private String lockYn;
|
||||||
|
|
||||||
|
@Size(max = 1)
|
||||||
|
@Column(name = "lbl_yn", length = 1)
|
||||||
|
private String lblYn;
|
||||||
|
|
||||||
|
@Size(max = 1)
|
||||||
|
@Column(name = "chg_yn", length = 1)
|
||||||
|
private String chgYn;
|
||||||
|
|
||||||
|
@Size(max = 50)
|
||||||
|
@Column(name = "rsatct_no", length = 50)
|
||||||
|
private String rsatctNo;
|
||||||
|
|
||||||
|
@Size(max = 100)
|
||||||
|
@Column(name = "rmk", length = 100)
|
||||||
|
private String rmk;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "crt_dt", length = 20)
|
||||||
|
private String crtDt;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "crt_epno", length = 20)
|
||||||
|
private String crtEpno;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "crt_ip", length = 20)
|
||||||
|
private String crtIp;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "chg_dt", length = 20)
|
||||||
|
private String chgDt;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "chg_epno", length = 20)
|
||||||
|
private String chgEpno;
|
||||||
|
|
||||||
|
@Size(max = 20)
|
||||||
|
@Column(name = "chg_ip", length = 20)
|
||||||
|
private String chgIp;
|
||||||
|
|
||||||
|
@Size(max = 10)
|
||||||
|
@Column(name = "chn_dtct_sno", length = 10)
|
||||||
|
private String chnDtctSno;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.kamco.cd.kamcoback.postgres.repository.batch;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.postgres.entity.BatchStepHistoryEntity;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
public interface BatchStepHistoryRepository
|
||||||
|
extends JpaRepository<BatchStepHistoryEntity, Long>, BatchStepHistoryRepositoryCustom {}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.kamco.cd.kamcoback.postgres.repository.batch;
|
||||||
|
|
||||||
|
public interface BatchStepHistoryRepositoryCustom {
|
||||||
|
boolean isDownloadable(Long analUid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.kamco.cd.kamcoback.postgres.repository.batch;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.postgres.entity.QBatchStepHistoryEntity;
|
||||||
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BatchStepHistoryRepositoryImpl implements BatchStepHistoryRepositoryCustom {
|
||||||
|
private final JPAQueryFactory queryFactory;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isDownloadable(Long analUid) {
|
||||||
|
QBatchStepHistoryEntity h = QBatchStepHistoryEntity.batchStepHistoryEntity;
|
||||||
|
|
||||||
|
boolean startedExists =
|
||||||
|
queryFactory
|
||||||
|
.selectOne()
|
||||||
|
.from(h)
|
||||||
|
.where(
|
||||||
|
h.analUid.eq(analUid), h.stepName.eq("zipResponseStep"), h.status.eq("STARTED"))
|
||||||
|
.fetchFirst()
|
||||||
|
!= null;
|
||||||
|
|
||||||
|
boolean successExists =
|
||||||
|
queryFactory
|
||||||
|
.selectOne()
|
||||||
|
.from(h)
|
||||||
|
.where(
|
||||||
|
h.analUid.eq(analUid), h.stepName.eq("zipResponseStep"), h.status.eq("SUCCESS"))
|
||||||
|
.fetchFirst()
|
||||||
|
!= null;
|
||||||
|
|
||||||
|
return successExists && !startedExists;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,13 +30,19 @@ public class GukYuinLabelJobRepositoryImpl implements GukYuinLabelJobRepositoryC
|
|||||||
public List<GeomUidDto> findYesterdayLabelingCompleteList() {
|
public List<GeomUidDto> findYesterdayLabelingCompleteList() {
|
||||||
ZoneId zone = ZoneId.of("Asia/Seoul");
|
ZoneId zone = ZoneId.of("Asia/Seoul");
|
||||||
ZonedDateTime todayStart = ZonedDateTime.now(zone).toLocalDate().atStartOfDay(zone);
|
ZonedDateTime todayStart = ZonedDateTime.now(zone).toLocalDate().atStartOfDay(zone);
|
||||||
|
ZonedDateTime tomorrowStart = todayStart.plusDays(1);
|
||||||
ZonedDateTime yesterdayStart = todayStart.minusDays(1);
|
ZonedDateTime yesterdayStart = todayStart.minusDays(1);
|
||||||
|
|
||||||
|
// BooleanExpression isYesterday =
|
||||||
|
// labelingAssignmentEntity
|
||||||
|
// .inspectStatDttm
|
||||||
|
// .goe(yesterdayStart)
|
||||||
|
// .and(labelingAssignmentEntity.inspectStatDttm.lt(todayStart));
|
||||||
BooleanExpression isYesterday =
|
BooleanExpression isYesterday =
|
||||||
labelingAssignmentEntity
|
labelingAssignmentEntity
|
||||||
.inspectStatDttm
|
.inspectStatDttm
|
||||||
.goe(yesterdayStart)
|
.goe(todayStart)
|
||||||
.and(labelingAssignmentEntity.inspectStatDttm.lt(todayStart));
|
.and(labelingAssignmentEntity.inspectStatDttm.lt(tomorrowStart));
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ public interface GukYuinPnuJobRepositoryCustom {
|
|||||||
|
|
||||||
Long findMapSheetAnalDataInferenceGeomUid(String chnDtctObjtId);
|
Long findMapSheetAnalDataInferenceGeomUid(String chnDtctObjtId);
|
||||||
|
|
||||||
void insertGeoUidPnuData(Long geoUid, String[] pnuList);
|
void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId);
|
||||||
|
|
||||||
void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status);
|
void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status);
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import static com.kamco.cd.kamcoback.postgres.entity.QPnuEntity.pnuEntity;
|
|||||||
|
|
||||||
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.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.entity.PnuEntity;
|
||||||
import com.querydsl.core.types.Projections;
|
import com.querydsl.core.types.Projections;
|
||||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
import jakarta.persistence.EntityManager;
|
import jakarta.persistence.EntityManager;
|
||||||
@@ -42,13 +43,21 @@ public class GukYuinPnuJobRepositoryImpl implements GukYuinPnuJobRepositoryCusto
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertGeoUidPnuData(Long geoUid, String[] pnuList) {
|
public void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId) {
|
||||||
for (String pnu : pnuList) {
|
for (String pnu : pnuList) {
|
||||||
queryFactory
|
PnuEntity entity =
|
||||||
.insert(pnuEntity)
|
queryFactory
|
||||||
.columns(pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm)
|
.selectFrom(pnuEntity)
|
||||||
.values(geoUid, pnu, ZonedDateTime.now())
|
.where(pnuEntity.pnu.eq(pnu), pnuEntity.chnDtctObjtId.eq(chnDtctObjtId))
|
||||||
.execute();
|
.fetchOne();
|
||||||
|
if (entity == null) {
|
||||||
|
queryFactory
|
||||||
|
.insert(pnuEntity)
|
||||||
|
.columns(
|
||||||
|
pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm, pnuEntity.chnDtctObjtId)
|
||||||
|
.values(geoUid, pnu, ZonedDateTime.now(), chnDtctObjtId)
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,8 +96,12 @@ public class GukYuinPnuJobRepositoryImpl implements GukYuinPnuJobRepositoryCusto
|
|||||||
long result =
|
long result =
|
||||||
queryFactory
|
queryFactory
|
||||||
.insert(pnuEntity)
|
.insert(pnuEntity)
|
||||||
.columns(pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm)
|
.columns(
|
||||||
.values(geoUid, pnu, ZonedDateTime.now())
|
pnuEntity.geo.geoUid,
|
||||||
|
pnuEntity.pnu,
|
||||||
|
pnuEntity.createdDttm,
|
||||||
|
pnuEntity.chnDtctObjtId)
|
||||||
|
.values(geoUid, pnu, ZonedDateTime.now(), chnDtctObjtId)
|
||||||
.execute();
|
.execute();
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
succCnt++;
|
succCnt++;
|
||||||
|
|||||||
@@ -14,13 +14,13 @@ public interface GukYuinRepositoryCustom {
|
|||||||
|
|
||||||
void updateGukYuinMastRegResult(Basic resultBody);
|
void updateGukYuinMastRegResult(Basic resultBody);
|
||||||
|
|
||||||
void updateGukYuinMastRegRemove(Basic resultBody);
|
void updateGukYuinMastRegRemove(String chnDtctId);
|
||||||
|
|
||||||
void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt);
|
void updateInferenceGeomDataPnuCnt(String chnDtctObjtId, long pnuCnt);
|
||||||
|
|
||||||
Long findMapSheetAnalDataInferenceGeomUid(String chnDtctObjtId);
|
Long findMapSheetAnalDataInferenceGeomUid(String chnDtctObjtId);
|
||||||
|
|
||||||
void insertGeoUidPnuData(Long geoUid, String[] pnuList);
|
void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId);
|
||||||
|
|
||||||
void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status);
|
void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status);
|
||||||
|
|
||||||
@@ -39,4 +39,10 @@ public interface GukYuinRepositoryCustom {
|
|||||||
void updateAnalDataInferenceGeomSendDttm(Long geoUid);
|
void updateAnalDataInferenceGeomSendDttm(Long geoUid);
|
||||||
|
|
||||||
List<LabelSendDto> findLabelingCompleteSendList(LocalDate yesterday);
|
List<LabelSendDto> findLabelingCompleteSendList(LocalDate yesterday);
|
||||||
|
|
||||||
|
Long findMapSheetLearnInfoByYyyy(Integer compareYyyy, Integer targetYyyy, Integer maxStage);
|
||||||
|
|
||||||
|
void updateMapSheetLearnGukyuinEndStatus(Long learnId);
|
||||||
|
|
||||||
|
void updateMapSheetInferenceLabelEndStatus(Long learnId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GeomUidDto;
|
|||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.LearnInfo;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.LearnInfo;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
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.postgres.entity.PnuEntity;
|
||||||
import com.querydsl.core.types.Projections;
|
import com.querydsl.core.types.Projections;
|
||||||
import com.querydsl.core.types.dsl.BooleanExpression;
|
import com.querydsl.core.types.dsl.BooleanExpression;
|
||||||
import com.querydsl.core.types.dsl.Expressions;
|
import com.querydsl.core.types.dsl.Expressions;
|
||||||
@@ -59,12 +61,13 @@ public class GukYuinRepositoryImpl implements GukYuinRepositoryCustom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateGukYuinMastRegRemove(Basic resultBody) {
|
public void updateGukYuinMastRegRemove(String chnDtctId) {
|
||||||
queryFactory
|
queryFactory
|
||||||
.update(mapSheetLearnEntity)
|
.update(mapSheetLearnEntity)
|
||||||
.set(mapSheetLearnEntity.applyStatus, GukYuinStatus.CANCELED.getId())
|
.set(mapSheetLearnEntity.applyStatus, GukYuinStatus.CANCELED.getId())
|
||||||
.set(mapSheetLearnEntity.applyStatusDttm, ZonedDateTime.now())
|
.set(mapSheetLearnEntity.applyStatusDttm, ZonedDateTime.now())
|
||||||
.where(mapSheetLearnEntity.uid.eq(resultBody.getChnDtctId()))
|
.set(mapSheetLearnEntity.applyYn, false)
|
||||||
|
.where(mapSheetLearnEntity.uid.eq(chnDtctId))
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,13 +90,25 @@ public class GukYuinRepositoryImpl implements GukYuinRepositoryCustom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertGeoUidPnuData(Long geoUid, String[] pnuList) {
|
public void insertGeoUidPnuData(Long geoUid, String[] pnuList, String chnDtctObjtId) {
|
||||||
for (String pnu : pnuList) {
|
for (String pnu : pnuList) {
|
||||||
queryFactory
|
PnuEntity entity =
|
||||||
.insert(pnuEntity)
|
queryFactory
|
||||||
.columns(pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm)
|
.selectFrom(pnuEntity)
|
||||||
.values(geoUid, pnu, ZonedDateTime.now())
|
.where(
|
||||||
.execute();
|
pnuEntity.geo.geoUid.eq(geoUid),
|
||||||
|
pnuEntity.pnu.eq(pnu),
|
||||||
|
pnuEntity.chnDtctObjtId.eq(chnDtctObjtId))
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
|
if (entity == null) {
|
||||||
|
queryFactory
|
||||||
|
.insert(pnuEntity)
|
||||||
|
.columns(
|
||||||
|
pnuEntity.geo.geoUid, pnuEntity.pnu, pnuEntity.createdDttm, pnuEntity.chnDtctObjtId)
|
||||||
|
.values(geoUid, pnu, ZonedDateTime.now(), chnDtctObjtId)
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,6 +205,7 @@ public class GukYuinRepositoryImpl implements GukYuinRepositoryCustom {
|
|||||||
.update(mapSheetAnalInferenceEntity)
|
.update(mapSheetAnalInferenceEntity)
|
||||||
.set(mapSheetAnalInferenceEntity.gukyuinUsed, "Y")
|
.set(mapSheetAnalInferenceEntity.gukyuinUsed, "Y")
|
||||||
.set(mapSheetAnalInferenceEntity.gukyuinApplyDttm, ZonedDateTime.now())
|
.set(mapSheetAnalInferenceEntity.gukyuinApplyDttm, ZonedDateTime.now())
|
||||||
|
.set(mapSheetAnalInferenceEntity.stage, Integer.parseInt(registRes.getChnDtctSno()))
|
||||||
.where(mapSheetAnalInferenceEntity.learnId.eq(learnId))
|
.where(mapSheetAnalInferenceEntity.learnId.eq(learnId))
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
@@ -269,6 +285,39 @@ public class GukYuinRepositoryImpl implements GukYuinRepositoryCustom {
|
|||||||
.fetch();
|
.fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long findMapSheetLearnInfoByYyyy(
|
||||||
|
Integer compareYyyy, Integer targetYyyy, Integer maxStage) {
|
||||||
|
return queryFactory
|
||||||
|
.select(mapSheetLearnEntity.id)
|
||||||
|
.from(mapSheetLearnEntity)
|
||||||
|
.where(
|
||||||
|
mapSheetLearnEntity.compareYyyy.eq(compareYyyy),
|
||||||
|
mapSheetLearnEntity.targetYyyy.eq(targetYyyy),
|
||||||
|
mapSheetLearnEntity.stage.eq(maxStage))
|
||||||
|
.fetchOne();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateMapSheetLearnGukyuinEndStatus(Long learnId) {
|
||||||
|
queryFactory
|
||||||
|
.update(mapSheetLearnEntity)
|
||||||
|
.set(mapSheetLearnEntity.applyStatus, GukYuinStatus.END.getId())
|
||||||
|
.set(mapSheetLearnEntity.applyStatusDttm, ZonedDateTime.now())
|
||||||
|
.where(mapSheetLearnEntity.id.eq(learnId))
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateMapSheetInferenceLabelEndStatus(Long learnId) {
|
||||||
|
queryFactory
|
||||||
|
.update(mapSheetAnalInferenceEntity)
|
||||||
|
.set(mapSheetAnalInferenceEntity.analState, LabelMngState.FINISH.getId())
|
||||||
|
.set(mapSheetAnalInferenceEntity.updatedDttm, ZonedDateTime.now())
|
||||||
|
.where(mapSheetAnalInferenceEntity.learnId.eq(learnId))
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status) {
|
public void updateGukYuinApplyStateComplete(Long id, GukYuinStatus status) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.repository.gukyuin;
|
package com.kamco.cd.kamcoback.postgres.repository.gukyuin;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.PnuEntity;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
public interface GukYuinStbltJobRepository
|
public interface GukYuinStbltJobRepository
|
||||||
extends JpaRepository<MapSheetLearnEntity, Long>, GukYuinStbltJobRepositoryCustom {}
|
extends JpaRepository<PnuEntity, Long>, GukYuinStbltJobRepositoryCustom {}
|
||||||
|
|||||||
@@ -1,11 +1,18 @@
|
|||||||
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.postgres.entity.PnuEntity;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface GukYuinStbltJobRepositoryCustom {
|
public interface GukYuinStbltJobRepositoryCustom {
|
||||||
|
|
||||||
List<LearnKeyDto> findGukYuinEligibleForSurveyList(String status);
|
List<LearnKeyDto> findGukYuinEligibleForSurveyList(String status);
|
||||||
|
|
||||||
void updateGukYuinEligibleForSurvey(String resultUid, String stbltYn, String lockYn);
|
void updateGukYuinEligibleForSurvey(String resultUid, RlbDtctMastDto stbltDto);
|
||||||
|
|
||||||
|
PnuEntity findPnuEntityByResultUid(String resultUid, String pnu);
|
||||||
|
|
||||||
|
void updateGukYuinObjectStbltYn(String resultUid, StbltResult stbResult);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,10 +4,15 @@ import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceE
|
|||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||||
|
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.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
||||||
|
import com.kamco.cd.kamcoback.postgres.entity.PnuEntity;
|
||||||
import com.querydsl.core.types.Projections;
|
import com.querydsl.core.types.Projections;
|
||||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||||
import jakarta.persistence.EntityManager;
|
import jakarta.persistence.EntityManager;
|
||||||
@@ -42,7 +47,7 @@ public class GukYuinStbltJobRepositoryImpl implements GukYuinStbltJobRepositoryC
|
|||||||
.on(mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid))
|
.on(mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid))
|
||||||
.where(
|
.where(
|
||||||
mapSheetLearnEntity.applyStatus.eq(GukYuinStatus.PNU_COMPLETED.getId()),
|
mapSheetLearnEntity.applyStatus.eq(GukYuinStatus.PNU_COMPLETED.getId()),
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull(),
|
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0),
|
||||||
mapSheetAnalDataInferenceGeomEntity.fitState.isNull())
|
mapSheetAnalDataInferenceGeomEntity.fitState.isNull())
|
||||||
.groupBy(mapSheetLearnEntity.id, mapSheetLearnEntity.uid, mapSheetLearnEntity.chnDtctMstId)
|
.groupBy(mapSheetLearnEntity.id, mapSheetLearnEntity.uid, mapSheetLearnEntity.chnDtctMstId)
|
||||||
.having(mapSheetAnalDataInferenceGeomEntity.geoUid.count().gt(1L))
|
.having(mapSheetAnalDataInferenceGeomEntity.geoUid.count().gt(1L))
|
||||||
@@ -50,14 +55,54 @@ public class GukYuinStbltJobRepositoryImpl implements GukYuinStbltJobRepositoryC
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateGukYuinEligibleForSurvey(String resultUid, String stbltYn, String lockYn) {
|
public void updateGukYuinEligibleForSurvey(String resultUid, RlbDtctMastDto stbltDto) {
|
||||||
|
|
||||||
|
MapSheetAnalDataInferenceGeomEntity geomEntity =
|
||||||
|
queryFactory
|
||||||
|
.selectFrom(mapSheetAnalDataInferenceGeomEntity)
|
||||||
|
.where(mapSheetAnalDataInferenceGeomEntity.resultUid.eq(resultUid))
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
|
if (geomEntity != null) {
|
||||||
|
PnuEntity pnuEt =
|
||||||
|
queryFactory
|
||||||
|
.selectFrom(pnuEntity)
|
||||||
|
.where(pnuEntity.chnDtctObjtId.eq(resultUid))
|
||||||
|
.fetchFirst();
|
||||||
|
|
||||||
|
queryFactory
|
||||||
|
.update(mapSheetAnalDataInferenceGeomEntity)
|
||||||
|
.set(
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.fitState,
|
||||||
|
pnuEt.getStbltYn().equals("Y")
|
||||||
|
? ImageryFitStatus.UNFIT.getId()
|
||||||
|
: ImageryFitStatus.FIT.getId()) // 적합여부가 Y 이면 부적합인 것, N 이면 적합한 것이라고 함
|
||||||
|
.set(mapSheetAnalDataInferenceGeomEntity.fitStateDttm, ZonedDateTime.now())
|
||||||
|
.set(mapSheetAnalDataInferenceGeomEntity.lockYn, stbltDto.getLockYn())
|
||||||
|
.where(mapSheetAnalDataInferenceGeomEntity.resultUid.eq(resultUid))
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PnuEntity findPnuEntityByResultUid(String resultUid, String pnu) {
|
||||||
|
return queryFactory
|
||||||
|
.selectFrom(pnuEntity)
|
||||||
|
.where(pnuEntity.pnu.eq(pnu), pnuEntity.chnDtctObjtId.eq(resultUid))
|
||||||
|
.fetchOne();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateGukYuinObjectStbltYn(String resultUid, StbltResult stbResult) {
|
||||||
queryFactory
|
queryFactory
|
||||||
.update(mapSheetAnalDataInferenceGeomEntity)
|
.update(mapSheetAnalDataInferenceGeomEntity)
|
||||||
.set(
|
.set(
|
||||||
mapSheetAnalDataInferenceGeomEntity.fitState,
|
mapSheetAnalDataInferenceGeomEntity.fitState,
|
||||||
stbltYn.equals("Y") ? ImageryFitStatus.FIT.getId() : ImageryFitStatus.UNFIT.getId())
|
stbResult.getStbltYn().equals("Y")
|
||||||
|
? ImageryFitStatus.UNFIT.getId()
|
||||||
|
: ImageryFitStatus.FIT.getId()) // 적합여부가 Y 이면 부적합인 것, N 이면 적합한 것이라고 함
|
||||||
.set(mapSheetAnalDataInferenceGeomEntity.fitStateDttm, ZonedDateTime.now())
|
.set(mapSheetAnalDataInferenceGeomEntity.fitStateDttm, ZonedDateTime.now())
|
||||||
.set(mapSheetAnalDataInferenceGeomEntity.lockYn, lockYn)
|
.set(mapSheetAnalDataInferenceGeomEntity.fitStateCmmnt, stbResult.getIncyCmnt())
|
||||||
.where(mapSheetAnalDataInferenceGeomEntity.resultUid.eq(resultUid))
|
.where(mapSheetAnalDataInferenceGeomEntity.resultUid.eq(resultUid))
|
||||||
.execute();
|
.execute();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.kamco.cd.kamcoback.postgres.repository.label;
|
|||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.AllocateInfoDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.AllocateInfoDto;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceDetail;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceDetail;
|
||||||
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceLearnDto;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelerDetail;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelerDetail;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelingStatDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelingStatDto;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.MoveInfo;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.MoveInfo;
|
||||||
@@ -15,6 +16,7 @@ import com.kamco.cd.kamcoback.label.dto.WorkerStatsDto.WorkerStatistics;
|
|||||||
import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.LabelingAssignmentEntity;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
|
|
||||||
@@ -104,4 +106,8 @@ public interface LabelAllocateRepositoryCustom {
|
|||||||
void updateAnalInferenceMngState(UUID uuid, String status);
|
void updateAnalInferenceMngState(UUID uuid, String status);
|
||||||
|
|
||||||
Long findLabelingIngProcessCnt();
|
Long findLabelingIngProcessCnt();
|
||||||
|
|
||||||
|
InferenceLearnDto findLabelingIngProcessId(UUID uuid);
|
||||||
|
|
||||||
|
Optional<String> findLearnUid(UUID uuid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,15 @@ import static com.kamco.cd.kamcoback.postgres.entity.QLabelingLabelerEntity.labe
|
|||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity.mapSheetAnalDataInferenceEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity.mapSheetAnalDataInferenceEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity.mapSheetAnalDataInferenceGeomEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity.mapSheetAnalInferenceEntity;
|
||||||
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMemberEntity.memberEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMemberEntity.memberEntity;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.common.enums.ImageryFitStatus;
|
||||||
import com.kamco.cd.kamcoback.common.enums.StatusType;
|
import com.kamco.cd.kamcoback.common.enums.StatusType;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.AllocateInfoDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.AllocateInfoDto;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceDetail;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceDetail;
|
||||||
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.InferenceLearnDto;
|
||||||
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.label.dto.LabelAllocateDto.LabelState;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelState;
|
||||||
@@ -48,6 +51,7 @@ import java.time.ZoneId;
|
|||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -82,7 +86,9 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.innerJoin(mapSheetAnalDataInferenceGeomEntity)
|
.innerJoin(mapSheetAnalDataInferenceGeomEntity)
|
||||||
.on(
|
.on(
|
||||||
mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid),
|
mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid),
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull(),
|
// mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull(),
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0),
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.fitState.eq(ImageryFitStatus.UNFIT.getId()),
|
||||||
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
|
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
|
||||||
.where(
|
.where(
|
||||||
mapSheetAnalInferenceEntity.uuid.eq(uuid),
|
mapSheetAnalInferenceEntity.uuid.eq(uuid),
|
||||||
@@ -126,8 +132,8 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
"""
|
"""
|
||||||
insert into tb_labeling_assignment
|
insert into tb_labeling_assignment
|
||||||
(assignment_uid, inference_geom_uid, worker_uid,
|
(assignment_uid, inference_geom_uid, worker_uid,
|
||||||
work_state, assign_group_id, anal_uid, pnu)
|
work_state, assign_group_id, anal_uid)
|
||||||
values (?, ?, ?, ?, ?, ?, ?)
|
values (?, ?, ?, ?, ?, ?)
|
||||||
""";
|
""";
|
||||||
|
|
||||||
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
try (PreparedStatement ps = connection.prepareStatement(sql)) {
|
||||||
@@ -140,7 +146,6 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
ps.setString(4, LabelState.ASSIGNED.getId());
|
ps.setString(4, LabelState.ASSIGNED.getId());
|
||||||
ps.setString(5, String.valueOf(info.getMapSheetNum()));
|
ps.setString(5, String.valueOf(info.getMapSheetNum()));
|
||||||
ps.setLong(6, analEntity.getId());
|
ps.setLong(6, analEntity.getId());
|
||||||
ps.setLong(7, info.getPnu());
|
|
||||||
|
|
||||||
ps.addBatch();
|
ps.addBatch();
|
||||||
batchSize++;
|
batchSize++;
|
||||||
@@ -190,7 +195,9 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.innerJoin(mapSheetAnalDataInferenceGeomEntity)
|
.innerJoin(mapSheetAnalDataInferenceGeomEntity)
|
||||||
.on(
|
.on(
|
||||||
mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid),
|
mapSheetAnalDataInferenceEntity.id.eq(mapSheetAnalDataInferenceGeomEntity.dataUid),
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull(),
|
// mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull(),
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0),
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.fitState.eq(ImageryFitStatus.UNFIT.getId()),
|
||||||
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
|
mapSheetAnalDataInferenceGeomEntity.labelState.isNull())
|
||||||
.where(mapSheetAnalInferenceEntity.uuid.eq(uuid))
|
.where(mapSheetAnalInferenceEntity.uuid.eq(uuid))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
@@ -381,9 +388,10 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(analEntity.getCompareYyyy()),
|
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(analEntity.getCompareYyyy()),
|
||||||
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(analEntity.getTargetYyyy()),
|
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(analEntity.getTargetYyyy()),
|
||||||
mapSheetAnalDataInferenceGeomEntity.stage.eq(analEntity.getStage()),
|
mapSheetAnalDataInferenceGeomEntity.stage.eq(analEntity.getStage()),
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull()
|
// mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull()
|
||||||
// mapSheetAnalDataInferenceGeomEntity.pnu.gt(0L)
|
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0L),
|
||||||
// mapSheetAnalDataInferenceGeomEntity.passYn.isFalse() //TODO:
|
mapSheetAnalDataInferenceGeomEntity.fitState.eq(
|
||||||
|
ImageryFitStatus.UNFIT.getId()) // TODO:
|
||||||
// 추후 라벨링 대상 조건 수정하기
|
// 추후 라벨링 대상 조건 수정하기
|
||||||
)
|
)
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
@@ -555,11 +563,9 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
mapSheetAnalDataInferenceGeomEntity.dataUid))
|
mapSheetAnalDataInferenceGeomEntity.dataUid))
|
||||||
.where(
|
.where(
|
||||||
mapSheetAnalInferenceEntity.uuid.eq(targetUuid),
|
mapSheetAnalInferenceEntity.uuid.eq(targetUuid),
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull()
|
// mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull()
|
||||||
// mapSheetAnalDataInferenceGeomEntity.pnu.gt(0L),
|
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0L),
|
||||||
// mapSheetAnalDataInferenceGeomEntity.passYn.isFalse() //TODO: 추후 라벨링
|
mapSheetAnalDataInferenceGeomEntity.fitState.eq(ImageryFitStatus.UNFIT.getId()))
|
||||||
// 대상 조건 수정하기
|
|
||||||
)
|
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -576,8 +582,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
queryFactory
|
queryFactory
|
||||||
.select(labelingAssignmentEntity.count())
|
.select(labelingAssignmentEntity.count())
|
||||||
.from(labelingAssignmentEntity)
|
.from(labelingAssignmentEntity)
|
||||||
.where(
|
.where(analUidCondition, labelingAssignmentEntity.workState.in("SKIP", "DONE"))
|
||||||
analUidCondition, labelingAssignmentEntity.workState.in("ASSIGNED", "SKIP", "DONE"))
|
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
Long skipCount =
|
Long skipCount =
|
||||||
@@ -602,6 +607,13 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.where(analUidCondition, labelingAssignmentEntity.inspectState.eq("COMPLETE"))
|
.where(analUidCondition, labelingAssignmentEntity.inspectState.eq("COMPLETE"))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
|
Long inspectionExcept =
|
||||||
|
queryFactory
|
||||||
|
.select(labelingAssignmentEntity.count())
|
||||||
|
.from(labelingAssignmentEntity)
|
||||||
|
.where(analUidCondition, labelingAssignmentEntity.inspectState.eq("EXCEPT"))
|
||||||
|
.fetchOne();
|
||||||
|
|
||||||
Long inspectorCount =
|
Long inspectorCount =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(labelingAssignmentEntity.inspectorUid.countDistinct())
|
.select(labelingAssignmentEntity.inspectorUid.countDistinct())
|
||||||
@@ -614,6 +626,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
long labelCompleted = labelingCompleted != null ? labelingCompleted : 0L;
|
long labelCompleted = labelingCompleted != null ? labelingCompleted : 0L;
|
||||||
long inspectCompleted = inspectionCompleted != null ? inspectionCompleted : 0L;
|
long inspectCompleted = inspectionCompleted != null ? inspectionCompleted : 0L;
|
||||||
long skipped = skipCount != null ? skipCount : 0L;
|
long skipped = skipCount != null ? skipCount : 0L;
|
||||||
|
long inspectExcepted = inspectionExcept != null ? inspectionExcept : 0L;
|
||||||
|
|
||||||
long labelingRemaining = labelingTotal - labelCompleted - skipped;
|
long labelingRemaining = labelingTotal - labelCompleted - skipped;
|
||||||
if (labelingRemaining < 0) {
|
if (labelingRemaining < 0) {
|
||||||
@@ -621,7 +634,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
}
|
}
|
||||||
|
|
||||||
long inspectionTotal = labelingTotal;
|
long inspectionTotal = labelingTotal;
|
||||||
long inspectionRemaining = inspectionTotal - inspectCompleted - skipped;
|
long inspectionRemaining = inspectionTotal - inspectCompleted - inspectExcepted;
|
||||||
if (inspectionRemaining < 0) {
|
if (inspectionRemaining < 0) {
|
||||||
inspectionRemaining = 0;
|
inspectionRemaining = 0;
|
||||||
}
|
}
|
||||||
@@ -658,7 +671,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
.inspectionStatus(inspectionStatus)
|
.inspectionStatus(inspectionStatus)
|
||||||
.inspectionTotalCount(inspectionTotal)
|
.inspectionTotalCount(inspectionTotal)
|
||||||
.inspectionCompletedCount(inspectCompleted)
|
.inspectionCompletedCount(inspectCompleted)
|
||||||
.inspectionSkipCount(skipped) // TODO
|
.inspectionSkipCount(inspectExcepted)
|
||||||
.inspectionRemainingCount(inspectionRemaining)
|
.inspectionRemainingCount(inspectionRemaining)
|
||||||
.inspectorCount(inspectorCount != null ? inspectorCount : 0L)
|
.inspectorCount(inspectorCount != null ? inspectorCount : 0L)
|
||||||
.progressRate(labelingRate)
|
.progressRate(labelingRate)
|
||||||
@@ -740,11 +753,9 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
mapSheetAnalInferenceEntity.targetYyyy.eq(
|
mapSheetAnalInferenceEntity.targetYyyy.eq(
|
||||||
mapSheetAnalDataInferenceGeomEntity.targetYyyy),
|
mapSheetAnalDataInferenceGeomEntity.targetYyyy),
|
||||||
mapSheetAnalInferenceEntity.stage.eq(mapSheetAnalDataInferenceGeomEntity.stage),
|
mapSheetAnalInferenceEntity.stage.eq(mapSheetAnalDataInferenceGeomEntity.stage),
|
||||||
mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull()
|
// mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull()
|
||||||
// mapSheetAnalDataInferenceGeomEntity.pnu.gt(0),
|
mapSheetAnalDataInferenceGeomEntity.pnu.gt(0),
|
||||||
// mapSheetAnalDataInferenceGeomEntity.passYn.isFalse() //TODO: 추후 라벨링 대상 조건
|
mapSheetAnalDataInferenceGeomEntity.fitState.eq(ImageryFitStatus.UNFIT.getId()))
|
||||||
// 수정하기
|
|
||||||
)
|
|
||||||
.where(mapSheetAnalInferenceEntity.id.eq(analEntity.getId()))
|
.where(mapSheetAnalInferenceEntity.id.eq(analEntity.getId()))
|
||||||
.groupBy(
|
.groupBy(
|
||||||
mapSheetAnalInferenceEntity.analTitle,
|
mapSheetAnalInferenceEntity.analTitle,
|
||||||
@@ -1816,4 +1827,33 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto
|
|||||||
LabelMngState.ASSIGNED.getId(), LabelMngState.ING.getId()))
|
LabelMngState.ASSIGNED.getId(), LabelMngState.ING.getId()))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public InferenceLearnDto findLabelingIngProcessId(UUID uuid) {
|
||||||
|
return queryFactory
|
||||||
|
.select(
|
||||||
|
Projections.constructor(
|
||||||
|
InferenceLearnDto.class,
|
||||||
|
mapSheetAnalInferenceEntity.uuid,
|
||||||
|
mapSheetLearnEntity.uid,
|
||||||
|
mapSheetAnalInferenceEntity.analState,
|
||||||
|
mapSheetAnalInferenceEntity.id))
|
||||||
|
.from(mapSheetLearnEntity)
|
||||||
|
.join(mapSheetAnalInferenceEntity)
|
||||||
|
.on(mapSheetAnalInferenceEntity.learnId.eq(mapSheetLearnEntity.id))
|
||||||
|
.where(mapSheetAnalInferenceEntity.uuid.eq(uuid))
|
||||||
|
.fetchOne();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Optional<String> findLearnUid(UUID uuid) {
|
||||||
|
return Optional.ofNullable(
|
||||||
|
queryFactory
|
||||||
|
.select(mapSheetLearnEntity.uid)
|
||||||
|
.from(mapSheetLearnEntity)
|
||||||
|
.innerJoin(mapSheetAnalInferenceEntity)
|
||||||
|
.on(mapSheetAnalInferenceEntity.learnId.eq(mapSheetLearnEntity.id))
|
||||||
|
.where(mapSheetAnalInferenceEntity.uuid.eq(uuid))
|
||||||
|
.fetchOne());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.postgres.repository.label;
|
|||||||
|
|
||||||
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.common.enums.ImageryFitStatus;
|
||||||
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.LabelState;
|
import com.kamco.cd.kamcoback.label.dto.LabelAllocateDto.LabelState;
|
||||||
import com.kamco.cd.kamcoback.label.dto.LabelWorkDto;
|
import com.kamco.cd.kamcoback.label.dto.LabelWorkDto;
|
||||||
@@ -133,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();
|
||||||
@@ -200,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(),
|
||||||
@@ -294,14 +291,14 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
|
|
||||||
if (searchReq.getSearchVal() != null && !searchReq.getSearchVal().isEmpty()) {
|
if (searchReq.getSearchVal() != null && !searchReq.getSearchVal().isEmpty()) {
|
||||||
whereSubBuilder.and(
|
whereSubBuilder.and(
|
||||||
Expressions.stringTemplate("{0}", memberEntity.userId)
|
Expressions.stringTemplate("{0}", memberEntity.employeeNo)
|
||||||
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")
|
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")
|
||||||
.or(
|
.or(
|
||||||
Expressions.stringTemplate("{0}", memberEntity.name)
|
Expressions.stringTemplate("{0}", memberEntity.name)
|
||||||
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")));
|
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")));
|
||||||
}
|
}
|
||||||
|
|
||||||
whereSubBuilder.and(labelingAssignmentEntity.workerUid.eq(memberEntity.userId));
|
whereSubBuilder.and(labelingAssignmentEntity.workerUid.eq(memberEntity.employeeNo));
|
||||||
|
|
||||||
// 공통 조건 추출
|
// 공통 조건 추출
|
||||||
BooleanExpression doneStateCondition =
|
BooleanExpression doneStateCondition =
|
||||||
@@ -344,7 +341,7 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
WorkerState.class,
|
WorkerState.class,
|
||||||
memberEntity.userRole,
|
memberEntity.userRole,
|
||||||
memberEntity.name,
|
memberEntity.name,
|
||||||
memberEntity.userId,
|
memberEntity.employeeNo,
|
||||||
assignedCnt.as("assignedCnt"),
|
assignedCnt.as("assignedCnt"),
|
||||||
doneCnt.as("doneCnt"),
|
doneCnt.as("doneCnt"),
|
||||||
skipCnt.as("skipCnt"),
|
skipCnt.as("skipCnt"),
|
||||||
@@ -363,7 +360,10 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
.on(whereSubBuilder)
|
.on(whereSubBuilder)
|
||||||
.where(whereBuilder)
|
.where(whereBuilder)
|
||||||
.groupBy(
|
.groupBy(
|
||||||
memberEntity.userRole, memberEntity.name, memberEntity.userId, memberEntity.status)
|
memberEntity.userRole,
|
||||||
|
memberEntity.name,
|
||||||
|
memberEntity.employeeNo,
|
||||||
|
memberEntity.status)
|
||||||
.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]))
|
.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]))
|
||||||
.offset(pageable.getOffset())
|
.offset(pageable.getOffset())
|
||||||
.limit(pageable.getPageSize())
|
.limit(pageable.getPageSize())
|
||||||
@@ -441,14 +441,14 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
|
|
||||||
if (searchReq.getSearchVal() != null && !searchReq.getSearchVal().isEmpty()) {
|
if (searchReq.getSearchVal() != null && !searchReq.getSearchVal().isEmpty()) {
|
||||||
whereSubBuilder.and(
|
whereSubBuilder.and(
|
||||||
Expressions.stringTemplate("{0}", memberEntity.userId)
|
Expressions.stringTemplate("{0}", memberEntity.employeeNo)
|
||||||
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")
|
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")
|
||||||
.or(
|
.or(
|
||||||
Expressions.stringTemplate("{0}", memberEntity.name)
|
Expressions.stringTemplate("{0}", memberEntity.name)
|
||||||
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")));
|
.likeIgnoreCase("%" + searchReq.getSearchVal() + "%")));
|
||||||
}
|
}
|
||||||
|
|
||||||
whereSubBuilder.and(labelingAssignmentEntity.inspectorUid.eq(memberEntity.userId));
|
whereSubBuilder.and(labelingAssignmentEntity.inspectorUid.eq(memberEntity.employeeNo));
|
||||||
|
|
||||||
// 공통 조건 추출
|
// 공통 조건 추출
|
||||||
BooleanExpression doneStateCondition =
|
BooleanExpression doneStateCondition =
|
||||||
@@ -492,7 +492,7 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
WorkerState.class,
|
WorkerState.class,
|
||||||
memberEntity.userRole,
|
memberEntity.userRole,
|
||||||
memberEntity.name,
|
memberEntity.name,
|
||||||
memberEntity.userId,
|
memberEntity.employeeNo,
|
||||||
assignedCnt.as("assignedCnt"),
|
assignedCnt.as("assignedCnt"),
|
||||||
doneCnt.as("doneCnt"),
|
doneCnt.as("doneCnt"),
|
||||||
skipCnt.as("skipCnt"),
|
skipCnt.as("skipCnt"),
|
||||||
@@ -511,7 +511,10 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
.on(whereSubBuilder)
|
.on(whereSubBuilder)
|
||||||
.where(whereBuilder)
|
.where(whereBuilder)
|
||||||
.groupBy(
|
.groupBy(
|
||||||
memberEntity.userRole, memberEntity.name, memberEntity.userId, memberEntity.status)
|
memberEntity.userRole,
|
||||||
|
memberEntity.name,
|
||||||
|
memberEntity.employeeNo,
|
||||||
|
memberEntity.status)
|
||||||
.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]))
|
.orderBy(orderSpecifiers.toArray(new OrderSpecifier[0]))
|
||||||
.offset(pageable.getOffset())
|
.offset(pageable.getOffset())
|
||||||
.limit(pageable.getPageSize())
|
.limit(pageable.getPageSize())
|
||||||
@@ -549,7 +552,19 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
|||||||
@Override
|
@Override
|
||||||
public LabelWorkMngDetail findLabelWorkMngDetail(UUID uuid) {
|
public LabelWorkMngDetail findLabelWorkMngDetail(UUID uuid) {
|
||||||
|
|
||||||
NumberExpression<Long> labelTotCnt = mapSheetAnalDataInferenceGeomEntity.geoUid.count();
|
NumberExpression<Long> labelTotCnt =
|
||||||
|
new CaseBuilder()
|
||||||
|
// .when(mapSheetAnalDataInferenceGeomEntity.pnu.isNotNull())
|
||||||
|
.when(
|
||||||
|
mapSheetAnalDataInferenceGeomEntity
|
||||||
|
.pnu
|
||||||
|
.gt(0)
|
||||||
|
.and(
|
||||||
|
mapSheetAnalDataInferenceGeomEntity.fitState.eq(
|
||||||
|
ImageryFitStatus.UNFIT.getId())))
|
||||||
|
.then(1L)
|
||||||
|
.otherwise(0L)
|
||||||
|
.sum();
|
||||||
NumberExpression<Long> labelerCnt = labelingAssignmentEntity.workerUid.count();
|
NumberExpression<Long> labelerCnt = labelingAssignmentEntity.workerUid.count();
|
||||||
NumberExpression<Long> reviewerCnt = labelingAssignmentEntity.inspectorUid.count();
|
NumberExpression<Long> reviewerCnt = labelingAssignmentEntity.inspectorUid.count();
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -168,13 +168,13 @@ public class AuditLogRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
whereBuilder.and(auditLogEntity.eventStatus.ne(EventStatus.valueOf("FAILED")));
|
whereBuilder.and(auditLogEntity.eventStatus.ne(EventStatus.valueOf("FAILED")));
|
||||||
whereBuilder.and(auditLogEntity.eventType.eq(EventType.valueOf("DOWNLOAD")));
|
whereBuilder.and(auditLogEntity.eventType.eq(EventType.valueOf("DOWNLOAD")));
|
||||||
|
|
||||||
if (req.getMenuId() != null && !req.getMenuId().isEmpty()) {
|
// if (req.getMenuId() != null && !req.getMenuId().isEmpty()) {
|
||||||
whereBuilder.and(auditLogEntity.menuUid.eq(req.getMenuId()));
|
// whereBuilder.and(auditLogEntity.menuUid.eq(req.getMenuId()));
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (req.getUuid() != null) {
|
if (req.getUuid() != null) {
|
||||||
whereBuilder.and(auditLogEntity.requestUri.contains("/api/inference/download/"));
|
whereBuilder.and(auditLogEntity.requestUri.contains(req.getRequestUri()));
|
||||||
whereBuilder.and(auditLogEntity.requestUri.endsWith(String.valueOf(req.getUuid())));
|
whereBuilder.and(auditLogEntity.downloadUuid.eq(req.getUuid()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (req.getSearchValue() != null && !req.getSearchValue().isEmpty()) {
|
if (req.getSearchValue() != null && !req.getSearchValue().isEmpty()) {
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -305,6 +306,10 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
queryFactory
|
queryFactory
|
||||||
.select(labelingAssignmentEntity.count())
|
.select(labelingAssignmentEntity.count())
|
||||||
.from(labelingAssignmentEntity)
|
.from(labelingAssignmentEntity)
|
||||||
|
.innerJoin(mapSheetAnalInferenceEntity)
|
||||||
|
.on(
|
||||||
|
labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id),
|
||||||
|
mapSheetAnalInferenceEntity.analState.ne(LabelMngState.FINISH.getId()))
|
||||||
.where(labelingAssignmentEntity.workerUid.eq(userId))
|
.where(labelingAssignmentEntity.workerUid.eq(userId))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
@@ -325,6 +330,10 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
queryFactory
|
queryFactory
|
||||||
.select(labelingAssignmentEntity.count())
|
.select(labelingAssignmentEntity.count())
|
||||||
.from(labelingAssignmentEntity)
|
.from(labelingAssignmentEntity)
|
||||||
|
.innerJoin(mapSheetAnalInferenceEntity)
|
||||||
|
.on(
|
||||||
|
labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id),
|
||||||
|
mapSheetAnalInferenceEntity.analState.ne(LabelMngState.FINISH.getId()))
|
||||||
.where(
|
.where(
|
||||||
labelingAssignmentEntity.workerUid.eq(userId),
|
labelingAssignmentEntity.workerUid.eq(userId),
|
||||||
labelingAssignmentEntity.workState.eq("ASSIGNED"))
|
labelingAssignmentEntity.workState.eq("ASSIGNED"))
|
||||||
@@ -353,6 +362,10 @@ public class TrainingDataLabelRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
queryFactory
|
queryFactory
|
||||||
.select(labelingAssignmentEntity.count())
|
.select(labelingAssignmentEntity.count())
|
||||||
.from(labelingAssignmentEntity)
|
.from(labelingAssignmentEntity)
|
||||||
|
.innerJoin(mapSheetAnalInferenceEntity)
|
||||||
|
.on(
|
||||||
|
labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id),
|
||||||
|
mapSheetAnalInferenceEntity.analState.ne(LabelMngState.FINISH.getId()))
|
||||||
.where(
|
.where(
|
||||||
labelingAssignmentEntity.workerUid.eq(userId),
|
labelingAssignmentEntity.workerUid.eq(userId),
|
||||||
labelingAssignmentEntity.workState.in(
|
labelingAssignmentEntity.workState.in(
|
||||||
@@ -492,6 +505,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 +519,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 +543,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;
|
||||||
@@ -314,6 +314,10 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
queryFactory
|
queryFactory
|
||||||
.select(labelingAssignmentEntity.count())
|
.select(labelingAssignmentEntity.count())
|
||||||
.from(labelingAssignmentEntity)
|
.from(labelingAssignmentEntity)
|
||||||
|
.innerJoin(mapSheetAnalInferenceEntity)
|
||||||
|
.on(
|
||||||
|
labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id),
|
||||||
|
mapSheetAnalInferenceEntity.analState.ne(LabelMngState.FINISH.getId()))
|
||||||
.where(labelingAssignmentEntity.inspectorUid.eq(userId))
|
.where(labelingAssignmentEntity.inspectorUid.eq(userId))
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
@@ -334,6 +338,10 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
queryFactory
|
queryFactory
|
||||||
.select(labelingAssignmentEntity.count())
|
.select(labelingAssignmentEntity.count())
|
||||||
.from(labelingAssignmentEntity)
|
.from(labelingAssignmentEntity)
|
||||||
|
.innerJoin(mapSheetAnalInferenceEntity)
|
||||||
|
.on(
|
||||||
|
labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id),
|
||||||
|
mapSheetAnalInferenceEntity.analState.ne(LabelMngState.FINISH.getId()))
|
||||||
.where(
|
.where(
|
||||||
labelingAssignmentEntity.inspectorUid.eq(userId),
|
labelingAssignmentEntity.inspectorUid.eq(userId),
|
||||||
labelingAssignmentEntity.inspectState.eq("UNCONFIRM"))
|
labelingAssignmentEntity.inspectState.eq("UNCONFIRM"))
|
||||||
@@ -362,6 +370,10 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
queryFactory
|
queryFactory
|
||||||
.select(labelingAssignmentEntity.count())
|
.select(labelingAssignmentEntity.count())
|
||||||
.from(labelingAssignmentEntity)
|
.from(labelingAssignmentEntity)
|
||||||
|
.innerJoin(mapSheetAnalInferenceEntity)
|
||||||
|
.on(
|
||||||
|
labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id),
|
||||||
|
mapSheetAnalInferenceEntity.analState.ne(LabelMngState.FINISH.getId()))
|
||||||
.where(
|
.where(
|
||||||
labelingAssignmentEntity.inspectorUid.eq(userId),
|
labelingAssignmentEntity.inspectorUid.eq(userId),
|
||||||
labelingAssignmentEntity.inspectState.in("COMPLETE", "EXCEPT"),
|
labelingAssignmentEntity.inspectState.in("COMPLETE", "EXCEPT"),
|
||||||
@@ -483,7 +495,7 @@ public class TrainingDataReviewRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
queryFactory
|
queryFactory
|
||||||
.select(memberEntity.name)
|
.select(memberEntity.name)
|
||||||
.from(memberEntity)
|
.from(memberEntity)
|
||||||
.where(memberEntity.userId.eq(assignment.toDto().getWorkerUid()))
|
.where(memberEntity.employeeNo.eq(assignment.toDto().getWorkerUid()))
|
||||||
.fetchFirst();
|
.fetchFirst();
|
||||||
if (workerName == null) {
|
if (workerName == null) {
|
||||||
workerName = "";
|
workerName = "";
|
||||||
@@ -520,6 +532,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 +546,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 +571,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,27 +1,15 @@
|
|||||||
package com.kamco.cd.kamcoback.scheduler.service;
|
package com.kamco.cd.kamcoback.scheduler.service;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.NetUtils;
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiLogFunction;
|
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultPnuDto;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GeomUidDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinDto.GeomUidDto;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventStatus;
|
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventType;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.core.GukYuinLabelJobCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.GukYuinLabelJobCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.AuditLogEntity;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.log.AuditLogRepository;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
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;
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@Service
|
@Service
|
||||||
@@ -29,22 +17,11 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
public class GukYuinApiLabelJobService {
|
public class GukYuinApiLabelJobService {
|
||||||
|
|
||||||
private final GukYuinLabelJobCoreService gukYuinLabelJobCoreService;
|
private final GukYuinLabelJobCoreService gukYuinLabelJobCoreService;
|
||||||
|
private final GukYuinApiService gukYuinApiService;
|
||||||
private final ExternalHttpClient externalHttpClient;
|
|
||||||
private final NetUtils netUtils = new NetUtils();
|
|
||||||
private final AuditLogRepository auditLogRepository;
|
|
||||||
|
|
||||||
private final UserUtil userUtil;
|
|
||||||
|
|
||||||
@Value("${spring.profiles.active}")
|
@Value("${spring.profiles.active}")
|
||||||
private String profile;
|
private String profile;
|
||||||
|
|
||||||
@Value("${gukyuin.url}")
|
|
||||||
private String gukyuinUrl;
|
|
||||||
|
|
||||||
@Value("${gukyuin.cdi}")
|
|
||||||
private String gukyuinCdiUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 실행중인 profile
|
* 실행중인 profile
|
||||||
*
|
*
|
||||||
@@ -67,57 +44,12 @@ public class GukYuinApiLabelJobService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (GeomUidDto gto : list) {
|
for (GeomUidDto gto : list) {
|
||||||
String url = gukyuinCdiUrl + "/rlb/objt/" + gto.getResultUid() + "/lbl/" + "Y";
|
ChngDetectContDto.ResultLabelDto dto =
|
||||||
|
gukYuinApiService.updateChnDtctObjtLabelingYn(gto.getResultUid(), "Y");
|
||||||
ExternalCallResult<ResultPnuDto> result =
|
if (dto.getSuccess()) {
|
||||||
externalHttpClient.call(
|
// inference_geom 에 label_send_dttm 업데이트 하기
|
||||||
url,
|
gukYuinLabelJobCoreService.updateAnalDataInferenceGeomSendDttm(gto.getGeoUid());
|
||||||
HttpMethod.POST,
|
}
|
||||||
null,
|
|
||||||
netUtils.jsonHeaders(),
|
|
||||||
ChngDetectContDto.ResultPnuDto.class);
|
|
||||||
|
|
||||||
ChngDetectContDto.ResultPnuDto dto = result.body();
|
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
|
||||||
EventType.MODIFIED.getId(),
|
|
||||||
netUtils.getLocalIP(),
|
|
||||||
userUtil.getId(),
|
|
||||||
url.replace(gukyuinUrl, ""),
|
|
||||||
null,
|
|
||||||
result.body().getSuccess());
|
|
||||||
|
|
||||||
// inference_geom 에 label_send_dttm 업데이트 하기
|
|
||||||
gukYuinLabelJobCoreService.updateAnalDataInferenceGeomSendDttm(gto.getGeoUid());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
|
|
||||||
public void insertGukyuinAuditLog(
|
|
||||||
String actionType,
|
|
||||||
String myIp,
|
|
||||||
Long userUid,
|
|
||||||
String requestUri,
|
|
||||||
Object requestBody,
|
|
||||||
boolean successFail) {
|
|
||||||
try {
|
|
||||||
AuditLogEntity log =
|
|
||||||
new AuditLogEntity(
|
|
||||||
userUid,
|
|
||||||
EventType.fromName(actionType),
|
|
||||||
successFail ? EventStatus.SUCCESS : EventStatus.FAILED,
|
|
||||||
"GUKYUIN", // 메뉴도 국유인으로 하나 따기
|
|
||||||
myIp,
|
|
||||||
requestUri,
|
|
||||||
requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()),
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null);
|
|
||||||
auditLogRepository.save(log);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
throw e;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,31 +1,19 @@
|
|||||||
package com.kamco.cd.kamcoback.scheduler.service;
|
package com.kamco.cd.kamcoback.scheduler.service;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.NetUtils;
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiLogFunction;
|
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ContBasic;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ContBasic;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultContDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.ResultContDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
||||||
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.ResultDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto.ResultDto;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventStatus;
|
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventType;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.core.GukYuinPnuJobCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.GukYuinPnuJobCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.AuditLogEntity;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.log.AuditLogRepository;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
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;
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@Service
|
@Service
|
||||||
@@ -33,21 +21,11 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
public class GukYuinApiPnuJobService {
|
public class GukYuinApiPnuJobService {
|
||||||
|
|
||||||
private final GukYuinPnuJobCoreService gukYuinPnuJobCoreService;
|
private final GukYuinPnuJobCoreService gukYuinPnuJobCoreService;
|
||||||
private final ExternalHttpClient externalHttpClient;
|
private final GukYuinApiService gukYuinApiService;
|
||||||
private final NetUtils netUtils = new NetUtils();
|
|
||||||
private final AuditLogRepository auditLogRepository;
|
|
||||||
|
|
||||||
private final UserUtil userUtil;
|
|
||||||
|
|
||||||
@Value("${spring.profiles.active}")
|
@Value("${spring.profiles.active}")
|
||||||
private String profile;
|
private String profile;
|
||||||
|
|
||||||
@Value("${gukyuin.url}")
|
|
||||||
private String gukyuinUrl;
|
|
||||||
|
|
||||||
@Value("${gukyuin.cdi}")
|
|
||||||
private String gukyuinCdiUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 실행중인 profile
|
* 실행중인 profile
|
||||||
*
|
*
|
||||||
@@ -73,14 +51,9 @@ public class GukYuinApiPnuJobService {
|
|||||||
|
|
||||||
for (LearnKeyDto dto : list) {
|
for (LearnKeyDto dto : list) {
|
||||||
try {
|
try {
|
||||||
long succCnt = processUid(dto.getChnDtctMstId(), dto.getUid());
|
processUid(dto.getUid(), dto.getUid());
|
||||||
if (succCnt > 0) {
|
gukYuinPnuJobCoreService.updateGukYuinApplyStateComplete(
|
||||||
gukYuinPnuJobCoreService.updateGukYuinApplyStateComplete(
|
dto.getId(), GukYuinStatus.PNU_COMPLETED);
|
||||||
dto.getId(), GukYuinStatus.PNU_COMPLETED);
|
|
||||||
} else {
|
|
||||||
gukYuinPnuJobCoreService.updateGukYuinApplyStateComplete(
|
|
||||||
dto.getId(), GukYuinStatus.PNU_FAILED);
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("[GUKYUIN] failed uid={}", dto.getUid(), e);
|
log.error("[GUKYUIN] failed uid={}", dto.getUid(), e);
|
||||||
gukYuinPnuJobCoreService.updateGukYuinApplyStateComplete(
|
gukYuinPnuJobCoreService.updateGukYuinApplyStateComplete(
|
||||||
@@ -89,31 +62,16 @@ public class GukYuinApiPnuJobService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private long processUid(String chnDtctMstId, String uid) {
|
private void processUid(String chnDtctId, String uid) {
|
||||||
long succCnt = 0;
|
ResultDto result = gukYuinApiService.listChnDtctId(chnDtctId);
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/list/" + chnDtctMstId;
|
|
||||||
|
|
||||||
ExternalCallResult<ResultDto> response =
|
|
||||||
externalHttpClient.call(
|
|
||||||
url, HttpMethod.GET, null, netUtils.jsonHeaders(), ChngDetectMastDto.ResultDto.class);
|
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
|
||||||
EventType.DETAIL.getId(),
|
|
||||||
netUtils.getLocalIP(),
|
|
||||||
userUtil.getId(),
|
|
||||||
url.replace(gukyuinUrl, ""),
|
|
||||||
null,
|
|
||||||
response.body().getSuccess());
|
|
||||||
|
|
||||||
ResultDto result = response.body();
|
|
||||||
if (result == null || result.getResult() == null || result.getResult().isEmpty()) {
|
if (result == null || result.getResult() == null || result.getResult().isEmpty()) {
|
||||||
return succCnt;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChngDetectMastDto.Basic basic = result.getResult().get(0);
|
ChngDetectMastDto.Basic basic = result.getResult().get(0);
|
||||||
String chnDtctCnt = basic.getChnDtctCnt();
|
String chnDtctCnt = basic.getChnDtctCnt();
|
||||||
if (chnDtctCnt == null || chnDtctCnt.isEmpty()) {
|
if (chnDtctCnt == null || chnDtctCnt.isEmpty()) {
|
||||||
return succCnt;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// page 계산
|
// page 계산
|
||||||
@@ -122,30 +80,18 @@ public class GukYuinApiPnuJobService {
|
|||||||
int totalPages = (totalCount + pageSize - 1) / pageSize;
|
int totalPages = (totalCount + pageSize - 1) / pageSize;
|
||||||
|
|
||||||
for (int page = 0; page < totalPages; page++) {
|
for (int page = 0; page < totalPages; page++) {
|
||||||
succCnt += processPage(uid, page, pageSize);
|
processPage(uid, page, pageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
return succCnt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private long processPage(String uid, int page, int pageSize) {
|
private void processPage(String uid, int page, int pageSize) {
|
||||||
long result = 0;
|
ResultContDto resContList = gukYuinApiService.findChnContList(uid, page, pageSize);
|
||||||
String url =
|
|
||||||
gukyuinCdiUrl + "/chn/cont/" + uid + "?pageIndex=" + page + "&pageSize=" + pageSize;
|
|
||||||
|
|
||||||
ExternalCallResult<ChngDetectContDto.ResultContDto> response =
|
if (resContList.getResult() == null || resContList.getResult().isEmpty()) {
|
||||||
externalHttpClient.call(
|
return; // 외부 API 이상 방어
|
||||||
url,
|
|
||||||
HttpMethod.GET,
|
|
||||||
null,
|
|
||||||
netUtils.jsonHeaders(),
|
|
||||||
ChngDetectContDto.ResultContDto.class);
|
|
||||||
|
|
||||||
List<ContBasic> contList = response.body().getResult();
|
|
||||||
if (contList == null || contList.isEmpty()) {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<ContBasic> contList = resContList.getResult();
|
||||||
for (ContBasic cont : contList) {
|
for (ContBasic cont : contList) {
|
||||||
String[] pnuList = cont.getPnuList();
|
String[] pnuList = cont.getPnuList();
|
||||||
long pnuCnt = pnuList == null ? 0 : pnuList.length;
|
long pnuCnt = pnuList == null ? 0 : pnuList.length;
|
||||||
@@ -156,65 +102,9 @@ public class GukYuinApiPnuJobService {
|
|||||||
Long geoUid =
|
Long geoUid =
|
||||||
gukYuinPnuJobCoreService.findMapSheetAnalDataInferenceGeomUid(
|
gukYuinPnuJobCoreService.findMapSheetAnalDataInferenceGeomUid(
|
||||||
cont.getChnDtctObjtId());
|
cont.getChnDtctObjtId());
|
||||||
gukYuinPnuJobCoreService.insertGeoUidPnuData(geoUid, pnuList);
|
gukYuinPnuJobCoreService.insertGeoUidPnuData(geoUid, pnuList, cont.getChnDtctObjtId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
|
||||||
EventType.LIST.getId(),
|
|
||||||
netUtils.getLocalIP(),
|
|
||||||
userUtil.getId(),
|
|
||||||
url.replace(gukyuinUrl, ""),
|
|
||||||
null,
|
|
||||||
response.body().getSuccess());
|
|
||||||
|
|
||||||
ResultContDto cont = response.body();
|
|
||||||
if (cont == null || cont.getResult().isEmpty()) {
|
|
||||||
return result; // 외부 API 이상 방어
|
|
||||||
}
|
|
||||||
|
|
||||||
// pnuList 업데이트
|
|
||||||
for (ChngDetectContDto.ContBasic contBasic : cont.getResult()) {
|
|
||||||
if (contBasic.getPnuList() == null || contBasic.getChnDtctObjtId() == null) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
long upsertCnt =
|
|
||||||
gukYuinPnuJobCoreService.upsertMapSheetDataAnalGeomPnu(
|
|
||||||
contBasic.getChnDtctObjtId(), contBasic.getPnuList());
|
|
||||||
result += upsertCnt;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
|
|
||||||
public void insertGukyuinAuditLog(
|
|
||||||
String actionType,
|
|
||||||
String myIp,
|
|
||||||
Long userUid,
|
|
||||||
String requestUri,
|
|
||||||
Object requestBody,
|
|
||||||
boolean successFail) {
|
|
||||||
try {
|
|
||||||
AuditLogEntity log =
|
|
||||||
new AuditLogEntity(
|
|
||||||
userUid,
|
|
||||||
EventType.fromName(actionType),
|
|
||||||
successFail ? EventStatus.SUCCESS : EventStatus.FAILED,
|
|
||||||
"GUKYUIN", // 메뉴도 국유인으로 하나 따기
|
|
||||||
myIp,
|
|
||||||
requestUri,
|
|
||||||
requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()),
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null);
|
|
||||||
auditLogRepository.save(log);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,52 +1,28 @@
|
|||||||
package com.kamco.cd.kamcoback.scheduler.service;
|
package com.kamco.cd.kamcoback.scheduler.service;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.NetUtils;
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiLogFunction;
|
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
||||||
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.ResultDto;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventStatus;
|
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventType;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.core.GukYuinJobCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.GukYuinJobCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.AuditLogEntity;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.log.AuditLogRepository;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
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;
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class GukYuinApiStatusJobService {
|
public class GukYuinApiStatusJobService {
|
||||||
|
|
||||||
private final ExternalHttpClient externalHttpClient;
|
|
||||||
private final NetUtils netUtils = new NetUtils();
|
|
||||||
private final GukYuinJobCoreService gukYuinJobCoreService;
|
private final GukYuinJobCoreService gukYuinJobCoreService;
|
||||||
private final AuditLogRepository auditLogRepository;
|
private final GukYuinApiService gukYuinApiService;
|
||||||
|
|
||||||
private final UserUtil userUtil;
|
|
||||||
private final ObjectMapper objectMapper;
|
|
||||||
|
|
||||||
@Value("${spring.profiles.active}")
|
@Value("${spring.profiles.active}")
|
||||||
private String profile;
|
private String profile;
|
||||||
|
|
||||||
@Value("${gukyuin.url}")
|
|
||||||
private String gukyuinUrl;
|
|
||||||
|
|
||||||
@Value("${gukyuin.cdi}")
|
|
||||||
private String gukyuinCdiUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 실행중인 profile
|
* 실행중인 profile
|
||||||
*
|
*
|
||||||
@@ -72,32 +48,14 @@ public class GukYuinApiStatusJobService {
|
|||||||
|
|
||||||
for (LearnKeyDto dto : list) {
|
for (LearnKeyDto dto : list) {
|
||||||
try {
|
try {
|
||||||
String url = gukyuinCdiUrl + "/chn/mast/list/" + dto.getChnDtctMstId();
|
ChngDetectMastDto.ResultDto result = gukYuinApiService.listChnDtctId(dto.getUid());
|
||||||
|
|
||||||
ExternalCallResult<ResultDto> response =
|
|
||||||
externalHttpClient.call(
|
|
||||||
url,
|
|
||||||
HttpMethod.GET,
|
|
||||||
null,
|
|
||||||
netUtils.jsonHeaders(),
|
|
||||||
ChngDetectMastDto.ResultDto.class);
|
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
|
||||||
EventType.DETAIL.getId(),
|
|
||||||
netUtils.getLocalIP(),
|
|
||||||
userUtil.getId(),
|
|
||||||
url.replace(gukyuinUrl, ""),
|
|
||||||
null,
|
|
||||||
response.body().getSuccess());
|
|
||||||
|
|
||||||
ResultDto result = response.body();
|
|
||||||
|
|
||||||
if (result == null || result.getResult() == null || result.getResult().isEmpty()) {
|
if (result == null || result.getResult() == null || result.getResult().isEmpty()) {
|
||||||
log.warn("[GUKYUIN] empty result chnDtctMstId={}", dto.getChnDtctMstId());
|
log.warn("[GUKYUIN] empty result chnDtctMstId={}", dto.getChnDtctMstId());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChngDetectMastDto.Basic basic = result.getResult().get(0);
|
ChngDetectMastDto.Basic basic = result.getResult().getFirst();
|
||||||
|
|
||||||
Integer progress =
|
Integer progress =
|
||||||
basic.getExcnPgrt() == null ? null : Integer.parseInt(basic.getExcnPgrt().trim());
|
basic.getExcnPgrt() == null ? null : Integer.parseInt(basic.getExcnPgrt().trim());
|
||||||
@@ -110,33 +68,4 @@ public class GukYuinApiStatusJobService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
|
|
||||||
public void insertGukyuinAuditLog(
|
|
||||||
String actionType,
|
|
||||||
String myIp,
|
|
||||||
Long userUid,
|
|
||||||
String requestUri,
|
|
||||||
Object requestBody,
|
|
||||||
boolean successFail) {
|
|
||||||
try {
|
|
||||||
AuditLogEntity log =
|
|
||||||
new AuditLogEntity(
|
|
||||||
userUid,
|
|
||||||
EventType.fromName(actionType),
|
|
||||||
successFail ? EventStatus.SUCCESS : EventStatus.FAILED,
|
|
||||||
"GUKYUIN", // 메뉴도 국유인으로 하나 따기
|
|
||||||
myIp,
|
|
||||||
requestUri,
|
|
||||||
requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()),
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null);
|
|
||||||
auditLogRepository.save(log);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,51 +1,35 @@
|
|||||||
package com.kamco.cd.kamcoback.scheduler.service;
|
package com.kamco.cd.kamcoback.scheduler.service;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.NetUtils;
|
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectContDto.StbltResult;
|
||||||
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiLogFunction;
|
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.ChngDetectMastDto;
|
|
||||||
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;
|
||||||
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
import com.kamco.cd.kamcoback.gukyuin.dto.GukYuinStatus;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventStatus;
|
import com.kamco.cd.kamcoback.gukyuin.service.GukYuinApiService;
|
||||||
import com.kamco.cd.kamcoback.log.dto.EventType;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.core.GukYuinStbltJobCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.GukYuinStbltJobCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.AuditLogEntity;
|
import java.time.LocalDate;
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.log.AuditLogRepository;
|
import java.time.ZoneId;
|
||||||
|
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;
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Propagation;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class GukYuinApiStbltJobService {
|
public class GukYuinApiStbltJobService {
|
||||||
|
|
||||||
private final ExternalHttpClient externalHttpClient;
|
|
||||||
private final NetUtils netUtils = new NetUtils();
|
|
||||||
private final GukYuinStbltJobCoreService gukYuinStbltJobCoreService;
|
private final GukYuinStbltJobCoreService gukYuinStbltJobCoreService;
|
||||||
private final AuditLogRepository auditLogRepository;
|
private final GukYuinApiService gukYuinApiService;
|
||||||
|
|
||||||
private final UserUtil userUtil;
|
|
||||||
|
|
||||||
@Value("${spring.profiles.active}")
|
@Value("${spring.profiles.active}")
|
||||||
private String profile;
|
private String profile;
|
||||||
|
|
||||||
@Value("${gukyuin.url}")
|
|
||||||
private String gukyuinUrl;
|
|
||||||
|
|
||||||
@Value("${gukyuin.cdi}")
|
|
||||||
private String gukyuinCdiUrl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 실행중인 profile
|
* 실행중인 profile
|
||||||
*
|
*
|
||||||
@@ -71,25 +55,11 @@ public class GukYuinApiStbltJobService {
|
|||||||
|
|
||||||
for (LearnKeyDto dto : list) {
|
for (LearnKeyDto dto : list) {
|
||||||
try {
|
try {
|
||||||
String url = gukyuinCdiUrl + "/rlb/dtct/" + dto.getUid();
|
String yesterday =
|
||||||
|
LocalDate.now(ZoneId.of("Asia/Seoul"))
|
||||||
ExternalCallResult<RlbDtctDto> response =
|
.minusDays(1)
|
||||||
externalHttpClient.call(
|
.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||||
url,
|
RlbDtctDto result = gukYuinApiService.findRlbDtctList(dto.getUid(), yesterday);
|
||||||
HttpMethod.GET,
|
|
||||||
null,
|
|
||||||
netUtils.jsonHeaders(),
|
|
||||||
ChngDetectMastDto.RlbDtctDto.class);
|
|
||||||
|
|
||||||
this.insertGukyuinAuditLog(
|
|
||||||
EventType.LIST.getId(),
|
|
||||||
netUtils.getLocalIP(),
|
|
||||||
userUtil.getId(),
|
|
||||||
url.replace(gukyuinUrl, ""),
|
|
||||||
null,
|
|
||||||
response.body().getSuccess());
|
|
||||||
|
|
||||||
RlbDtctDto result = response.body();
|
|
||||||
|
|
||||||
if (result == null || result.getResult() == null || result.getResult().isEmpty()) {
|
if (result == null || result.getResult() == null || result.getResult().isEmpty()) {
|
||||||
log.warn("[GUKYUIN] empty result chnDtctMstId={}", dto.getChnDtctMstId());
|
log.warn("[GUKYUIN] empty result chnDtctMstId={}", dto.getChnDtctMstId());
|
||||||
@@ -98,41 +68,48 @@ public class GukYuinApiStbltJobService {
|
|||||||
|
|
||||||
for (RlbDtctMastDto stbltDto : result.getResult()) {
|
for (RlbDtctMastDto stbltDto : result.getResult()) {
|
||||||
String resultUid = stbltDto.getChnDtctObjtId();
|
String resultUid = stbltDto.getChnDtctObjtId();
|
||||||
gukYuinStbltJobCoreService.updateGukYuinEligibleForSurvey(
|
gukYuinStbltJobCoreService.updateGukYuinEligibleForSurvey(resultUid, stbltDto);
|
||||||
resultUid, stbltDto.getStbltYn(), stbltDto.getLockYn());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = false)
|
|
||||||
public void insertGukyuinAuditLog(
|
|
||||||
String actionType,
|
|
||||||
String myIp,
|
|
||||||
Long userUid,
|
|
||||||
String requestUri,
|
|
||||||
Object requestBody,
|
|
||||||
boolean successFail) {
|
|
||||||
try {
|
|
||||||
AuditLogEntity log =
|
|
||||||
new AuditLogEntity(
|
|
||||||
userUid,
|
|
||||||
EventType.fromName(actionType),
|
|
||||||
successFail ? EventStatus.SUCCESS : EventStatus.FAILED,
|
|
||||||
"GUKYUIN", // 메뉴도 국유인으로 하나 따기
|
|
||||||
myIp,
|
|
||||||
requestUri,
|
|
||||||
requestBody == null ? null : ApiLogFunction.cutRequestBody(requestBody.toString()),
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null);
|
|
||||||
auditLogRepository.save(log);
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error(e.getMessage());
|
|
||||||
throw 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 = "작업 통계 응답")
|
||||||
|
|||||||
@@ -107,6 +107,8 @@ file:
|
|||||||
pt-path: /kamco-nfs/ckpt/model/v6-cls-checkpoints/
|
pt-path: /kamco-nfs/ckpt/model/v6-cls-checkpoints/
|
||||||
pt-FileName: yolov8_6th-6m.pt
|
pt-FileName: yolov8_6th-6m.pt
|
||||||
|
|
||||||
|
dataset-response: /kamco-nfs/dataset/response/
|
||||||
|
|
||||||
inference:
|
inference:
|
||||||
url: http://192.168.2.183:8000/jobs
|
url: http://192.168.2.183:8000/jobs
|
||||||
batch-url: http://192.168.2.183:8000/batches
|
batch-url: http://192.168.2.183:8000/batches
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ file:
|
|||||||
pt-path: /kamco-nfs/ckpt/model/v6-cls-checkpoints/
|
pt-path: /kamco-nfs/ckpt/model/v6-cls-checkpoints/
|
||||||
pt-FileName: yolov8_6th-6m.pt
|
pt-FileName: yolov8_6th-6m.pt
|
||||||
|
|
||||||
|
dataset-response: /kamco-nfs/dataset/response/
|
||||||
|
|
||||||
inference:
|
inference:
|
||||||
url: http://192.168.2.183:8000/jobs
|
url: http://192.168.2.183:8000/jobs
|
||||||
batch-url: http://192.168.2.183:8000/batches
|
batch-url: http://192.168.2.183:8000/batches
|
||||||
|
|||||||
Reference in New Issue
Block a user