추론결과 목록조회 수정
This commit is contained in:
@@ -5,7 +5,10 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceResultShpDto;
|
|||||||
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.InferenceResultCoreService;
|
||||||
import com.kamco.cd.kamcoback.postgres.core.InferenceResultShpCoreService;
|
import com.kamco.cd.kamcoback.postgres.core.InferenceResultShpCoreService;
|
||||||
import com.kamco.cd.kamcoback.scheduler.service.ShpPipelineService;
|
import com.kamco.cd.kamcoback.scheduler.service.ShpPipelineService;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
import java.util.stream.Stream;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -46,10 +49,12 @@ public class InferenceResultShpService {
|
|||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Long m1BatchId = dto.getM1ModelBatchId();
|
|
||||||
Long m2BatchId = dto.getM2ModelBatchId();
|
String batchId =
|
||||||
Long m3BatchId = dto.getM3ModelBatchId();
|
Stream.of(dto.getM1ModelBatchId(), dto.getM2ModelBatchId(), dto.getM3ModelBatchId())
|
||||||
String batchId = m1BatchId + "," + m2BatchId + "," + m3BatchId;
|
.filter(Objects::nonNull)
|
||||||
|
.map(String::valueOf)
|
||||||
|
.collect(Collectors.joining(","));
|
||||||
|
|
||||||
// shp 파일 비동기 생성
|
// shp 파일 비동기 생성
|
||||||
shpPipelineService.runPipeline(jarPath, datasetDir, batchId, dto.getUid());
|
shpPipelineService.runPipeline(jarPath, datasetDir, batchId, dto.getUid());
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ public class InferenceResultCoreService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Page<ResultList> getInferenceResultList(InferenceResultDto.SearchListReq req) {
|
public Page<ResultList> getInferenceResultList(InferenceResultDto.SearchListReq req) {
|
||||||
Page<MapSheetLearnEntity> list = mapSheetLearnRepository.getInferenceMgnResultList(req);
|
Page<ResultList> list = mapSheetLearnRepository.getInferenceMgnResultList(req);
|
||||||
return list.map(MapSheetLearnEntity::toDto);
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -110,8 +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);
|
||||||
// 도엽건수가 아니라 실제 탐지건수(polygon), 추론 1분 배치에서 업데이트
|
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,6 +10,7 @@ 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;
|
||||||
@@ -18,7 +19,7 @@ import org.springframework.data.domain.Page;
|
|||||||
|
|
||||||
public interface MapSheetLearnRepositoryCustom {
|
public interface MapSheetLearnRepositoryCustom {
|
||||||
|
|
||||||
Page<MapSheetLearnEntity> getInferenceMgnResultList(InferenceResultDto.SearchListReq req);
|
Page<ResultList> getInferenceMgnResultList(InferenceResultDto.SearchListReq req);
|
||||||
|
|
||||||
Optional<MapSheetLearnEntity> getInferenceResultByUuid(UUID uuid);
|
Optional<MapSheetLearnEntity> getInferenceResultByUuid(UUID uuid);
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,10 @@ 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;
|
||||||
@@ -60,7 +62,7 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
private final ModelMngService modelMngService;
|
private final ModelMngService modelMngService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<MapSheetLearnEntity> getInferenceMgnResultList(InferenceResultDto.SearchListReq req) {
|
public Page<ResultList> getInferenceMgnResultList(InferenceResultDto.SearchListReq req) {
|
||||||
Pageable pageable = req.toPageable();
|
Pageable pageable = req.toPageable();
|
||||||
BooleanBuilder builder = new BooleanBuilder();
|
BooleanBuilder builder = new BooleanBuilder();
|
||||||
|
|
||||||
@@ -90,24 +92,75 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
builder.and(mapSheetLearnEntity.title.containsIgnoreCase(req.getTitle()));
|
builder.and(mapSheetLearnEntity.title.containsIgnoreCase(req.getTitle()));
|
||||||
}
|
}
|
||||||
|
|
||||||
List<MapSheetLearnEntity> content =
|
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<ResultList> content =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(mapSheetLearnEntity)
|
.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))
|
||||||
.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 == null ? 0L : total);
|
return new PageImpl<>(content, pageable, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user