Merge remote-tracking branch 'origin/feat/infer_dev_260107' into feat/infer_dev_260107
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.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.utils.interfaces.JsonFormatDttm;
|
||||
import com.kamco.cd.kamcoback.inference.dto.InferenceResultDto.DetectOption;
|
||||
@@ -307,10 +304,11 @@ public class InferenceDetailDto {
|
||||
Double classAfterProb;
|
||||
Long mapSheetNum;
|
||||
String mapSheetName;
|
||||
@JsonIgnore String gemoStr;
|
||||
@JsonIgnore String geomCenterStr;
|
||||
JsonNode gemo;
|
||||
JsonNode geomCenter;
|
||||
|
||||
// @JsonIgnore String gemoStr;
|
||||
// @JsonIgnore String geomCenterStr;
|
||||
// JsonNode gemo;
|
||||
// JsonNode geomCenter;
|
||||
|
||||
public Geom(
|
||||
UUID uuid,
|
||||
@@ -323,9 +321,7 @@ public class InferenceDetailDto {
|
||||
String classAfterCd,
|
||||
Double classAfterProb,
|
||||
Long mapSheetNum,
|
||||
String mapSheetName,
|
||||
String gemoStr,
|
||||
String geomCenterStr) {
|
||||
String mapSheetName) {
|
||||
this.uuid = uuid;
|
||||
this.uid = uid;
|
||||
this.compareYyyy = compareYyyy;
|
||||
@@ -339,20 +335,20 @@ public class InferenceDetailDto {
|
||||
this.classAfterProb = classAfterProb;
|
||||
this.mapSheetNum = mapSheetNum;
|
||||
this.mapSheetName = mapSheetName;
|
||||
this.gemoStr = gemoStr;
|
||||
this.geomCenterStr = geomCenterStr;
|
||||
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
JsonNode geomJson;
|
||||
JsonNode geomCenterJson;
|
||||
try {
|
||||
geomJson = mapper.readTree(gemoStr);
|
||||
geomCenterJson = mapper.readTree(geomCenterStr);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
this.gemo = geomJson;
|
||||
this.geomCenter = geomCenterJson;
|
||||
// this.gemoStr = gemoStr;
|
||||
// this.geomCenterStr = geomCenterStr;
|
||||
//
|
||||
// ObjectMapper mapper = new ObjectMapper();
|
||||
// JsonNode geomJson;
|
||||
// JsonNode geomCenterJson;
|
||||
// try {
|
||||
// geomJson = mapper.readTree(gemoStr);
|
||||
// geomCenterJson = mapper.readTree(geomCenterStr);
|
||||
// } catch (JsonProcessingException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// this.gemo = geomJson;
|
||||
// this.geomCenter = geomCenterJson;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -531,5 +531,9 @@ public class InferenceResultService {
|
||||
request.setUuid(dto.getUuid());
|
||||
request.setUpdateUid(userUtil.getId());
|
||||
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) {
|
||||
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 java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface InferenceResultRepositoryCustom {
|
||||
|
||||
@@ -24,4 +25,6 @@ public interface InferenceResultRepositoryCustom {
|
||||
int markGeomCreatedByGeoUids(List<Long> geoUids);
|
||||
|
||||
List<MapSheetAnalDataInferenceGeomEntity> findGeomEntitiesByDataUid(Long dataUid, int limit);
|
||||
|
||||
Long getInferenceLearnIdByUuid(UUID uuid);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
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.QMapSheetAnalDataInferenceEntity;
|
||||
import com.kamco.cd.kamcoback.postgres.entity.QMapSheetAnalDataInferenceGeomEntity;
|
||||
@@ -8,6 +10,7 @@ import com.querydsl.jpa.impl.JPAQueryFactory;
|
||||
import jakarta.persistence.EntityManager;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -454,4 +457,13 @@ public class InferenceResultRepositoryImpl implements InferenceResultRepositoryC
|
||||
.limit(limit)
|
||||
.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("")) {
|
||||
builder.and(
|
||||
mapSheetAnalDataInferenceGeomEntity
|
||||
.classAfterCd
|
||||
.toLowerCase()
|
||||
.eq(searchGeoReq.getTargetClass().toLowerCase()));
|
||||
mapSheetAnalDataInferenceGeomEntity.classAfterCd.eq(
|
||||
searchGeoReq.getTargetClass().toLowerCase()));
|
||||
}
|
||||
|
||||
// 비교년도 분류
|
||||
if (searchGeoReq.getCompareClass() != null && !searchGeoReq.getCompareClass().equals("")) {
|
||||
builder.and(
|
||||
mapSheetAnalDataInferenceGeomEntity
|
||||
.classBeforeCd
|
||||
.toLowerCase()
|
||||
.eq(searchGeoReq.getCompareClass().toLowerCase()));
|
||||
mapSheetAnalDataInferenceGeomEntity.classBeforeCd.eq(
|
||||
searchGeoReq.getCompareClass().toLowerCase()));
|
||||
}
|
||||
|
||||
// 분석도엽
|
||||
@@ -414,11 +410,14 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
mapSheetAnalDataInferenceGeomEntity.classAfterCd,
|
||||
mapSheetAnalDataInferenceGeomEntity.classAfterProb,
|
||||
mapSheetAnalDataInferenceGeomEntity.mapSheetNum,
|
||||
mapInkx5kEntity.mapidNm,
|
||||
Expressions.stringTemplate(
|
||||
"ST_AsGeoJSON({0})", mapSheetAnalDataInferenceGeomEntity.geom),
|
||||
Expressions.stringTemplate(
|
||||
"ST_AsGeoJSON({0})", mapSheetAnalDataInferenceGeomEntity.geomCenter)))
|
||||
mapInkx5kEntity.mapidNm
|
||||
// Expressions.stringTemplate(
|
||||
// "ST_AsGeoJSON({0})",
|
||||
// mapSheetAnalDataInferenceGeomEntity.geom),
|
||||
// Expressions.stringTemplate(
|
||||
// "ST_AsGeoJSON({0})",
|
||||
// mapSheetAnalDataInferenceGeomEntity.geomCenter)
|
||||
))
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.join(mapSheetAnalDataInferenceGeomEntity)
|
||||
.on(
|
||||
@@ -429,10 +428,9 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
mapSheetAnalDataInferenceGeomEntity.stage.eq(mapSheetAnalInferenceEntity.stage))
|
||||
.join(mapInkx5kEntity)
|
||||
.on(
|
||||
mapSheetAnalDataInferenceGeomEntity
|
||||
.mapSheetNum
|
||||
.stringValue()
|
||||
.eq(mapInkx5kEntity.mapidcdNo))
|
||||
mapSheetAnalDataInferenceGeomEntity.mapSheetNum.eq(
|
||||
Expressions.numberTemplate(
|
||||
Long.class, "CAST({0} AS long)", mapInkx5kEntity.mapidcdNo)))
|
||||
.where(builder)
|
||||
.offset(pageable.getOffset())
|
||||
.limit(pageable.getPageSize())
|
||||
@@ -443,14 +441,6 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
.select(mapSheetAnalDataInferenceGeomEntity.geoUid)
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.join(mapSheetAnalDataInferenceGeomEntity)
|
||||
.on(
|
||||
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(
|
||||
mapSheetAnalInferenceEntity.compareYyyy),
|
||||
mapSheetAnalDataInferenceGeomEntity.targetYyyy.eq(
|
||||
mapSheetAnalInferenceEntity.targetYyyy),
|
||||
mapSheetAnalDataInferenceGeomEntity.stage.eq(mapSheetAnalInferenceEntity.stage))
|
||||
.from(mapSheetAnalInferenceEntity)
|
||||
.join(mapSheetAnalDataInferenceGeomEntity)
|
||||
.on(
|
||||
mapSheetAnalDataInferenceGeomEntity.compareYyyy.eq(
|
||||
mapSheetAnalInferenceEntity.compareYyyy),
|
||||
@@ -459,10 +449,9 @@ public class MapSheetLearnRepositoryImpl implements MapSheetLearnRepositoryCusto
|
||||
mapSheetAnalDataInferenceGeomEntity.stage.eq(mapSheetAnalInferenceEntity.stage))
|
||||
.join(mapInkx5kEntity)
|
||||
.on(
|
||||
mapSheetAnalDataInferenceGeomEntity
|
||||
.mapSheetNum
|
||||
.stringValue()
|
||||
.eq(mapInkx5kEntity.mapidcdNo))
|
||||
mapSheetAnalDataInferenceGeomEntity.mapSheetNum.eq(
|
||||
Expressions.numberTemplate(
|
||||
Long.class, "CAST({0} AS long)", mapInkx5kEntity.mapidcdNo)))
|
||||
.where(builder)
|
||||
.fetchCount();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user