Merge pull request 'feat/infer_dev_260107' (#340) from feat/infer_dev_260107 into develop
Reviewed-on: https://kamco.gitea.gs.dabeeo.com/dabeeo/kamco-dabeeo-backoffice/pulls/340
This commit is contained in:
@@ -58,7 +58,7 @@ public class InferenceResultCoreService {
|
||||
private final MapInkx5kRepository mapInkx5kRepository;
|
||||
private final MapSheetLearn5kRepository mapSheetLearn5kRepository;
|
||||
private final InferenceResultRepository inferenceResultRepository;
|
||||
private final InferenceResultsTestingRepository inferenceResultsTetingRepository;
|
||||
private final InferenceResultsTestingRepository inferenceResultsTestingRepository;
|
||||
private final EntityManager entityManager;
|
||||
private final UserUtil userUtil;
|
||||
|
||||
@@ -110,7 +110,8 @@ public class InferenceResultCoreService {
|
||||
mapSheetLearnEntity.setDetectOption(req.getDetectOption());
|
||||
mapSheetLearnEntity.setCreatedUid(userUtil.getId());
|
||||
mapSheetLearnEntity.setMapSheetCnt(mapSheetName);
|
||||
mapSheetLearnEntity.setDetectingCnt((long) detectingCnt);
|
||||
// 도엽건수가 아니라 실제 탐지건수(polygon), 추론 1분 배치에서 업데이트
|
||||
mapSheetLearnEntity.setDetectingCnt(0L);
|
||||
// 회차는 국유인 반영할때 update로 변경됨
|
||||
// mapSheetLearnEntity.setStage(
|
||||
// mapSheetLearnRepository.getLearnStage(req.getCompareYyyy(), req.getTargetYyyy()));
|
||||
@@ -263,6 +264,14 @@ public class InferenceResultCoreService {
|
||||
applyModelUpdate(entity, request);
|
||||
}
|
||||
|
||||
List<Long> batchIds = new ArrayList<>();
|
||||
batchIds.add(entity.getM1ModelBatchId());
|
||||
batchIds.add(entity.getM2ModelBatchId());
|
||||
batchIds.add(entity.getM3ModelBatchId());
|
||||
|
||||
// testing 추론결과 테이블 조회하여 탐지 개수 업데이트
|
||||
Long testing = getInferenceResultCnt(batchIds);
|
||||
|
||||
// 공통 영역 업데이트
|
||||
applyIfNotNull(request.getRunningModelType(), entity::setRunningModelType);
|
||||
applyIfNotNull(request.getInferStartDttm(), entity::setInferStartDttm);
|
||||
@@ -272,6 +281,7 @@ public class InferenceResultCoreService {
|
||||
applyIfNotNull(request.getDetectEndCnt(), entity::setDetectEndCnt);
|
||||
applyIfNotNull(request.getStatus(), entity::setStatus);
|
||||
applyIfNotNull(request.getUpdateUid(), entity::setUpdatedUid);
|
||||
applyIfNotNull(testing, entity::setDetectingCnt);
|
||||
|
||||
entity.setUpdatedDttm(ZonedDateTime.now());
|
||||
}
|
||||
@@ -481,10 +491,14 @@ public class InferenceResultCoreService {
|
||||
*/
|
||||
public List<InferenceResultsTestingDto.ShpDto> getInferenceResults(List<Long> batchIds) {
|
||||
List<InferenceResultsTestingEntity> list =
|
||||
inferenceResultsTetingRepository.getInferenceResultList(batchIds);
|
||||
inferenceResultsTestingRepository.getInferenceResultList(batchIds);
|
||||
return list.stream().map(InferenceResultsTestingDto.ShpDto::fromEntity).toList();
|
||||
}
|
||||
|
||||
public Long getInferenceResultCnt(List<Long> batchIds) {
|
||||
return inferenceResultsTestingRepository.getInferenceResultCnt(batchIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* uid 조회
|
||||
*
|
||||
|
||||
@@ -6,4 +6,6 @@ import java.util.List;
|
||||
public interface InferenceResultsTestingRepositoryCustom {
|
||||
|
||||
List<InferenceResultsTestingEntity> getInferenceResultList(List<Long> batchIds);
|
||||
|
||||
Long getInferenceResultCnt(List<Long> batchIds);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,31 @@ public class InferenceResultsTestingRepositoryImpl
|
||||
return queryFactory
|
||||
.select(inferenceResultsTestingEntity)
|
||||
.from(inferenceResultsTestingEntity)
|
||||
.where(inferenceResultsTestingEntity.batchId.in(batchIds))
|
||||
.where(
|
||||
inferenceResultsTestingEntity
|
||||
.batchId
|
||||
.in(batchIds)
|
||||
.and(inferenceResultsTestingEntity.afterC.isNotNull())
|
||||
.and(inferenceResultsTestingEntity.afterP.isNotNull()))
|
||||
.fetch();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getInferenceResultCnt(List<Long> batchIds) {
|
||||
if (batchIds == null || batchIds.isEmpty()) {
|
||||
return 0L;
|
||||
}
|
||||
|
||||
Long cnt =
|
||||
queryFactory
|
||||
.select(inferenceResultsTestingEntity.count())
|
||||
.from(inferenceResultsTestingEntity)
|
||||
.where(
|
||||
inferenceResultsTestingEntity.batchId.in(batchIds),
|
||||
inferenceResultsTestingEntity.afterC.isNotNull(),
|
||||
inferenceResultsTestingEntity.afterP.isNotNull())
|
||||
.fetchOne();
|
||||
|
||||
return cnt == null ? 0L : cnt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,7 +388,11 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
mapSheetMngHstEntity.syncCheckTifFileName))
|
||||
.from(mapSheetMngHstEntity)
|
||||
.innerJoin(mapInkx5kEntity)
|
||||
.on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
|
||||
.on(
|
||||
mapSheetMngHstEntity
|
||||
.mapSheetNum
|
||||
.eq(mapInkx5kEntity.mapidcdNo)
|
||||
.and(mapInkx5kEntity.useInference.eq(CommonUseStatus.USE)))
|
||||
.where(whereBuilder)
|
||||
.orderBy(mapSheetMngHstEntity.createdDate.desc())
|
||||
.offset(pageable.getOffset())
|
||||
@@ -400,7 +404,11 @@ public class MapSheetMngRepositoryImpl extends QuerydslRepositorySupport
|
||||
.select(mapSheetMngHstEntity.hstUid.count())
|
||||
.from(mapSheetMngHstEntity)
|
||||
.innerJoin(mapInkx5kEntity)
|
||||
.on(mapSheetMngHstEntity.mapSheetNum.eq(mapInkx5kEntity.mapidcdNo))
|
||||
.on(
|
||||
mapSheetMngHstEntity
|
||||
.mapSheetNum
|
||||
.eq(mapInkx5kEntity.mapidcdNo)
|
||||
.and(mapInkx5kEntity.useInference.eq(CommonUseStatus.USE)))
|
||||
.where(whereBuilder)
|
||||
.fetchOne();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user