변화탐지 COG URL API 로직 수정
This commit is contained in:
@@ -74,11 +74,16 @@ public class ChangeDetectionApiController {
|
|||||||
@Parameter(description = "5k/50k 구분(SCALE_5K/SCALE_50K))", required = true)
|
@Parameter(description = "5k/50k 구분(SCALE_5K/SCALE_50K))", required = true)
|
||||||
@RequestParam(defaultValue = "SCALE_50K")
|
@RequestParam(defaultValue = "SCALE_50K")
|
||||||
MapScaleType scale,
|
MapScaleType scale,
|
||||||
|
@Parameter(
|
||||||
|
description = "변화탐지 년도(차수) /year-list 의 uuid",
|
||||||
|
example = "8584e8d4-53b3-4582-bde2-28a81495a626")
|
||||||
|
@RequestParam
|
||||||
|
UUID uuid,
|
||||||
@Parameter(description = "이전 년도", example = "2023") @RequestParam Integer beforeYear,
|
@Parameter(description = "이전 년도", example = "2023") @RequestParam Integer beforeYear,
|
||||||
@Parameter(description = "이후 년도", example = "2024") @RequestParam Integer afterYear,
|
@Parameter(description = "이후 년도", example = "2024") @RequestParam Integer afterYear,
|
||||||
@Parameter(description = "도엽번호(5k)", example = "35905086") @RequestParam String mapSheetNum) {
|
@Parameter(description = "도엽번호(5k)", example = "35905086") @RequestParam String mapSheetNum) {
|
||||||
ChangeDetectionDto.CogUrlReq req =
|
ChangeDetectionDto.CogUrlReq req =
|
||||||
new ChangeDetectionDto.CogUrlReq(beforeYear, afterYear, mapSheetNum, type, scale);
|
new ChangeDetectionDto.CogUrlReq(uuid, beforeYear, afterYear, mapSheetNum, type, scale);
|
||||||
return ApiResponseDto.ok(changeDetectionService.getChangeDetectionCogUrl(req));
|
return ApiResponseDto.ok(changeDetectionService.getChangeDetectionCogUrl(req));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public class ChangeDetectionDto {
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class CogUrlReq {
|
public static class CogUrlReq {
|
||||||
|
|
||||||
|
private UUID uuid;
|
||||||
private Integer beforeYear;
|
private Integer beforeYear;
|
||||||
private Integer afterYear;
|
private Integer afterYear;
|
||||||
private String mapSheetNum;
|
private String mapSheetNum;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
|||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto;
|
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto;
|
||||||
|
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.DetectSearchType;
|
||||||
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.MapScaleType;
|
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.MapScaleType;
|
||||||
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.MapSheetList;
|
import com.kamco.cd.kamcoback.changedetection.dto.ChangeDetectionDto.MapSheetList;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapSheetAnalDataInferenceGeomEntity;
|
||||||
@@ -111,6 +112,26 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ChangeDetectionDto.CogUrlDto getChangeDetectionCogUrl(ChangeDetectionDto.CogUrlReq req) {
|
public ChangeDetectionDto.CogUrlDto getChangeDetectionCogUrl(ChangeDetectionDto.CogUrlReq req) {
|
||||||
|
String mapSheetNum = req.getMapSheetNum();
|
||||||
|
|
||||||
|
if (req.getType().equals(DetectSearchType.MAPSHEET)
|
||||||
|
&& req.getScale().equals(MapScaleType.SCALE_50K)) {
|
||||||
|
mapSheetNum =
|
||||||
|
queryFactory
|
||||||
|
.select(mapSheetAnalDataInferenceEntity.mapSheetNum.stringValue())
|
||||||
|
.from(mapSheetAnalInferenceEntity)
|
||||||
|
.innerJoin(mapSheetAnalDataInferenceEntity)
|
||||||
|
.on(mapSheetAnalInferenceEntity.id.eq(mapSheetAnalDataInferenceEntity.analUid))
|
||||||
|
.where(
|
||||||
|
mapSheetAnalInferenceEntity.uuid.eq(req.getUuid()),
|
||||||
|
mapSheetAnalDataInferenceEntity
|
||||||
|
.mapSheetNum
|
||||||
|
.stringValue()
|
||||||
|
.like("%" + req.getMapSheetNum() + "%"))
|
||||||
|
.orderBy(mapSheetAnalDataInferenceEntity.mapSheetNum.asc())
|
||||||
|
.fetchFirst();
|
||||||
|
}
|
||||||
|
|
||||||
ChangeDetectionDto.CogUrlData data =
|
ChangeDetectionDto.CogUrlData data =
|
||||||
queryFactory
|
queryFactory
|
||||||
.select(
|
.select(
|
||||||
@@ -128,7 +149,7 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.year
|
.year
|
||||||
.eq(req.getBeforeYear())
|
.eq(req.getBeforeYear())
|
||||||
.or(imageryEntity.year.eq(req.getAfterYear())),
|
.or(imageryEntity.year.eq(req.getAfterYear())),
|
||||||
imageryEntity.scene5k.eq(req.getMapSheetNum()))
|
imageryEntity.scene5k.eq(mapSheetNum))
|
||||||
.groupBy(mapInkx5kEntity.geom)
|
.groupBy(mapInkx5kEntity.geom)
|
||||||
.fetchOne();
|
.fetchOne();
|
||||||
|
|
||||||
@@ -191,6 +212,7 @@ public class ChangeDetectionRepositoryImpl extends QuerydslRepositorySupport
|
|||||||
.where(
|
.where(
|
||||||
mapSheetAnalInferenceEntity.uuid.eq(uuid),
|
mapSheetAnalInferenceEntity.uuid.eq(uuid),
|
||||||
mapScaleTypeAnalDataSearchExpression(scale, mapSheetNum))
|
mapScaleTypeAnalDataSearchExpression(scale, mapSheetNum))
|
||||||
|
.orderBy(mapSheetAnalDataInferenceGeomEntity.mapSheetNum.asc())
|
||||||
.fetch();
|
.fetch();
|
||||||
|
|
||||||
ObjectMapper mapper = new ObjectMapper();
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|||||||
Reference in New Issue
Block a user