추론 결과 조회 수정

This commit is contained in:
2026-01-22 12:13:19 +09:00
parent c70abbdb6d
commit e2eb653df7
6 changed files with 530 additions and 441 deletions

View File

@@ -29,20 +29,22 @@ public class InferenceDetailDto {
private String dataName;
private Long mapSheepNum;
private Long detectingCnt;
@JsonFormatDttm private ZonedDateTime analStrtDttm;
@JsonFormatDttm private ZonedDateTime analEndDttm;
@JsonFormatDttm
private ZonedDateTime analStrtDttm;
@JsonFormatDttm
private ZonedDateTime analEndDttm;
private Long analSec;
private String analState;
public Basic(
Long id,
String dataName,
Long mapSheepNum,
Long detectingCnt,
ZonedDateTime analStrtDttm,
ZonedDateTime analEndDttm,
Long analSec,
String analState) {
Long id,
String dataName,
Long mapSheepNum,
Long detectingCnt,
ZonedDateTime analStrtDttm,
ZonedDateTime analEndDttm,
Long analSec,
String analState) {
this.id = id;
this.dataName = dataName;
this.mapSheepNum = mapSheepNum;
@@ -61,8 +63,10 @@ public class InferenceDetailDto {
private Long id;
private String analTitle;
private Long detectingCnt;
@JsonFormatDttm private ZonedDateTime analStrtDttm;
@JsonFormatDttm private ZonedDateTime analEndDttm;
@JsonFormatDttm
private ZonedDateTime analStrtDttm;
@JsonFormatDttm
private ZonedDateTime analEndDttm;
private Long analSec;
private Long analPredSec;
private String analState;
@@ -70,16 +74,16 @@ public class InferenceDetailDto {
private String gukyuinUsed;
public AnalResList(
Long id,
String analTitle,
Long detectingCnt,
ZonedDateTime analStrtDttm,
ZonedDateTime analEndDttm,
Long analSec,
Long analPredSec,
String analState,
String analStateNm,
String gukyuinUsed) {
Long id,
String analTitle,
Long detectingCnt,
ZonedDateTime analStrtDttm,
ZonedDateTime analEndDttm,
Long analSec,
Long analPredSec,
String analState,
String analStateNm,
String gukyuinUsed) {
this.id = id;
this.analTitle = analTitle;
this.detectingCnt = detectingCnt;
@@ -102,8 +106,10 @@ public class InferenceDetailDto {
private String modelInfo;
private Integer targetYyyy;
private Integer compareYyyy;
@JsonFormatDttm private ZonedDateTime analStrtDttm;
@JsonFormatDttm private ZonedDateTime analEndDttm;
@JsonFormatDttm
private ZonedDateTime analStrtDttm;
@JsonFormatDttm
private ZonedDateTime analEndDttm;
private Long analSec;
private Long analPredSec;
private String resultUrl;
@@ -113,20 +119,20 @@ public class InferenceDetailDto {
private String analStateNm;
public AnalResSummary(
Long id,
String analTitle,
String modelInfo,
Integer targetYyyy,
Integer compareYyyy,
ZonedDateTime analStrtDttm,
ZonedDateTime analEndDttm,
Long analSec,
Long analPredSec,
String resultUrl,
Long detectingCnt,
Double accuracy,
String analState,
String analStateNm) {
Long id,
String analTitle,
String modelInfo,
Integer targetYyyy,
Integer compareYyyy,
ZonedDateTime analStrtDttm,
ZonedDateTime analEndDttm,
Long analSec,
Long analPredSec,
String resultUrl,
Long detectingCnt,
Double accuracy,
String analState,
String analStateNm) {
this.id = id;
this.analTitle = analTitle;
this.modelInfo = modelInfo;
@@ -183,16 +189,17 @@ public class InferenceDetailDto {
private Clazzes target;
private MapSheet mapSheet;
private Coordinate center;
@JsonFormatDttm private ZonedDateTime updatedDttm;
@JsonFormatDttm
private ZonedDateTime updatedDttm;
public DetailListEntity(
UUID uuid,
Double detectionScore,
Clazzes compare,
Clazzes target,
MapSheet mapSheet,
Coordinate center,
ZonedDateTime updatedDttm) {
UUID uuid,
Double detectionScore,
Clazzes compare,
Clazzes target,
MapSheet mapSheet,
Coordinate center,
ZonedDateTime updatedDttm) {
this.code = new Uid(uuid);
this.detectionScore = detectionScore;
this.compare = compare;
@@ -233,7 +240,8 @@ public class InferenceDetailDto {
private String code;
private String name;
@JsonIgnore private Double score;
@JsonIgnore
private Double score;
public Clazz(String code, Double score) {
this.code = code;
@@ -305,6 +313,7 @@ public class InferenceDetailDto {
Long mapSheetNum;
String mapSheetName;
String subUid;
String pnu;
// @JsonIgnore String gemoStr;
// @JsonIgnore String geomCenterStr;
@@ -312,18 +321,19 @@ public class InferenceDetailDto {
// JsonNode geomCenter;
public Geom(
UUID uuid,
String uid,
Integer compareYyyy,
Integer targetYyyy,
Double cdProb,
String classBeforeCd,
Double classBeforeProb,
String classAfterCd,
Double classAfterProb,
Long mapSheetNum,
String mapSheetName,
String subUid) {
UUID uuid,
String uid,
Integer compareYyyy,
Integer targetYyyy,
Double cdProb,
String classBeforeCd,
Double classBeforeProb,
String classAfterCd,
Double classAfterProb,
Long mapSheetNum,
String mapSheetName,
String subUid,
String pnu) {
this.uuid = uuid;
this.uid = uid;
this.compareYyyy = compareYyyy;
@@ -338,20 +348,7 @@ public class InferenceDetailDto {
this.mapSheetNum = mapSheetNum;
this.mapSheetName = mapSheetName;
this.subUid = subUid;
// this.gemoStr = gemoStr;
// this.geomCenterStr = geomCenterStr;
//
// ObjectMapper mapper = new ObjectMapper();
// JsonNode geomJson;
// JsonNode geomCenterJson;
// try {
// geomJson = mapper.readTree(gemoStr);
// geomCenterJson = mapper.readTree(geomCenterStr);
// } catch (JsonProcessingException e) {
// throw new RuntimeException(e);
// }
// this.gemo = geomJson;
// this.geomCenter = geomCenterJson;
this.pnu = pnu;
}
}
@@ -399,7 +396,7 @@ public class InferenceDetailDto {
String[] sortParams = sort.split(",");
String property = sortParams[0];
Sort.Direction direction =
sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC;
sortParams.length > 1 ? Sort.Direction.fromString(sortParams[1]) : Sort.Direction.ASC;
return PageRequest.of(page, size, Sort.by(direction, property));
}
return PageRequest.of(page, size);
@@ -439,25 +436,27 @@ public class InferenceDetailDto {
private Integer targetYyyy;
private String detectOption;
private String mapSheetScope;
@JsonFormatDttm private ZonedDateTime inferStartDttm;
@JsonFormatDttm private ZonedDateTime inferEndDttm;
@JsonFormatDttm
private ZonedDateTime inferStartDttm;
@JsonFormatDttm
private ZonedDateTime inferEndDttm;
private Integer stage;
private String elapsedDuration;
private String subUid;
public AnalResultInfo(
String analTitle,
String modelVer1,
String modelVer2,
String modelVer3,
Integer compareYyyy,
Integer targetYyyy,
String detectOption,
String mapSheetScope,
ZonedDateTime inferStartDttm,
ZonedDateTime inferEndDttm,
Integer stage,
String subUid) {
String analTitle,
String modelVer1,
String modelVer2,
String modelVer3,
Integer compareYyyy,
Integer targetYyyy,
String detectOption,
String mapSheetScope,
ZonedDateTime inferStartDttm,
ZonedDateTime inferEndDttm,
Integer stage,
String subUid) {
this.analTitle = analTitle;
this.modelVer1 = modelVer1;
this.modelVer2 = modelVer2;
@@ -471,9 +470,9 @@ public class InferenceDetailDto {
this.stage = stage;
this.subUid = subUid;
Duration elapsed =
(inferStartDttm != null && inferEndDttm != null)
? Duration.between(inferStartDttm, inferEndDttm)
: null;
(inferStartDttm != null && inferEndDttm != null)
? Duration.between(inferStartDttm, inferEndDttm)
: null;
if (elapsed != null) {
long seconds = elapsed.getSeconds();

View File

@@ -23,7 +23,9 @@ import org.springframework.data.domain.Pageable;
public class InferenceResultDto {
/** 분석대상 도엽 enum */
/**
* 분석대상 도엽 enum
*/
@Getter
@AllArgsConstructor
public enum MapSheetScope implements EnumType {
@@ -52,7 +54,9 @@ public class InferenceResultDto {
}
}
/** 탐지 데이터 옵션 dto */
/**
* 탐지 데이터 옵션 dto
*/
@Getter
@AllArgsConstructor
public enum DetectOption implements EnumType {
@@ -129,7 +133,9 @@ public class InferenceResultDto {
}
}
/** 목록조회 dto */
/**
* 목록조회 dto
*/
@Schema(name = "ResultList", description = "추론관리 목록")
@Getter
@Setter
@@ -178,6 +184,12 @@ public class InferenceResultDto {
@Schema(description = "uid")
private String uid;
@Schema(description = "uid 앞 8자리")
@JsonProperty("subUid")
public String subUid() {
return this.uid.substring(0, 8).toUpperCase();
}
@Schema(description = "상태명")
@JsonProperty("statusName")
public String statusName() {
@@ -207,7 +219,9 @@ public class InferenceResultDto {
}
}
/** 목록조회 검색 조건 dto */
/**
* 목록조회 검색 조건 dto
*/
@Getter
@Setter
@NoArgsConstructor
@@ -229,7 +243,9 @@ public class InferenceResultDto {
}
}
/** 변화탐지 실행 정보 저장 요청 정보 */
/**
* 변화탐지 실행 정보 저장 요청 정보
*/
@Getter
@Setter
@NoArgsConstructor
@@ -268,8 +284,8 @@ public class InferenceResultDto {
@Schema(description = "탐지 데이터 옵션 - 추론제외(EXCL), 이전 년도 도엽 사용(PREV)", example = "EXCL")
@NotBlank
@EnumValid(
enumClass = DetectOption.class,
message = "탐지 데이터 옵션은 '추론제외', '이전 년도 도엽 사용' 만 사용 가능합니다.")
enumClass = DetectOption.class,
message = "탐지 데이터 옵션은 '추론제외', '이전 년도 도엽 사용' 만 사용 가능합니다.")
private String detectOption;
@Schema(description = "5k 도협 번호 목록", example = "[33605,33606, 33610, 34802, 35603, 35611]")
@@ -381,33 +397,33 @@ public class InferenceResultDto {
private String modelVer3;
public InferenceStatusDetailDto(
Long detectingCnt,
Integer m1PendingJobs,
Integer m2PendingJobs,
Integer m3PendingJobs,
Integer m1CompletedJobs,
Integer m2CompletedJobs,
Integer m3CompletedJobs,
Integer m1FailedJobs,
Integer m2FailedJobs,
Integer m3FailedJobs,
ZonedDateTime m1ModelStartDttm,
ZonedDateTime m2ModelStartDttm,
ZonedDateTime m3ModelStartDttm,
ZonedDateTime m1ModelEndDttm,
ZonedDateTime m2ModelEndDttm,
ZonedDateTime m3ModelEndDttm,
String title,
Integer compareYyyy,
Integer targetYyyy,
Integer stage,
ZonedDateTime inferStartDttm,
ZonedDateTime inferEndDttm,
String detectOption,
String mapSheetScope,
String modelVer1,
String modelVer2,
String modelVer3) {
Long detectingCnt,
Integer m1PendingJobs,
Integer m2PendingJobs,
Integer m3PendingJobs,
Integer m1CompletedJobs,
Integer m2CompletedJobs,
Integer m3CompletedJobs,
Integer m1FailedJobs,
Integer m2FailedJobs,
Integer m3FailedJobs,
ZonedDateTime m1ModelStartDttm,
ZonedDateTime m2ModelStartDttm,
ZonedDateTime m3ModelStartDttm,
ZonedDateTime m1ModelEndDttm,
ZonedDateTime m2ModelEndDttm,
ZonedDateTime m3ModelEndDttm,
String title,
Integer compareYyyy,
Integer targetYyyy,
Integer stage,
ZonedDateTime inferStartDttm,
ZonedDateTime inferEndDttm,
String detectOption,
String mapSheetScope,
String modelVer1,
String modelVer2,
String modelVer3) {
this.detectingCnt = detectingCnt;
this.m1PendingJobs = m1PendingJobs;
this.m2PendingJobs = m2PendingJobs;
@@ -443,12 +459,12 @@ public class InferenceResultDto {
long tiles = this.detectingCnt; // 도엽수
int models = 3; // 모델 개수
int completed =
this.m1CompletedJobs
+ this.m2CompletedJobs
+ this.m3CompletedJobs
+ this.m1FailedJobs
+ this.m2FailedJobs
+ this.m3FailedJobs; // 완료수
this.m1CompletedJobs
+ this.m2CompletedJobs
+ this.m3CompletedJobs
+ this.m1FailedJobs
+ this.m2FailedJobs
+ this.m3FailedJobs; // 완료수
long total = tiles * models; // 전체 작업량
if (completed >= total) {
@@ -513,9 +529,12 @@ public class InferenceResultDto {
public static class InferenceServerStatusDto {
private String serverName;
@JsonIgnore private float cpu_user;
@JsonIgnore private float cpu_system;
@JsonIgnore private float memused;
@JsonIgnore
private float cpu_user;
@JsonIgnore
private float cpu_system;
@JsonIgnore
private float memused;
private Long kbmemused;
private float gpuUtil;