diff --git a/src/main/java/com/kamco/cd/kamcoback/inference/InferenceResultApiController.java b/src/main/java/com/kamco/cd/kamcoback/inference/InferenceResultApiController.java index cc0fbaea..5da4c5bc 100644 --- a/src/main/java/com/kamco/cd/kamcoback/inference/InferenceResultApiController.java +++ b/src/main/java/com/kamco/cd/kamcoback/inference/InferenceResultApiController.java @@ -240,7 +240,6 @@ public class InferenceResultApiController { return ApiResponseDto.ok(inferenceResultService.getInferenceServerStatusList()); } - @Operation(summary = "추론관리 진행현황 상세", description = "어드민 홈 > 추론관리 > 추론관리 > 진행현황 상세") @ApiResponses( value = { @@ -257,7 +256,7 @@ public class InferenceResultApiController { @GetMapping("/status/{uuid}") public ApiResponseDto getInferenceStatus( @io.swagger.v3.oas.annotations.parameters.RequestBody( - description = "모델 삭제 요청 정보", + description = "추론진행현왕 요청 정보", required = true) @PathVariable UUID uuid) { 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 27aab9b5..f159d885 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 @@ -76,9 +76,7 @@ public class InferenceResultDto { } } - /** - * 탐지 데이터 옵션 dto - */ + /** 탐지 데이터 옵션 dto */ @Getter @AllArgsConstructor public enum MapSheetScope implements EnumType { @@ -99,9 +97,7 @@ public class InferenceResultDto { } } - /** - * 분석대상 도엽 enum - */ + /** 분석대상 도엽 enum */ @Getter @AllArgsConstructor public enum DetectOption implements EnumType { @@ -149,9 +145,7 @@ public class InferenceResultDto { } } - /** - * 변화탐지 실행 정보 저장 요청 정보 - */ + /** 변화탐지 실행 정보 저장 요청 정보 */ @Getter @Setter @NoArgsConstructor @@ -190,13 +184,13 @@ 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 = "[{\"mapSheetNum\":37914034,\"mapSheetName\":\"죽변\"}]") + description = "5k 도협 번호 목록", + example = "[{\"mapSheetNum\":37914034,\"mapSheetName\":\"죽변\"}]") @NotNull private List mapSheetNum; } @@ -220,28 +214,28 @@ public class InferenceResultDto { private Integer targetYyyy; private String detectOption; private String mapSheetScope; - @JsonFormatDttm - private ZonedDateTime inferStartDttm; - @JsonFormatDttm - private ZonedDateTime inferEndDttm; - private Long detectingCnt; + @JsonFormatDttm private ZonedDateTime inferStartDttm; + @JsonFormatDttm private ZonedDateTime inferEndDttm; + private Long detectingCnt = 0L; + private Long detectingEndCnt = 0L; private String model1Ver; private String model2Ver; private String model3Ver; public InferenceStatusDetailDto( - String title, - Integer compareYyyy, - Integer targetYyyy, - String detectOption, - String mapSheetScope, - ZonedDateTime inferStartDttm, - ZonedDateTime inferEndDttm, - Long detectingCnt, - String model1Ver, - String model2Ver, - String model3Ver) { + String title, + Integer compareYyyy, + Integer targetYyyy, + String detectOption, + String mapSheetScope, + ZonedDateTime inferStartDttm, + ZonedDateTime inferEndDttm, + Long detectingCnt, + Long detectingEndCnt, + String model1Ver, + String model2Ver, + String model3Ver) { this.title = title; this.compareYyyy = compareYyyy; this.targetYyyy = targetYyyy; @@ -250,33 +244,43 @@ public class InferenceResultDto { this.inferStartDttm = inferStartDttm; this.inferEndDttm = inferEndDttm; this.detectingCnt = detectingCnt; + this.detectingEndCnt = detectingEndCnt; this.model1Ver = model1Ver; this.model2Ver = model2Ver; this.model3Ver = model3Ver; + + if( this.detectingEndCnt == null )this.detectingEndCnt = 0L; + } private String usedServerName; - private Long detectingEndCnt = 7L; private String model1VerStatus = "PROCCESING"; private String model1VerStatusName = "진행중"; private String model2VerStatus = "PROCCESING"; private String model2VerStatusName = "진행중"; private String model3VerStatus = "PROCCESING"; - private String model4VerStatusName = "진행중"; + private String model3VerStatusName = "진행중"; public String getDetectOptionName() { - if (this.detectOption.equals("EXCL")) { - return "추론제외"; - } + if (this.detectOption.equals("EXCL")) return "추론제외"; return "이전 년도 도엽 사용"; } public String getMapSheetScopeName() { - if (this.detectOption.equals("ALL")) { - return "전체"; - } + if (this.mapSheetScope.equals("ALL")) return "전체"; return "부분"; } + + 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; + } + } @Getter diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryImpl.java index a59eabdf..b16332dd 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryImpl.java @@ -142,11 +142,11 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto @Override public Optional getInferenceResultByStatus(String status) { return Optional.ofNullable( - queryFactory - .selectFrom(mapSheetLearnEntity) - .where(mapSheetLearnEntity.status.eq(status)) - .limit(1) - .fetchOne()); + queryFactory + .selectFrom(mapSheetLearnEntity) + .where(mapSheetLearnEntity.status.eq(status)) + .limit(1) + .fetchOne()); } @Override diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java index cb64cfe3..f2353cea 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/label/LabelAllocateRepositoryImpl.java @@ -1101,9 +1101,7 @@ public class LabelAllocateRepositoryImpl implements LabelAllocateRepositoryCusto Expression completeCnt = Expressions.numberTemplate( - Long.class, - "COUNT(*) FILTER (WHERE {0} = 'COMPLETE')", - labelingAssignmentEntity.workState); + Long.class, "COUNT(*) FILTER (WHERE {0} = 'DONE')", labelingAssignmentEntity.workState); Expression remainCnt = Expressions.numberTemplate(Long.class, "({0} - {1} - {2})", totalCnt, skipCnt, completeCnt);