From 5b14cfff3687f922e9ec93d1171dca7b6f315b3b Mon Sep 17 00:00:00 2001 From: myname Date: Thu, 5 Sep 2024 18:15:43 +0900 Subject: [PATCH] =?UTF-8?q?2024-09-05=2018:15=20=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EA=B4=80=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../seed/com/user/code/CodeController.java | 228 +++++---- .../WEB-INF/jsp/layout/seedAdminLayout.jsp | 2 +- .../jsp/seed/_extra/gtm/exam/write.jsp | 471 +++++++++--------- .../WEB-INF/views/_common/_js/common_XHR.js | 143 +++++- 4 files changed, 501 insertions(+), 343 deletions(-) diff --git a/src/main/java/seed/com/user/code/CodeController.java b/src/main/java/seed/com/user/code/CodeController.java index a95a3c40..e7b85d5b 100644 --- a/src/main/java/seed/com/user/code/CodeController.java +++ b/src/main/java/seed/com/user/code/CodeController.java @@ -1,108 +1,120 @@ -package seed.com.user.code; - -import java.util.Map; - -import javax.servlet.http.HttpServletRequest; -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.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import egovframework.rte.psl.dataaccess.util.EgovMap; -import seed.com.gtm.service.BaseService; -import seed.com.gtm.util.JSONView; -import seed.com.gtm.util.JSPUtil; - - -@Controller -/*@RequestMapping("/gtm/case")*/ -public class CodeController { - protected Log log = LogFactory.getLog(this.getClass()); - - //CodeService, BaseService는 관리자단에서 공통으로 가져다 쓰고있음 - - @Autowired - private BaseService bservice; - - - - public void setSessionMessageRemove(HttpSession session){ - session.removeAttribute("sSiteIdx"); - session.removeAttribute("url"); - session.removeAttribute("message"); - session.removeAttribute("opener"); - session.removeAttribute("append"); - session.removeAttribute("self"); - } - - @RequestMapping(value = "/user/case/{pageFolder}/{pageName}/{pageAction}.do") - public ModelAndView getManagerPage(HttpServletRequest request, - HttpSession session, Map map, - @PathVariable(value="pageFolder") String pageFolder, - @PathVariable(value="pageName") String pageName, - @PathVariable(value="pageAction") String pageAction - ) throws Exception { - EgovMap params; - request.setCharacterEncoding("UTF-8"); - ModelAndView mav = new ModelAndView(); - ModelAndView mavjson = new ModelAndView(new JSONView()); - - params = JSPUtil.makeRequestParams(request, session, true); - - //시큐어코딩 관련 파라미터는 삭제 - params.remove("SpringSecurityFiltersecurityinterceptorFilterapplied"); - params.remove("SpringSecuritySessionMgmtFilterApplied"); - params.remove("springSecurityContext"); - params.remove("SpringSecurityScpfApplied"); - params.remove("springSecuritySavedRequest"); - - String type = ""; - - if(!"".equals((String) params.get("type")) && (String) params.get("type") != null){ - type = (String) params.get("type"); - }else{ - //type이 없을 경우 default 리스트 출력 - type = "L"; - } - - log.warn(">>>>>>type<<<<<<"+type); - - params.put("sql", pageFolder+pageAction); - - log.warn(">>>>>>>>params1<<<<<<<<<"+params); - if("L".equals(type)){ - //mav.addObject("data", bservice.list(params)); - params.put("data", JSPUtil.fixNull(bservice.list(params))); - }else if("S".equals(type)){ - //mav.addObject("data", bservice.select(params)); - params.put("data", JSPUtil.fixNull(bservice.select(params))); - }else if("I".equals(type)){ - params.put("data", JSPUtil.fixNull(bservice.insert(params))); - }else if("U".equals(type)){ - //mav.addObject("data", bservice.update(params)); - params.put("data", JSPUtil.fixNull(bservice.update(params)).toString()); - }else if("D".equals(type)){ - //mav.addObject("data", bservice.delete(params)); - params.put("data", JSPUtil.fixNull(bservice.delete(params)).toString()); - } - - log.warn(">>>>>>>>params2<<<<<<<<<"+params); - if("ajax".equals(pageName)){ - log.warn("===================[[ ajax! ]]================="); - - - params.remove("simpleCaptcha"); - mavjson.addAllObjects(params); - return mavjson; - }else{ - mav.addAllObjects(params); - return mav; - } - } - -} +package seed.com.user.code; + +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +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.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.ModelAndView; + +import egovframework.rte.psl.dataaccess.util.EgovMap; +import seed.com.gtm.service.BaseService; +import seed.com.gtm.util.JSONView; +import seed.com.gtm.util.JSPUtil; + + +@Controller +/*@RequestMapping("/gtm/case")*/ +public class CodeController { + protected Log log = LogFactory.getLog(this.getClass()); + + //CodeService, BaseService는 관리자단에서 공통으로 가져다 쓰고있음 + + @Autowired + private BaseService bservice; + + + + public void setSessionMessageRemove(HttpSession session){ + session.removeAttribute("sSiteIdx"); + session.removeAttribute("url"); + session.removeAttribute("message"); + session.removeAttribute("opener"); + session.removeAttribute("append"); + session.removeAttribute("self"); + } + + @RequestMapping(value = "/user/case/{pageFolder}/{pageName}/{pageAction}.do") + public ModelAndView getManagerPage(HttpServletRequest request, + HttpSession session, Map map, + @PathVariable(value="pageFolder") String pageFolder, + @PathVariable(value="pageName") String pageName, + @PathVariable(value="pageAction") String pageAction + ) throws Exception { + EgovMap params; + request.setCharacterEncoding("UTF-8"); + ModelAndView mav = new ModelAndView(); + ModelAndView mavjson = new ModelAndView(new JSONView()); + + params = JSPUtil.makeRequestParams(request, session, true); + + //시큐어코딩 관련 파라미터는 삭제 + params.remove("SpringSecurityFiltersecurityinterceptorFilterapplied"); + params.remove("SpringSecuritySessionMgmtFilterApplied"); + params.remove("springSecurityContext"); + params.remove("SpringSecurityScpfApplied"); + params.remove("springSecuritySavedRequest"); + + String type = ""; + + if(!"".equals((String) params.get("type")) && (String) params.get("type") != null){ + type = (String) params.get("type"); + }else{ + //type이 없을 경우 default 리스트 출력 + type = "L"; + } + + log.warn(">>>>>>type<<<<<<"+type); + + params.put("sql", pageFolder+pageAction); + + log.warn(">>>>>>>>params1<<<<<<<<<"+params); + if("L".equals(type)){ + //mav.addObject("data", bservice.list(params)); + params.put("data", JSPUtil.fixNull(bservice.list(params))); + }else if("S".equals(type)){ + //mav.addObject("data", bservice.select(params)); + params.put("data", JSPUtil.fixNull(bservice.select(params))); + }else if("I".equals(type)){ + params.put("data", JSPUtil.fixNull(bservice.insert(params))); + }else if("U".equals(type)){ + //mav.addObject("data", bservice.update(params)); + params.put("data", JSPUtil.fixNull(bservice.update(params)).toString()); + }else if("D".equals(type)){ + //mav.addObject("data", bservice.delete(params)); + params.put("data", JSPUtil.fixNull(bservice.delete(params)).toString()); + } + + log.warn(">>>>>>>>params2<<<<<<<<<"+params); + if("Exam".equals(pageFolder) + && "ajax".equals(pageName) + && "BBsInfo".equals(pageAction) + ){ + EgovMap params1 = new EgovMap(); + params1.put("data", params.get("data")); + + mavjson.addAllObjects(params1); + //System.out.println(params); + return mavjson; + + }else if("ajax".equals(pageName)){ + log.warn("===================[[ ajax! ]]================="); + + + params.remove("simpleCaptcha"); + mavjson.addAllObjects(params); + //System.out.println(params); + return mavjson; + }else{ + mav.addAllObjects(params); + return mav; + } + } + +} diff --git a/src/main/webapp/WEB-INF/jsp/layout/seedAdminLayout.jsp b/src/main/webapp/WEB-INF/jsp/layout/seedAdminLayout.jsp index edcdc85f..b46ae827 100644 --- a/src/main/webapp/WEB-INF/jsp/layout/seedAdminLayout.jsp +++ b/src/main/webapp/WEB-INF/jsp/layout/seedAdminLayout.jsp @@ -90,7 +90,7 @@ - + diff --git a/src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/exam/write.jsp b/src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/exam/write.jsp index 87c39935..b8d8de17 100644 --- a/src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/exam/write.jsp +++ b/src/main/webapp/WEB-INF/jsp/seed/_extra/gtm/exam/write.jsp @@ -1,234 +1,239 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> - - - -정보 관리 - - - - - - - - -
-
-

분쟁조정 사례(${menuName})

-
- -
-

분쟁조정 사례(${menuName})를 작성 할 수 있는 페이지 입니다.

-
-
-
-
- - - - - <%-- --%> - - -
-
-
-

제목

-
- -
-
-
-

작성자

-
- ${memberName} -
-
-
-

첨부자료

-
-
- -
-
    - -
- - - -
-
-
-

사건 유형 및 분류 선택

-
- - - / - - - -
-
-
-

사건의 개요

-
- -
-
-
-

분쟁사실 및 당사자 주장

-
- -
-
-
-

검토

-
- -
-
-
-

조정결과

-
- -
-
-
- - - -
- - 목록 -
-
-
- -
- -
- -
-
-
- - - - -
- <%-- - - --%> - - - - +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> + + + + +정보 관리 + + + + + + + + + +
+
+

분쟁조정 사례(${menuName})

+
+ +
+

분쟁조정 사례(${menuName})를 작성 할 수 있는 페이지 입니다.

+
+
+
+
+ + + + + <%-- --%> + + +
+
+
+

제목

+
+ +
+
+
+

작성자

+
+ ${memberName} +
+
+
+

첨부자료

+
+
+ +
+
    + +
+ + + +
+
+
+

사건 유형 및 분류 선택

+
+ + + / + + + +
+
+
+

사건의 개요

+
+ +
+
+
+

분쟁사실 및 당사자 주장

+
+ +
+
+
+

검토

+
+ +
+
+
+

조정결과

+
+ +
+
+
+ + + +
+ + 목록 +
+
+
+ +
+ +
+ +
+
+
+ + + + +
+ <%-- + + --%> + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/_common/_js/common_XHR.js b/src/main/webapp/WEB-INF/views/_common/_js/common_XHR.js index 1b4e686b..eee50827 100644 --- a/src/main/webapp/WEB-INF/views/_common/_js/common_XHR.js +++ b/src/main/webapp/WEB-INF/views/_common/_js/common_XHR.js @@ -2,6 +2,70 @@ * jQuery AJAX */ function XHR(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){ + $.blockUI({ message : '

  잠시만 기다려주세요.

' }); + $.ajax({ + url: url, + type: "POST", + dataType: "html", + //data: data + "&IS_AJAX_REQUEST=IS_AJAX_REQUEST", + contentType: 'application/x-www-form-urlencoded; charset=utf-8', + data: data, + async: true, + cache: false, + success: function (data, textStatus) { + var result; + try{ + console.log(data); + result = eval('(' + data + ')'); + }catch(ex){ + $.unblockUI(); + alert(ex); + } + if( typeof(result) == 'object' ){ // JSON 오프젝트로 받음(리턴값이 JSON이거나 Exception 발생시) + + if(result._EXCEPTION_){ + if(exceptionFunc){ // 익셉션 처리 함수가 있으면 + $.unblockUI(); + exceptionFunc(result._EXCEPTION_); + }else{ + $.unblockUI(); + _processException(result._EXCEPTION_); + } + }else if(result._SESSION_OUT_){ // 세션 아웃 처리 + alert(result._SESSION_OUT_.message); + if(result._SESSION_OUT_.redirectUrl !=""){ + $.unblockUI(); + parent.location.href= redirectUrl; + } + }else{ + if(callbackFunc){ // 익셉션이 아니고 callback 펑션이 있을때. + $.unblockUI(); + callbackFunc(result); + } + } + }else{ + if(callbackFunc){ // HTML 형식의 리턴이며 callback 펑션이 있을때. + $.unblockUI(); + callbackFunc(data); + } + } + }, + beforeSend : function(){ // 로컬 이벤트 , 시작 + if(localStartFunc){ + $.unblockUI(); + localStartFunc(); + } + }, + complete: function(){ // 로컬 이벤트 , 끝 + if(localEndFunc){ + $.unblockUI(); + localEndFunc(); + } + } + }); +} + + function XHR_OLD(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){ $.blockUI({ message : '

  잠시만 기다려주세요.

' }); jQuery.ajax({ url: url, @@ -64,9 +128,86 @@ } }); } - + //비동기 false function XHR2(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){ + $.blockUI({ message : '

  잠시만 기다려주세요.

' }); + $.ajax({ + url: url, + type: "POST", + dataType: "html", + //data: data + "&IS_AJAX_REQUEST=IS_AJAX_REQUEST", + contentType: 'application/x-www-form-urlencoded; charset=utf-8', + data: data, + async: false, + cache: false, + success: function (data, textStatus) { + var result; + try{ + //시큐어코딩 관련 session이 들어가 있으면 신텍스 에러나기 떄문에 삭제 + /* data = data.replace('"SpringSecurityFiltersecurityinterceptorFilterapplied":true,',''); + data = data.replace('"SpringSecuritySessionMgmtFilterApplied":true,',''); + data = data.replace('"springSecurityContext":org.springframework.security.core.context.SecurityContextImpl@689a8480: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@689a8480: Principal: soattorney; Credentials: [PROTECTED]; Authenticated: true; Details: seed.security.SecurityUserDetails@b15278a; Granted Authorities: ROLE_USER,',''); + data = data.replace('"springSecurityContext":org.springframework.security.core.context.SecurityContextImpl@7ef97b48: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@7ef97b48: Principal: soattorney; Credentials: [PROTECTED]; Authenticated: true; Details: seed.security.SecurityUserDetails@1d76d842; Granted Authorities: ROLE_USER,',''); + data = data.replace('"SpringSecurityScpfApplied":true,',''); + data = data.replace('"springSecurityContext":org.springframework.security.core.context.SecurityContextImpl@e3239a3: Authentication: org.springframework.security.authentication.UsernamePasswordAuthenticationToken@e3239a3: Principal: soattorney; Credentials: [PROTECTED]; Authenticated: true; Details: seed.security.SecurityUserDetails@6dbd9aa9; Granted Authorities: ROLE_USER,',''); + */ + + //20191004 주석. + //console.log(data); + + result = eval('(' + data + ')'); + + }catch(ex){ + $.unblockUI(); + alert(ex); + } + if( typeof(result) == 'object' ){ // JSON 오프젝트로 받음(리턴값이 JSON이거나 Exception 발생시) + + if(result._EXCEPTION_){ + if(exceptionFunc){ // 익셉션 처리 함수가 있으면 + exceptionFunc(result._EXCEPTION_); + $.unblockUI(); + }else{ + _processException(result._EXCEPTION_); + $.unblockUI(); + } + }else if(result._SESSION_OUT_){ // 세션 아웃 처리 + alert(result._SESSION_OUT_.message); + if(result._SESSION_OUT_.redirectUrl !=""){ + $.unblockUI(); + parent.location.href= redirectUrl; + } + }else{ + if(callbackFunc){ // 익셉션이 아니고 callback 펑션이 있을때. + $.unblockUI(); + callbackFunc(result); + } + } + }else{ + if(callbackFunc){ // HTML 형식의 리턴이며 callback 펑션이 있을 때. + $.unblockUI(); + callbackFunc(data); + } + } + }, + beforeSend : function(){ // 로컬 이벤트, 시작 + if(localStartFunc){ + $.unblockUI(); + localStartFunc(); + } + }, + complete: function(){ // 로컬 이벤트, 끝 + if(localEndFunc){ + $.unblockUI(); + localEndFunc(); + } + } + }); +} + + //비동기 false + function XHR2_OLD(url, data, callbackFunc, exceptionFunc , localStartFunc , localEndFunc){ // $.blockUI({ message : '

  잠시만 기다려주세요.

' }); jQuery.ajax({ url: url,