[KC-116] 추론 다운로드 이력 수정

This commit is contained in:
2026-01-19 19:48:18 +09:00
parent 932fa25180
commit 9e7ed0e53f
9 changed files with 82 additions and 58 deletions

View File

@@ -467,9 +467,6 @@ public class InferenceResultApiController {
@Parameter(description = "UUID", example = "0192efc6-9ec2-43ee-9a90-5b73e763c09f")
@PathVariable
UUID uuid,
@Parameter(description = "구분-NAME(이름), EMPLOYEE_NO(사번)", example = "NAME")
@RequestParam(required = false)
String type,
@Parameter(description = "다운로드일 시작", example = "2025-01-01") @RequestParam(required = false)
LocalDate strtDttm,
@Parameter(description = "다운로드일 종료", example = "2026-01-01") @RequestParam(required = false)
@@ -487,7 +484,6 @@ public class InferenceResultApiController {
downloadReq.setUuid(uuid);
downloadReq.setStartDate(strtDttm);
downloadReq.setEndDate(endDttm);
downloadReq.setType(type);
downloadReq.setSearchValue(searchValue);
downloadReq.setMenuId("22");
downloadReq.setRequestUri("/api/inference/download-audit");

View File

@@ -481,4 +481,14 @@ public class InferenceDetailDto {
}
}
}
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public static class Scene {
private String path;
private Integer size;
}
}

View File

@@ -240,15 +240,15 @@ public class InferenceResultDto {
@NotBlank
private String title;
@Schema(description = "M1", example = "3e5d18b8-a7d7-4ce1-9f1e-52d75f953439")
@Schema(description = "M1", example = "b40e0f68-c1d8-49fc-93f9-a36270093861")
@NotNull
private UUID model1Uuid;
@Schema(description = "M2", example = "55fba5d2-f69c-47ea-b54c-7efc8e1ecfa0")
@Schema(description = "M2", example = "ec92b7d2-b5a3-4915-9bdf-35fb3ca8ad27")
@NotNull
private UUID model2Uuid;
@Schema(description = "M3", example = "a96cb525-a17c-4157-9e4a-49cceeb17518")
@Schema(description = "M3", example = "37f45782-8ccf-4cf6-911c-a055a1510d39")
@NotNull
private UUID model3Uuid;

View File

@@ -4,6 +4,8 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
import com.kamco.cd.kamcoback.common.geometry.GeoJsonFileWriter.ImageFeature;
import com.kamco.cd.kamcoback.common.geometry.GeoJsonFileWriter.Scene;
import com.kamco.cd.kamcoback.common.utils.UserUtil;
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
@@ -172,9 +174,6 @@ public class InferenceResultService {
}
}
// 목록 및 추론 대상 도엽정보 저장
UUID uuid = inferenceResultCoreService.saveInferenceInfo(req, targetList);
// 추론에 필요한 geojson 파일 생성
List<String> mapSheetNumList =
targetList.stream()
@@ -183,7 +182,7 @@ public class InferenceResultService {
.toList();
// 비교년도 geojson 파일 생성하여 경로 받기
String modelComparePath =
Scene modelComparePath =
getSceneInference(
String.valueOf(req.getCompareYyyy()),
mapSheetNumList,
@@ -191,19 +190,44 @@ public class InferenceResultService {
req.getDetectOption());
// 기준년도 geojson 파일 생성하여 경로 받기
String modelTargetPath =
Scene modelTargetPath =
getSceneInference(
String.valueOf(req.getTargetYyyy()),
mapSheetNumList,
req.getMapSheetScope(),
req.getDetectOption());
// 작은 쪽 기준으로 탐지건수/파일생성 리스트 결정
List<ImageFeature> imageFeatureList;
if (modelComparePath.getFeatures().size() <= modelTargetPath.getFeatures().size()) {
imageFeatureList = modelComparePath.getFeatures();
} else {
imageFeatureList = modelTargetPath.getFeatures();
}
// imageFeatureList 기준 sceneId Set
Set<String> sceneIdSet =
imageFeatureList.stream()
.map(ImageFeature::getSceneId)
.filter(Objects::nonNull)
.collect(Collectors.toSet());
// targetList(List<MngListDto>) 리턴용으로 필터링
List<MngListDto> newTargetList =
targetList.stream()
.filter(m -> m.getMapSheetNum() != null)
.filter(m -> sceneIdSet.contains(m.getMapSheetNum()))
.toList();
// 목록 및 추론 대상 도엽정보 저장
UUID uuid = inferenceResultCoreService.saveInferenceInfo(req, newTargetList);
// ai 서버에 전달할 파라미터 생성
pred_requests_areas predRequestsAreas = new pred_requests_areas();
predRequestsAreas.setInput1_year(req.getCompareYyyy());
predRequestsAreas.setInput2_year(req.getTargetYyyy());
predRequestsAreas.setInput1_scene_path(modelComparePath);
predRequestsAreas.setInput2_scene_path(modelTargetPath);
predRequestsAreas.setInput1_scene_path(modelComparePath.getFilePath());
predRequestsAreas.setInput2_scene_path(modelTargetPath.getFilePath());
InferenceSendDto m1 = this.getModelInfo(req.getModel1Uuid());
m1.setPred_requests_areas(predRequestsAreas);
@@ -218,8 +242,8 @@ public class InferenceResultService {
saveInferenceAiDto.setStatus(Status.IN_PROGRESS.getId());
saveInferenceAiDto.setType("M1");
saveInferenceAiDto.setInferStartDttm(ZonedDateTime.now());
saveInferenceAiDto.setModelComparePath(modelComparePath);
saveInferenceAiDto.setModelTargetPath(modelTargetPath);
saveInferenceAiDto.setModelComparePath(modelComparePath.getFilePath());
saveInferenceAiDto.setModelTargetPath(modelTargetPath.getFilePath());
saveInferenceAiDto.setModelStartDttm(ZonedDateTime.now());
inferenceResultCoreService.update(saveInferenceAiDto);
@@ -406,7 +430,7 @@ public class InferenceResultService {
* @param mapSheetScope EXCL : 추론제외, PREV 이전 년도 도엽 사용
* @return
*/
private String getSceneInference(
private Scene getSceneInference(
String yyyy, List<String> mapSheetNums, String mapSheetScope, String detectOption) {
return mapSheetMngCoreService.getSceneInference(
yyyy, mapSheetNums, mapSheetScope, detectOption);
@@ -565,10 +589,7 @@ public class InferenceResultService {
* 다운로드 이력 조회
*
* @param searchReq 페이징
* @param startDate 다운로드 시작일
* @param endDate 다운로드 종료일
* @param type 검색 구분
* @param searchValue 키워드
* @param downloadReq 조회조건
*/
public Page<AuditLogDto.DownloadRes> getDownloadAudit(
AuditLogDto.searchReq searchReq, DownloadReq downloadReq) {