|
|
|
@@ -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.MapSheetLearn5kEntity;
|
|
|
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearnEntity;
|
|
|
|
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.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.MapSheetAnalDataInferenceRepository;
|
|
|
|
import com.kamco.cd.kamcoback.postgres.repository.Inference.MapSheetLearn5kRepository;
|
|
|
|
import com.kamco.cd.kamcoback.postgres.repository.Inference.MapSheetLearn5kRepository;
|
|
|
|
import com.kamco.cd.kamcoback.postgres.repository.Inference.MapSheetLearnRepository;
|
|
|
|
import com.kamco.cd.kamcoback.postgres.repository.Inference.MapSheetLearnRepository;
|
|
|
|
@@ -55,7 +55,7 @@ public class InferenceResultCoreService {
|
|
|
|
private final MapInkx5kRepository mapInkx5kRepository;
|
|
|
|
private final MapInkx5kRepository mapInkx5kRepository;
|
|
|
|
private final MapSheetLearn5kRepository mapSheetLearn5kRepository;
|
|
|
|
private final MapSheetLearn5kRepository mapSheetLearn5kRepository;
|
|
|
|
private final InferenceResultRepository inferenceResultRepository;
|
|
|
|
private final InferenceResultRepository inferenceResultRepository;
|
|
|
|
private final InferenceResultsTetingRepository inferenceResultsTetingRepository;
|
|
|
|
private final InferenceResultsTestingRepository inferenceResultsTetingRepository;
|
|
|
|
private final EntityManager entityManager;
|
|
|
|
private final EntityManager entityManager;
|
|
|
|
private final UserUtil userUtil;
|
|
|
|
private final UserUtil userUtil;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -174,9 +174,9 @@ public class InferenceResultCoreService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public InferenceDetailDto.AnalResSummary getInferenceResultSummary(Long id) {
|
|
|
|
public InferenceDetailDto.AnalResSummary getInferenceResultSummary(Long id) {
|
|
|
|
InferenceDetailDto.AnalResSummary summary =
|
|
|
|
InferenceDetailDto.AnalResSummary summary =
|
|
|
|
mapSheetAnalDataRepository
|
|
|
|
mapSheetAnalDataRepository
|
|
|
|
.getInferenceResultSummary(id)
|
|
|
|
.getInferenceResultSummary(id)
|
|
|
|
.orElseThrow(() -> new EntityNotFoundException("요약정보를 찾을 수 없습니다. " + id));
|
|
|
|
.orElseThrow(() -> new EntityNotFoundException("요약정보를 찾을 수 없습니다. " + id));
|
|
|
|
return summary;
|
|
|
|
return summary;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -197,7 +197,7 @@ public class InferenceResultCoreService {
|
|
|
|
* @return
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public Page<InferenceDetailDto.Geom> getInferenceResultGeomList(
|
|
|
|
public Page<InferenceDetailDto.Geom> getInferenceResultGeomList(
|
|
|
|
Long id, InferenceDetailDto.SearchGeoReq searchGeoReq) {
|
|
|
|
Long id, InferenceDetailDto.SearchGeoReq searchGeoReq) {
|
|
|
|
return mapSheetAnalDataRepository.getInferenceGeomList(id, searchGeoReq);
|
|
|
|
return mapSheetAnalDataRepository.getInferenceGeomList(id, searchGeoReq);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -209,16 +209,16 @@ public class InferenceResultCoreService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
public Page<InferenceDetailDto.DetailListEntity> listInferenceResultWithGeom(
|
|
|
|
public Page<InferenceDetailDto.DetailListEntity> listInferenceResultWithGeom(
|
|
|
|
@NotNull Long analyId, InferenceDetailDto.SearchGeoReq searchReq) {
|
|
|
|
@NotNull Long analyId, InferenceDetailDto.SearchGeoReq searchReq) {
|
|
|
|
// 분석 ID 에 해당하는 dataids를 가져온다.
|
|
|
|
// 분석 ID 에 해당하는 dataids를 가져온다.
|
|
|
|
List<Long> dataIds =
|
|
|
|
List<Long> dataIds =
|
|
|
|
mapSheetAnalDataRepository.listAnalyGeom(analyId).stream()
|
|
|
|
mapSheetAnalDataRepository.listAnalyGeom(analyId).stream()
|
|
|
|
.mapToLong(MapSheetAnalDataInferenceEntity::getId)
|
|
|
|
.mapToLong(MapSheetAnalDataInferenceEntity::getId)
|
|
|
|
.boxed()
|
|
|
|
.boxed()
|
|
|
|
.toList();
|
|
|
|
.toList();
|
|
|
|
// 해당데이터의 폴리곤데이터를 가져온다
|
|
|
|
// 해당데이터의 폴리곤데이터를 가져온다
|
|
|
|
Page<MapSheetAnalDataInferenceGeomEntity> mapSheetAnalDataGeomEntities =
|
|
|
|
Page<MapSheetAnalDataInferenceGeomEntity> mapSheetAnalDataGeomEntities =
|
|
|
|
mapSheetAnalDataRepository.listInferenceResultWithGeom(dataIds, searchReq);
|
|
|
|
mapSheetAnalDataRepository.listInferenceResultWithGeom(dataIds, searchReq);
|
|
|
|
return mapSheetAnalDataGeomEntities.map(MapSheetAnalDataInferenceGeomEntity::toEntity);
|
|
|
|
return mapSheetAnalDataGeomEntities.map(MapSheetAnalDataInferenceGeomEntity::toEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -235,14 +235,14 @@ public class InferenceResultCoreService {
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
@Transactional(readOnly = true)
|
|
|
|
public List<MapSheet> listGetScenes5k(Long analyId) {
|
|
|
|
public List<MapSheet> listGetScenes5k(Long analyId) {
|
|
|
|
List<String> sceneCodes =
|
|
|
|
List<String> sceneCodes =
|
|
|
|
mapSheetAnalDataRepository.listAnalyGeom(analyId).stream()
|
|
|
|
mapSheetAnalDataRepository.listAnalyGeom(analyId).stream()
|
|
|
|
.mapToLong(MapSheetAnalDataInferenceEntity::getMapSheetNum)
|
|
|
|
.mapToLong(MapSheetAnalDataInferenceEntity::getMapSheetNum)
|
|
|
|
.mapToObj(String::valueOf)
|
|
|
|
.mapToObj(String::valueOf)
|
|
|
|
.toList();
|
|
|
|
.toList();
|
|
|
|
|
|
|
|
|
|
|
|
return mapInkx5kRepository.listGetScenes5k(sceneCodes).stream()
|
|
|
|
return mapInkx5kRepository.listGetScenes5k(sceneCodes).stream()
|
|
|
|
.map(MapInkx5kEntity::toEntity)
|
|
|
|
.map(MapInkx5kEntity::toEntity)
|
|
|
|
.toList();
|
|
|
|
.toList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@@ -253,9 +253,9 @@ public class InferenceResultCoreService {
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
public void update(SaveInferenceAiDto request) {
|
|
|
|
public void update(SaveInferenceAiDto request) {
|
|
|
|
MapSheetLearnEntity entity =
|
|
|
|
MapSheetLearnEntity entity =
|
|
|
|
mapSheetLearnRepository
|
|
|
|
mapSheetLearnRepository
|
|
|
|
.getInferenceResultByUuid(request.getUuid())
|
|
|
|
.getInferenceResultByUuid(request.getUuid())
|
|
|
|
.orElseThrow(EntityNotFoundException::new);
|
|
|
|
.orElseThrow(EntityNotFoundException::new);
|
|
|
|
|
|
|
|
|
|
|
|
// M1/M2/M3 영역 업데이트
|
|
|
|
// M1/M2/M3 영역 업데이트
|
|
|
|
if (request.getType() != null) {
|
|
|
|
if (request.getType() != null) {
|
|
|
|
@@ -277,49 +277,46 @@ public class InferenceResultCoreService {
|
|
|
|
|
|
|
|
|
|
|
|
private void applyModelUpdate(MapSheetLearnEntity entity, SaveInferenceAiDto request) {
|
|
|
|
private void applyModelUpdate(MapSheetLearnEntity entity, SaveInferenceAiDto request) {
|
|
|
|
switch (request.getType()) {
|
|
|
|
switch (request.getType()) {
|
|
|
|
case "M1" ->
|
|
|
|
case "M1" -> applyModelFields(
|
|
|
|
applyModelFields(
|
|
|
|
request,
|
|
|
|
request,
|
|
|
|
entity::setM1ModelBatchId,
|
|
|
|
entity::setM1ModelBatchId,
|
|
|
|
entity::setM1ModelStartDttm,
|
|
|
|
entity::setM1ModelStartDttm,
|
|
|
|
entity::setM1ModelEndDttm,
|
|
|
|
entity::setM1ModelEndDttm,
|
|
|
|
entity::setM1PendingJobs,
|
|
|
|
entity::setM1PendingJobs,
|
|
|
|
entity::setM1RunningJobs,
|
|
|
|
entity::setM1RunningJobs,
|
|
|
|
entity::setM1CompletedJobs,
|
|
|
|
entity::setM1CompletedJobs,
|
|
|
|
entity::setM1FailedJobs);
|
|
|
|
entity::setM1FailedJobs);
|
|
|
|
case "M2" -> applyModelFields(
|
|
|
|
case "M2" ->
|
|
|
|
request,
|
|
|
|
applyModelFields(
|
|
|
|
entity::setM2ModelBatchId,
|
|
|
|
request,
|
|
|
|
entity::setM2ModelStartDttm,
|
|
|
|
entity::setM2ModelBatchId,
|
|
|
|
entity::setM2ModelEndDttm,
|
|
|
|
entity::setM2ModelStartDttm,
|
|
|
|
entity::setM2PendingJobs,
|
|
|
|
entity::setM2ModelEndDttm,
|
|
|
|
entity::setM2RunningJobs,
|
|
|
|
entity::setM2PendingJobs,
|
|
|
|
entity::setM2CompletedJobs,
|
|
|
|
entity::setM2RunningJobs,
|
|
|
|
entity::setM2FailedJobs);
|
|
|
|
entity::setM2CompletedJobs,
|
|
|
|
case "M3" -> applyModelFields(
|
|
|
|
entity::setM2FailedJobs);
|
|
|
|
request,
|
|
|
|
case "M3" ->
|
|
|
|
entity::setM3ModelBatchId,
|
|
|
|
applyModelFields(
|
|
|
|
entity::setM3ModelStartDttm,
|
|
|
|
request,
|
|
|
|
entity::setM3ModelEndDttm,
|
|
|
|
entity::setM3ModelBatchId,
|
|
|
|
entity::setM3PendingJobs,
|
|
|
|
entity::setM3ModelStartDttm,
|
|
|
|
entity::setM3RunningJobs,
|
|
|
|
entity::setM3ModelEndDttm,
|
|
|
|
entity::setM3CompletedJobs,
|
|
|
|
entity::setM3PendingJobs,
|
|
|
|
entity::setM3FailedJobs);
|
|
|
|
entity::setM3RunningJobs,
|
|
|
|
|
|
|
|
entity::setM3CompletedJobs,
|
|
|
|
|
|
|
|
entity::setM3FailedJobs);
|
|
|
|
|
|
|
|
default -> throw new IllegalArgumentException("Unknown type: " + request.getType());
|
|
|
|
default -> throw new IllegalArgumentException("Unknown type: " + request.getType());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void applyModelFields(
|
|
|
|
private void applyModelFields(
|
|
|
|
SaveInferenceAiDto request,
|
|
|
|
SaveInferenceAiDto request,
|
|
|
|
Consumer<Long> setBatchId,
|
|
|
|
Consumer<Long> setBatchId,
|
|
|
|
Consumer<ZonedDateTime> setStart,
|
|
|
|
Consumer<ZonedDateTime> setStart,
|
|
|
|
Consumer<ZonedDateTime> setEnd,
|
|
|
|
Consumer<ZonedDateTime> setEnd,
|
|
|
|
Consumer<Integer> setPending,
|
|
|
|
Consumer<Integer> setPending,
|
|
|
|
Consumer<Integer> setRunning,
|
|
|
|
Consumer<Integer> setRunning,
|
|
|
|
Consumer<Integer> setCompleted,
|
|
|
|
Consumer<Integer> setCompleted,
|
|
|
|
Consumer<Integer> setFailed) {
|
|
|
|
Consumer<Integer> setFailed) {
|
|
|
|
applyIfNotNull(request.getBatchId(), setBatchId);
|
|
|
|
applyIfNotNull(request.getBatchId(), setBatchId);
|
|
|
|
applyIfNotNull(request.getModelStartDttm(), setStart);
|
|
|
|
applyIfNotNull(request.getModelStartDttm(), setStart);
|
|
|
|
applyIfNotNull(request.getModelEndDttm(), setEnd);
|
|
|
|
applyIfNotNull(request.getModelEndDttm(), setEnd);
|
|
|
|
@@ -346,7 +343,7 @@ public class InferenceResultCoreService {
|
|
|
|
|
|
|
|
|
|
|
|
public InferenceBatchSheet getInferenceResultByStatus(String status) {
|
|
|
|
public InferenceBatchSheet getInferenceResultByStatus(String status) {
|
|
|
|
MapSheetLearnEntity entity =
|
|
|
|
MapSheetLearnEntity entity =
|
|
|
|
mapSheetLearnRepository.getInferenceResultByStatus(status).orElse(null);
|
|
|
|
mapSheetLearnRepository.getInferenceResultByStatus(status).orElse(null);
|
|
|
|
|
|
|
|
|
|
|
|
if (entity == null) {
|
|
|
|
if (entity == null) {
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
@@ -436,9 +433,9 @@ public class InferenceResultCoreService {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 모델별 도엽별 실패여부 저장
|
|
|
|
* 모델별 도엽별 실패여부 저장
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param uuid learn 테이블 uuid
|
|
|
|
* @param uuid learn 테이블 uuid
|
|
|
|
* @param failMapIds 실패한 도엽 목록
|
|
|
|
* @param failMapIds 실패한 도엽 목록
|
|
|
|
* @param type 모델타입
|
|
|
|
* @param type 모델타입
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
public void saveFail5k(UUID uuid, List<Long> failMapIds, String type) {
|
|
|
|
public void saveFail5k(UUID uuid, List<Long> failMapIds, String type) {
|
|
|
|
@@ -457,7 +454,7 @@ public class InferenceResultCoreService {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public List<InferenceResultsTestingDto.ShpDto> getInferenceResults(List<Long> batchIds) {
|
|
|
|
public List<InferenceResultsTestingDto.ShpDto> getInferenceResults(List<Long> batchIds) {
|
|
|
|
List<InferenceResultsTestingEntity> list =
|
|
|
|
List<InferenceResultsTestingEntity> list =
|
|
|
|
inferenceResultsTetingRepository.getInferenceResultList(batchIds);
|
|
|
|
inferenceResultsTetingRepository.getInferenceResultList(batchIds);
|
|
|
|
return list.stream().map(InferenceResultsTestingDto.ShpDto::fromEntity).toList();
|
|
|
|
return list.stream().map(InferenceResultsTestingDto.ShpDto::fromEntity).toList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|