From 7a048c66f4ecd7d2fc1323f063120e6378a2b0a8 Mon Sep 17 00:00:00 2001 From: thkim Date: Fri, 19 Jul 2024 13:50:04 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=C2=96=EC=8B=A0=EA=B7=9C=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=EC=A0=9D=ED=8A=B8=20=EC=82=AC=EC=97=85=EB=AA=85=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=20=EA=B2=80=EC=82=AC=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 지반자료 입력 결과 보고서에도 중복을 체크하도록 구현. " --- .../geoinfo/com/file/service/FileService.java | 3 +- .../file/service/impl/FileServiceImpl.java | 3 +- .../projectList/ProjectListController.java | 19 ++-- .../WEB-INF/views/web/input/meta_info.jsp | 90 ++++++++++++++++++- .../WEB-INF/views/web/input/meta_info1.jsp | 1 - .../WEB-INF/views/web/input/projectInfo.jsp | 11 +-- 6 files changed, 105 insertions(+), 22 deletions(-) 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" %> + +