[KC-99] 추론관리 등록 api 추가
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,15 @@ public class InferenceResultService {
|
||||
return inferenceResultCoreService.getInferenceResultList(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 변화탐지 실행 정보 생성
|
||||
*
|
||||
* @param req
|
||||
*/
|
||||
public void saveInferenceInfo(InferenceResultDto.RegReq req) {
|
||||
inferenceResultCoreService.saveInferenceInfo(req);
|
||||
}
|
||||
|
||||
/**
|
||||
* 분석결과 요약정보
|
||||
*
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
/****/
|
||||
|
||||
/**
|
||||
|
||||
@@ -57,7 +57,6 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
||||
QLabelingAssignmentEntity.labelingAssignmentEntity;
|
||||
private final QMemberEntity memberEntity = QMemberEntity.memberEntity;
|
||||
|
||||
|
||||
/**
|
||||
* 변화탐지 년도 셀렉트박스 조회
|
||||
*
|
||||
@@ -81,8 +80,7 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
||||
}
|
||||
|
||||
/**
|
||||
* 라벨링 작업관리 목록 조회
|
||||
* (복잡한 집계 쿼리로 인해 DTO 직접 반환)
|
||||
* 라벨링 작업관리 목록 조회 (복잡한 집계 쿼리로 인해 DTO 직접 반환)
|
||||
*
|
||||
* @param searchReq 검색 조건
|
||||
* @return 라벨링 작업관리 목록 페이지
|
||||
@@ -345,7 +343,9 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
||||
mapSheetAnalInferenceEntity
|
||||
.uuid
|
||||
.eq(uuid)
|
||||
.and(labelingAssignmentEntity.analUid.eq(mapSheetAnalInferenceEntity.id)))
|
||||
.and(
|
||||
labelingAssignmentEntity.analUid.eq(
|
||||
mapSheetAnalInferenceEntity.id)))
|
||||
.innerJoin(memberEntity)
|
||||
.on(whereSubBuilder)
|
||||
.where(whereBuilder)
|
||||
@@ -390,8 +390,7 @@ public class LabelWorkRepositoryImpl implements LabelWorkRepositoryCustom {
|
||||
}
|
||||
|
||||
/**
|
||||
* 작업배정 상세조회
|
||||
* (복잡한 집계 쿼리로 인해 DTO 직접 반환)
|
||||
* 작업배정 상세조회 (복잡한 집계 쿼리로 인해 DTO 직접 반환)
|
||||
*
|
||||
* @param uuid 작업배정 UUID
|
||||
* @return 작업배정 상세 정보
|
||||
|
||||
Reference in New Issue
Block a user