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 2721f5f4..b946c6ab 100644 --- a/src/main/java/com/kamco/cd/kamcoback/inference/InferenceResultApiController.java +++ b/src/main/java/com/kamco/cd/kamcoback/inference/InferenceResultApiController.java @@ -44,53 +44,53 @@ public class InferenceResultApiController { @Operation(summary = "추론관리 목록", description = "어드민 홈 > 추론관리 > 추론관리 > 추론관리 목록") @ApiResponses( - value = { - @ApiResponse( - responseCode = "200", - description = "검색 성공", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = Page.class))), - @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "200", + description = "검색 성공", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = Page.class))), + @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @GetMapping("/list") public ApiResponseDto> getInferenceResultList( - @Parameter(description = "국유인 반영 여부", example = "Y") @RequestParam(required = false) - String applyYn, - @Parameter(description = "반영일", example = "2025-01-01") @RequestParam(required = false) - LocalDate strtDttm, - @Parameter(description = "반영일", example = "2026-01-01") @RequestParam(required = false) - LocalDate endDttm, - @Parameter(description = "제목", example = "변화탐지") @RequestParam(required = false) String title, - @Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0") - int page, - @Parameter(description = "페이지 크기", example = "20") @RequestParam(defaultValue = "20") - int size) { + @Parameter(description = "국유인 반영 여부", example = "Y") @RequestParam(required = false) + String applyYn, + @Parameter(description = "반영일", example = "2025-01-01") @RequestParam(required = false) + LocalDate strtDttm, + @Parameter(description = "반영일", example = "2026-01-01") @RequestParam(required = false) + LocalDate endDttm, + @Parameter(description = "제목", example = "변화탐지") @RequestParam(required = false) String title, + @Parameter(description = "페이지 번호 (0부터 시작)", example = "0") @RequestParam(defaultValue = "0") + int page, + @Parameter(description = "페이지 크기", example = "20") @RequestParam(defaultValue = "20") + int size) { InferenceResultDto.SearchListReq req = - new InferenceResultDto.SearchListReq(applyYn, strtDttm, endDttm, title, page, size); + new InferenceResultDto.SearchListReq(applyYn, strtDttm, endDttm, title, page, size); Page analResList = inferenceResultService.getInferenceResultList(req); return ApiResponseDto.ok(analResList); } @Operation(summary = "추론 진행 여부 확인", description = "어드민 홈 > 추론관리 > 추론관리 > 추론관리 목록") @ApiResponses( - value = { - @ApiResponse( - responseCode = "200", - description = "검색 성공", - content = - @Content( - mediaType = "application/json", - schema = - @Schema( - description = "진행 여부 (UUID 있으면 진행중)", - type = "UUID", - example = "44709877-2e27-4fc5-bacb-8e0328c69b64"))), - @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "200", + description = "검색 성공", + content = + @Content( + mediaType = "application/json", + schema = + @Schema( + description = "진행 여부 (UUID 있으면 진행중)", + type = "UUID", + example = "44709877-2e27-4fc5-bacb-8e0328c69b64"))), + @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @GetMapping("/processing-yn") public ApiResponseDto getProcessing() { return ApiResponseDto.ok(inferenceResultService.getProcessing()); @@ -98,17 +98,17 @@ public class InferenceResultApiController { @Operation(summary = "년도 목록 조회", description = "어드민 홈 > 추론관리 > 추론목록 > 변화탐지 실행 정보 입력 > 년도 목록 조회") @ApiResponses( - value = { - @ApiResponse( - responseCode = "200", - description = "조회 성공", - content = - @Content( - mediaType = "application/json", - array = @ArraySchema(schema = @Schema(implementation = Integer.class)))), - @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "200", + description = "조회 성공", + content = + @Content( + mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = Integer.class)))), + @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @GetMapping("/years") public ApiResponseDto> findMapSheetMngDoneYyyyList() { return ApiResponseDto.ok(mapSheetMngService.findMapSheetMngDoneYyyyList()); @@ -116,57 +116,57 @@ public class InferenceResultApiController { @Operation(summary = "변화탐지 실행 정보 입력", description = "어드민 홈 > 추론관리 > 추론목록 > 변화탐지 실행 정보 입력") @ApiResponses( - value = { - @ApiResponse( - responseCode = "201", - description = "변화탐지 실행 정보 생성 성공", - content = - @Content( - mediaType = "application/json", - schema = @Schema(description = "저장 uuid", implementation = UUID.class))), - @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "201", + description = "변화탐지 실행 정보 생성 성공", + content = + @Content( + mediaType = "application/json", + schema = @Schema(description = "저장 uuid", implementation = UUID.class))), + @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @PostMapping("/reg") public ApiResponseDto saveInferenceInfo( - @io.swagger.v3.oas.annotations.parameters.RequestBody( - description = "변화탐지 실행 정보 저장 요청 정보", - required = true) - @RequestBody - @Valid - InferenceResultDto.RegReq req) { + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "변화탐지 실행 정보 저장 요청 정보", + required = true) + @RequestBody + @Valid + InferenceResultDto.RegReq req) { UUID uuid = inferenceResultService.saveInferenceInfo(req); return ApiResponseDto.ok(uuid); } @Operation(summary = "분석 모델 선택 조회", description = "변화탐지 실행 정보 입력 모델선택 팝업 ") @ApiResponses( - value = { - @ApiResponse( - responseCode = "200", - description = "분석 모델 조회 성공", - content = - @Content( - mediaType = "application/json", - schema = @Schema(description = "분석 모델", implementation = Page.class))), - @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "200", + description = "분석 모델 조회 성공", + content = + @Content( + mediaType = "application/json", + schema = @Schema(description = "분석 모델", implementation = Page.class))), + @ApiResponse(responseCode = "404", description = "코드를 찾을 수 없음", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @GetMapping("/model") public ApiResponseDto> saveInferenceInfo( - @Parameter(description = "모델 생성일 시작", example = "2025-12-01") @RequestParam(required = false) - LocalDate strtDttm, - @Parameter(description = "모델 생성일 종료", example = "2026-01-09") @RequestParam(required = false) - LocalDate endDttm, - @Parameter(description = "키워드 (모델버전)", example = "M1.H1.E28") @RequestParam(required = false) - String searchVal, - @Parameter(description = "타입", example = "M1") @RequestParam(required = false) - String modelType, - @RequestParam(defaultValue = "0") int page, - @RequestParam(defaultValue = "20") int size) { + @Parameter(description = "모델 생성일 시작", example = "2025-12-01") @RequestParam(required = false) + LocalDate strtDttm, + @Parameter(description = "모델 생성일 종료", example = "2026-01-09") @RequestParam(required = false) + LocalDate endDttm, + @Parameter(description = "키워드 (모델버전)", example = "M1.H1.E28") @RequestParam(required = false) + String searchVal, + @Parameter(description = "타입", example = "M1") @RequestParam(required = false) + String modelType, + @RequestParam(defaultValue = "0") int page, + @RequestParam(defaultValue = "20") int size) { ModelMngDto.searchReq searchReq = new ModelMngDto.searchReq(page, size, null); Page result = - modelMngService.findModelMgmtList(searchReq, strtDttm, endDttm, modelType, searchVal); + modelMngService.findModelMgmtList(searchReq, strtDttm, endDttm, modelType, searchVal); return ApiResponseDto.ok(result); } @@ -246,17 +246,17 @@ public class InferenceResultApiController { @Operation(summary = "추론관리 추론진행 서버 현황", description = "추론관리 추론진행 서버 현황") @ApiResponses( - value = { - @ApiResponse( - responseCode = "200", - description = "검색 성공", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = Page.class))), - @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "200", + description = "검색 성공", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = Page.class))), + @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @GetMapping("/serverStatus") public ApiResponseDto> getInferenceServerStatusList() { @@ -265,46 +265,46 @@ public class InferenceResultApiController { @Operation(summary = "추론관리 진행현황 상세", description = "어드민 홈 > 추론관리 > 추론관리 > 진행현황 상세") @ApiResponses( - value = { - @ApiResponse( - responseCode = "200", - description = "검색 성공", - content = - @Content( - mediaType = "application/json", - schema = @Schema(implementation = InferenceStatusDetailDto.class))), - @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content), - @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) - }) + value = { + @ApiResponse( + responseCode = "200", + description = "검색 성공", + content = + @Content( + mediaType = "application/json", + schema = @Schema(implementation = InferenceStatusDetailDto.class))), + @ApiResponse(responseCode = "400", description = "잘못된 검색 조건", content = @Content), + @ApiResponse(responseCode = "500", description = "서버 오류", content = @Content) + }) @GetMapping("/status/{uuid}") public ApiResponseDto getInferenceStatus( - @io.swagger.v3.oas.annotations.parameters.RequestBody( - description = "추론 진행현황 정보", - required = true) - @PathVariable - UUID uuid) { + @io.swagger.v3.oas.annotations.parameters.RequestBody( + description = "추론 진행현황 정보", + required = true) + @PathVariable + UUID 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) - }) + 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 getInferenceResultInfo( - @Parameter(description = "회차 uuid", example = "932fbd72-2e8e-4a49-b189-09046787f9d1") - @RequestParam - String uuid) { + @Parameter(description = "회차 uuid", example = "932fbd72-2e8e-4a49-b189-09046787f9d1") + @RequestParam + String uuid) { return ApiResponseDto.ok(inferenceResultService.getInferenceResultInfo(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 0feaef04..128baa9a 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 @@ -22,9 +22,7 @@ import org.springframework.data.domain.Pageable; public class InferenceResultDto { - /** - * 탐지 데이터 옵션 dto - */ + /** 탐지 데이터 옵션 dto */ @Getter @AllArgsConstructor public enum MapSheetScope implements EnumType { @@ -53,9 +51,7 @@ public class InferenceResultDto { } } - /** - * 분석대상 도엽 enum - */ + /** 분석대상 도엽 enum */ @Getter @AllArgsConstructor public enum DetectOption implements EnumType { @@ -132,9 +128,7 @@ public class InferenceResultDto { } } - /** - * 목록조회 dto - */ + /** 목록조회 dto */ @Getter @Setter @AllArgsConstructor @@ -146,15 +140,11 @@ public class InferenceResultDto { private String status; private String mapSheetCnt; private Long detectingCnt; - @JsonFormatDttm - private ZonedDateTime startTime; - @JsonFormatDttm - private ZonedDateTime endTime; - @JsonFormatDttm - private ZonedDateTime elapsedTime; + @JsonFormatDttm private ZonedDateTime startTime; + @JsonFormatDttm private ZonedDateTime endTime; + @JsonFormatDttm private ZonedDateTime elapsedTime; private Boolean applyYn; - @JsonFormatDttm - private ZonedDateTime applyDttm; + @JsonFormatDttm private ZonedDateTime applyDttm; @JsonProperty("statusName") public String statusName() { @@ -162,9 +152,7 @@ public class InferenceResultDto { } } - /** - * 목록조회 검색 조건 dto - */ + /** 목록조회 검색 조건 dto */ @Getter @Setter @NoArgsConstructor @@ -186,9 +174,7 @@ public class InferenceResultDto { } } - /** - * 변화탐지 실행 정보 저장 요청 정보 - */ + /** 변화탐지 실행 정보 저장 요청 정보 */ @Getter @Setter @NoArgsConstructor @@ -227,8 +213,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]") @@ -252,96 +238,121 @@ public class InferenceResultDto { @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; + @Schema(description = "모델1 버전") private String modelVer1; + @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, - 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; @@ -373,11 +384,17 @@ public class InferenceResultDto { @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 tiles = this.detectingCnt; // 도엽수 + int models = 3; // 모델 개수 + int completed = + this.m1CompletedJobs + + this.m2CompletedJobs + + this.m3CompletedJobs + + this.m1FailedJobs + + this.m2FailedJobs + + this.m3FailedJobs; // 완료수 - long total = tiles * models; // 전체 작업량 + long total = tiles * models; // 전체 작업량 return (int) ((completed * 100L) / total); } @@ -392,7 +409,6 @@ public class InferenceResultDto { } } - @Getter @Setter @NoArgsConstructor @@ -400,12 +416,9 @@ 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; diff --git a/src/main/java/com/kamco/cd/kamcoback/inference/service/InferenceResultService.java b/src/main/java/com/kamco/cd/kamcoback/inference/service/InferenceResultService.java index 8bd7d6b2..1af57e25 100644 --- a/src/main/java/com/kamco/cd/kamcoback/inference/service/InferenceResultService.java +++ b/src/main/java/com/kamco/cd/kamcoback/inference/service/InferenceResultService.java @@ -109,7 +109,7 @@ public class InferenceResultService { // 변화탐지 실행 가능 비교년도 조회 List compareList = - mapSheetMngCoreService.getByHstMapSheetCompareList(req.getCompareYyyy(), mapTargetIds); + mapSheetMngCoreService.getByHstMapSheetCompareList(req.getCompareYyyy(), mapTargetIds); if (compareList.isEmpty()) { throw new CustomApiException("NOT_FOUND_COMPARE_YEAR", HttpStatus.NOT_FOUND); @@ -158,20 +158,20 @@ public class InferenceResultService { // 추론에 필요한 geojson 파일 생성 List mapSheetNumList = - targetList.stream() - .filter(t -> Boolean.TRUE.equals(t.getIsSuccess())) - .map(MngListDto::getMapSheetNum) - .toList(); + targetList.stream() + .filter(t -> Boolean.TRUE.equals(t.getIsSuccess())) + .map(MngListDto::getMapSheetNum) + .toList(); // 비교년도 geojson 파일 생성하여 경로 받기 String modelComparePath = - getSceneInference( - String.valueOf(req.getCompareYyyy()), mapSheetNumList, req.getMapSheetScope()); + getSceneInference( + String.valueOf(req.getCompareYyyy()), mapSheetNumList, req.getMapSheetScope()); // 기준년도 geojson 파일 생성하여 경로 받기 String modelTargetPath = - getSceneInference( - String.valueOf(req.getTargetYyyy()), mapSheetNumList, req.getMapSheetScope()); + getSceneInference( + String.valueOf(req.getTargetYyyy()), mapSheetNumList, req.getMapSheetScope()); // ai 서버에 전달할 파라미터 생성 pred_requests_areas predRequestsAreas = new pred_requests_areas(); @@ -203,19 +203,19 @@ public class InferenceResultService { // 비교년도 탐지 제이터 옵션 별로 조회하여 req에 적용 private List createdMngDto( - InferenceResultDto.RegReq req, List targetList) { + InferenceResultDto.RegReq req, List targetList) { List mapTargetIds = new ArrayList<>(); targetList.forEach( - hstMapSheet -> { - // 비교년도는 target 년도 기준으로 가져옴 파라미터 만들기 - mapTargetIds.add(hstMapSheet.getMapSheetNum()); - }); + hstMapSheet -> { + // 비교년도는 target 년도 기준으로 가져옴 파라미터 만들기 + mapTargetIds.add(hstMapSheet.getMapSheetNum()); + }); // 비교년도 조회 List mapCompareIds = new ArrayList<>(); List compareList = - mapSheetMngCoreService.getByHstMapSheetCompareList(req.getCompareYyyy(), mapTargetIds); + mapSheetMngCoreService.getByHstMapSheetCompareList(req.getCompareYyyy(), mapTargetIds); for (MngListCompareDto dto : compareList) { // 추론 제외일때 이전년도 파일이 없으면 제외 @@ -230,35 +230,35 @@ public class InferenceResultService { } Set compareSet = - mapCompareIds.stream() - .filter(Objects::nonNull) - .map(String::trim) // 공백/개행 방지 - .collect(Collectors.toSet()); + mapCompareIds.stream() + .filter(Objects::nonNull) + .map(String::trim) // 공백/개행 방지 + .collect(Collectors.toSet()); // target 기준 compare 비교하여 서로 있는것만 저장 List commonIds = - mapTargetIds.stream() - .filter(Objects::nonNull) - .map(String::trim) - .filter(compareSet::contains) - .toList(); + mapTargetIds.stream() + .filter(Objects::nonNull) + .map(String::trim) + .filter(compareSet::contains) + .toList(); Set commonIdSet = - commonIds.stream().filter(Objects::nonNull).map(String::trim).collect(Collectors.toSet()); + commonIds.stream().filter(Objects::nonNull).map(String::trim).collect(Collectors.toSet()); // 저장하기위해 파라미터 다시 구성 List mapSheetNum = - targetList.stream() - .filter(dto -> dto.getMapSheetNum() != null) - .filter(dto -> commonIdSet.contains(dto.getMapSheetNum().trim())) - .map( - dto -> { - MapSheetNumDto mapSheetNumDto = new MapSheetNumDto(); - mapSheetNumDto.setMapSheetNum(dto.getMapSheetNum()); - mapSheetNumDto.setMapSheetName(dto.getMapSheetName()); - return mapSheetNumDto; - }) - .toList(); + targetList.stream() + .filter(dto -> dto.getMapSheetNum() != null) + .filter(dto -> commonIdSet.contains(dto.getMapSheetNum().trim())) + .map( + dto -> { + MapSheetNumDto mapSheetNumDto = new MapSheetNumDto(); + mapSheetNumDto.setMapSheetNum(dto.getMapSheetNum()); + mapSheetNumDto.setMapSheetName(dto.getMapSheetName()); + return mapSheetNumDto; + }) + .toList(); return mapSheetNum; } @@ -297,7 +297,7 @@ public class InferenceResultService { headers.setAccept(List.of(MediaType.APPLICATION_JSON)); ExternalCallResult result = - externalHttpClient.call(inferenceUrl, HttpMethod.POST, dto, headers, String.class); + externalHttpClient.call(inferenceUrl, HttpMethod.POST, dto, headers, String.class); if (result.statusCode() < 200 || result.statusCode() >= 300) { log.error("Inference API failed. status={}, body={}", result.statusCode(), result.body()); @@ -307,8 +307,7 @@ public class InferenceResultService { // 4) 응답 파싱 try { List> list = - objectMapper.readValue(result.body(), new TypeReference<>() { - }); + objectMapper.readValue(result.body(), new TypeReference<>() {}); if (list.isEmpty()) { throw new IllegalStateException("Inference response is empty"); @@ -377,8 +376,8 @@ public class InferenceResultService { /** * geojson 파일 생성 * - * @param yyyy 영상관리 파일별 년도 - * @param mapSheetNums 5k 도엽 번호 리스트 + * @param yyyy 영상관리 파일별 년도 + * @param mapSheetNums 5k 도엽 번호 리스트 * @param mapSheetScope EXCL : 추론제외, PREV 이전 년도 도엽 사용 * @return */ @@ -413,7 +412,7 @@ public class InferenceResultService { * @return */ public Page getInferenceResultGeomList( - Long id, InferenceDetailDto.SearchGeoReq searchGeoReq) { + Long id, InferenceDetailDto.SearchGeoReq searchGeoReq) { return inferenceResultCoreService.getInferenceResultGeomList(id, searchGeoReq); } @@ -424,7 +423,7 @@ public class InferenceResultService { * @return */ public Page listInferenceResultWithGeom( - @NotNull Long id, InferenceDetailDto.SearchGeoReq searchReq) { + @NotNull Long id, InferenceDetailDto.SearchGeoReq searchReq) { return inferenceResultCoreService.listInferenceResultWithGeom(id, searchReq); } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/core/InferenceResultCoreService.java b/src/main/java/com/kamco/cd/kamcoback/postgres/core/InferenceResultCoreService.java index 4aea070c..a78ff0b4 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/core/InferenceResultCoreService.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/core/InferenceResultCoreService.java @@ -106,7 +106,7 @@ public class InferenceResultCoreService { mapSheetLearnEntity.setMapSheetCnt(mapSheetName); mapSheetLearnEntity.setDetectingCnt((long) detectingCnt); mapSheetLearnEntity.setStage( - mapSheetLearnRepository.getLearnStage(req.getCompareYyyy(), req.getTargetYyyy())); + mapSheetLearnRepository.getLearnStage(req.getCompareYyyy(), req.getTargetYyyy())); // learn 테이블 저장 MapSheetLearnEntity savedLearn = mapSheetLearnRepository.save(mapSheetLearnEntity); @@ -168,9 +168,9 @@ public class InferenceResultCoreService { */ public InferenceDetailDto.AnalResSummary getInferenceResultSummary(Long id) { InferenceDetailDto.AnalResSummary summary = - mapSheetAnalDataRepository - .getInferenceResultSummary(id) - .orElseThrow(() -> new EntityNotFoundException("요약정보를 찾을 수 없습니다. " + id)); + mapSheetAnalDataRepository + .getInferenceResultSummary(id) + .orElseThrow(() -> new EntityNotFoundException("요약정보를 찾을 수 없습니다. " + id)); return summary; } @@ -191,7 +191,7 @@ public class InferenceResultCoreService { * @return */ public Page getInferenceResultGeomList( - Long id, InferenceDetailDto.SearchGeoReq searchGeoReq) { + Long id, InferenceDetailDto.SearchGeoReq searchGeoReq) { return mapSheetAnalDataRepository.getInferenceGeomList(id, searchGeoReq); } @@ -203,16 +203,16 @@ public class InferenceResultCoreService { */ @Transactional(readOnly = true) public Page listInferenceResultWithGeom( - @NotNull Long analyId, InferenceDetailDto.SearchGeoReq searchReq) { + @NotNull Long analyId, InferenceDetailDto.SearchGeoReq searchReq) { // 분석 ID 에 해당하는 dataids를 가져온다. List dataIds = - mapSheetAnalDataRepository.listAnalyGeom(analyId).stream() - .mapToLong(MapSheetAnalDataInferenceEntity::getId) - .boxed() - .toList(); + mapSheetAnalDataRepository.listAnalyGeom(analyId).stream() + .mapToLong(MapSheetAnalDataInferenceEntity::getId) + .boxed() + .toList(); // 해당데이터의 폴리곤데이터를 가져온다 Page mapSheetAnalDataGeomEntities = - mapSheetAnalDataRepository.listInferenceResultWithGeom(dataIds, searchReq); + mapSheetAnalDataRepository.listInferenceResultWithGeom(dataIds, searchReq); return mapSheetAnalDataGeomEntities.map(MapSheetAnalDataInferenceGeomEntity::toEntity); } @@ -229,14 +229,14 @@ public class InferenceResultCoreService { @Transactional(readOnly = true) public List listGetScenes5k(Long analyId) { List sceneCodes = - mapSheetAnalDataRepository.listAnalyGeom(analyId).stream() - .mapToLong(MapSheetAnalDataInferenceEntity::getMapSheetNum) - .mapToObj(String::valueOf) - .toList(); + mapSheetAnalDataRepository.listAnalyGeom(analyId).stream() + .mapToLong(MapSheetAnalDataInferenceEntity::getMapSheetNum) + .mapToObj(String::valueOf) + .toList(); return mapInkx5kRepository.listGetScenes5k(sceneCodes).stream() - .map(MapInkx5kEntity::toEntity) - .toList(); + .map(MapInkx5kEntity::toEntity) + .toList(); } /** @@ -246,9 +246,9 @@ public class InferenceResultCoreService { */ public void update(SaveInferenceAiDto request) { MapSheetLearnEntity entity = - mapSheetLearnRepository - .getInferenceResultByUuid(request.getUuid()) - .orElseThrow(EntityNotFoundException::new); + mapSheetLearnRepository + .getInferenceResultByUuid(request.getUuid()) + .orElseThrow(EntityNotFoundException::new); // M1/M2/M3 영역 업데이트 if (request.getType() != null) { @@ -270,46 +270,49 @@ public class InferenceResultCoreService { private void applyModelUpdate(MapSheetLearnEntity entity, SaveInferenceAiDto request) { switch (request.getType()) { - case "M1" -> applyModelFields( - request, - entity::setM1ModelBatchId, - entity::setM1ModelStartDttm, - entity::setM1ModelEndDttm, - entity::setM1PendingJobs, - entity::setM1RunningJobs, - entity::setM1CompletedJobs, - entity::setM1FailedJobs); - case "M2" -> applyModelFields( - request, - entity::setM2ModelBatchId, - entity::setM2ModelStartDttm, - entity::setM2ModelEndDttm, - entity::setM2PendingJobs, - entity::setM2RunningJobs, - entity::setM2CompletedJobs, - entity::setM2FailedJobs); - case "M3" -> applyModelFields( - request, - entity::setM3ModelBatchId, - entity::setM3ModelStartDttm, - entity::setM3ModelEndDttm, - entity::setM3PendingJobs, - entity::setM3RunningJobs, - entity::setM3CompletedJobs, - entity::setM3FailedJobs); + case "M1" -> + applyModelFields( + request, + entity::setM1ModelBatchId, + entity::setM1ModelStartDttm, + entity::setM1ModelEndDttm, + entity::setM1PendingJobs, + entity::setM1RunningJobs, + entity::setM1CompletedJobs, + entity::setM1FailedJobs); + case "M2" -> + applyModelFields( + request, + entity::setM2ModelBatchId, + entity::setM2ModelStartDttm, + entity::setM2ModelEndDttm, + entity::setM2PendingJobs, + entity::setM2RunningJobs, + entity::setM2CompletedJobs, + entity::setM2FailedJobs); + case "M3" -> + applyModelFields( + request, + entity::setM3ModelBatchId, + entity::setM3ModelStartDttm, + entity::setM3ModelEndDttm, + entity::setM3PendingJobs, + entity::setM3RunningJobs, + entity::setM3CompletedJobs, + entity::setM3FailedJobs); default -> throw new IllegalArgumentException("Unknown type: " + request.getType()); } } private void applyModelFields( - SaveInferenceAiDto request, - Consumer setBatchId, - Consumer setStart, - Consumer setEnd, - Consumer setPending, - Consumer setRunning, - Consumer setCompleted, - Consumer setFailed) { + SaveInferenceAiDto request, + Consumer setBatchId, + Consumer setStart, + Consumer setEnd, + Consumer setPending, + Consumer setRunning, + Consumer setCompleted, + Consumer setFailed) { applyIfNotNull(request.getBatchId(), setBatchId); applyIfNotNull(request.getModelStartDttm(), setStart); applyIfNotNull(request.getModelEndDttm(), setEnd); @@ -336,7 +339,7 @@ public class InferenceResultCoreService { public InferenceBatchSheet getInferenceResultByStatus(String status) { MapSheetLearnEntity entity = - mapSheetLearnRepository.getInferenceResultByStatus(status).orElse(null); + mapSheetLearnRepository.getInferenceResultByStatus(status).orElse(null); if (entity == null) { return null; @@ -382,7 +385,7 @@ public class InferenceResultCoreService { /** * @param compareYear 비교년도 - * @param targetYear 기준년도 + * @param targetYear 기준년도 * @return */ public Integer getLearnStage(Integer compareYear, Integer targetYear) { 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 87604269..d58f9b53 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 @@ -52,7 +52,7 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto BooleanBuilder builder = new BooleanBuilder(); NumberExpression statusOrder = - new CaseBuilder().when(mapSheetLearnEntity.status.eq("Y")).then(0).otherwise(1); + new CaseBuilder().when(mapSheetLearnEntity.status.eq("Y")).then(0).otherwise(1); // 국유인 반영 여부 if (StringUtils.isNotBlank(req.getApplyYn())) { @@ -66,10 +66,10 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto // 국유인 반영일 if (req.getStrtDttm() != null && req.getEndDttm() != null) { builder.and( - mapSheetLearnEntity - .applyDttm - .goe(DateRange.start(req.getStrtDttm())) - .and(mapSheetLearnEntity.applyDttm.lt(DateRange.end(req.getEndDttm())))); + mapSheetLearnEntity + .applyDttm + .goe(DateRange.start(req.getStrtDttm())) + .and(mapSheetLearnEntity.applyDttm.lt(DateRange.end(req.getEndDttm())))); } // 제목 @@ -78,21 +78,21 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto } List content = - queryFactory - .select(mapSheetLearnEntity) - .from(mapSheetLearnEntity) - .where(builder) - .offset(pageable.getOffset()) - .limit(pageable.getPageSize()) - .orderBy(mapSheetLearnEntity.id.desc()) - .fetch(); + queryFactory + .select(mapSheetLearnEntity) + .from(mapSheetLearnEntity) + .where(builder) + .offset(pageable.getOffset()) + .limit(pageable.getPageSize()) + .orderBy(mapSheetLearnEntity.id.desc()) + .fetch(); Long total = - queryFactory - .select(mapSheetLearnEntity.count()) - .from(mapSheetLearnEntity) - .where(builder) - .fetchOne(); + queryFactory + .select(mapSheetLearnEntity.count()) + .from(mapSheetLearnEntity) + .where(builder) + .fetchOne(); return new PageImpl<>(content, pageable, total == null ? 0L : total); } @@ -100,10 +100,10 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto @Override public Optional getInferenceResultByUuid(UUID uuid) { return Optional.ofNullable( - queryFactory - .selectFrom(mapSheetLearnEntity) - .where(mapSheetLearnEntity.uuid.eq(uuid)) - .fetchOne()); + queryFactory + .selectFrom(mapSheetLearnEntity) + .where(mapSheetLearnEntity.uuid.eq(uuid)) + .fetchOne()); } @Override @@ -112,41 +112,41 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto BooleanBuilder builder = new BooleanBuilder(); List latestIds = - queryFactory - .select(systemMetricEntity.id1.max()) - .from(systemMetricEntity) - .groupBy(systemMetricEntity.serverName) - .fetch(); + queryFactory + .select(systemMetricEntity.id1.max()) + .from(systemMetricEntity) + .groupBy(systemMetricEntity.serverName) + .fetch(); List latestGpuIds = - queryFactory - .select(gpuMetricEntity.id1.max()) - .from(gpuMetricEntity) - .groupBy(gpuMetricEntity.serverName) - .fetch(); + queryFactory + .select(gpuMetricEntity.id1.max()) + .from(gpuMetricEntity) + .groupBy(gpuMetricEntity.serverName) + .fetch(); List foundContent = - queryFactory - .select( - Projections.constructor( - InferenceServerStatusDto.class, - systemMetricEntity.serverName, - systemMetricEntity.cpuUser, - systemMetricEntity.cpuSystem, - systemMetricEntity.memused, - systemMetricEntity.kbmemused, - gpuMetricEntity.gpuUtil)) - .from(systemMetricEntity) - .leftJoin(gpuMetricEntity) - .on( - gpuMetricEntity - .id1 - .in(latestGpuIds) - .and(gpuMetricEntity.serverName.eq(systemMetricEntity.serverName))) - .where(systemMetricEntity.id1.in(latestIds)) // In 절 사용 - .orderBy(systemMetricEntity.serverName.asc()) - .limit(4) - .fetch(); + queryFactory + .select( + Projections.constructor( + InferenceServerStatusDto.class, + systemMetricEntity.serverName, + systemMetricEntity.cpuUser, + systemMetricEntity.cpuSystem, + systemMetricEntity.memused, + systemMetricEntity.kbmemused, + gpuMetricEntity.gpuUtil)) + .from(systemMetricEntity) + .leftJoin(gpuMetricEntity) + .on( + gpuMetricEntity + .id1 + .in(latestGpuIds) + .and(gpuMetricEntity.serverName.eq(systemMetricEntity.serverName))) + .where(systemMetricEntity.id1.in(latestIds)) // In 절 사용 + .orderBy(systemMetricEntity.serverName.asc()) + .limit(4) + .fetch(); return foundContent; } @@ -154,11 +154,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()); } /** @@ -177,46 +177,46 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto QModelMngEntity m3Model = new QModelMngEntity("m3Model"); InferenceStatusDetailDto foundContent = - queryFactory - .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.stage, - mapSheetLearnEntity.inferStartDttm, - mapSheetLearnEntity.inferEndDttm, - mapSheetLearnEntity.detectOption, - mapSheetLearnEntity.mapSheetScope, - m1Model.modelVer.as("model1Ver"), - m2Model.modelVer.as("model2Ver"), - m3Model.modelVer.as("model3Ver"))) - .from(mapSheetLearnEntity) - .leftJoin(m1Model) - .on(m1Model.uuid.eq(mapSheetLearnEntity.m1ModelUuid)) - .leftJoin(m2Model) - .on(m2Model.uuid.eq(mapSheetLearnEntity.m2ModelUuid)) - .leftJoin(m3Model) - .on(m3Model.uuid.eq(mapSheetLearnEntity.m3ModelUuid)) - .where(mapSheetLearnEntity.uuid.eq(uuid)) - .fetchOne(); + queryFactory + .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.stage, + mapSheetLearnEntity.inferStartDttm, + mapSheetLearnEntity.inferEndDttm, + mapSheetLearnEntity.detectOption, + mapSheetLearnEntity.mapSheetScope, + m1Model.modelVer.as("model1Ver"), + m2Model.modelVer.as("model2Ver"), + m3Model.modelVer.as("model3Ver"))) + .from(mapSheetLearnEntity) + .leftJoin(m1Model) + .on(m1Model.uuid.eq(mapSheetLearnEntity.m1ModelUuid)) + .leftJoin(m2Model) + .on(m2Model.uuid.eq(mapSheetLearnEntity.m2ModelUuid)) + .leftJoin(m3Model) + .on(m3Model.uuid.eq(mapSheetLearnEntity.m3ModelUuid)) + .where(mapSheetLearnEntity.uuid.eq(uuid)) + .fetchOne(); return foundContent; } @@ -227,30 +227,30 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto QModelMngEntity model = new QModelMngEntity("model"); InferenceProgressDto dto = - queryFactory - .select( - Projections.constructor( - InferenceProgressDto.class, - Projections.constructor( - InferenceProgressDto.pred_requests_areas.class, - mapSheetLearnEntity.compareYyyy, - mapSheetLearnEntity.targetYyyy, - mapSheetLearnEntity.modelComparePath, - mapSheetLearnEntity.modelTargetPath), - model.modelVer.as("modelVer"), - model.cdModelPath.as("cdModelPath"), - model.cdModelFileName.as("cdModelFileName"), - model.cdModelConfigPath.as("cdModelConfigPath"), - model.cdModelConfigFileName.as("cdModelConfigFileName"), - model.clsModelPath, - model.clsModelFileName, - model.clsModelVersion, - model.priority)) - .from(mapSheetLearnEntity) - .join(model) - .on(model.uuid.eq(modelUuid)) - .where(mapSheetLearnEntity.id.eq(id)) - .fetchOne(); + queryFactory + .select( + Projections.constructor( + InferenceProgressDto.class, + Projections.constructor( + InferenceProgressDto.pred_requests_areas.class, + mapSheetLearnEntity.compareYyyy, + mapSheetLearnEntity.targetYyyy, + mapSheetLearnEntity.modelComparePath, + mapSheetLearnEntity.modelTargetPath), + model.modelVer.as("modelVer"), + model.cdModelPath.as("cdModelPath"), + model.cdModelFileName.as("cdModelFileName"), + model.cdModelConfigPath.as("cdModelConfigPath"), + model.cdModelConfigFileName.as("cdModelConfigFileName"), + model.clsModelPath, + model.clsModelFileName, + model.clsModelVersion, + model.priority)) + .from(mapSheetLearnEntity) + .join(model) + .on(model.uuid.eq(modelUuid)) + .where(mapSheetLearnEntity.id.eq(id)) + .fetchOne(); return dto; } @@ -261,10 +261,10 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto */ public UUID getProcessing() { return queryFactory - .select(mapSheetLearnEntity.uuid) - .from(mapSheetLearnEntity) - .where(mapSheetLearnEntity.status.eq("IN_PROGRESS")) - .fetchOne(); + .select(mapSheetLearnEntity.uuid) + .from(mapSheetLearnEntity) + .where(mapSheetLearnEntity.status.eq("IN_PROGRESS")) + .fetchOne(); } @Override @@ -274,17 +274,17 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto entity.setTargetYyyy(targetYear); Integer stage = - queryFactory - .select(mapSheetLearnEntity.stage) - .from(mapSheetLearnEntity) - .where( - mapSheetLearnEntity - .compareYyyy - .eq(compareYear) - .and(mapSheetLearnEntity.targetYyyy.eq(targetYear))) - .orderBy(mapSheetLearnEntity.stage.desc()) - .limit(1) - .fetchOne(); + queryFactory + .select(mapSheetLearnEntity.stage) + .from(mapSheetLearnEntity) + .where( + mapSheetLearnEntity + .compareYyyy + .eq(compareYear) + .and(mapSheetLearnEntity.targetYyyy.eq(targetYear))) + .orderBy(mapSheetLearnEntity.stage.desc()) + .limit(1) + .fetchOne(); return stage == null ? 1 : stage + 1; } @@ -296,28 +296,28 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto 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(); + .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(); } @Override