Merge pull request 'feat/infer_dev_260107' (#163) from feat/infer_dev_260107 into develop

Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/163
This commit is contained in:
2026-01-09 09:51:07 +09:00
5 changed files with 127 additions and 14 deletions

View File

@@ -11,10 +11,13 @@ import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import java.time.LocalDate;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@@ -59,6 +62,30 @@ public class InferenceResultApiController {
return ApiResponseDto.ok(analResList);
}
@Operation(summary = "변화탐지 실행 정보 입력", description = "어드민 홈 > 추론관리 > 추론목록 > 변화탐지 실행 정보 입력")
@ApiResponses(
value = {
@ApiResponse(
responseCode = "201",
description = "변화탐지 실행 정보 생성 성공",
content =
@Content(
mediaType = "application/json",
schema = @Schema(implementation = Void.class))),
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content),
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
})
@PostMapping("/reg")
public ApiResponseDto<Void> saveInferenceInfo(
@io.swagger.v3.oas.annotations.parameters.RequestBody(
description = "변화탐지 실행 정보 저장 요청 정보",
required = true)
@RequestBody
@Valid
InferenceResultDto.RegReq req) {
return ApiResponseDto.ok(null);
}
// @ApiResponses(
// value = {
// @ApiResponse(

View File

@@ -1,9 +1,14 @@
package com.kamco.cd.kamcoback.inference.dto;
import com.kamco.cd.kamcoback.common.utils.enums.EnumType;
import com.kamco.cd.kamcoback.common.utils.interfaces.EnumValid;
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.ZonedDateTime;
import java.util.List;
import java.util.UUID;
import lombok.AllArgsConstructor;
import lombok.Getter;
@@ -14,6 +19,7 @@ import org.springframework.data.domain.Pageable;
public class InferenceResultDto {
/** 목록조회 dto */
@Getter
@Setter
@AllArgsConstructor
@@ -32,6 +38,7 @@ public class InferenceResultDto {
@JsonFormatDttm private ZonedDateTime applyDttm;
}
/** 목록조회 검색 조건 dto */
@Getter
@Setter
@NoArgsConstructor
@@ -53,6 +60,27 @@ public class InferenceResultDto {
}
}
/** 탐지 데이터 옵션 dto */
@Getter
@AllArgsConstructor
public enum MapSheetScope implements EnumType {
EXCL("추론제외"),
PREV("이전 년도 도엽 사용"),
;
private final String desc;
@Override
public String getId() {
return name();
}
@Override
public String getText() {
return desc;
}
}
/** 분석대상 도엽 enum */
@Getter
@AllArgsConstructor
public enum DetectOption implements EnumType {
@@ -72,22 +100,51 @@ public class InferenceResultDto {
}
}
/** 변화탐지 실행 정보 저장 요청 정보 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public enum MapSheetScope implements EnumType {
EXCL("추론제외"),
PREV("이전 년도 도엽 사용"),
;
private final String desc;
public static class RegReq {
@Override
public String getId() {
return name();
}
@Schema(description = "제목", example = "2025-2026 track changes Pororo")
@NotBlank
private String title;
@Override
public String getText() {
return desc;
}
@Schema(description = "M1", example = "2")
@NotNull
private Long model1Uid;
@Schema(description = "M2", example = "4")
@NotNull
private Long model2Uid;
@Schema(description = "M3", example = "7")
@NotNull
private Long model3Uid;
@Schema(description = "비교년도", example = "2003")
@NotNull
private Integer compareYyyy;
@Schema(description = "탐지년도", example = "2004")
@NotNull
private Integer targetYyyy;
@Schema(description = "탐지 데이터 옵션 - 추론제외(PREV), 이전 년도 도엽 사용(PREV)", example = "EXCL")
@NotBlank
@EnumValid(
enumClass = MapSheetScope.class,
message = "탐지 데이터 옵션은 '추론제외', '이전 년도 도엽 사용' 만 사용 가능합니다.")
private String mapSheetScope;
@Schema(description = "분석대상 도엽 - 전체(ALL), 부분(PART)", example = "PART")
@NotBlank
@EnumValid(enumClass = DetectOption.class, message = "분석대상 도엽 옵션은 '전체', '부분' 만 사용 가능합니다.")
private String detectOption;
@Schema(description = "5k 도협 번호 목록", example = "[34607067,34607067]")
@NotNull
private List<String> mapSheetNum;
}
}

View File

@@ -31,6 +31,15 @@ public class InferenceResultService {
return inferenceResultCoreService.getInferenceResultList(req);
}
/**
* 변화탐지 실행 정보 생성
*
* @param req
*/
public void saveInferenceInfo(InferenceResultDto.RegReq req) {
inferenceResultCoreService.saveInferenceInfo(req);
}
/**
* 분석결과 요약정보
*

View File

@@ -27,7 +27,8 @@ public class LabelAllocateDto {
LABEL_COMPLETE("라벨완료"),
INSPECT_REQ("검수요청"),
INSPECT_ING("검수진행중"),
INSPECT_COMPLETE("검수완료");
INSPECT_COMPLETE("검수완료"),
FINISH("종료");
private String desc;

View File

@@ -1,5 +1,6 @@
package com.kamco.cd.kamcoback.postgres.core;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Dashboard;
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.MapSheet;
@@ -16,6 +17,7 @@ import jakarta.persistence.EntityNotFoundException;
import jakarta.validation.constraints.NotNull;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.locationtech.jts.io.geojson.GeoJsonWriter;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -28,6 +30,9 @@ public class InferenceResultCoreService {
private final MapSheetLearnRepository mapSheetLearnRepository;
private final MapInkx5kRepository mapInkx5kRepository;
private final ObjectMapper objectMapper = new ObjectMapper();
private final GeoJsonWriter geoJsonWriter = new GeoJsonWriter();
/**
* 추론관리 목록
*
@@ -39,6 +44,20 @@ public class InferenceResultCoreService {
return list.map(MapSheetLearnEntity::toDto);
}
/**
* 변화탐지 실행 정보 생성
*
* @param req
*/
public void saveInferenceInfo(InferenceResultDto.RegReq req) {
MapSheetLearnEntity mapSheetLearnEntity = new MapSheetLearnEntity();
mapSheetLearnEntity.setTitle(req.getTitle());
mapSheetLearnEntity.setM1ModelUid(req.getModel1Uid());
mapSheetLearnEntity.setM2ModelUid(req.getModel2Uid());
mapSheetLearnEntity.setM3ModelUid(req.getModel3Uid());
// mapSheetLearnRepository.save()
}
/****/
/**