diff --git a/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java b/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java index 92cda102..fdbb0b8d 100644 --- a/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java +++ b/src/main/java/com/kamco/cd/kamcoback/inference/dto/InferenceResultDto.java @@ -8,6 +8,7 @@ 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.Duration; import java.time.LocalDate; import java.time.ZonedDateTime; import java.util.Arrays; @@ -129,6 +130,7 @@ public class InferenceResultDto { } /** 목록조회 dto */ + @Schema(name = "ResultList", description = "추론관리 목록") @Getter @Setter @AllArgsConstructor @@ -136,20 +138,70 @@ public class InferenceResultDto { public static class ResultList { private UUID uuid; - private String title; - private String status; - private String mapSheetCnt; - private Long detectingCnt; - @JsonFormatDttm private ZonedDateTime startTime; - @JsonFormatDttm private ZonedDateTime endTime; - @JsonFormatDttm private ZonedDateTime elapsedTime; - private Boolean applyYn; - @JsonFormatDttm private ZonedDateTime applyDttm; + @Schema(description = "제목") + private String title; + + @Schema(description = "회차") + private Integer stage; + + @Schema(description = "상태") + private String status; + + @Schema(description = "분석 도엽") + private String mapSheetCnt; + + @Schema(description = "탐지건수") + private Long detectingCnt; + + @Schema(description = "시작일시") + @JsonFormatDttm + private ZonedDateTime startTime; + + @Schema(description = "종료일시") + @JsonFormatDttm + private ZonedDateTime endTime; + + @Schema(description = "반영여부") + private Boolean applyYn; + + @Schema(description = "반영일시") + @JsonFormatDttm + private ZonedDateTime applyDttm; + + @Schema(description = "비교년도") + private Integer compareYyyy; + + @Schema(description = "기준년도") + private Integer targetYyyy; + + @Schema(description = "상태명") @JsonProperty("statusName") public String statusName() { return Status.getDescByCode(this.status); } + + @Schema(description = "소요시간") + @JsonProperty("elapsedTim") + public String getElapsedTime() { + if (this.startTime == null || this.endTime == null) { + return null; + } + ZonedDateTime start = this.startTime; + ZonedDateTime end = this.endTime; + Duration d = Duration.between(start, end); + + if (d.isNegative()) { + d = d.negated(); + } + + long s = d.getSeconds(); + long h = s / 3600; + long m = (s % 3600) / 60; + long sec = s % 60; + + return String.format("%dH %dM %dS", h, m, sec); + } } /** 목록조회 검색 조건 dto */ diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapSheetLearnEntity.java b/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapSheetLearnEntity.java index c21cf6e8..d3e71756 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapSheetLearnEntity.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/entity/MapSheetLearnEntity.java @@ -190,13 +190,15 @@ public class MapSheetLearnEntity { return new InferenceResultDto.ResultList( this.uuid, this.title, + this.stage, this.status, this.mapSheetCnt, this.detectingCnt, this.inferStartDttm, this.inferEndDttm, - this.elapsedTime, this.applyYn, - this.applyDttm); + this.applyDttm, + this.compareYyyy, + this.targetYyyy); } }