추론결과 > 기본정보 작업 진행중
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.kamco.cd.kamcoback.inference;
|
package com.kamco.cd.kamcoback.inference;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
import com.kamco.cd.kamcoback.config.api.ApiResponseDto;
|
||||||
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
|
||||||
@@ -285,4 +286,25 @@ public class InferenceResultApiController {
|
|||||||
|
|
||||||
return ApiResponseDto.ok(inferenceResultService.getInferenceStatus(uuid));
|
return ApiResponseDto.ok(inferenceResultService.getInferenceStatus(uuid));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "추론결과 기본정보", description = "추론결과 기본정보")
|
||||||
|
@ApiResponses(
|
||||||
|
value = {
|
||||||
|
@ApiResponse(
|
||||||
|
responseCode = "200",
|
||||||
|
description = "검색 성공",
|
||||||
|
content =
|
||||||
|
@Content(
|
||||||
|
mediaType = "application/json",
|
||||||
|
schema = @Schema(implementation = InferenceDetailDto.AnalResSummary.class))),
|
||||||
|
@ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content),
|
||||||
|
@ApiResponse(responseCode = "500", description = "서버 오류", content = @Content)
|
||||||
|
})
|
||||||
|
@GetMapping("/infer-result-info")
|
||||||
|
public ApiResponseDto<InferenceDetailDto.AnalResultInfo> getInferenceResultInfo(
|
||||||
|
@Parameter(description = "회차 uuid", example = "932fbd72-2e8e-4a49-b189-09046787f9d1")
|
||||||
|
@RequestParam
|
||||||
|
String uuid) {
|
||||||
|
return ApiResponseDto.ok(inferenceResultService.getInferenceResultInfo(uuid));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import com.kamco.cd.kamcoback.common.enums.DetectionClassification;
|
import com.kamco.cd.kamcoback.common.enums.DetectionClassification;
|
||||||
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import java.time.Duration;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -29,8 +30,10 @@ public class InferenceDetailDto {
|
|||||||
private String dataName;
|
private String dataName;
|
||||||
private Long mapSheepNum;
|
private Long mapSheepNum;
|
||||||
private Long detectingCnt;
|
private Long detectingCnt;
|
||||||
@JsonFormatDttm private ZonedDateTime analStrtDttm;
|
@JsonFormatDttm
|
||||||
@JsonFormatDttm private ZonedDateTime analEndDttm;
|
private ZonedDateTime analStrtDttm;
|
||||||
|
@JsonFormatDttm
|
||||||
|
private ZonedDateTime analEndDttm;
|
||||||
private Long analSec;
|
private Long analSec;
|
||||||
private String analState;
|
private String analState;
|
||||||
|
|
||||||
@@ -61,8 +64,10 @@ public class InferenceDetailDto {
|
|||||||
private Long id;
|
private Long id;
|
||||||
private String analTitle;
|
private String analTitle;
|
||||||
private Long detectingCnt;
|
private Long detectingCnt;
|
||||||
@JsonFormatDttm private ZonedDateTime analStrtDttm;
|
@JsonFormatDttm
|
||||||
@JsonFormatDttm private ZonedDateTime analEndDttm;
|
private ZonedDateTime analStrtDttm;
|
||||||
|
@JsonFormatDttm
|
||||||
|
private ZonedDateTime analEndDttm;
|
||||||
private Long analSec;
|
private Long analSec;
|
||||||
private Long analPredSec;
|
private Long analPredSec;
|
||||||
private String analState;
|
private String analState;
|
||||||
@@ -102,8 +107,10 @@ public class InferenceDetailDto {
|
|||||||
private String modelInfo;
|
private String modelInfo;
|
||||||
private Integer targetYyyy;
|
private Integer targetYyyy;
|
||||||
private Integer compareYyyy;
|
private Integer compareYyyy;
|
||||||
@JsonFormatDttm private ZonedDateTime analStrtDttm;
|
@JsonFormatDttm
|
||||||
@JsonFormatDttm private ZonedDateTime analEndDttm;
|
private ZonedDateTime analStrtDttm;
|
||||||
|
@JsonFormatDttm
|
||||||
|
private ZonedDateTime analEndDttm;
|
||||||
private Long analSec;
|
private Long analSec;
|
||||||
private Long analPredSec;
|
private Long analPredSec;
|
||||||
private String resultUrl;
|
private String resultUrl;
|
||||||
@@ -183,7 +190,8 @@ public class InferenceDetailDto {
|
|||||||
private Clazzes target;
|
private Clazzes target;
|
||||||
private MapSheet mapSheet;
|
private MapSheet mapSheet;
|
||||||
private Coordinate center;
|
private Coordinate center;
|
||||||
@JsonFormatDttm private ZonedDateTime updatedDttm;
|
@JsonFormatDttm
|
||||||
|
private ZonedDateTime updatedDttm;
|
||||||
|
|
||||||
public DetailListEntity(
|
public DetailListEntity(
|
||||||
UUID uuid,
|
UUID uuid,
|
||||||
@@ -233,7 +241,8 @@ public class InferenceDetailDto {
|
|||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
private String name;
|
private String name;
|
||||||
@JsonIgnore private Double score;
|
@JsonIgnore
|
||||||
|
private Double score;
|
||||||
|
|
||||||
public Clazz(String code, Double score) {
|
public Clazz(String code, Double score) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
@@ -300,8 +309,10 @@ public class InferenceDetailDto {
|
|||||||
String classAfterName;
|
String classAfterName;
|
||||||
Double classAfterProb;
|
Double classAfterProb;
|
||||||
Long mapSheetNum;
|
Long mapSheetNum;
|
||||||
@JsonIgnore String gemoStr;
|
@JsonIgnore
|
||||||
@JsonIgnore String geomCenterStr;
|
String gemoStr;
|
||||||
|
@JsonIgnore
|
||||||
|
String geomCenterStr;
|
||||||
JsonNode gemo;
|
JsonNode gemo;
|
||||||
JsonNode geomCenter;
|
JsonNode geomCenter;
|
||||||
|
|
||||||
@@ -409,4 +420,52 @@ public class InferenceDetailDto {
|
|||||||
private UUID m2ModelUuid;
|
private UUID m2ModelUuid;
|
||||||
private UUID m3ModelUuid;
|
private UUID m3ModelUuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Schema(name = "AnalResultInfo", description = "추론결과 기본정보")
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public static class AnalResultInfo {
|
||||||
|
|
||||||
|
private String analTitle;
|
||||||
|
private String modelVer1;
|
||||||
|
private String modelVer2;
|
||||||
|
private String modelVer3;
|
||||||
|
private Integer compareYyyy;
|
||||||
|
private Integer targetYyyy;
|
||||||
|
private String detectOption;
|
||||||
|
private String mapSheetScope;
|
||||||
|
@JsonFormatDttm
|
||||||
|
private ZonedDateTime inferStartDttm;
|
||||||
|
@JsonFormatDttm
|
||||||
|
private ZonedDateTime inferEndDttm;
|
||||||
|
|
||||||
|
private Duration elapsedDuration;
|
||||||
|
|
||||||
|
public AnalResultInfo(String analTitle,
|
||||||
|
String modelVer1,
|
||||||
|
String modelVer2,
|
||||||
|
String modelVer3,
|
||||||
|
Integer compareYyyy,
|
||||||
|
Integer targetYyyy,
|
||||||
|
String detectOption,
|
||||||
|
String mapSheetScope,
|
||||||
|
ZonedDateTime inferStartDttm,
|
||||||
|
ZonedDateTime inferEndDttm
|
||||||
|
) {
|
||||||
|
this.analTitle = analTitle;
|
||||||
|
this.modelVer1 = modelVer1;
|
||||||
|
this.modelVer2 = modelVer2;
|
||||||
|
this.modelVer3 = modelVer3;
|
||||||
|
this.compareYyyy = compareYyyy;
|
||||||
|
this.targetYyyy = targetYyyy;
|
||||||
|
this.detectOption = detectOption;
|
||||||
|
this.mapSheetScope = mapSheetScope;
|
||||||
|
this.inferStartDttm = inferStartDttm;
|
||||||
|
this.inferEndDttm = inferEndDttm;
|
||||||
|
this.elapsedDuration = (inferStartDttm != null && inferEndDttm != null)
|
||||||
|
? Duration.between(inferStartDttm, inferEndDttm)
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.kamco.cd.kamcoback.common.exception.CustomApiException;
|
|||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient;
|
||||||
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
import com.kamco.cd.kamcoback.config.resttemplate.ExternalHttpClient.ExternalCallResult;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
|
||||||
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.AnalResultInfo;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Dashboard;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Dashboard;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Detail;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Detail;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.MapSheet;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.MapSheet;
|
||||||
@@ -480,4 +481,8 @@ public class InferenceResultService {
|
|||||||
|
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AnalResultInfo getInferenceResultInfo(String uuid) {
|
||||||
|
return inferenceResultCoreService.getInferenceResultInfo(uuid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.kamco.cd.kamcoback.postgres.core;
|
|||||||
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
|
import com.kamco.cd.kamcoback.common.exception.CustomApiException;
|
||||||
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
import com.kamco.cd.kamcoback.common.utils.UserUtil;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto;
|
||||||
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.AnalResultInfo;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Dashboard;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.Dashboard;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.InferenceBatchSheet;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.InferenceBatchSheet;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.MapSheet;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.MapSheet;
|
||||||
@@ -370,4 +371,8 @@ public class InferenceResultCoreService {
|
|||||||
public Integer getLearnStage(Integer compareYear, Integer targetYear) {
|
public Integer getLearnStage(Integer compareYear, Integer targetYear) {
|
||||||
return mapSheetLearnRepository.getLearnStage(compareYear, targetYear);
|
return mapSheetLearnRepository.getLearnStage(compareYear, targetYear);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AnalResultInfo getInferenceResultInfo(String uuid) {
|
||||||
|
return mapSheetLearnRepository.getInferenceResultInfo(uuid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.AnalResultInfo;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceProgressDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceProgressDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
|
||||||
@@ -27,4 +28,6 @@ public interface MapSheetLearnRepositoryCustom {
|
|||||||
UUID getProcessing();
|
UUID getProcessing();
|
||||||
|
|
||||||
Integer getLearnStage(Integer compareYear, Integer targetYear);
|
Integer getLearnStage(Integer compareYear, Integer targetYear);
|
||||||
|
|
||||||
|
AnalResultInfo getInferenceResultInfo(String uuid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapShe
|
|||||||
import static com.kamco.cd.kamcoback.postgres.entity.QSystemMetricEntity.systemMetricEntity;
|
import static com.kamco.cd.kamcoback.postgres.entity.QSystemMetricEntity.systemMetricEntity;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.common.utils.DateRange;
|
import com.kamco.cd.kamcoback.common.utils.DateRange;
|
||||||
|
import com.kamco.cd.kamcoback.inference.dto.InferenceDetailDto.AnalResultInfo;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceProgressDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceProgressDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerStatusDto;
|
||||||
@@ -261,4 +262,36 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
|
|
||||||
return stage == null ? 1 : stage + 1;
|
return stage == null ? 1 : stage + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AnalResultInfo getInferenceResultInfo(String uuid) {
|
||||||
|
QModelMngEntity m1 = new QModelMngEntity("m1");
|
||||||
|
QModelMngEntity m2 = new QModelMngEntity("m2");
|
||||||
|
QModelMngEntity m3 = new QModelMngEntity("m3");
|
||||||
|
|
||||||
|
return queryFactory
|
||||||
|
.select(
|
||||||
|
Projections.constructor(
|
||||||
|
AnalResultInfo.class,
|
||||||
|
mapSheetLearnEntity.title,
|
||||||
|
m1.modelVer,
|
||||||
|
m2.modelVer,
|
||||||
|
m3.modelVer,
|
||||||
|
mapSheetLearnEntity.compareYyyy,
|
||||||
|
mapSheetLearnEntity.targetYyyy,
|
||||||
|
mapSheetLearnEntity.detectOption,
|
||||||
|
mapSheetLearnEntity.mapSheetScope,
|
||||||
|
mapSheetLearnEntity.inferStartDttm,
|
||||||
|
mapSheetLearnEntity.inferEndDttm
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.from(mapSheetLearnEntity)
|
||||||
|
.leftJoin(m1)
|
||||||
|
.on(mapSheetLearnEntity.m1ModelUuid.eq(m1.uuid))
|
||||||
|
.leftJoin(m2)
|
||||||
|
.on(mapSheetLearnEntity.m2ModelUuid.eq(m2.uuid))
|
||||||
|
.leftJoin(m3)
|
||||||
|
.on(mapSheetLearnEntity.m3ModelUuid.eq(m3.uuid))
|
||||||
|
.where(mapSheetLearnEntity.uuid.eq(UUID.fromString(uuid))).fetchOne();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user