diff --git a/src/main/java/kcc/utill/OzUtill.java b/src/main/java/kcc/utill/OzUtill.java new file mode 100644 index 00000000..b16d01d2 --- /dev/null +++ b/src/main/java/kcc/utill/OzUtill.java @@ -0,0 +1,87 @@ +package kcc.utill; + +import org.json.simple.JSONObject; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Component; +import org.springframework.ui.ModelMap; + +import com.fasterxml.jackson.core.io.JsonStringEncoder; +import com.google.gson.JsonObject; + +@Component +public class OzUtill { + + @Value("#{globalSettings['oz.ozServerNm']}") + private String ozServerNm; + + private static final Logger LOGGER = LoggerFactory.getLogger(OzUtill.class); + + public OzUtill() { + } + + /** + * @methodName : ozReportOdi + * @author : JunHo Lee + * @date : 2024.09.13 + * @description : + * @param model + * @param connectionReportname // ozr파일 경로(repositories 이후 경로) ex) '/kofair2024/odi_test.ozr' + * @param exportApplyformat // 파일다운로드 확장자-구분자는 ','로 필요확장자 추가 ex) hwp,pdf + * @param exportFilename // 파일다운로드 파일명 + * @param query // 쿼리 + */ + public void ozReportOdi( + ModelMap model + , String connectionReportname // ozr파일 경로(repositories 이후 경로) ex) '/kofair2024/odi_test.ozr' + , String exportApplyformat // 파일다운로드 확장자-구분자는 ','로 필요확장자 추가 ex) hwp,pdf + , String exportFilename // 파일다운로드 파일명 + , String query // 쿼리 + ) { + +// oz.sendToActionScript("connection.reportname", "/kofair2024/odi_test.ozr"); +// oz.sendToActionScript('export.applyformat', 'hwp'); //파일 다운로드 확장자 지정 +// oz.sendToActionScript('export.filename', '테스트'); //다운로드 파일 이름 지정 +// oz.sendToActionScript("odi.kofair.args1", "queryTest=SELECT 'test1' AS \"컬럼1\", 'test2' AS \"컬럼2\", 'test3' AS \"컬럼3\", 'test4' AS \"컬럼4\", 'test5' AS \"컬럼5\", 'test6' AS \"컬럼6\", 'test7' AS \"컬럼7\", 'test8' AS \"컬럼8\", 'test9' AS \"컬럼9\", 'test10' AS \"컬럼10\", 'test11' AS \"컬럼11\", 'test12' AS \"컬럼12\", 'test13' AS \"컬럼13\", 'test14' AS \"컬럼14\", 'test15' AS \"컬럼15\", 'test16' AS \"컬럼16\", 'test17' AS \"컬럼17\", 'test18' AS \"컬럼18\", 'test19' AS \"컬럼19\", 'test20' AS \"컬럼20\", 'test21' AS \"컬럼21\", 'test22' AS \"컬럼22\", 'test23' AS \"컬럼23\", 'test24' AS \"컬럼24\", 'test25' AS \"컬럼25\", 'test26' AS \"컬럼26\", 'test27' AS \"컬럼27\", 'test28' AS \"컬럼28\", 'test29' AS \"컬럼29\", 'test30' AS \"컬럼30\", 'test31' AS \"컬럼31\", 'test32' AS \"컬럼32\", 'test33' AS \"컬럼33\", 'test34' AS \"컬럼34\", 'test35' AS \"컬럼35\", 'test36' AS \"컬럼36\", 'test37' AS \"컬럼37\", 'test38' AS \"컬럼38\", 'test39' AS \"컬럼39\", 'test40' AS \"컬럼40\", 'test41' AS \"컬럼41\", 'test42' AS \"컬럼42\", 'test43' AS \"컬럼43\", 'test44' AS \"컬럼44\", 'test45' AS \"컬럼45\", 'test46' AS \"컬럼46\", 'test47' AS \"컬럼47\", 'test48' AS \"컬럼48\", 'test49' AS \"컬럼49\", 'test50' AS \"컬럼50\" FROM dual"); // 첫번째 odi패러미터의 이름=값 + + //오즈서버 주소 + model.addAttribute("ozServerNm", ozServerNm); + +// connectionReportname +// exportApplyformat +// exportFilename +// odiKofairArgs1 + + model.addAttribute("connectionReportname", connectionReportname); + model.addAttribute("exportApplyformat", exportApplyformat); + model.addAttribute("exportFilename", exportFilename); + model.addAttribute("odiKofairArgs1", query); + + } + + public void ozReportJson( + JSONObject obj + , ModelMap model + ) { + + /* + * 개행 오류 수정 + * */ + JsonStringEncoder encoder = JsonStringEncoder.getInstance(); + char[] escapedJson = encoder.quoteAsString(obj.toJSONString()); + System.out.println(escapedJson); // {\"type\":\"BIG\"} + String p_json = new String(escapedJson); + p_json = p_json.replace("\\\\\\\\r\\\\\\\\n", "\\\\r\\\\n").replace("\'", "\\'"); + + model.addAttribute("jsonData", p_json); //전체 통합 정보 + /* + * 개행 오류 수정 끝 + * */ + + //오즈서버 주소 + model.addAttribute("ozServerNm", ozServerNm); + } + +} \ No newline at end of file diff --git a/src/main/java/kcc/xxx/service/XxxService.java b/src/main/java/kcc/xxx/service/XxxService.java index a83333c8..7ebef02a 100644 --- a/src/main/java/kcc/xxx/service/XxxService.java +++ b/src/main/java/kcc/xxx/service/XxxService.java @@ -21,5 +21,5 @@ import seed.map.T_MEMBER; public interface XxxService { public T_MEMBER getMemberForm(String memberId); - + } diff --git a/src/main/java/kcc/xxx/service/XxxVO.java b/src/main/java/kcc/xxx/service/XxxVO.java index cbbc2edb..de662a03 100644 --- a/src/main/java/kcc/xxx/service/XxxVO.java +++ b/src/main/java/kcc/xxx/service/XxxVO.java @@ -3,6 +3,9 @@ package kcc.xxx.service; import java.io.Serializable; import kcc.com.cmm.ComDefaultVO; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; @SuppressWarnings("serial") public class XxxVO extends ComDefaultVO implements Serializable { diff --git a/src/main/java/kcc/xxx/web/XxxController.java b/src/main/java/kcc/xxx/web/XxxController.java index 4a1bb87c..d2ec094c 100644 --- a/src/main/java/kcc/xxx/web/XxxController.java +++ b/src/main/java/kcc/xxx/web/XxxController.java @@ -2,11 +2,17 @@ package kcc.xxx.web; import javax.annotation.Resource; +import org.json.JSONArray; +import org.json.simple.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; +import com.fasterxml.jackson.core.io.JsonStringEncoder; + +import kcc.utill.OzUtill; import kcc.xxx.service.XxxService; import seed.map.T_MEMBER; @@ -18,6 +24,9 @@ public class XxxController { @Resource(name = "XxxService") private XxxService xxxService; + @Resource + private OzUtill ozUtill; + @RequestMapping("/xxx/xxxTest.do") public String xxxTest() throws Exception { @@ -31,12 +40,97 @@ public class XxxController { } + @SuppressWarnings("unchecked") @RequestMapping("/xxx/xxxTest2.do") - public String xxxTest2() throws Exception { + public String xxxTest2(ModelMap model) throws Exception { + + JSONObject json1 = new JSONObject(); + json1.put("col1", "test1"); + json1.put("col2", "test2"); + JSONArray jsonArray = new JSONArray(); + for(int i = 0 ; i < 100 ; i++) { + jsonArray.put(json1); + } + + JSONObject pramJsonObj = new JSONObject(); + pramJsonObj.put("json1", jsonArray); - - return null; + ozUtill.ozReportJson(pramJsonObj, model); + + return "/xxx/ozReport"; } + @SuppressWarnings("unchecked") + @RequestMapping("/xxx/ozReportOdi.do") + public String ozReportOdi(ModelMap model) throws Exception { + + String query = "SELECT 'test1' AS \\\"컬럼1\\\"" + + ", 'test2' AS \\\"컬럼2\\\"" + + ", 'test3' AS \\\"컬럼3\\\"" + + ", 'test4' AS \\\"컬럼4\\\"" + + ", 'test5' AS \\\"컬럼5\\\"" + + ", 'test6' AS \\\"컬럼6\\\"" + + ", 'test7' AS \\\"컬럼7\\\"" + + ", 'test8' AS \\\"컬럼8\\\"" + + ", 'test9' AS \\\"컬럼9\\\"" + + ", 'test10' AS \\\"컬럼10\\\"" + + ", 'test11' AS \\\"컬럼11\\\"" + + ", 'test12' AS \\\"컬럼12\\\"" + + ", 'test13' AS \\\"컬럼13\\\"" + + ", 'test14' AS \\\"컬럼14\\\"" + + ", 'test15' AS \\\"컬럼15\\\"" + + ", 'test16' AS \\\"컬럼16\\\"" + + ", 'test17' AS \\\"컬럼17\\\"" + + ", 'test18' AS \\\"컬럼18\\\"" + + ", 'test19' AS \\\"컬럼19\\\"" + + ", 'test20' AS \\\"컬럼20\\\"" + + ", 'test21' AS \\\"컬럼21\\\"" + + ", 'test22' AS \\\"컬럼22\\\"" + + ", 'test23' AS \\\"컬럼23\\\"" + + ", 'test24' AS \\\"컬럼24\\\"" + + ", 'test25' AS \\\"컬럼25\\\"" + + ", 'test26' AS \\\"컬럼26\\\"" + + ", 'test27' AS \\\"컬럼27\\\"" + + ", 'test28' AS \\\"컬럼28\\\"" + + ", 'test29' AS \\\"컬럼29\\\"" + + ", 'test30' AS \\\"컬럼30\\\"" + + ", 'test31' AS \\\"컬럼31\\\"" + + ", 'test32' AS \\\"컬럼32\\\"" + + ", 'test33' AS \\\"컬럼33\\\"" + + ", 'test34' AS \\\"컬럼34\\\"" + + ", 'test35' AS \\\"컬럼35\\\"" + + ", 'test36' AS \\\"컬럼36\\\"" + + ", 'test37' AS \\\"컬럼37\\\"" + + ", 'test38' AS \\\"컬럼38\\\"" + + ", 'test39' AS \\\"컬럼39\\\"" + + ", 'test40' AS \\\"컬럼40\\\"" + + ", 'test41' AS \\\"컬럼41\\\"" + + ", 'test42' AS \\\"컬럼42\\\"" + + ", 'test43' AS \\\"컬럼43\\\"" + + ", 'test44' AS \\\"컬럼44\\\"" + + ", 'test45' AS \\\"컬럼45\\\"" + + ", 'test46' AS \\\"컬럼46\\\"" + + ", 'test47' AS \\\"컬럼47\\\"" + + ", 'test48' AS \\\"컬럼48\\\"" + + ", 'test49' AS \\\"컬럼49\\\"" + + ", 'test50' AS \\\"컬럼50\\\"" + + " FROM dual"; + + /* + * 파라미터 설정 + * connectionReportname // ozr파일 경로(repositories 이후 경로) ex) '/kofair2024/odi_test.ozr' + * exportApplyformat // 파일다운로드 확장자-구분자는 ','로 필요확장자 추가 ex) hwp,pdf + * exportFilename // 파일다운로드 파일명 + * query // 쿼리 + * + * */ + ozUtill.ozReportOdi(model + , "/kofair2024/odi_test.ozr" + , "hwp" + , "testDownload" + , query); + + return "/xxx/ozReportOdi"; + } } diff --git a/src/main/resources/egovframework/egovProps/globals_dev.properties b/src/main/resources/egovframework/egovProps/globals_dev.properties index d1b3725c..41707eb9 100644 --- a/src/main/resources/egovframework/egovProps/globals_dev.properties +++ b/src/main/resources/egovframework/egovProps/globals_dev.properties @@ -215,4 +215,7 @@ file.real.path=D:/project/git/case_seed/WebContent/WEB-INF/views/site/case/uploa #NICE nice.uid=kofair -nice.pwd=kofair2016! \ No newline at end of file +nice.pwd=kofair2016! + +#oz \uc11c\ubc84 \uc8fc\uc18c +oz.ozServerNm=http://119.193.215.98:8086 \ No newline at end of file diff --git a/src/main/resources/egovframework/egovProps/globals_local.properties b/src/main/resources/egovframework/egovProps/globals_local.properties index d1b3725c..41707eb9 100644 --- a/src/main/resources/egovframework/egovProps/globals_local.properties +++ b/src/main/resources/egovframework/egovProps/globals_local.properties @@ -215,4 +215,7 @@ file.real.path=D:/project/git/case_seed/WebContent/WEB-INF/views/site/case/uploa #NICE nice.uid=kofair -nice.pwd=kofair2016! \ No newline at end of file +nice.pwd=kofair2016! + +#oz \uc11c\ubc84 \uc8fc\uc18c +oz.ozServerNm=http://119.193.215.98:8086 \ No newline at end of file diff --git a/src/main/resources/egovframework/egovProps/globals_svr.properties b/src/main/resources/egovframework/egovProps/globals_svr.properties index 293e5e05..4f2d67ca 100644 --- a/src/main/resources/egovframework/egovProps/globals_svr.properties +++ b/src/main/resources/egovframework/egovProps/globals_svr.properties @@ -396,4 +396,7 @@ file.real.path=D:/project/git/case_seed/WebContent/WEB-INF/views/site/case/uploa #NICE nice.uid=kofair -nice.pwd=kofair2016! \ No newline at end of file +nice.pwd=kofair2016! + +#oz \uc11c\ubc84 \uc8fc\uc18c +oz.ozServerNm=http://119.193.215.98:8086 \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/xxx/ozReport.jsp b/src/main/webapp/WEB-INF/jsp/xxx/ozReport.jsp new file mode 100644 index 00000000..4b96e1ed --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/xxx/ozReport.jsp @@ -0,0 +1,65 @@ +<%-- + 대국민 사용자 + Class Name : adjstReqReport.jsp + Description : 조정신청서 리포트 전송 화면(오즈리포트 정보 전송) + Modification Information + + 수정일 수정자 수정내용 + ------- -------- --------------------------- + 2021.09.27 우영두 최초생성 + + author : 우영두 + since : 2021.09.27 + +--%> +<%-- 공통 JS 함수 정의 : /jsp/web/com/webLayout.jsp --%> +<%@ page contentType="text/html; charset=utf-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator"%> + + + + + + + + + + + + + + +
+ + + + + + diff --git a/src/main/webapp/WEB-INF/jsp/xxx/ozReportOdi.jsp b/src/main/webapp/WEB-INF/jsp/xxx/ozReportOdi.jsp new file mode 100644 index 00000000..e6653f9a --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/xxx/ozReportOdi.jsp @@ -0,0 +1,68 @@ +<%-- + 대국민 사용자 + Class Name : adjstReqReport.jsp + Description : 조정신청서 리포트 전송 화면(오즈리포트 정보 전송) + Modification Information + + 수정일 수정자 수정내용 + ------- -------- --------------------------- + 2021.09.27 우영두 최초생성 + + author : 우영두 + since : 2021.09.27 + +--%> +<%-- 공통 JS 함수 정의 : /jsp/web/com/webLayout.jsp --%> +<%@ page contentType="text/html; charset=utf-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui"%> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator"%> + + + + + + + + + + + + + + +
+ + + + + + diff --git a/src/main/webapp/WEB-INF/views/_common/_js/seed.tab.js b/src/main/webapp/WEB-INF/views/_common/_js/seed.tab.js index d316b0ea..97d4ac06 100644 --- a/src/main/webapp/WEB-INF/views/_common/_js/seed.tab.js +++ b/src/main/webapp/WEB-INF/views/_common/_js/seed.tab.js @@ -88,7 +88,10 @@ Array.prototype.unique=function(){var unique=this.reduce(function(a,b){if(a.inde window.sessionStorage.siteIdx = currentSiteIdx; } - return emptySiteIdx ? sessionStorage.siteIdx : currentSiteIdx; + /*return emptySiteIdx ? sessionStorage.siteIdx : currentSiteIdx;*/ + + //seed.tab이 계속 뜨는 문제로 인해 하드코딩으로 넘기기_임시방편!!!!!!!!!!!!_이준호 + return "case"; }()); // from : https://arifhossen.wordpress.com/2010/07/19/javascript-get-base-url/