Merge pull request '추론결과 목록조회 수정' (#348) from feat/infer_dev_260107 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/348
This commit is contained in:
@@ -69,8 +69,8 @@ public class InferenceResultCoreService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Page<ResultList> getInferenceResultList(InferenceResultDto.SearchListReq req) {
|
public Page<ResultList> getInferenceResultList(InferenceResultDto.SearchListReq req) {
|
||||||
Page<ResultList> list = mapSheetLearnRepository.getInferenceMgnResultList(req);
|
Page<MapSheetLearnEntity> list = mapSheetLearnRepository.getInferenceMgnResultList(req);
|
||||||
return list;
|
return list.map(MapSheetLearnEntity::toDto);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -110,7 +110,7 @@ public class InferenceResultCoreService {
|
|||||||
mapSheetLearnEntity.setDetectOption(req.getDetectOption());
|
mapSheetLearnEntity.setDetectOption(req.getDetectOption());
|
||||||
mapSheetLearnEntity.setCreatedUid(userUtil.getId());
|
mapSheetLearnEntity.setCreatedUid(userUtil.getId());
|
||||||
mapSheetLearnEntity.setMapSheetCnt(mapSheetName);
|
mapSheetLearnEntity.setMapSheetCnt(mapSheetName);
|
||||||
mapSheetLearnEntity.setDetectingCnt((long) detectingCnt);
|
mapSheetLearnEntity.setDetectingCnt(0L);
|
||||||
// 회차는 국유인 반영할때 update로 변경됨
|
// 회차는 국유인 반영할때 update로 변경됨
|
||||||
// mapSheetLearnEntity.setStage(
|
// mapSheetLearnEntity.setStage(
|
||||||
// mapSheetLearnRepository.getLearnStage(req.getCompareYyyy(), req.getTargetYyyy()));
|
// mapSheetLearnRepository.getLearnStage(req.getCompareYyyy(), req.getTargetYyyy()));
|
||||||
|
|||||||
@@ -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;
|
||||||
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;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -19,7 +18,7 @@ import org.springframework.data.domain.Page;
|
|||||||
|
|
||||||
public interface MapSheetLearnRepositoryCustom {
|
public interface MapSheetLearnRepositoryCustom {
|
||||||
|
|
||||||
Page<ResultList> getInferenceMgnResultList(InferenceResultDto.SearchListReq req);
|
Page<MapSheetLearnEntity> getInferenceMgnResultList(InferenceResultDto.SearchListReq req);
|
||||||
|
|
||||||
Optional<MapSheetLearnEntity> getInferenceResultByUuid(UUID uuid);
|
Optional<MapSheetLearnEntity> getInferenceResultByUuid(UUID uuid);
|
||||||
|
|
||||||
|
|||||||
@@ -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.InferenceServerStatusDto;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
|
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.MapSheetScope;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
|
||||||
import com.kamco.cd.kamcoback.model.service.ModelMngService;
|
import com.kamco.cd.kamcoback.model.service.ModelMngService;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
|
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.QMapSheetAnalInferenceEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.QModelMngEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.QModelMngEntity;
|
||||||
@@ -62,7 +60,7 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
private final ModelMngService modelMngService;
|
private final ModelMngService modelMngService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<ResultList> getInferenceMgnResultList(InferenceResultDto.SearchListReq req) {
|
public Page<MapSheetLearnEntity> getInferenceMgnResultList(InferenceResultDto.SearchListReq req) {
|
||||||
Pageable pageable = req.toPageable();
|
Pageable pageable = req.toPageable();
|
||||||
BooleanBuilder builder = new BooleanBuilder();
|
BooleanBuilder builder = new BooleanBuilder();
|
||||||
|
|
||||||
@@ -92,75 +90,24 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
builder.and(mapSheetLearnEntity.title.containsIgnoreCase(req.getTitle()));
|
builder.and(mapSheetLearnEntity.title.containsIgnoreCase(req.getTitle()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QInferenceResultsTestingEntity irt =
|
List<MapSheetLearnEntity> content =
|
||||||
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<ResultList> content =
|
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(mapSheetLearnEntity)
|
||||||
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))
|
|
||||||
.from(mapSheetLearnEntity)
|
.from(mapSheetLearnEntity)
|
||||||
.leftJoin(irt)
|
|
||||||
.on(joinCond)
|
|
||||||
.where(builder)
|
.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())
|
.offset(pageable.getOffset())
|
||||||
.limit(pageable.getPageSize())
|
.limit(pageable.getPageSize())
|
||||||
|
.orderBy(mapSheetLearnEntity.id.desc())
|
||||||
.fetch();
|
.fetch();
|
||||||
|
|
||||||
Long total =
|
Long total =
|
||||||
Optional.ofNullable(
|
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(mapSheetLearnEntity.count())
|
.select(mapSheetLearnEntity.count())
|
||||||
.from(mapSheetLearnEntity)
|
.from(mapSheetLearnEntity)
|
||||||
.where(builder)
|
.where(builder)
|
||||||
.fetchOne())
|
.fetchOne();
|
||||||
.orElse(0L);
|
|
||||||
|
|
||||||
return new PageImpl<>(content, pageable, total);
|
return new PageImpl<>(content, pageable, total == null ? 0L : total);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user