레이어관리 수정
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
|
||||
@Schema(description = "등록일시")
|
||||
private ZonedDateTime createdDttm;
|
||||
|
||||
@Schema(description = "좌표계")
|
||||
private String crs;
|
||||
}
|
||||
|
||||
@Getter
|
||||
@@ -140,6 +143,9 @@ public class LayerDto {
|
||||
|
||||
@Schema(description = "zoom max", example = "18")
|
||||
private Short max;
|
||||
|
||||
@Schema(description = "좌표계", example = "EPSG_3857")
|
||||
private String crs;
|
||||
}
|
||||
|
||||
@Getter
|
||||
|
||||
@@ -65,7 +65,7 @@ public class LayerService {
|
||||
}
|
||||
|
||||
case GEOJSON -> {
|
||||
mapLayerCoreService.saveGeoJson(dto);
|
||||
return mapLayerCoreService.saveGeoJson(dto);
|
||||
}
|
||||
|
||||
case WMTS -> {
|
||||
@@ -91,7 +91,6 @@ public class LayerService {
|
||||
|
||||
default -> throw new CustomApiException("BAD_REQUEST", HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -131,6 +131,10 @@ public class MapLayerCoreService {
|
||||
entity.setIsLabelingMap(dto.getIsLabelingMap());
|
||||
}
|
||||
|
||||
if (dto.getCrs() != null) {
|
||||
entity.setCrs(dto.getCrs());
|
||||
}
|
||||
|
||||
entity.setUpdatedUid(userUtil.getId());
|
||||
entity.setUpdatedDttm(ZonedDateTime.now());
|
||||
}
|
||||
@@ -210,13 +214,7 @@ public class MapLayerCoreService {
|
||||
* @param dto
|
||||
*/
|
||||
public UUID saveTile(LayerDto.AddReq dto) {
|
||||
LayerDto.SearchReq searchReq = new LayerDto.SearchReq();
|
||||
searchReq.setLayerType(LayerType.TILE.getId());
|
||||
List<LayerDto.Basic> entityList = mapLayerRepository.findAllLayer(searchReq);
|
||||
|
||||
if (!entityList.isEmpty()) {
|
||||
throw new CustomApiException("DUPLICATE_DATA", HttpStatus.CONFLICT);
|
||||
}
|
||||
Long order = mapLayerRepository.findSortOrderDesc();
|
||||
|
||||
MapLayerEntity mapLayerEntity = new MapLayerEntity();
|
||||
mapLayerEntity.setDescription(dto.getDescription());
|
||||
@@ -228,11 +226,12 @@ public class MapLayerCoreService {
|
||||
mapLayerEntity.setMaxLat(dto.getMaxLat());
|
||||
mapLayerEntity.setMinZoom(dto.getMin());
|
||||
mapLayerEntity.setMaxZoom(dto.getMax());
|
||||
mapLayerEntity.setCrs(dto.getCrs());
|
||||
|
||||
mapLayerEntity.setCreatedUid(userUtil.getId());
|
||||
mapLayerEntity.setIsChangeMap(true);
|
||||
mapLayerEntity.setIsLabelingMap(false);
|
||||
mapLayerEntity.setOrder(1L);
|
||||
mapLayerEntity.setIsLabelingMap(true);
|
||||
mapLayerEntity.setOrder(order + 1);
|
||||
mapLayerEntity.setLayerType(LayerType.TILE.getId());
|
||||
mapLayerEntity.setUpdatedDttm(ZonedDateTime.now());
|
||||
return mapLayerRepository.save(mapLayerEntity).getUuid();
|
||||
@@ -255,6 +254,7 @@ public class MapLayerCoreService {
|
||||
mapLayerEntity.setIsChangeMap(true);
|
||||
mapLayerEntity.setIsLabelingMap(true);
|
||||
mapLayerEntity.setLayerType(LayerType.GEOJSON.getId());
|
||||
mapLayerEntity.setCrs(addDto.getCrs());
|
||||
mapLayerEntity.setUpdatedDttm(ZonedDateTime.now());
|
||||
mapLayerEntity.setOrder(order + 1);
|
||||
return mapLayerRepository.save(mapLayerEntity).getUuid();
|
||||
|
||||
@@ -103,6 +103,9 @@ public class MapLayerEntity {
|
||||
@Column(name = "is_deleted")
|
||||
private Boolean isDeleted = false;
|
||||
|
||||
@Column(name = "crs")
|
||||
private String crs;
|
||||
|
||||
public LayerDto.Detail toDto() {
|
||||
return new LayerDto.Detail(
|
||||
this.uuid,
|
||||
@@ -120,6 +123,7 @@ public class MapLayerEntity {
|
||||
this.maxLat,
|
||||
this.minZoom,
|
||||
this.maxZoom,
|
||||
this.createdDttm);
|
||||
this.createdDttm,
|
||||
this.crs);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user