추론종료 시 geom 데이터 넣기, geom-list 쿼리 수정
This commit is contained in:
@@ -2,9 +2,6 @@ package com.kamco.cd.kamcoback.inference.dto;
|
|||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.kamco.cd.kamcoback.common.enums.DetectionClassification;
|
import com.kamco.cd.kamcoback.common.enums.DetectionClassification;
|
||||||
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
import com.kamco.cd.kamcoback.common.utils.interfaces.JsonFormatDttm;
|
||||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.DetectOption;
|
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.DetectOption;
|
||||||
@@ -307,10 +304,11 @@ public class InferenceDetailDto {
|
|||||||
Double classAfterProb;
|
Double classAfterProb;
|
||||||
Long mapSheetNum;
|
Long mapSheetNum;
|
||||||
String mapSheetName;
|
String mapSheetName;
|
||||||
@JsonIgnore String gemoStr;
|
|
||||||
@JsonIgnore String geomCenterStr;
|
// @JsonIgnore String gemoStr;
|
||||||
JsonNode gemo;
|
// @JsonIgnore String geomCenterStr;
|
||||||
JsonNode geomCenter;
|
// JsonNode gemo;
|
||||||
|
// JsonNode geomCenter;
|
||||||
|
|
||||||
public Geom(
|
public Geom(
|
||||||
UUID uuid,
|
UUID uuid,
|
||||||
@@ -323,9 +321,7 @@ public class InferenceDetailDto {
|
|||||||
String classAfterCd,
|
String classAfterCd,
|
||||||
Double classAfterProb,
|
Double classAfterProb,
|
||||||
Long mapSheetNum,
|
Long mapSheetNum,
|
||||||
String mapSheetName,
|
String mapSheetName) {
|
||||||
String gemoStr,
|
|
||||||
String geomCenterStr) {
|
|
||||||
this.uuid = uuid;
|
this.uuid = uuid;
|
||||||
this.uid = uid;
|
this.uid = uid;
|
||||||
this.compareYyyy = compareYyyy;
|
this.compareYyyy = compareYyyy;
|
||||||
@@ -339,20 +335,20 @@ public class InferenceDetailDto {
|
|||||||
this.classAfterProb = classAfterProb;
|
this.classAfterProb = classAfterProb;
|
||||||
this.mapSheetNum = mapSheetNum;
|
this.mapSheetNum = mapSheetNum;
|
||||||
this.mapSheetName = mapSheetName;
|
this.mapSheetName = mapSheetName;
|
||||||
this.gemoStr = gemoStr;
|
// this.gemoStr = gemoStr;
|
||||||
this.geomCenterStr = geomCenterStr;
|
// this.geomCenterStr = geomCenterStr;
|
||||||
|
//
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
// ObjectMapper mapper = new ObjectMapper();
|
||||||
JsonNode geomJson;
|
// JsonNode geomJson;
|
||||||
JsonNode geomCenterJson;
|
// JsonNode geomCenterJson;
|
||||||
try {
|
// try {
|
||||||
geomJson = mapper.readTree(gemoStr);
|
// geomJson = mapper.readTree(gemoStr);
|
||||||
geomCenterJson = mapper.readTree(geomCenterStr);
|
// geomCenterJson = mapper.readTree(geomCenterStr);
|
||||||
} catch (JsonProcessingException e) {
|
// } catch (JsonProcessingException e) {
|
||||||
throw new RuntimeException(e);
|
// throw new RuntimeException(e);
|
||||||
}
|
// }
|
||||||
this.gemo = geomJson;
|
// this.gemo = geomJson;
|
||||||
this.geomCenter = geomCenterJson;
|
// this.geomCenter = geomCenterJson;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -531,5 +531,9 @@ public class InferenceResultService {
|
|||||||
request.setUuid(dto.getUuid());
|
request.setUuid(dto.getUuid());
|
||||||
request.setUpdateUid(userUtil.getId());
|
request.setUpdateUid(userUtil.getId());
|
||||||
inferenceResultCoreService.update(request);
|
inferenceResultCoreService.update(request);
|
||||||
|
|
||||||
|
// upsertGeomData
|
||||||
|
Long learnId = inferenceResultCoreService.getInferenceLearnIdByUuid(dto.getUuid());
|
||||||
|
inferenceResultCoreService.upsertGeomData(learnId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -437,4 +437,8 @@ public class InferenceResultCoreService {
|
|||||||
public void saveFail5k(UUID uuid, List<Long> failMapIds, String type) {
|
public void saveFail5k(UUID uuid, List<Long> failMapIds, String type) {
|
||||||
mapSheetLearn5kRepository.saveFail5k(uuid, failMapIds, type);
|
mapSheetLearn5kRepository.saveFail5k(uuid, failMapIds, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getInferenceLearnIdByUuid(UUID uuid) {
|
||||||
|
return inferenceResultRepository.getInferenceLearnIdByUuid(uuid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
|||||||
|
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface InferenceResultRepositoryCustom {
|
public interface InferenceResultRepositoryCustom {
|
||||||
|
|
||||||
@@ -24,4 +25,6 @@ public interface InferenceResultRepositoryCustom {
|
|||||||
int markGeomCreatedByGeoUids(List<Long> geoUids);
|
int markGeomCreatedByGeoUids(List<Long> geoUids);
|
||||||
|
|
||||||
List<MapSheetAnalDataInferenceGeomEntity> findGeomEntitiesByDataUid(Long dataUid, int limit);
|
List<MapSheetAnalDataInferenceGeomEntity> findGeomEntitiesByDataUid(Long dataUid, int limit);
|
||||||
|
|
||||||
|
Long getInferenceLearnIdByUuid(UUID uuid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
package com.kamco.cd.kamcoback.postgres.repository.Inference;
|
||||||
|
|
||||||
|
import static com.kamco.cd.kamcoback.postgres.entity.QMapSheetLearnEntity.mapSheetLearnEntity;
|
||||||
|
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity;
|
||||||
@@ -8,6 +10,7 @@ import com.querydsl.jpa.impl.JPAQueryFactory;
|
|||||||
import jakarta.persistence.EntityManager;
|
import jakarta.persistence.EntityManager;
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
@@ -454,4 +457,13 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
|||||||
.limit(limit)
|
.limit(limit)
|
||||||
.fetch();
|
.fetch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long getInferenceLearnIdByUuid(UUID uuid) {
|
||||||
|
return queryFactory
|
||||||
|
.select(mapSheetLearnEntity.id)
|
||||||
|
.from(mapSheetLearnEntity)
|
||||||
|
.where(mapSheetLearnEntity.uuid.eq(uuid))
|
||||||
|
.fetchOne();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -378,19 +378,15 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
// 기준년도 분류
|
// 기준년도 분류
|
||||||
if (searchGeoReq.getTargetClass() != null && !searchGeoReq.getTargetClass().equals("")) {
|
if (searchGeoReq.getTargetClass() != null && !searchGeoReq.getTargetClass().equals("")) {
|
||||||
builder.and(
|
builder.and(
|
||||||
mapSheetAnalDataInferenceGeomEntity
|
mapSheetAnalDataInferenceGeomEntity.classAfterCd.eq(
|
||||||
.classAfterCd
|
searchGeoReq.getTargetClass().toLowerCase()));
|
||||||
.toLowerCase()
|
|
||||||
.eq(searchGeoReq.getTargetClass().toLowerCase()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 비교년도 분류
|
// 비교년도 분류
|
||||||
if (searchGeoReq.getCompareClass() != null && !searchGeoReq.getCompareClass().equals("")) {
|
if (searchGeoReq.getCompareClass() != null && !searchGeoReq.getCompareClass().equals("")) {
|
||||||
builder.and(
|
builder.and(
|
||||||
mapSheetAnalDataInferenceGeomEntity
|
mapSheetAnalDataInferenceGeomEntity.classBeforeCd.eq(
|
||||||
.classBeforeCd
|
searchGeoReq.getCompareClass().toLowerCase()));
|
||||||
.toLowerCase()
|
|
||||||
.eq(searchGeoReq.getCompareClass().toLowerCase()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 분석도엽
|
// 분석도엽
|
||||||
@@ -414,11 +410,14 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
mapSheetAnalDataInferenceGeomEntity.classAfterCd,
|
mapSheetAnalDataInferenceGeomEntity.classAfterCd,
|
||||||
mapSheetAnalDataInferenceGeomEntity.classAfterProb,
|
mapSheetAnalDataInferenceGeomEntity.classAfterProb,
|
||||||
mapSheetAnalDataInferenceGeomEntity.mapSheetNum,
|
mapSheetAnalDataInferenceGeomEntity.mapSheetNum,
|
||||||
mapInkx5kEntity.mapidNm,
|
mapInkx5kEntity.mapidNm
|
||||||
Expressions.stringTemplate(
|
// Expressions.stringTemplate(
|
||||||
"ST_AsGeoJSON({0})", mapSheetAnalDataInferenceGeomEntity.geom),
|
// "ST_AsGeoJSON({0})",
|
||||||
Expressions.stringTemplate(
|
// mapSheetAnalDataInferenceGeomEntity.geom),
|
||||||
"ST_AsGeoJSON({0})", mapSheetAnalDataInferenceGeomEntity.geomCenter)))
|
// Expressions.stringTemplate(
|
||||||
|
// "ST_AsGeoJSON({0})",
|
||||||
|
// mapSheetAnalDataInferenceGeomEntity.geomCenter)
|
||||||
|
))
|
||||||
.from(mapSheetAnalInferenceEntity)
|
.from(mapSheetAnalInferenceEntity)
|
||||||
.join(mapSheetAnalDataInferenceGeomEntity)
|
.join(mapSheetAnalDataInferenceGeomEntity)
|
||||||
.on(
|
.on(
|
||||||
@@ -429,10 +428,9 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
mapSheetAnalDataInferenceGeomEntity.stage.eq(mapSheetAnalInferenceEntity.stage))
|
mapSheetAnalDataInferenceGeomEntity.stage.eq(mapSheetAnalInferenceEntity.stage))
|
||||||
.join(mapInkx5kEntity)
|
.join(mapInkx5kEntity)
|
||||||
.on(
|
.on(
|
||||||
mapSheetAnalDataInferenceGeomEntity
|
mapSheetAnalDataInferenceGeomEntity.mapSheetNum.eq(
|
||||||
.mapSheetNum
|
Expressions.numberTemplate(
|
||||||
.stringValue()
|
Long.class, "CAST({0} AS long)", mapInkx5kEntity.mapidcdNo)))
|
||||||
.eq(mapInkx5kEntity.mapidcdNo))
|
|
||||||
.where(builder)
|
.where(builder)
|
||||||
.offset(pageable.getOffset())
|
.offset(pageable.getOffset())
|
||||||
.limit(pageable.getPageSize())
|
.limit(pageable.getPageSize())
|
||||||
@@ -443,14 +441,6 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
.select(mapSheetAnalDataInferenceGeomEntity.geoUid)
|
.select(mapSheetAnalDataInferenceGeomEntity.geoUid)
|
||||||
.from(mapSheetAnalInferenceEntity)
|
.from(mapSheetAnalInferenceEntity)
|
||||||
.join(mapSheetAnalDataInferenceGeomEntity)
|
.join(mapSheetAnalDataInferenceGeomEntity)
|
||||||
.on(
|
|
||||||
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(
|
|
||||||
mapSheetAnalInferenceEntity.compareYyyy),
|
|
||||||
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(
|
|
||||||
mapSheetAnalInferenceEntity.targetYyyy),
|
|
||||||
mapSheetAnalDataInferenceGeomEntity.stage.eq(mapSheetAnalInferenceEntity.stage))
|
|
||||||
.from(mapSheetAnalInferenceEntity)
|
|
||||||
.join(mapSheetAnalDataInferenceGeomEntity)
|
|
||||||
.on(
|
.on(
|
||||||
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(
|
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(
|
||||||
mapSheetAnalInferenceEntity.compareYyyy),
|
mapSheetAnalInferenceEntity.compareYyyy),
|
||||||
@@ -459,10 +449,9 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
|||||||
mapSheetAnalDataInferenceGeomEntity.stage.eq(mapSheetAnalInferenceEntity.stage))
|
mapSheetAnalDataInferenceGeomEntity.stage.eq(mapSheetAnalInferenceEntity.stage))
|
||||||
.join(mapInkx5kEntity)
|
.join(mapInkx5kEntity)
|
||||||
.on(
|
.on(
|
||||||
mapSheetAnalDataInferenceGeomEntity
|
mapSheetAnalDataInferenceGeomEntity.mapSheetNum.eq(
|
||||||
.mapSheetNum
|
Expressions.numberTemplate(
|
||||||
.stringValue()
|
Long.class, "CAST({0} AS long)", mapInkx5kEntity.mapidcdNo)))
|
||||||
.eq(mapInkx5kEntity.mapidcdNo))
|
|
||||||
.where(builder)
|
.where(builder)
|
||||||
.fetchCount();
|
.fetchCount();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user