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 51582171..51d231f6 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 @@ -24,7 +24,7 @@ import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntit import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearn5kEntity; import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity; import com.kamco.cd.kamcoback.postgres.repository.Inference.InferenceResultRepository; -import com.kamco.cd.kamcoback.postgres.repository.Inference.InferenceResultsTetingRepository; +import com.kamco.cd.kamcoback.postgres.repository.Inference.InferenceResultsTestingRepository; import com.kamco.cd.kamcoback.postgres.repository.Inference.MapSheetAnalDataInferenceRepository; import com.kamco.cd.kamcoback.postgres.repository.Inference.MapSheetLearn5kRepository; import com.kamco.cd.kamcoback.postgres.repository.Inference.MapSheetLearnRepository; @@ -55,7 +55,7 @@ public class InferenceResultCoreService { private final MapInkx5kRepository mapInkx5kRepository; private final MapSheetLearn5kRepository mapSheetLearn5kRepository; private final InferenceResultRepository inferenceResultRepository; - private final InferenceResultsTetingRepository inferenceResultsTetingRepository; + private final InferenceResultsTestingRepository inferenceResultsTetingRepository; private final EntityManager entityManager; private final UserUtil userUtil; @@ -174,9 +174,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; } @@ -197,7 +197,7 @@ public class InferenceResultCoreService { * @return */ public Page getInferenceResultGeomList( - Long id, InferenceDetailDto.SearchGeoReq searchGeoReq) { + Long id, InferenceDetailDto.SearchGeoReq searchGeoReq) { return mapSheetAnalDataRepository.getInferenceGeomList(id, searchGeoReq); } @@ -209,16 +209,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); } @@ -235,14 +235,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(); } /** @@ -253,9 +253,9 @@ public class InferenceResultCoreService { @Transactional 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) { @@ -277,49 +277,46 @@ 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); @@ -346,7 +343,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; @@ -436,9 +433,9 @@ public class InferenceResultCoreService { /** * 모델별 도엽별 실패여부 저장 * - * @param uuid learn 테이블 uuid + * @param uuid learn 테이블 uuid * @param failMapIds 실패한 도엽 목록 - * @param type 모델타입 + * @param type 모델타입 */ @Transactional public void saveFail5k(UUID uuid, List failMapIds, String type) { @@ -457,7 +454,7 @@ public class InferenceResultCoreService { */ public List getInferenceResults(List batchIds) { List list = - inferenceResultsTetingRepository.getInferenceResultList(batchIds); + inferenceResultsTetingRepository.getInferenceResultList(batchIds); return list.stream().map(InferenceResultsTestingDto.ShpDto::fromEntity).toList(); } } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTetingRepository.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTestingRepository.java similarity index 55% rename from src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTetingRepository.java rename to src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTestingRepository.java index 1ba732ac..d2ef9aad 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTetingRepository.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTestingRepository.java @@ -3,6 +3,8 @@ package com.kamco.cd.kamcoback.postgres.repository.Inference; import com.kamco.cd.kamcoback.postgres.entity.InferenceResultsTestingEntity; import org.springframework.data.jpa.repository.JpaRepository; -public interface InferenceResultsTetingRepository - extends JpaRepository, - InferenceResultsTetingRepositoryCustom {} +public interface InferenceResultsTestingRepository + extends JpaRepository, + InferenceResultsTestingRepositoryCustom { + +} diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTetingRepositoryCustom.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTestingRepositoryCustom.java similarity index 80% rename from src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTetingRepositoryCustom.java rename to src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTestingRepositoryCustom.java index 575b19fe..0e199f75 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTetingRepositoryCustom.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTestingRepositoryCustom.java @@ -3,7 +3,7 @@ package com.kamco.cd.kamcoback.postgres.repository.Inference; import com.kamco.cd.kamcoback.postgres.entity.InferenceResultsTestingEntity; import java.util.List; -public interface InferenceResultsTetingRepositoryCustom { +public interface InferenceResultsTestingRepositoryCustom { List getInferenceResultList(List batchIds); } diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTestingRepositoryImpl.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTestingRepositoryImpl.java index 2faa5ad2..dba35968 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTestingRepositoryImpl.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/InferenceResultsTestingRepositoryImpl.java @@ -11,16 +11,16 @@ import org.springframework.stereotype.Repository; @Repository @RequiredArgsConstructor public class InferenceResultsTestingRepositoryImpl - implements InferenceResultsTetingRepositoryCustom { + implements InferenceResultsTestingRepositoryCustom { private final JPAQueryFactory queryFactory; @Override public List getInferenceResultList(List batchIds) { return queryFactory - .select(inferenceResultsTestingEntity) - .from(inferenceResultsTestingEntity) - .where(inferenceResultsTestingEntity.batchId.in(batchIds)) - .fetch(); + .select(inferenceResultsTestingEntity) + .from(inferenceResultsTestingEntity) + .where(inferenceResultsTestingEntity.batchId.in(batchIds)) + .fetch(); } }