From 784d13d3fd7ab8a7391cbea824b5b59b338ab995 Mon Sep 17 00:00:00 2001 From: JIWOO Date: Tue, 29 Oct 2024 10:16:32 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=9A=B0=20-=20=EC=9D=B4?= =?UTF-8?q?=EB=85=B8=EB=A6=AD=EC=8A=A4=20=EC=9E=91=EC=97=85=20=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 7 +++++ src/main/java/config/seed/config.properties | 4 +-- .../com/gtm/seedfile/SeedFileController.java | 27 ++++++++++++++-- .../com/gtm/seedfile/SeedFileService.java | 31 ++++++++++++++----- .../egovProps/globals_svr.properties | 8 ++--- src/main/webapp/innorix/exam/upload.html | 3 +- 6 files changed, 61 insertions(+), 19 deletions(-) diff --git a/pom.xml b/pom.xml index 251ce224..b99d2177 100644 --- a/pom.xml +++ b/pom.xml @@ -514,6 +514,13 @@ commons-dbutils 1.6 + + + innorix + InnorixJAVA + 9.2 + + diff --git a/src/main/java/config/seed/config.properties b/src/main/java/config/seed/config.properties index 5df8c39a..772b3087 100644 --- a/src/main/java/config/seed/config.properties +++ b/src/main/java/config/seed/config.properties @@ -149,10 +149,10 @@ root.path=C:/project/git/case_seed/WebContent/WEB-INF/views/site root.contextpath= #\ucca8\ubd80\ud30c\uc77c \uc784\uc2dc\ud3f4\ub354 -file.temp.path=C:/project/git/case_seed/WebContent/WEB-INF/views/site/case/upload/tempFiles +file.temp.path=D:/project/git/case_seed/WebContent/WEB-INF/views/site/case/upload/tempFiles #file.temp.path=C:/Project_Files/case_seed-v3.0/WebContent/WEB-INF/views/site/case/upload/tempFiles #\ucca8\ubd80\ud30c\uc77c \uc5c5\ub85c\ub4dc\ud3f4\ub354 -file.real.path=C:/project/git/case_seed/WebContent/WEB-INF/views/site/case/upload/uploadFiles +file.real.path=D:/project/git/case_seed/WebContent/WEB-INF/views/site/case/upload/uploadFiles #file.real.path=C:/Project_Files/case_seed-v3.0/WebContent/WEB-INF/views/site/case/upload/uploadFiles #NICE diff --git a/src/main/java/seed/com/gtm/seedfile/SeedFileController.java b/src/main/java/seed/com/gtm/seedfile/SeedFileController.java index 6486c761..3fc82c07 100644 --- a/src/main/java/seed/com/gtm/seedfile/SeedFileController.java +++ b/src/main/java/seed/com/gtm/seedfile/SeedFileController.java @@ -22,6 +22,7 @@ import javax.servlet.http.HttpSession; import org.apache.ibatis.logging.Log; import org.apache.ibatis.logging.LogFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; @@ -49,6 +50,16 @@ public class SeedFileController { protected Log log = LogFactory.getLog(this.getClass()); + //임시 파일 저장 경로 + @Value("#{globalSettings['file.temp.path']}") + private String globalTempPath; + //파일 저장 경로 + @Value("#{globalSettings['file.real.path']}") + private String globalRealPath; + //루트 경로 + @Value("#{globalSettings['root.path']}") + private String globalRootPath; + @RequestMapping(value="/seed/extra/temp/file.do", method=RequestMethod.POST) public @ResponseBody HashMap tempFileUpload(HttpSession session, HttpServletRequest req, MultipartHttpServletRequest mreq){ String siteIdx = SeedUtils.setReplaceNull(session.getAttribute("siteIdx")); @@ -70,12 +81,20 @@ public class SeedFileController { boolean success = false; - SeedProperties seedProperties = new SeedProperties(); + /*SeedProperties seedProperties = new SeedProperties(); String tempPath = ""; if(funcType.equals("trublchargermng")){ tempPath = seedProperties.getConfigValue("root.path"); }else{ tempPath = seedProperties.getConfigValue("file.temp.path"); + }*/ + + SeedProperties seedProperties = new SeedProperties(); + String tempPath = ""; + if(funcType.equals("trublchargermng")){ + tempPath = globalRootPath; + }else{ + tempPath = globalTempPath; } //SeedUtils.setSeedMkDirs(rootPath + "/" + siteIdx + "/upload/tempFiles/"+funcType); @@ -197,7 +216,8 @@ public class SeedFileController { public ModelAndView fileDown(ModelMap map, HttpSession session ,HttpServletResponse response,HttpServletRequest request,@RequestParam Map paramMap){ SeedProperties seedProperties = new SeedProperties(); - String rootPath = seedProperties.getConfigValue("file.real.path"); + /*String rootPath = seedProperties.getConfigValue("file.real.path");*/ + String rootPath = globalRootPath; String dataIdx = SeedUtils.setReplaceNull(paramMap.get("dataIdx")); String pathKey1 = SeedUtils.setReplaceNull(paramMap.get("pathKey1")); @@ -205,7 +225,8 @@ public class SeedFileController { String funcType = SeedUtils.setReplaceNull(paramMap.get("funcType")); if(funcType.equals("trublchargermng")){ - rootPath = seedProperties.getConfigValue("root.path"); + /*rootPath = seedProperties.getConfigValue("root.path");*/ + rootPath = globalRootPath; } String path = SeedUtils.setReplaceNull(paramMap.get("filePath")); diff --git a/src/main/java/seed/com/gtm/seedfile/SeedFileService.java b/src/main/java/seed/com/gtm/seedfile/SeedFileService.java index 90866df9..42998bc9 100644 --- a/src/main/java/seed/com/gtm/seedfile/SeedFileService.java +++ b/src/main/java/seed/com/gtm/seedfile/SeedFileService.java @@ -10,6 +10,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import egovframework.rte.fdl.property.EgovPropertyService; @@ -35,6 +36,16 @@ public class SeedFileService { @Resource(name = "propertiesService") protected EgovPropertyService propertyService; + //임시 파일 저장 경로 + @Value("#{globalSettings['file.temp.path']}") + private String globalTempPath; + //파일 저장 경로 + @Value("#{globalSettings['file.real.path']}") + private String globalRealPath; + //루트 경로 + @Value("#{globalSettings['root.path']}") + private String globalRootPath; + public void fileInsert(Map paramMap, HttpServletRequest request, HttpSession session){ String siteIdx = SeedUtils.setReplaceNull(session.getAttribute("siteIdx")); @@ -44,22 +55,26 @@ public class SeedFileService { String fileFuncType = (String)paramMap.get("fileFuncType"); SeedProperties seedProperties = new SeedProperties(); + + /*AS-IS 분쟁조정 첨부파일 경로 설정*/ + /*String rootPath = null; + String tempPath = seedProperties.getConfigValue("file.temp.path"); + if(fileFuncType.equals("trublchargermng")){ + rootPath = seedProperties.getConfigValue("root.path"); + }else{ + rootPath = seedProperties.getConfigValue("file.real.path"); + }*/ String rootPath = null; - //AS-iS 분쟁조정 설정 - /*String tempPath = seedProperties.getConfigValue("file.temp.path");*/ - String tempPath = propertyService.getString("Globals.fileStorePath"); + String tempPath = globalTempPath; if(fileFuncType.equals("trublchargermng")){ - /*rootPath = seedProperties.getConfigValue("root.path");*/ - rootPath = propertyService.getString("root.path"); + rootPath = globalRootPath; }else{ - /*rootPath = seedProperties.getConfigValue("file.real.path");*/ - rootPath = propertyService.getString("Globals.fileStorePath"); + rootPath = globalRealPath; } - SeedDateUtil seedDateUtil = new SeedDateUtil(); String toDate = seedDateUtil.getSimpleDateFormat(new Date(), "yyyyMMdd"); String renameDate = seedDateUtil.getSimpleDateFormat(new Date(), "yyyyMMddHHmmss"); diff --git a/src/main/resources/egovframework/egovProps/globals_svr.properties b/src/main/resources/egovframework/egovProps/globals_svr.properties index 0e695f01..9da0a466 100644 --- a/src/main/resources/egovframework/egovProps/globals_svr.properties +++ b/src/main/resources/egovframework/egovProps/globals_svr.properties @@ -383,16 +383,14 @@ http.url= #\ud574\ub2f9 \uc0ac\uc774\ud2b8 URL root.url=http://localhost #\ud574\ub2f9 \uc11c\ubc84 SEED\uc11c\ubc84 \uacbd\ub85c -root.path=D:/project/git/case_seed/WebContent/WEB-INF/views/site +root.path=/usr/local/homepage/WEB-INF/views/site #\ud574\ub2f9 \uc0ac\uc774\ud2b8 URL path root.contextpath= #\ucca8\ubd80\ud30c\uc77c \uc784\uc2dc\ud3f4\ub354 -file.temp.path=D:/project/git/case_seed/WebContent/WEB-INF/views/site/case/upload/tempFiles -#file.temp.path=C:/Project_Files/case_seed-v3.0/WebContent/WEB-INF/views/site/case/upload/tempFiles +file.temp.path=/usr/local/homepage/WEB-INF/views/site/case/upload/tempFiles #\ucca8\ubd80\ud30c\uc77c \uc5c5\ub85c\ub4dc\ud3f4\ub354 -file.real.path=D:/project/git/case_seed/WebContent/WEB-INF/views/site/case/upload/uploadFiles -#file.real.path=C:/Project_Files/case_seed-v3.0/WebContent/WEB-INF/views/site/case/upload/uploadFiles +file.real.path=/usr/local/homepage/WEB-INF/views/site/case/upload/uploadFiles #NICE nice.uid=kofair diff --git a/src/main/webapp/innorix/exam/upload.html b/src/main/webapp/innorix/exam/upload.html index 3641ace8..273a54bf 100644 --- a/src/main/webapp/innorix/exam/upload.html +++ b/src/main/webapp/innorix/exam/upload.html @@ -13,7 +13,8 @@ el: '#fileControl', // 컨트롤 출력 HTML 객체 ID transferMode: 'both', // 업로드, 다운로드 혼합사용 installUrl: '/innorix/install/install.html', // Agent 설치 페이지 - uploadUrl: '/innorix/exam/upload_test_220916.jsp' // 업로드 URL + uploadUrl: '/innorix/exam/upload.jsp' // 업로드 URL + /* uploadUrl: '/innorix/exam/upload_test_220916.jsp' // 업로드 URL */ }); // 업로드 완료 이벤트