From 23e8e9b27c4705d87eb765774c165225ac68984a Mon Sep 17 00:00:00 2001 From: teddy Date: Mon, 26 Jan 2026 15:17:28 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=94=EB=A1=A0=EA=B2=B0=EA=B3=BC=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=EC=A1=B0=ED=9A=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/InferenceResultCoreService.java | 6 +- .../MapSheetLearnRepositoryCustom.java | 3 +- .../MapSheetLearnRepositoryImpl.java | 73 +++---------------- 3 files changed, 14 insertions(+), 68 deletions(-) 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 ae415883..edcdaf2c 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 @@ -69,8 +69,8 @@ public class InferenceResultCoreService { * @return */ public Page getInferenceResultList(InferenceResultDto.SearchListReq req) { - Page list = mapSheetLearnRepository.getInferenceMgnResultList(req); - return list; + Page list = mapSheetLearnRepository.getInferenceMgnResultList(req); + return list.map(MapSheetLearnEntity::toDto); } /** @@ -110,7 +110,7 @@ public class InferenceResultCoreService { mapSheetLearnEntity.setDetectOption(req.getDetectOption()); mapSheetLearnEntity.setCreatedUid(userUtil.getId()); mapSheetLearnEntity.setMapSheetCnt(mapSheetName); - mapSheetLearnEntity.setDetectingCnt((long) detectingCnt); + mapSheetLearnEntity.setDetectingCnt(0L); // 회차는 국유인 반영할때 update로 변경됨 // mapSheetLearnEntity.setStage( // mapSheetLearnRepository.getLearnStage(req.getCompareYyyy(), req.getTargetYyyy())); diff --git a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryCustom.java b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryCustom.java index 5d0b8323..41ad1fa2 100644 --- a/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryCustom.java +++ b/src/main/java/com/kamco/cd/kamcoback/postgres/repository/Inference/MapSheetLearnRepositoryCustom.java @@ -10,7 +10,6 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceProgressDto; 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.InferenceStatusDetailDto; -import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList; import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity; import java.util.List; import java.util.Optional; @@ -19,7 +18,7 @@ import org.springframework.data.domain.Page; public interface MapSheetLearnRepositoryCustom { - Page getInferenceMgnResultList(InferenceResultDto.SearchListReq req); + Page getInferenceMgnResultList(InferenceResultDto.SearchListReq req); Optional getInferenceResultByUuid(UUID uuid); 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 3bccbccc..7a210a0f 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 @@ -24,10 +24,8 @@ 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.InferenceStatusDetailDto; import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.MapSheetScope; -import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList; import com.kamco.cd.kamcoback.model.service.ModelMngService; import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity; -import com.kamco.cd.kamcoback.postgres.entity.QInferenceResultsTestingEntity; import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalInferenceEntity; import com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity; import com.kamco.cd.kamcoback.postgres.entity.QModelMngEntity; @@ -62,7 +60,7 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto private final ModelMngService modelMngService; @Override - public Page getInferenceMgnResultList(InferenceResultDto.SearchListReq req) { + public Page getInferenceMgnResultList(InferenceResultDto.SearchListReq req) { Pageable pageable = req.toPageable(); BooleanBuilder builder = new BooleanBuilder(); @@ -92,75 +90,24 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto builder.and(mapSheetLearnEntity.title.containsIgnoreCase(req.getTitle())); } - QInferenceResultsTestingEntity irt = - QInferenceResultsTestingEntity.inferenceResultsTestingEntity; - BooleanExpression joinCond = - mapSheetLearnEntity - .m1ModelBatchId - .isNotNull() - .and(irt.batchId.eq(mapSheetLearnEntity.m1ModelBatchId)) - .or( - mapSheetLearnEntity - .m2ModelBatchId - .isNotNull() - .and(irt.batchId.eq(mapSheetLearnEntity.m2ModelBatchId))) - .or( - mapSheetLearnEntity - .m3ModelBatchId - .isNotNull() - .and(irt.batchId.eq(mapSheetLearnEntity.m3ModelBatchId))); - - List content = + List content = queryFactory - .select( - Projections.constructor( - ResultList.class, - mapSheetLearnEntity.uuid, - mapSheetLearnEntity.title, - mapSheetLearnEntity.stage, - mapSheetLearnEntity.status, - mapSheetLearnEntity.mapSheetCnt, - irt.seq.count(), - mapSheetLearnEntity.inferStartDttm, - mapSheetLearnEntity.inferEndDttm, - mapSheetLearnEntity.applyYn, - mapSheetLearnEntity.applyDttm, - mapSheetLearnEntity.compareYyyy, - mapSheetLearnEntity.targetYyyy, - mapSheetLearnEntity.uid)) + .select(mapSheetLearnEntity) .from(mapSheetLearnEntity) - .leftJoin(irt) - .on(joinCond) .where(builder) - .groupBy( - mapSheetLearnEntity.id, - mapSheetLearnEntity.uuid, - mapSheetLearnEntity.title, - mapSheetLearnEntity.stage, - mapSheetLearnEntity.status, - mapSheetLearnEntity.mapSheetCnt, - mapSheetLearnEntity.inferStartDttm, - mapSheetLearnEntity.inferEndDttm, - mapSheetLearnEntity.applyYn, - mapSheetLearnEntity.applyDttm, - mapSheetLearnEntity.compareYyyy, - mapSheetLearnEntity.targetYyyy, - mapSheetLearnEntity.uid) - .orderBy(mapSheetLearnEntity.id.desc()) .offset(pageable.getOffset()) .limit(pageable.getPageSize()) + .orderBy(mapSheetLearnEntity.id.desc()) .fetch(); Long total = - Optional.ofNullable( - queryFactory - .select(mapSheetLearnEntity.count()) - .from(mapSheetLearnEntity) - .where(builder) - .fetchOne()) - .orElse(0L); + queryFactory + .select(mapSheetLearnEntity.count()) + .from(mapSheetLearnEntity) + .where(builder) + .fetchOne(); - return new PageImpl<>(content, pageable, total); + return new PageImpl<>(content, pageable, total == null ? 0L : total); } @Override