도엽관리 : 자동 50k 등록 로직 -> exception으로 수정
This commit is contained in:
@@ -2,7 +2,6 @@ package com.kamco.cd.kamcoback.postgres.core;
|
|||||||
|
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto.ApiResponseCode;
|
import com.kamco.cd.kamcoback.config.api.ApiResponseDto.ApiResponseCode;
|
||||||
import com.kamco.cd.kamcoback.config.api.ApiResponseDto.ResponseObj;
|
import com.kamco.cd.kamcoback.config.api.ApiResponseDto.ResponseObj;
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapInkx50kEntity;
|
|
||||||
import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
|
import com.kamco.cd.kamcoback.postgres.entity.MapInkx5kEntity;
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.scene.MapInkx50kRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.scene.MapInkx50kRepository;
|
||||||
import com.kamco.cd.kamcoback.postgres.repository.scene.MapInkx5kRepository;
|
import com.kamco.cd.kamcoback.postgres.repository.scene.MapInkx5kRepository;
|
||||||
@@ -39,21 +38,13 @@ public class MapInkxMngCoreService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Integer fid50k = mapInkx50kRepository.findByMapidCdParentNo(req.getMapidcdNo());
|
Integer fid50k = mapInkx50kRepository.findByMapidCdParentNo(req.getMapidcdNo());
|
||||||
if (fid50k == null || fid50k <= 0) {
|
if (fid50k == null) {
|
||||||
// parent도 등록
|
return new ResponseObj(ApiResponseCode.NOT_FOUND_DATA, "1:50,000 도엽의 정보가 없습니다. 관리자에게 문의하세요.");
|
||||||
MapInkx50kEntity parent =
|
|
||||||
new MapInkx50kEntity(req.getMapidcdNo().substring(0, 5), req.getMapidNm(), "", null);
|
|
||||||
MapInkx50kEntity result = mapInkx50kRepository.save(parent);
|
|
||||||
fid50k = result.getFid();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MapInkx5kEntity entity =
|
MapInkx5kEntity entity =
|
||||||
new MapInkx5kEntity(
|
new MapInkx5kEntity(
|
||||||
req.getMapidcdNo(),
|
req.getMapidcdNo(), req.getMapidNm(), map_polygon, fid50k.longValue(), "USE" // 기본은 USE로
|
||||||
req.getMapidNm(),
|
|
||||||
map_polygon,
|
|
||||||
fid50k == null ? null : fid50k.longValue(),
|
|
||||||
"USE" // 기본은 USE로
|
|
||||||
);
|
);
|
||||||
|
|
||||||
mapInkx5kRepository.save(entity);
|
mapInkx5kRepository.save(entity);
|
||||||
|
|||||||
Reference in New Issue
Block a user