diff --git a/src/main/java/geoinfo/com/file/service/FileService.java b/src/main/java/geoinfo/com/file/service/FileService.java index 210002eb..1708a14b 100644 --- a/src/main/java/geoinfo/com/file/service/FileService.java +++ b/src/main/java/geoinfo/com/file/service/FileService.java @@ -1,5 +1,6 @@ package geoinfo.com.file.service; +import java.sql.SQLException; import java.util.List; import java.util.Map; @@ -12,7 +13,7 @@ public interface FileService { void insertFile(Map map) throws Exception; - List> selectFiles(Map map) throws Exception; + List> selectFiles(Map map) throws Exception, SQLException; void deleteFiles(Map map) throws Exception; diff --git a/src/main/java/geoinfo/com/file/service/impl/FileServiceImpl.java b/src/main/java/geoinfo/com/file/service/impl/FileServiceImpl.java index a479ab2f..e1998b04 100644 --- a/src/main/java/geoinfo/com/file/service/impl/FileServiceImpl.java +++ b/src/main/java/geoinfo/com/file/service/impl/FileServiceImpl.java @@ -3,6 +3,7 @@ package geoinfo.com.file.service.impl; import geoinfo.com.file.service.FileMapper; import geoinfo.com.file.service.FileService; +import java.sql.SQLException; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -38,7 +39,7 @@ public class FileServiceImpl implements FileService{ } @Override - public List> selectFiles(Map map) throws Exception { + public List> selectFiles(Map map) throws Exception, SQLException { return fileMapper.selectFiles(map); } diff --git a/src/main/java/geoinfo/regi/projectList/ProjectListController.java b/src/main/java/geoinfo/regi/projectList/ProjectListController.java index 8c61be8d..91c37ea2 100644 --- a/src/main/java/geoinfo/regi/projectList/ProjectListController.java +++ b/src/main/java/geoinfo/regi/projectList/ProjectListController.java @@ -48,8 +48,11 @@ public class ProjectListController { strUtil sUtil = new strUtil(); String projectName = sUtil.checkNull((String)params.get("projectName")); + String projectCode = sUtil.checkNull((String)params.get("projectCode")); String isProjectNameChecking = sUtil.checkNull((String)params.get("isProjectNameChecking")); + System.out.println( "thkim 20240719:" + projectCode ); + if(isProjectNameChecking != null && isProjectNameChecking.toLowerCase().equals("true") && projectName == ""){ jsonObject.put("result", "false"); @@ -58,11 +61,17 @@ public class ProjectListController { } else { params.put("PROJECT_NAME", projectName); // 사업명(프로젝트 명) 중복 검사를 수행한다. - ArrayList> arrProjectCodeAndProjectName = masterService.getProjectCodeAndProjectNameByProjectName(params); - if( 0 < arrProjectCodeAndProjectName.size() ) { - jsonObject.put("result", "false"); - jsonObject.put("resultCode", "The name already exists."); - jsonObject.put("message", "해당 사업명이 이미 있습니다. 다른 사업명으로 입력해 주세요."); + ArrayList> arrProjectCodeAndProjectName = masterService.getProjectCodeAndProjectNameByProjectName(params); + + if( 0 < arrProjectCodeAndProjectName.size() ) { + + if( projectCode != null && arrProjectCodeAndProjectName.size() == 1 && projectCode.equals(arrProjectCodeAndProjectName.get(0).get("PROJECT_CODE")) ) { + // 나 자신의 프로젝트가 검색된 거임. + } else { + jsonObject.put("result", "false"); + jsonObject.put("resultCode", "The name already exists."); + jsonObject.put("message", "해당 사업명이 이미 있습니다. 다른 사업명으로 입력해 주세요."); + } } else { jsonObject.put("result", "true"); jsonObject.put("message", ""); diff --git a/src/main/webapp/WEB-INF/views/web/input/meta_info.jsp b/src/main/webapp/WEB-INF/views/web/input/meta_info.jsp index 5d260815..c87ff1ec 100644 --- a/src/main/webapp/WEB-INF/views/web/input/meta_info.jsp +++ b/src/main/webapp/WEB-INF/views/web/input/meta_info.jsp @@ -4,8 +4,28 @@ <%@ include file="/include/inc_head_2021_new.jsp" %> + +