Merge pull request 'feat/infer_dev_260107' (#232) from feat/infer_dev_260107 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/232
This commit is contained in:
@@ -272,14 +272,14 @@ public class InferenceResultApiController {
|
||||
content =
|
||||
@Content(
|
||||
mediaType = "application/json",
|
||||
schema = @Schema(implementation = Page.class))),
|
||||
schema = @Schema(implementation = InferenceStatusDetailDto.class))),
|
||||
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
|
||||
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||
})
|
||||
@GetMapping("/status/{uuid}")
|
||||
public ApiResponseDto<InferenceStatusDetailDto> getInferenceStatus(
|
||||
@io.swagger.v3.oas.annotations.parameters.RequestBody(
|
||||
description = "추론진행현왕 요청 정보",
|
||||
description = "추론 진행현황 정보",
|
||||
required = true)
|
||||
@PathVariable
|
||||
UUID uuid) {
|
||||
|
||||
@@ -8,7 +8,6 @@ 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;
|
||||
@@ -234,140 +233,179 @@ public class InferenceResultDto {
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(name = "InferenceStatusDetailDto", description = "추론(변화탐지) 진행상태")
|
||||
public static class InferenceStatusDetailDto {
|
||||
|
||||
@Schema(description = "탐지대상 도엽수")
|
||||
private Long detectingCnt;
|
||||
|
||||
@Schema(description = "모델1 분석 대기")
|
||||
private Integer m1PendingJobs;
|
||||
|
||||
@Schema(description = "모델2 분석 대기")
|
||||
private Integer m2PendingJobs;
|
||||
|
||||
@Schema(description = "모델3 분석 대기")
|
||||
private Integer m3PendingJobs;
|
||||
|
||||
@Schema(description = "모델1 분석 완료")
|
||||
private Integer m1CompletedJobs;
|
||||
|
||||
@Schema(description = "모델2 분석 완료")
|
||||
private Integer m2CompletedJobs;
|
||||
|
||||
@Schema(description = "모델3 분석 완료")
|
||||
private Integer m3CompletedJobs;
|
||||
|
||||
@Schema(description = "모델1 분석 실패")
|
||||
private Integer m1FailedJobs;
|
||||
|
||||
@Schema(description = "모델2 분석 실패")
|
||||
private Integer m2FailedJobs;
|
||||
|
||||
@Schema(description = "모델3 분석 실패")
|
||||
private Integer m3FailedJobs;
|
||||
|
||||
@Schema(description = "모델1 사용시간 시작일시")
|
||||
@JsonFormatDttm
|
||||
ZonedDateTime m1ModelStartDttm;
|
||||
|
||||
@Schema(description = "모델2 사용시간 시작일시")
|
||||
@JsonFormatDttm
|
||||
ZonedDateTime m2ModelStartDttm;
|
||||
|
||||
@Schema(description = "모델3 사용시간 시작일시")
|
||||
@JsonFormatDttm
|
||||
ZonedDateTime m3ModelStartDttm;
|
||||
|
||||
@Schema(description = "모델1 사용시간 종료일시")
|
||||
@JsonFormatDttm
|
||||
ZonedDateTime m1ModelEndDttm;
|
||||
|
||||
@Schema(description = "모델2 사용시간 종료일시")
|
||||
@JsonFormatDttm
|
||||
ZonedDateTime m2ModelEndDttm;
|
||||
|
||||
@Schema(description = "모델3 사용시간 종료일시")
|
||||
@JsonFormatDttm
|
||||
ZonedDateTime m3ModelEndDttm;
|
||||
|
||||
@Schema(description = "변화탐지 제목")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "비교년도")
|
||||
private Integer compareYyyy;
|
||||
|
||||
@Schema(description = "기준년도")
|
||||
private Integer targetYyyy;
|
||||
|
||||
@Schema(description = "회차")
|
||||
private Integer stage;
|
||||
|
||||
@Schema(description = "변화탐지 시작")
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime inferStartDttm;
|
||||
|
||||
@Schema(description = "변화탐지 종료")
|
||||
@JsonFormatDttm
|
||||
private ZonedDateTime inferEndDttm;
|
||||
|
||||
@Schema(description = "변화탐지 옵션")
|
||||
private String detectOption;
|
||||
|
||||
@Schema(description = "분석도엽")
|
||||
private String mapSheetScope;
|
||||
@JsonFormatDttm private ZonedDateTime inferStartDttm;
|
||||
@JsonFormatDttm private ZonedDateTime inferEndDttm;
|
||||
private Long detectingCnt = 0L;
|
||||
private Long detectingEndCnt = 0L;
|
||||
|
||||
@JsonFormatDttm private ZonedDateTime m1ModelStartDttm;
|
||||
@JsonFormatDttm private ZonedDateTime m1ModelEndDttm;
|
||||
@JsonFormatDttm private ZonedDateTime m2ModelStartDttm;
|
||||
@JsonFormatDttm private ZonedDateTime m2ModelEndDttm;
|
||||
@JsonFormatDttm private ZonedDateTime m3ModelStartDttm;
|
||||
@JsonFormatDttm private ZonedDateTime m3ModelEndDttm;
|
||||
@Schema(description = "모델1 버전")
|
||||
private String modelVer1;
|
||||
|
||||
private String model1Ver;
|
||||
private String model2Ver;
|
||||
private String model3Ver;
|
||||
private String usedServerName;
|
||||
private String model1VerStatus = "PROCCESING";
|
||||
private String model1VerStatusName = "진행중";
|
||||
private String model2VerStatus = "PROCCESING";
|
||||
private String model2VerStatusName = "진행중";
|
||||
private String model3VerStatus = "PROCCESING";
|
||||
private String model3VerStatusName = "진행중";
|
||||
@Schema(description = "모델2 버전")
|
||||
private String modelVer2;
|
||||
|
||||
@Schema(description = "모델3 버전")
|
||||
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,
|
||||
String detectOption,
|
||||
String mapSheetScope,
|
||||
Integer stage,
|
||||
ZonedDateTime inferStartDttm,
|
||||
ZonedDateTime inferEndDttm,
|
||||
Long detectingCnt,
|
||||
Long detectingEndCnt,
|
||||
ZonedDateTime m1ModelStartDttm,
|
||||
ZonedDateTime m1ModelEndDttm,
|
||||
ZonedDateTime m2ModelStartDttm,
|
||||
ZonedDateTime m2ModelEndDttm,
|
||||
ZonedDateTime m3ModelStartDttm,
|
||||
ZonedDateTime m3ModelEndDttm,
|
||||
String model1Ver,
|
||||
String model2Ver,
|
||||
String model3Ver) {
|
||||
String detectOption,
|
||||
String mapSheetScope,
|
||||
String modelVer1,
|
||||
String modelVer2,
|
||||
String modelVer3) {
|
||||
this.detectingCnt = detectingCnt;
|
||||
this.m1PendingJobs = m1PendingJobs;
|
||||
this.m2PendingJobs = m2PendingJobs;
|
||||
this.m3PendingJobs = m3PendingJobs;
|
||||
this.m1CompletedJobs = m1CompletedJobs;
|
||||
this.m2CompletedJobs = m2CompletedJobs;
|
||||
this.m3CompletedJobs = m3CompletedJobs;
|
||||
this.m1FailedJobs = m1FailedJobs;
|
||||
this.m2FailedJobs = m2FailedJobs;
|
||||
this.m3FailedJobs = m3FailedJobs;
|
||||
this.m1ModelStartDttm = m1ModelStartDttm;
|
||||
this.m2ModelStartDttm = m2ModelStartDttm;
|
||||
this.m3ModelStartDttm = m3ModelStartDttm;
|
||||
this.m1ModelEndDttm = m1ModelEndDttm;
|
||||
this.m2ModelEndDttm = m2ModelEndDttm;
|
||||
this.m3ModelEndDttm = m3ModelEndDttm;
|
||||
this.title = title;
|
||||
this.compareYyyy = compareYyyy;
|
||||
this.targetYyyy = targetYyyy;
|
||||
this.detectOption = detectOption;
|
||||
this.mapSheetScope = mapSheetScope;
|
||||
this.stage = stage;
|
||||
this.inferStartDttm = inferStartDttm;
|
||||
this.inferEndDttm = inferEndDttm;
|
||||
this.detectingCnt = detectingCnt;
|
||||
this.detectingEndCnt = detectingEndCnt;
|
||||
this.m1ModelStartDttm = m1ModelStartDttm;
|
||||
this.m1ModelEndDttm = m1ModelEndDttm;
|
||||
this.m2ModelStartDttm = m2ModelStartDttm;
|
||||
this.m2ModelEndDttm = m2ModelEndDttm;
|
||||
this.m3ModelStartDttm = m3ModelStartDttm;
|
||||
this.m3ModelEndDttm = m3ModelEndDttm;
|
||||
this.model1Ver = model1Ver;
|
||||
this.model2Ver = model2Ver;
|
||||
this.model3Ver = model3Ver;
|
||||
|
||||
if (this.detectingEndCnt == null) {
|
||||
this.detectingEndCnt = 0L;
|
||||
}
|
||||
this.detectOption = detectOption;
|
||||
this.mapSheetScope = mapSheetScope;
|
||||
this.modelVer1 = modelVer1;
|
||||
this.modelVer2 = modelVer2;
|
||||
this.modelVer3 = modelVer3;
|
||||
}
|
||||
|
||||
public String getDetectOptionName() {
|
||||
if (this.detectOption.equals("EXCL")) {
|
||||
return "추론제외";
|
||||
}
|
||||
return "이전 년도 도엽 사용";
|
||||
@JsonProperty("progress")
|
||||
private int getProgress() {
|
||||
long tiles = this.detectingCnt; // 도엽수
|
||||
int models = 3; // 모델 개수
|
||||
int completed =
|
||||
this.m1CompletedJobs
|
||||
+ this.m2CompletedJobs
|
||||
+ this.m3CompletedJobs
|
||||
+ this.m1FailedJobs
|
||||
+ this.m2FailedJobs
|
||||
+ this.m3FailedJobs; // 완료수
|
||||
|
||||
long total = tiles * models; // 전체 작업량
|
||||
return (int) ((completed * 100L) / total);
|
||||
}
|
||||
|
||||
public String getMapSheetScopeName() {
|
||||
if (this.mapSheetScope.equals("ALL")) {
|
||||
return "전체";
|
||||
}
|
||||
return "부분";
|
||||
@JsonProperty("detectOptionName")
|
||||
private String getDetectOptionName() {
|
||||
return DetectOption.getDescByCode(this.detectOption);
|
||||
}
|
||||
|
||||
public double getDetectingRate() {
|
||||
if (this.detectingCnt == null || this.detectingCnt == 0L) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
if (this.detectingEndCnt == null) {
|
||||
this.detectingEndCnt = 0L;
|
||||
}
|
||||
|
||||
return (double) (this.detectingEndCnt / this.detectingCnt) * 100.0;
|
||||
}
|
||||
|
||||
public String getM1Duration() {
|
||||
if (this.m1ModelStartDttm == null || this.m1ModelEndDttm == null) {
|
||||
return "00:00:00";
|
||||
}
|
||||
Duration duration = Duration.between(m1ModelStartDttm, m1ModelEndDttm);
|
||||
long hours = duration.toHours();
|
||||
long minutes = duration.toMinutesPart();
|
||||
long seconds = duration.toSecondsPart();
|
||||
|
||||
return String.format("%02d:%02d:%02d", hours, minutes, seconds);
|
||||
}
|
||||
|
||||
public String getM2Duration() {
|
||||
if (this.m2ModelStartDttm == null || this.m2ModelEndDttm == null) {
|
||||
return "00:00:00";
|
||||
}
|
||||
Duration duration = Duration.between(this.m2ModelStartDttm, this.m2ModelEndDttm);
|
||||
long hours = duration.toHours();
|
||||
long minutes = duration.toMinutesPart();
|
||||
long seconds = duration.toSecondsPart();
|
||||
|
||||
return String.format("%02d:%02d:%02d", hours, minutes, seconds);
|
||||
}
|
||||
|
||||
public String getM3Duration() {
|
||||
if (this.m3ModelStartDttm == null || this.m3ModelEndDttm == null) {
|
||||
return "00:00:00";
|
||||
}
|
||||
Duration duration = Duration.between(this.m3ModelStartDttm, this.m3ModelEndDttm);
|
||||
long hours = duration.toHours();
|
||||
long minutes = duration.toMinutesPart();
|
||||
long seconds = duration.toSecondsPart();
|
||||
|
||||
return String.format("%02d:%02d:%02d", hours, minutes, seconds);
|
||||
@JsonProperty("mapSheetScopeName")
|
||||
private String getMapSheetScope() {
|
||||
return MapSheetScope.getDescByCode(this.mapSheetScope);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,6 +491,15 @@ public class InferenceResultDto {
|
||||
}
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public static class InferenceStatusDetailDto2 {
|
||||
|
||||
InferenceServerStatusDto serverStatus;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -465,23 +465,14 @@ public class InferenceResultService {
|
||||
return inferenceResultCoreService.getInferenceServerStatusList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 추론 진행 현황 상세
|
||||
*
|
||||
* @param uuid
|
||||
* @return
|
||||
*/
|
||||
public InferenceStatusDetailDto getInferenceStatus(UUID uuid) {
|
||||
|
||||
List<InferenceServerStatusDto> servers =
|
||||
inferenceResultCoreService.getInferenceServerStatusList();
|
||||
|
||||
String serverNames = "";
|
||||
for (InferenceServerStatusDto server : servers) {
|
||||
if (serverNames.equals("")) {
|
||||
serverNames = server.getServerName();
|
||||
} else {
|
||||
serverNames = serverNames + "," + server.getServerName();
|
||||
}
|
||||
}
|
||||
|
||||
InferenceStatusDetailDto dto = inferenceResultCoreService.getInferenceStatus(uuid);
|
||||
dto.setUsedServerName(serverNames);
|
||||
|
||||
return dto;
|
||||
}
|
||||
|
||||
|
||||
@@ -328,6 +328,11 @@ public class InferenceResultCoreService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 서버 정보 조회
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public List<InferenceServerStatusDto> getInferenceServerStatusList() {
|
||||
return mapSheetLearnRepository.getInferenceServerStatusList();
|
||||
}
|
||||
|
||||
@@ -161,6 +161,12 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
.fetchOne());
|
||||
}
|
||||
|
||||
/**
|
||||
* 추론 실행 진행 현황
|
||||
*
|
||||
* @param uuid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public InferenceStatusDetailDto getInferenceStatus(UUID uuid) {
|
||||
|
||||
@@ -175,21 +181,30 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
.select(
|
||||
Projections.constructor(
|
||||
InferenceStatusDetailDto.class,
|
||||
mapSheetLearnEntity.detectingCnt,
|
||||
mapSheetLearnEntity.m1PendingJobs,
|
||||
mapSheetLearnEntity.m2PendingJobs,
|
||||
mapSheetLearnEntity.m3PendingJobs,
|
||||
mapSheetLearnEntity.m1CompletedJobs,
|
||||
mapSheetLearnEntity.m2CompletedJobs,
|
||||
mapSheetLearnEntity.m3CompletedJobs,
|
||||
mapSheetLearnEntity.m1FailedJobs,
|
||||
mapSheetLearnEntity.m2FailedJobs,
|
||||
mapSheetLearnEntity.m3FailedJobs,
|
||||
mapSheetLearnEntity.m1ModelStartDttm,
|
||||
mapSheetLearnEntity.m2ModelStartDttm,
|
||||
mapSheetLearnEntity.m3ModelStartDttm,
|
||||
mapSheetLearnEntity.m1ModelEndDttm,
|
||||
mapSheetLearnEntity.m2ModelEndDttm,
|
||||
mapSheetLearnEntity.m3ModelEndDttm,
|
||||
mapSheetLearnEntity.title,
|
||||
mapSheetLearnEntity.compareYyyy,
|
||||
mapSheetLearnEntity.targetYyyy,
|
||||
mapSheetLearnEntity.detectOption,
|
||||
mapSheetLearnEntity.mapSheetScope,
|
||||
mapSheetLearnEntity.stage,
|
||||
mapSheetLearnEntity.inferStartDttm,
|
||||
mapSheetLearnEntity.inferEndDttm,
|
||||
mapSheetLearnEntity.detectingCnt,
|
||||
mapSheetLearnEntity.detectEndCnt,
|
||||
mapSheetLearnEntity.m1ModelStartDttm,
|
||||
mapSheetLearnEntity.m1ModelEndDttm,
|
||||
mapSheetLearnEntity.m2ModelStartDttm,
|
||||
mapSheetLearnEntity.m2ModelEndDttm,
|
||||
mapSheetLearnEntity.m3ModelStartDttm,
|
||||
mapSheetLearnEntity.m3ModelEndDttm,
|
||||
mapSheetLearnEntity.detectOption,
|
||||
mapSheetLearnEntity.mapSheetScope,
|
||||
m1Model.modelVer.as("model1Ver"),
|
||||
m2Model.modelVer.as("model2Ver"),
|
||||
m3Model.modelVer.as("model3Ver")))
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user