Merge branch 'tolag3'

This commit is contained in:
leejunho 2024-09-13 11:14:22 +09:00
parent 29fd88e98b
commit 63ebf34277
10 changed files with 337 additions and 8 deletions

View File

@ -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);
}
}

View File

@ -21,5 +21,5 @@ import seed.map.T_MEMBER;
public interface XxxService {
public T_MEMBER getMemberForm(String memberId);
}

View File

@ -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 {

View File

@ -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";
}
}

View File

@ -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!
nice.pwd=kofair2016!
#oz \uc11c\ubc84 \uc8fc\uc18c
oz.ozServerNm=http://119.193.215.98:8086

View File

@ -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!
nice.pwd=kofair2016!
#oz \uc11c\ubc84 \uc8fc\uc18c
oz.ozServerNm=http://119.193.215.98:8086

View File

@ -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!
nice.pwd=kofair2016!
#oz \uc11c\ubc84 \uc8fc\uc18c
oz.ozServerNm=http://119.193.215.98:8086

View File

@ -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"%>
<!DOCTYPE html>
<html style="height:100%">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script src="${ozServerNm}/oz80/ozhviewer/jquery-2.0.3.min.js"></script>
<link rel="stylesheet" href="${ozServerNm}/oz80/ozhviewer/jquery-ui.css" type="text/css"/>
<script src="${ozServerNm}/oz80/ozhviewer/jquery-ui.min.js"></script>
<link rel="stylesheet" href="${ozServerNm}/oz80/ozhviewer/ui.dynatree.css" type="text/css"/>
<script type="text/javascript" src="${ozServerNm}/oz80/ozhviewer/jquery.dynatree.js" charset="utf-8"></script>
<script type="text/javascript" src="${ozServerNm}/oz80/ozhviewer/OZJSViewer.js" charset="utf-8"></script>
</head>
<body style="width:98%;height:98%">
<div id="OZViewer" style="width:98%;height:98%"></div>
<script type="text/javascript">
function SetOZParamters_OZViewer() {
var oz;
var jsonData = '${jsonData}';
oz = document.getElementById("OZViewer");
oz.sendToActionScript("information.debug", "true");
oz.sendToActionScript("connection.servlet", '${ozServerNm}'+"/oz80/server");
oz.sendToActionScript("connection.reportname", "/kofair2024/statistics_01.ozr");
oz.sendToActionScript('connection.pcount', '3');
oz.sendToActionScript('connection.args1', 'jsonData=' + jsonData); //Json 파라미터 전달
oz.sendToActionScript('connection.args2', 'subject1=' + '컬럼111'); //Json 파라미터 전달
oz.sendToActionScript('connection.args3', 'subject2=' + '컬럼222'); //Json 파라미터 전달
oz.sendToActionScript('export.applyformat', 'pdf,png,gif,jpg,jpeg'); //파일 다운로드 확장자 지정
oz.sendToActionScript('export.filename', '테스트'); //다운로드 파일 이름 지정
oz.sendToActionScript("toolbar.addmemo", "false"); //메모저장 아이콘
oz.sendToActionScript("toolbar.savedm", "false"); //데이터 저장 아이콘
oz.sendToActionScript("toolbar.etc", "false"); //다른메뉴 아이콘
oz.sendToActionScript("viewer.pagedisplay" , "singlepagecontinuous"); //스크롤 추가_220921_이준호
return true;
}
start_ozjs("OZViewer", '${ozServerNm}'+"/oz80/ozhviewer/");
</script>
</body>
</html>

View File

@ -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"%>
<!DOCTYPE html>
<html style="height:100%">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script src="${ozServerNm}/oz80/ozhviewer/jquery-2.0.3.min.js"></script>
<link rel="stylesheet" href="${ozServerNm}/oz80/ozhviewer/jquery-ui.css" type="text/css"/>
<script src="${ozServerNm}/oz80/ozhviewer/jquery-ui.min.js"></script>
<link rel="stylesheet" href="${ozServerNm}/oz80/ozhviewer/ui.dynatree.css" type="text/css"/>
<script type="text/javascript" src="${ozServerNm}/oz80/ozhviewer/jquery.dynatree.js" charset="utf-8"></script>
<script type="text/javascript" src="${ozServerNm}/oz80/ozhviewer/OZJSViewer.js" charset="utf-8"></script>
</head>
<body style="width:98%;height:98%">
<div id="OZViewer" style="width:98%;height:98%"></div>
<script type="text/javascript">
function SetOZParamters_OZViewer() {
var oz;
var jsonData = '${jsonData}';
oz = document.getElementById("OZViewer");
oz.sendToActionScript("information.debug", "true");
oz.sendToActionScript("connection.servlet", '${ozServerNm}'+"/oz80/server");
oz.sendToActionScript("connection.reportname", "${connectionReportname}");
oz.sendToActionScript('export.applyformat', "${exportApplyformat}"); //파일 다운로드 확장자 지정
oz.sendToActionScript('export.filename', "${exportFilename}"); //다운로드 파일 이름 지정
oz.sendToActionScript("toolbar.addmemo", "false"); //메모저장 아이콘
oz.sendToActionScript("toolbar.savedm", "false"); //데이터 저장 아이콘
oz.sendToActionScript("toolbar.etc", "false"); //다른메뉴 아이콘
oz.sendToActionScript("viewer.pagedisplay" , "singlepagecontinuous"); //스크롤 추가_220921_이준호
// ODI 파라미터 설정
oz.sendToActionScript("odi.odinames", "kofair"); // odi이름. 여러개인 경우 콤마로 구분
oz.sendToActionScript("odi.kofair.pcount", "1"); // odi 패러미터 개수
oz.sendToActionScript("odi.kofair.args1", "queryTest="+ "${odiKofairArgs1}"); // 첫번째 odi패러미터의 이름=값
return true;
}
start_ozjs("OZViewer", '${ozServerNm}'+"/oz80/ozhviewer/");
</script>
</body>
</html>

View File

@ -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/