추론실행 shp파일 생성 jar
This commit is contained in:
@@ -15,13 +15,16 @@ import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceServerSt
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.InferenceStatusDetailDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.ResultList;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.SaveInferenceAiDto;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultsTestingDto;
|
||||
import com.kamco.cd.kamcoback.mapsheet.dto.MapSheetMngDto.MngListDto;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.InferenceResultsTestingEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetLearn5kEntity;
|
||||
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.InferenceResultsTetingRepository;
|
||||
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.MapSheetLearnRepository;
|
||||
@@ -52,7 +55,7 @@ public class InferenceResultCoreService {
|
||||
private final MapInkx5kRepository mapInkx5kRepository;
|
||||
private final MapSheetLearn5kRepository mapSheetLearn5kRepository;
|
||||
private final InferenceResultRepository inferenceResultRepository;
|
||||
|
||||
private final InferenceResultsTetingRepository inferenceResultsTetingRepository;
|
||||
private final EntityManager entityManager;
|
||||
private final UserUtil userUtil;
|
||||
|
||||
@@ -444,4 +447,16 @@ public class InferenceResultCoreService {
|
||||
public Long getInferenceLearnIdByUuid(UUID uuid) {
|
||||
return inferenceResultRepository.getInferenceLearnIdByUuid(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 추론 결과 shp파일 생성위해서 조회
|
||||
*
|
||||
* @param batchIds
|
||||
* @return
|
||||
*/
|
||||
public List<InferenceResultsTestingDto.ShpDto> getInferenceResults(List<Long> batchIds) {
|
||||
List<InferenceResultsTestingEntity> list =
|
||||
inferenceResultsTetingRepository.getInferenceResultList(batchIds);
|
||||
return list.stream().map(InferenceResultsTestingDto.ShpDto::fromEntity).toList();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.kamco.cd.kamcoback.postgres.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.ZonedDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.locationtech.jts.geom.Geometry;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "inference_results_testing")
|
||||
public class InferenceResultsTestingEntity {
|
||||
|
||||
@Column(name = "probability")
|
||||
private Double probability;
|
||||
|
||||
@Column(name = "before_year")
|
||||
private Long beforeYear;
|
||||
|
||||
@Column(name = "after_year")
|
||||
private Long afterYear;
|
||||
|
||||
@Column(name = "map_id", length = Integer.MAX_VALUE)
|
||||
private String mapId;
|
||||
|
||||
@Column(name = "source_1", length = Integer.MAX_VALUE)
|
||||
private String source1;
|
||||
|
||||
@Column(name = "source_2", length = Integer.MAX_VALUE)
|
||||
private String source2;
|
||||
|
||||
@Column(name = "model_version", length = Integer.MAX_VALUE)
|
||||
private String modelVersion;
|
||||
|
||||
@Column(name = "cls_model_path", length = Integer.MAX_VALUE)
|
||||
private String clsModelPath;
|
||||
|
||||
@Column(name = "cls_model_version", length = Integer.MAX_VALUE)
|
||||
private String clsModelVersion;
|
||||
|
||||
@Column(name = "cd_model_type", length = Integer.MAX_VALUE)
|
||||
private String cdModelType;
|
||||
|
||||
@Column(name = "id")
|
||||
private Long id;
|
||||
|
||||
@Column(name = "model_name", length = Integer.MAX_VALUE)
|
||||
private String modelName;
|
||||
|
||||
@Column(name = "batch_id")
|
||||
private Long batchId;
|
||||
|
||||
@Column(name = "area")
|
||||
private Double area;
|
||||
|
||||
@Column(name = "cd_prob")
|
||||
private Double cdProb;
|
||||
|
||||
@Column(name = "before_c", length = Integer.MAX_VALUE)
|
||||
private String beforeC;
|
||||
|
||||
@Column(name = "before_p")
|
||||
private Double beforeP;
|
||||
|
||||
@Column(name = "after_c", length = Integer.MAX_VALUE)
|
||||
private String afterC;
|
||||
|
||||
@Column(name = "after_p")
|
||||
private Double afterP;
|
||||
|
||||
@Column(name = "input1")
|
||||
private Long input1;
|
||||
|
||||
@Column(name = "input2")
|
||||
private Long input2;
|
||||
|
||||
@Id
|
||||
@NotNull
|
||||
@ColumnDefault("nextval('inference_results_testing_seq_seq')")
|
||||
@Column(name = "seq", nullable = false)
|
||||
private Long seq;
|
||||
|
||||
@ColumnDefault("now()")
|
||||
@Column(name = "created_date")
|
||||
private ZonedDateTime createdDate;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@ColumnDefault("upper(replace((uuid_generate_v4()), '-', ''))")
|
||||
@Column(name = "uid", nullable = false, length = 32)
|
||||
private String uid;
|
||||
|
||||
@Column(name = "geometry", columnDefinition = "geometry")
|
||||
private Geometry geometry;
|
||||
}
|
||||
@@ -187,7 +187,7 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
||||
SELECT
|
||||
r.uid AS result_uid,
|
||||
msadi.stage,
|
||||
r.after_p as cd_prob,
|
||||
r.probability as cd_prob,
|
||||
msl.compare_yyyy,
|
||||
msl.target_yyyy,
|
||||
CASE
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
||||
|
||||
import static com.kamco.cd.kamcoback.postgres.entity.QInferenceResultsTestingEntity.inferenceResultsTestingEntity;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.entity.InferenceResultsTestingEntity;
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
public class InferenceResultsTestingRepositoryImpl
|
||||
implements InferenceResultsTetingRepositoryCustom {
|
||||
|
||||
private final JPAQueryFactory queryFactory;
|
||||
|
||||
@Override
|
||||
public List<InferenceResultsTestingEntity> getInferenceResultList(List<Long> batchIds) {
|
||||
return queryFactory
|
||||
.select(inferenceResultsTestingEntity)
|
||||
.from(inferenceResultsTestingEntity)
|
||||
.where(inferenceResultsTestingEntity.batchId.in(batchIds))
|
||||
.fetch();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.entity.InferenceResultsTestingEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface InferenceResultsTetingRepository
|
||||
extends JpaRepository<InferenceResultsTestingEntity, Long>,
|
||||
InferenceResultsTetingRepositoryCustom {}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
||||
|
||||
import com.kamco.cd.kamcoback.postgres.entity.InferenceResultsTestingEntity;
|
||||
import java.util.List;
|
||||
|
||||
public interface InferenceResultsTetingRepositoryCustom {
|
||||
|
||||
List<InferenceResultsTestingEntity> getInferenceResultList(List<Long> batchIds);
|
||||
}
|
||||
Reference in New Issue
Block a user