레이어관리 수정
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
package com.kamco.cd.kamcoback.common.enums;
|
||||||
|
|
||||||
|
import com.kamco.cd.kamcoback.common.utils.enums.CodeExpose;
|
||||||
|
import com.kamco.cd.kamcoback.common.utils.enums.EnumType;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@CodeExpose
|
||||||
|
@Getter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public enum CrsType implements EnumType {
|
||||||
|
EPSG_3857("korea 2000, 미터단위"),
|
||||||
|
EPSG_4326("geojson, osm기본"),
|
||||||
|
EPSG_5186("google, EPSG:900913동일");
|
||||||
|
|
||||||
|
private final String desc;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getId() {
|
||||||
|
return name();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getText() {
|
||||||
|
return desc;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -103,6 +103,9 @@ public class LayerDto {
|
|||||||
@JsonFormatDttm
|
@JsonFormatDttm
|
||||||
@Schema(description = "등록일시")
|
@Schema(description = "등록일시")
|
||||||
private ZonedDateTime createdDttm;
|
private ZonedDateTime createdDttm;
|
||||||
|
|
||||||
|
@Schema(description = "좌표계")
|
||||||
|
private String crs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -140,6 +143,9 @@ public class LayerDto {
|
|||||||
|
|
||||||
@Schema(description = "zoom max", example = "18")
|
@Schema(description = "zoom max", example = "18")
|
||||||
private Short max;
|
private Short max;
|
||||||
|
|
||||||
|
@Schema(description = "좌표계", example = "EPSG_3857")
|
||||||
|
private String crs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ public class LayerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case GEOJSON -> {
|
case GEOJSON -> {
|
||||||
mapLayerCoreService.saveGeoJson(dto);
|
return mapLayerCoreService.saveGeoJson(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
case WMTS -> {
|
case WMTS -> {
|
||||||
@@ -91,7 +91,6 @@ public class LayerService {
|
|||||||
|
|
||||||
default -> throw new CustomApiException("BAD_REQUEST", HttpStatus.BAD_REQUEST);
|
default -> throw new CustomApiException("BAD_REQUEST", HttpStatus.BAD_REQUEST);
|
||||||
}
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -131,6 +131,10 @@ public class MapLayerCoreService {
|
|||||||
entity.setIsLabelingMap(dto.getIsLabelingMap());
|
entity.setIsLabelingMap(dto.getIsLabelingMap());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dto.getCrs() != null) {
|
||||||
|
entity.setCrs(dto.getCrs());
|
||||||
|
}
|
||||||
|
|
||||||
entity.setUpdatedUid(userUtil.getId());
|
entity.setUpdatedUid(userUtil.getId());
|
||||||
entity.setUpdatedDttm(ZonedDateTime.now());
|
entity.setUpdatedDttm(ZonedDateTime.now());
|
||||||
}
|
}
|
||||||
@@ -210,13 +214,7 @@ public class MapLayerCoreService {
|
|||||||
* @param dto
|
* @param dto
|
||||||
*/
|
*/
|
||||||
public UUID saveTile(LayerDto.AddReq dto) {
|
public UUID saveTile(LayerDto.AddReq dto) {
|
||||||
LayerDto.SearchReq searchReq = new LayerDto.SearchReq();
|
Long order = mapLayerRepository.findSortOrderDesc();
|
||||||
searchReq.setLayerType(LayerType.TILE.getId());
|
|
||||||
List<LayerDto.Basic> entityList = mapLayerRepository.findAllLayer(searchReq);
|
|
||||||
|
|
||||||
if (!entityList.isEmpty()) {
|
|
||||||
throw new CustomApiException("DUPLICATE_DATA", HttpStatus.CONFLICT);
|
|
||||||
}
|
|
||||||
|
|
||||||
MapLayerEntity mapLayerEntity = new MapLayerEntity();
|
MapLayerEntity mapLayerEntity = new MapLayerEntity();
|
||||||
mapLayerEntity.setDescription(dto.getDescription());
|
mapLayerEntity.setDescription(dto.getDescription());
|
||||||
@@ -228,11 +226,12 @@ public class MapLayerCoreService {
|
|||||||
mapLayerEntity.setMaxLat(dto.getMaxLat());
|
mapLayerEntity.setMaxLat(dto.getMaxLat());
|
||||||
mapLayerEntity.setMinZoom(dto.getMin());
|
mapLayerEntity.setMinZoom(dto.getMin());
|
||||||
mapLayerEntity.setMaxZoom(dto.getMax());
|
mapLayerEntity.setMaxZoom(dto.getMax());
|
||||||
|
mapLayerEntity.setCrs(dto.getCrs());
|
||||||
|
|
||||||
mapLayerEntity.setCreatedUid(userUtil.getId());
|
mapLayerEntity.setCreatedUid(userUtil.getId());
|
||||||
mapLayerEntity.setIsChangeMap(true);
|
mapLayerEntity.setIsChangeMap(true);
|
||||||
mapLayerEntity.setIsLabelingMap(false);
|
mapLayerEntity.setIsLabelingMap(true);
|
||||||
mapLayerEntity.setOrder(1L);
|
mapLayerEntity.setOrder(order + 1);
|
||||||
mapLayerEntity.setLayerType(LayerType.TILE.getId());
|
mapLayerEntity.setLayerType(LayerType.TILE.getId());
|
||||||
mapLayerEntity.setUpdatedDttm(ZonedDateTime.now());
|
mapLayerEntity.setUpdatedDttm(ZonedDateTime.now());
|
||||||
return mapLayerRepository.save(mapLayerEntity).getUuid();
|
return mapLayerRepository.save(mapLayerEntity).getUuid();
|
||||||
@@ -255,6 +254,7 @@ public class MapLayerCoreService {
|
|||||||
mapLayerEntity.setIsChangeMap(true);
|
mapLayerEntity.setIsChangeMap(true);
|
||||||
mapLayerEntity.setIsLabelingMap(true);
|
mapLayerEntity.setIsLabelingMap(true);
|
||||||
mapLayerEntity.setLayerType(LayerType.GEOJSON.getId());
|
mapLayerEntity.setLayerType(LayerType.GEOJSON.getId());
|
||||||
|
mapLayerEntity.setCrs(addDto.getCrs());
|
||||||
mapLayerEntity.setUpdatedDttm(ZonedDateTime.now());
|
mapLayerEntity.setUpdatedDttm(ZonedDateTime.now());
|
||||||
mapLayerEntity.setOrder(order + 1);
|
mapLayerEntity.setOrder(order + 1);
|
||||||
return mapLayerRepository.save(mapLayerEntity).getUuid();
|
return mapLayerRepository.save(mapLayerEntity).getUuid();
|
||||||
|
|||||||
@@ -103,6 +103,9 @@ public class MapLayerEntity {
|
|||||||
@Column(name = "is_deleted")
|
@Column(name = "is_deleted")
|
||||||
private Boolean isDeleted = false;
|
private Boolean isDeleted = false;
|
||||||
|
|
||||||
|
@Column(name = "crs")
|
||||||
|
private String crs;
|
||||||
|
|
||||||
public LayerDto.Detail toDto() {
|
public LayerDto.Detail toDto() {
|
||||||
return new LayerDto.Detail(
|
return new LayerDto.Detail(
|
||||||
this.uuid,
|
this.uuid,
|
||||||
@@ -120,6 +123,7 @@ public class MapLayerEntity {
|
|||||||
this.maxLat,
|
this.maxLat,
|
||||||
this.minZoom,
|
this.minZoom,
|
||||||
this.maxZoom,
|
this.maxZoom,
|
||||||
this.createdDttm);
|
this.createdDttm,
|
||||||
|
this.crs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user