최초커밋(일부)
parent
459d31fa4f
commit
c625f6f0bc
@ -0,0 +1,110 @@
|
||||
package egovframework.com.cmm;
|
||||
/*
|
||||
* Copyright 2002-2005 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.jdbc.support.lob.LobCreator;
|
||||
import org.springframework.jdbc.support.lob.LobHandler;
|
||||
//import org.springframework.orm.ibatis.support.AbstractLobTypeHandler;
|
||||
import egovframework.rte.psl.orm.ibatis.support.AbstractLobTypeHandler;
|
||||
/**
|
||||
* iBATIS TypeHandler implementation for Strings that get mapped to CLOBs.
|
||||
* Retrieves the LobHandler to use from SqlMapClientFactoryBean at config time.
|
||||
*
|
||||
* <p>Particularly useful for storing Strings with more than 4000 characters in an
|
||||
* Oracle database (only possible via CLOBs), in combination with OracleLobHandler.
|
||||
*
|
||||
* <p>Can also be defined in generic iBATIS mappings, as DefaultLobCreator will
|
||||
* work with most JDBC-compliant database drivers. In this case, the field type
|
||||
* does not have to be BLOB: For databases like MySQL and MS SQL Server, any
|
||||
* large enough binary type will work.
|
||||
*
|
||||
* @author Juergen Hoeller
|
||||
* @since 1.1.5
|
||||
* @see org.springframework.orm.ibatis.SqlMapClientFactoryBean#setLobHandler
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class AltibaseClobStringTypeHandler extends AbstractLobTypeHandler {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(AltibaseClobStringTypeHandler.class);
|
||||
|
||||
/**
|
||||
* Constructor used by iBATIS: fetches config-time LobHandler from
|
||||
* SqlMapClientFactoryBean.
|
||||
* @see org.springframework.orm.ibatis.SqlMapClientFactoryBean#getConfigTimeLobHandler
|
||||
*/
|
||||
public AltibaseClobStringTypeHandler() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor used for testing: takes an explicit LobHandler.
|
||||
*/
|
||||
protected AltibaseClobStringTypeHandler(LobHandler lobHandler) {
|
||||
super(lobHandler);
|
||||
}
|
||||
|
||||
protected void setParameterInternal(
|
||||
PreparedStatement ps, int index, Object value, String jdbcType, LobCreator lobCreator)
|
||||
throws SQLException {
|
||||
lobCreator.setClobAsString(ps, index, (String) value);
|
||||
}
|
||||
|
||||
|
||||
protected Object getResultInternal(ResultSet rs, int index, LobHandler lobHandler)
|
||||
throws SQLException {
|
||||
|
||||
StringBuffer read_data = new StringBuffer("");
|
||||
int read_length;
|
||||
|
||||
char [] buf = new char[1024];
|
||||
|
||||
Reader rd = lobHandler.getClobAsCharacterStream(rs, index);
|
||||
try {
|
||||
while( (read_length=rd.read(buf)) != -1) {
|
||||
read_data.append(buf, 0, read_length);
|
||||
}
|
||||
} catch (IOException ie) {
|
||||
SQLException sqle = new SQLException(ie.getMessage());
|
||||
throw sqle;
|
||||
// 2011.10.10 보안점검 후속조치
|
||||
} finally {
|
||||
if (rd != null) {
|
||||
try {
|
||||
rd.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORE: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return read_data.toString();
|
||||
|
||||
//return lobHandler.getClobAsString(rs, index);
|
||||
}
|
||||
|
||||
public Object valueOf(String s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,185 @@
|
||||
package egovframework.com.cmm;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
/**
|
||||
* 클래스
|
||||
* @author 공통서비스개발팀 이삼섭
|
||||
* @since 2009.06.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.3.11 이삼섭 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ComDefaultCodeVO implements Serializable {
|
||||
/** 코드 ID */
|
||||
private String codeId = "";
|
||||
|
||||
/** 상세코드 */
|
||||
private String code = "";
|
||||
|
||||
/** 코드명 */
|
||||
private String codeNm = "";
|
||||
|
||||
/** 코드설명 */
|
||||
private String codeDc = "";
|
||||
|
||||
/** 특정테이블명 */
|
||||
private String tableNm = ""; //특정테이블에서 코드정보를추출시 사용
|
||||
|
||||
/** 상세 조건 여부 */
|
||||
private String haveDetailCondition = "N";
|
||||
|
||||
/** 상세 조건 */
|
||||
private String detailCondition = "";
|
||||
|
||||
/**
|
||||
* codeId attribute를 리턴한다.
|
||||
*
|
||||
* @return the codeId
|
||||
*/
|
||||
public String getCodeId() {
|
||||
return codeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* codeId attribute 값을 설정한다.
|
||||
*
|
||||
* @param codeId
|
||||
* the codeId to set
|
||||
*/
|
||||
public void setCodeId(String codeId) {
|
||||
this.codeId = codeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* code attribute를 리턴한다.
|
||||
*
|
||||
* @return the code
|
||||
*/
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* code attribute 값을 설정한다.
|
||||
*
|
||||
* @param code
|
||||
* the code to set
|
||||
*/
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* codeNm attribute를 리턴한다.
|
||||
*
|
||||
* @return the codeNm
|
||||
*/
|
||||
public String getCodeNm() {
|
||||
return codeNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* codeNm attribute 값을 설정한다.
|
||||
*
|
||||
* @param codeNm
|
||||
* the codeNm to set
|
||||
*/
|
||||
public void setCodeNm(String codeNm) {
|
||||
this.codeNm = codeNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* codeDc attribute를 리턴한다.
|
||||
*
|
||||
* @return the codeDc
|
||||
*/
|
||||
public String getCodeDc() {
|
||||
return codeDc;
|
||||
}
|
||||
|
||||
/**
|
||||
* codeDc attribute 값을 설정한다.
|
||||
*
|
||||
* @param codeDc
|
||||
* the codeDc to set
|
||||
*/
|
||||
public void setCodeDc(String codeDc) {
|
||||
this.codeDc = codeDc;
|
||||
}
|
||||
|
||||
/**
|
||||
* tableNm attribute를 리턴한다.
|
||||
*
|
||||
* @return the tableNm
|
||||
*/
|
||||
public String getTableNm() {
|
||||
return tableNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* tableNm attribute 값을 설정한다.
|
||||
*
|
||||
* @param tableNm
|
||||
* the tableNm to set
|
||||
*/
|
||||
public void setTableNm(String tableNm) {
|
||||
this.tableNm = tableNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* haveDetailCondition attribute를 리턴한다.
|
||||
*
|
||||
* @return the haveDetailCondition
|
||||
*/
|
||||
public String getHaveDetailCondition() {
|
||||
return haveDetailCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* haveDetailCondition attribute 값을 설정한다.
|
||||
*
|
||||
* @param haveDetailCondition
|
||||
* the haveDetailCondition to set
|
||||
*/
|
||||
public void setHaveDetailCondition(String haveDetailCondition) {
|
||||
this.haveDetailCondition = haveDetailCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* detailCondition attribute를 리턴한다.
|
||||
*
|
||||
* @return the detailCondition
|
||||
*/
|
||||
public String getDetailCondition() {
|
||||
return detailCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* detailCondition attribute 값을 설정한다.
|
||||
*
|
||||
* @param detailCondition
|
||||
* the detailCondition to set
|
||||
*/
|
||||
public void setDetailCondition(String detailCondition) {
|
||||
this.detailCondition = detailCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* toString 메소드를 대치한다.
|
||||
*/
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,210 @@
|
||||
package egovframework.com.cmm;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
import egovframework.itgcms.common.DefaultVO;
|
||||
|
||||
/**
|
||||
* @Class Name : ComDefaultVO.java
|
||||
* @Description : ComDefaultVO class
|
||||
* @Modification Information
|
||||
* @
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------- -------- ---------------------------
|
||||
* @ 2009.02.01 조재영 최초 생성
|
||||
*
|
||||
* @author 공통서비스 개발팀 조재영
|
||||
* @since 2009.02.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class ComDefaultVO extends DefaultVO implements Serializable {
|
||||
|
||||
/** 검색조건 */
|
||||
private String searchCondition = "";
|
||||
|
||||
/** 검색Keyword */
|
||||
private String searchKeyword = "";
|
||||
|
||||
private String searchKeyword0 = "";
|
||||
|
||||
/** 질문유형 */
|
||||
private String schQestnTyCode = "";
|
||||
|
||||
/** 기타답변여부 */
|
||||
private String schEtcAnswerAt = "";
|
||||
|
||||
private String schDiv = "";
|
||||
|
||||
/** 검색사용여부 */
|
||||
private String searchUseYn = "";
|
||||
|
||||
/** 현재페이지 */
|
||||
private int pageIndex = 1;
|
||||
|
||||
/** 페이지갯수 */
|
||||
private int pageUnit = 10;
|
||||
|
||||
/** 페이지사이즈 */
|
||||
private int pageSize = 10;
|
||||
|
||||
/** firstIndex */
|
||||
private int firstIndex = 1;
|
||||
|
||||
/** lastIndex */
|
||||
private int lastIndex = 1;
|
||||
|
||||
/** recordCountPerPage */
|
||||
private int recordCountPerPage = 10;
|
||||
|
||||
/** 검색KeywordFrom */
|
||||
private String searchKeywordFrom = "";
|
||||
|
||||
/** 검색KeywordTo */
|
||||
private String searchKeywordTo = "";
|
||||
|
||||
public int getFirstIndex() {
|
||||
return firstIndex;
|
||||
}
|
||||
|
||||
public void setFirstIndex(int firstIndex) {
|
||||
this.firstIndex = firstIndex;
|
||||
}
|
||||
|
||||
public int getLastIndex() {
|
||||
return lastIndex;
|
||||
}
|
||||
|
||||
public void setLastIndex(int lastIndex) {
|
||||
this.lastIndex = lastIndex;
|
||||
}
|
||||
|
||||
public int getRecordCountPerPage() {
|
||||
return recordCountPerPage;
|
||||
}
|
||||
|
||||
public void setRecordCountPerPage(int recordCountPerPage) {
|
||||
this.recordCountPerPage = recordCountPerPage;
|
||||
}
|
||||
|
||||
public String getSearchCondition() {
|
||||
return searchCondition;
|
||||
}
|
||||
|
||||
public void setSearchCondition(String searchCondition) {
|
||||
this.searchCondition = searchCondition;
|
||||
}
|
||||
|
||||
public String getSearchKeyword() {
|
||||
return searchKeyword;
|
||||
}
|
||||
|
||||
public void setSearchKeyword(String searchKeyword) {
|
||||
this.searchKeyword = searchKeyword;
|
||||
}
|
||||
|
||||
public String getSearchKeyword0() {
|
||||
return searchKeyword0;
|
||||
}
|
||||
|
||||
public void setSearchKeyword0(String searchKeyword0) {
|
||||
this.searchKeyword0 = searchKeyword0;
|
||||
}
|
||||
|
||||
public String getSchQestnTyCode() {
|
||||
return schQestnTyCode;
|
||||
}
|
||||
|
||||
public void setSchQestnTyCode(String schQestnTyCode) {
|
||||
this.schQestnTyCode = schQestnTyCode;
|
||||
}
|
||||
|
||||
public String getSchEtcAnswerAt() {
|
||||
return schEtcAnswerAt;
|
||||
}
|
||||
|
||||
public void setSchEtcAnswerAt(String schEtcAnswerAt) {
|
||||
this.schEtcAnswerAt = schEtcAnswerAt;
|
||||
}
|
||||
|
||||
public String getSchDiv() {
|
||||
return schDiv;
|
||||
}
|
||||
|
||||
public void setSchDiv(String schDiv) {
|
||||
this.schDiv = schDiv;
|
||||
}
|
||||
|
||||
public String getSearchUseYn() {
|
||||
return searchUseYn;
|
||||
}
|
||||
|
||||
public void setSearchUseYn(String searchUseYn) {
|
||||
this.searchUseYn = searchUseYn;
|
||||
}
|
||||
|
||||
public int getPageIndex() {
|
||||
return pageIndex;
|
||||
}
|
||||
|
||||
public void setPageIndex(int pageIndex) {
|
||||
this.pageIndex = pageIndex;
|
||||
}
|
||||
|
||||
public int getPageUnit() {
|
||||
return pageUnit;
|
||||
}
|
||||
|
||||
public void setPageUnit(int pageUnit) {
|
||||
this.pageUnit = pageUnit;
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* searchKeywordFrom attribute를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getSearchKeywordFrom() {
|
||||
return searchKeywordFrom;
|
||||
}
|
||||
|
||||
/**
|
||||
* searchKeywordFrom attribute 값을 설정한다.
|
||||
* @param searchKeywordFrom String
|
||||
*/
|
||||
public void setSearchKeywordFrom(String searchKeywordFrom) {
|
||||
this.searchKeywordFrom = searchKeywordFrom;
|
||||
}
|
||||
|
||||
/**
|
||||
* searchKeywordTo attribute를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getSearchKeywordTo() {
|
||||
return searchKeywordTo;
|
||||
}
|
||||
|
||||
/**
|
||||
* searchKeywordTo attribute 값을 설정한다.
|
||||
* @param searchKeywordTo String
|
||||
*/
|
||||
public void setSearchKeywordTo(String searchKeywordTo) {
|
||||
this.searchKeywordTo = searchKeywordTo;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,405 @@
|
||||
package egovframework.com.cmm;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.JspWriter;
|
||||
import javax.servlet.jsp.PageContext;
|
||||
import javax.servlet.jsp.tagext.BodyTagSupport;
|
||||
|
||||
import org.apache.taglibs.standard.tag.common.core.Util;
|
||||
|
||||
/**
|
||||
* Cross-Site Scripting 체크하여 값을 되돌려 받는 핸들러 JSP TLD, 자바에서 사용가능
|
||||
*
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2010.11.09
|
||||
* @version 1.0
|
||||
* @see <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.11.09 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class EgovComCrossSiteHndlr extends BodyTagSupport {
|
||||
|
||||
/*
|
||||
* (One almost wishes XML and JSP could support "anonymous tags," given the
|
||||
* amount of trouble we had naming this one!) :-) - sb
|
||||
*/
|
||||
|
||||
// *********************************************************************
|
||||
// Internal state
|
||||
|
||||
protected Object value; // tag attribute
|
||||
protected String def; // tag attribute
|
||||
protected boolean escapeXml; // tag attribute
|
||||
private boolean needBody; // non-space body needed?
|
||||
|
||||
// *********************************************************************
|
||||
// Construction and initialization
|
||||
|
||||
private final String m_sDiffChar ="()[]{}\"',:;= \t\r\n%!+-";
|
||||
//private String m_sDiffChar ="()[]{}\"',:;=%!+-";
|
||||
private final String m_sArrDiffChar [] = {
|
||||
"(",")",
|
||||
"[","]",
|
||||
"{","}",
|
||||
""","'",
|
||||
",",":",
|
||||
";","=",
|
||||
" ","\t", //" ","\t",
|
||||
"\r","\n", //"\r","\n",
|
||||
"%","!",
|
||||
"+","-"
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a new handler. As with TagSupport, subclasses should not
|
||||
* provide other constructors and are expected to call the superclass
|
||||
* constructor.
|
||||
*/
|
||||
public EgovComCrossSiteHndlr() {
|
||||
super();
|
||||
init();
|
||||
}
|
||||
|
||||
// resets local state
|
||||
private void init() {
|
||||
value = def = null;
|
||||
escapeXml = true;
|
||||
needBody = false;
|
||||
}
|
||||
|
||||
// Releases any resources we may have (or inherit)
|
||||
public void release() {
|
||||
super.release();
|
||||
init();
|
||||
}
|
||||
|
||||
// *********************************************************************
|
||||
// Tag logic
|
||||
|
||||
// evaluates 'value' and determines if the body should be evaluted
|
||||
public int doStartTag() throws JspException {
|
||||
|
||||
needBody = false; // reset state related to 'default'
|
||||
this.bodyContent = null; // clean-up body (just in case container is
|
||||
// pooling tag handlers)
|
||||
|
||||
JspWriter out = pageContext.getOut();
|
||||
//System.out.println("EgovComCrossSiteFilter> ============================");
|
||||
try {
|
||||
// print value if available; otherwise, try 'default'
|
||||
if (value != null) {
|
||||
//System.out.println("EgovComCrossSiteFilter> =value");
|
||||
String sWriteEscapedXml = getWriteEscapedXml();
|
||||
//System.out.println("EgovComCrossSiteFilter sWriteEscapedXml>" + sWriteEscapedXml);
|
||||
out.print(sWriteEscapedXml);
|
||||
return SKIP_BODY;
|
||||
} else {
|
||||
// if we don't have a 'default' attribute, just go to the body
|
||||
if (def == null) {
|
||||
needBody = true;
|
||||
return EVAL_BODY_BUFFERED;
|
||||
}
|
||||
|
||||
//System.out.println("EgovComCrossSiteFilter def> ="+def);
|
||||
|
||||
// if we do have 'default', print it
|
||||
if (def != null) {
|
||||
// good 'default'
|
||||
out(pageContext, escapeXml, def);
|
||||
//System.out.println("EgovComCrossSiteFilter> ="+def);
|
||||
}
|
||||
return SKIP_BODY;
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
throw new JspException(ex.toString(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
// prints the body if necessary; reports errors
|
||||
public int doEndTag() throws JspException {
|
||||
try {
|
||||
//System.out.println("EgovComCrossSiteFilter ==== doEndTag");
|
||||
if (!needBody){
|
||||
return EVAL_PAGE; // nothing more to do
|
||||
}
|
||||
|
||||
// trim and print out the body
|
||||
if (bodyContent != null && bodyContent.getString() != null){
|
||||
//String sWriteEscapedXml = getWriteEscapedXml();
|
||||
//out2(pageContext, escapeXml, sWriteEscapedXml.toString());
|
||||
//System.out.println("EgovComCrossSiteFilter> end");
|
||||
//System.out.println("EgovComCrossSiteFilter sWriteEscapedXml > sWriteEscapedXml");
|
||||
out(pageContext, escapeXml, bodyContent.getString().trim());
|
||||
|
||||
}
|
||||
return EVAL_PAGE;
|
||||
} catch (IOException ex) {
|
||||
throw new JspException(ex.toString(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
// *********************************************************************
|
||||
// Public utility methods
|
||||
|
||||
/**
|
||||
* Outputs <tt>text</tt> to <tt>pageContext</tt>'s current JspWriter. If
|
||||
* <tt>escapeXml</tt> is true, performs the following substring replacements
|
||||
* (to facilitate output to XML/HTML pages):
|
||||
*
|
||||
* & -> & < -> < > -> > " -> " ' -> '
|
||||
*
|
||||
* See also Util.escapeXml().
|
||||
*/
|
||||
public static void out(PageContext pageContext, boolean escapeXml,
|
||||
Object obj) throws IOException {
|
||||
JspWriter w = pageContext.getOut();
|
||||
|
||||
if (!escapeXml) {
|
||||
// write chars as is
|
||||
if (obj instanceof Reader) {
|
||||
Reader reader = (Reader) obj;
|
||||
char[] buf = new char[4096];
|
||||
int count;
|
||||
while ((count = reader.read(buf, 0, 4096)) != -1) {
|
||||
w.write(buf, 0, count);
|
||||
}
|
||||
} else {
|
||||
w.write(obj.toString());
|
||||
}
|
||||
} else {
|
||||
// escape XML chars
|
||||
if (obj instanceof Reader) {
|
||||
Reader reader = (Reader) obj;
|
||||
char[] buf = new char[4096];
|
||||
int count;
|
||||
while ((count = reader.read(buf, 0, 4096)) != -1) {
|
||||
writeEscapedXml(buf, count, w);
|
||||
}
|
||||
} else {
|
||||
String text = obj.toString();
|
||||
writeEscapedXml(text.toCharArray(), text.length(), w);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public static void out2(PageContext pageContext, boolean escapeXml,
|
||||
Object obj) throws IOException {
|
||||
JspWriter w = pageContext.getOut();
|
||||
|
||||
w.write(obj.toString());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Optimized to create no extra objects and write directly to the JspWriter
|
||||
* using blocks of escaped and unescaped characters
|
||||
*
|
||||
*/
|
||||
private static void writeEscapedXml(char[] buffer, int length, JspWriter w)
|
||||
throws IOException {
|
||||
int start = 0;
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
char c = buffer[i];
|
||||
if (c <= Util.HIGHEST_SPECIAL) {
|
||||
char[] escaped = Util.specialCharactersRepresentation[c];
|
||||
if (escaped != null) {
|
||||
// add unescaped portion
|
||||
if (start < i) {
|
||||
w.write(buffer, start, i - start);
|
||||
}
|
||||
// add escaped xml
|
||||
w.write(escaped);
|
||||
start = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// add rest of unescaped portion
|
||||
if (start < length) {
|
||||
w.write(buffer, start, length - start);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Optimized to create no extra objects and write directly to the JspWriter
|
||||
* using blocks of escaped and unescaped characters
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private String getWriteEscapedXml() throws IOException {
|
||||
String sRtn = "";
|
||||
|
||||
Object obj = this.value;
|
||||
|
||||
int start = 0;
|
||||
String text = obj.toString();
|
||||
|
||||
int length = text.length();
|
||||
char[] buffer = text.toCharArray();
|
||||
boolean booleanDiff = false;
|
||||
//String sDiffChar
|
||||
//String sArrDiffChar
|
||||
char[] cDiffChar = this.m_sDiffChar.toCharArray();
|
||||
|
||||
for(int i = 0; i < length; i++) {
|
||||
char c = buffer[i];
|
||||
|
||||
booleanDiff = false;
|
||||
|
||||
for(int k = 0; k < cDiffChar.length; k++){
|
||||
if(c == cDiffChar[k]){
|
||||
sRtn = sRtn + m_sArrDiffChar[k];
|
||||
booleanDiff = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(booleanDiff) continue;
|
||||
|
||||
if (c <= Util.HIGHEST_SPECIAL) {
|
||||
char[] escaped = Util.specialCharactersRepresentation[c];
|
||||
if (escaped != null) {
|
||||
// add unescaped portion
|
||||
//if (start < i) {
|
||||
// sRtn = sRtn + text.substring(start, i - start);
|
||||
//}
|
||||
// add escaped xml
|
||||
//sRtn = sRtn + escaped;
|
||||
//System.out.println(buffer[i]+" :: " + escaped);
|
||||
for (int j = 0; j < escaped.length; j++) {
|
||||
//System.out.println(buffer[i]+" :>: " + escaped[j]);
|
||||
sRtn = sRtn + escaped[j];
|
||||
}
|
||||
//sRtn = sRtn+ escaped.toString();
|
||||
//sRtn = sRtn + String.valueOf(buffer[i]);
|
||||
start = i + 1;
|
||||
}else{
|
||||
sRtn = sRtn + c;
|
||||
}
|
||||
}else{
|
||||
sRtn = sRtn + c;
|
||||
}
|
||||
}
|
||||
|
||||
return sRtn;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Optimized to create no extra objects and write directly to the JspWriter
|
||||
* using blocks of escaped and unescaped characters
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
private String getWriteEscapedXml(String sWriteString) throws IOException {
|
||||
|
||||
String sRtn = "";
|
||||
|
||||
Object obj = sWriteString;
|
||||
|
||||
int start = 0;
|
||||
String text = obj.toString();
|
||||
|
||||
int length = text.length();
|
||||
char[] buffer = text.toCharArray();
|
||||
boolean booleanDiff = false;
|
||||
//String sDiffChar
|
||||
//String sArrDiffChar
|
||||
char[] cDiffChar = this.m_sDiffChar.toCharArray();
|
||||
|
||||
for(int i = 0; i < length; i++) {
|
||||
char c = buffer[i];
|
||||
|
||||
booleanDiff = false;
|
||||
|
||||
for(int k = 0; k < cDiffChar.length; k++){
|
||||
if(c == cDiffChar[k]){
|
||||
sRtn = sRtn + m_sArrDiffChar[k];
|
||||
booleanDiff = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if(booleanDiff) continue;
|
||||
|
||||
if (c <= Util.HIGHEST_SPECIAL) {
|
||||
char[] escaped = Util.specialCharactersRepresentation[c];
|
||||
if (escaped != null) {
|
||||
// add unescaped portion
|
||||
//if (start < i) {
|
||||
// sRtn = sRtn + text.substring(start, i - start);
|
||||
//}
|
||||
// add escaped xml
|
||||
//sRtn = sRtn + escaped;
|
||||
//System.out.println(buffer[i]+" :: " + escaped);
|
||||
for (int j = 0; j < escaped.length; j++) {
|
||||
//System.out.println(buffer[i]+" :>: " + escaped[j]);
|
||||
sRtn = sRtn + escaped[j];
|
||||
}
|
||||
//sRtn = sRtn+ escaped.toString();
|
||||
//sRtn = sRtn + String.valueOf(buffer[i]);
|
||||
start = i + 1;
|
||||
}else{
|
||||
sRtn = sRtn + c;
|
||||
}
|
||||
}else{
|
||||
sRtn = sRtn + c;
|
||||
}
|
||||
}
|
||||
|
||||
return sRtn;
|
||||
}
|
||||
|
||||
// for tag attribute
|
||||
public void setValue(Object value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
// for tag attribute
|
||||
public void setDefault(String def) {
|
||||
this.def = def;
|
||||
}
|
||||
|
||||
// for tag attribute
|
||||
public void setEscapeXml(boolean escapeXml) {
|
||||
this.escapeXml = escapeXml;
|
||||
}
|
||||
|
||||
/** 2011.10.10 cmd 라인상에서 편의제공을 위해 제공, 필요없을시 삭제하여도 무방함
|
||||
public static void main(String[] args) throws IOException
|
||||
{
|
||||
|
||||
EgovComCrossSiteHndlr egovComCrossSiteHndlr = new EgovComCrossSiteHndlr();
|
||||
|
||||
egovComCrossSiteHndlr.value = "TRNSMIT";
|
||||
|
||||
String sCrossSiteHndlr = egovComCrossSiteHndlr.getWriteEscapedXml();
|
||||
//System.out.println("writeEscapedXml " + egovComCrossSiteHndlr.getWriteEscapedXml());
|
||||
/*
|
||||
System.out.println("sCrossSiteHndlr|"+ sCrossSiteHndlr + "|");
|
||||
|
||||
try{
|
||||
System.out.println("TRY TEST 1");
|
||||
throw new Exception();
|
||||
}catch(Exception e){
|
||||
System.out.println("TRY TEST 2");
|
||||
}finally{
|
||||
System.out.println("TRY TEST 3");
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,51 @@
|
||||
package egovframework.com.cmm;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.exception.handler.ExceptionHandler;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovComExcepHndlr.java
|
||||
* @Description : 공통서비스의 exception 처리 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 13. 이삼섭
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 13.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
public class EgovComExcepHndlr implements ExceptionHandler {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovComExcepHndlr.class);
|
||||
|
||||
/*
|
||||
@Resource(name = "otherSSLMailSender")
|
||||
private SimpleSSLMail mailSender;
|
||||
*/
|
||||
/**
|
||||
* 발생된 Exception을 처리한다.
|
||||
*/
|
||||
public void occur(Exception ex, String packageName) {
|
||||
//log.debug(" EgovServiceExceptionHandler run...............");
|
||||
|
||||
/*
|
||||
try {
|
||||
mailSender. send(ex, packageName);
|
||||
log.debug(" sending a alert mail is completed ");
|
||||
} catch (Exception e) {
|
||||
LOGGER.error(packageName, ex);
|
||||
}
|
||||
*/
|
||||
try {
|
||||
LOGGER.debug(" EgovServiceExceptionHandler try ");
|
||||
} catch (Exception e) {
|
||||
}
|
||||
LOGGER.error(packageName, ex);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package egovframework.com.cmm;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.exception.handler.ExceptionHandler;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class EgovComOthersExcepHndlr implements ExceptionHandler {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovComOthersExcepHndlr.class);
|
||||
|
||||
public void occur(Exception exception, String packageName) {
|
||||
//log.debug(" EgovServiceExceptionHandler run...............");
|
||||
LOGGER.error(packageName, exception);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package egovframework.com.cmm;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* EgovComUtil 클래스
|
||||
*
|
||||
* @author 서준식
|
||||
* @since 2011.09.15
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------------- ----------------------
|
||||
* 2011.09.15 서준식 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@Service("egovUtil")
|
||||
public class EgovComponentChecker extends EgovAbstractServiceImpl implements ApplicationContextAware{
|
||||
|
||||
|
||||
public static ApplicationContext context;
|
||||
|
||||
@SuppressWarnings("static-access")
|
||||
public void setApplicationContext(ApplicationContext context)
|
||||
throws BeansException {
|
||||
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Spring MVC에서 설정한 빈이 아닌 서비스 빈(컴포넌트)만을 검색할 수 있음
|
||||
*
|
||||
*/
|
||||
public static boolean hasComponent(String componentName){
|
||||
|
||||
try{
|
||||
Object component = context.getBean(componentName);
|
||||
|
||||
if(component == null){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
|
||||
}catch(NoSuchBeanDefinitionException ex){// 해당 컴포넌트를 찾을 수없을 경우 false반환
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
package egovframework.com.cmm;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.springframework.context.MessageSource;
|
||||
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
|
||||
|
||||
/**
|
||||
* 메시지 리소스 사용을 위한 MessageSource 인터페이스 및 ReloadableResourceBundleMessageSource 클래스의 구현체
|
||||
* @author 공통서비스 개발팀 이문준
|
||||
* @since 2009.06.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.11 이문준 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public class EgovMessageSource extends ReloadableResourceBundleMessageSource implements MessageSource {
|
||||
|
||||
private ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource;
|
||||
|
||||
/**
|
||||
* getReloadableResourceBundleMessageSource()
|
||||
* @param reloadableResourceBundleMessageSource - resource MessageSource
|
||||
* @return ReloadableResourceBundleMessageSource
|
||||
*/
|
||||
public void setReloadableResourceBundleMessageSource(ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource) {
|
||||
this.reloadableResourceBundleMessageSource = reloadableResourceBundleMessageSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* getReloadableResourceBundleMessageSource()
|
||||
* @return ReloadableResourceBundleMessageSource
|
||||
*/
|
||||
public ReloadableResourceBundleMessageSource getReloadableResourceBundleMessageSource() {
|
||||
return reloadableResourceBundleMessageSource;
|
||||
}
|
||||
|
||||
/**
|
||||
* 정의된 메세지 조회
|
||||
* @param code - 메세지 코드
|
||||
* @return String
|
||||
*/
|
||||
public String getMessage(String code) {
|
||||
return getReloadableResourceBundleMessageSource().getMessage(code, null, Locale.getDefault());
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,109 @@
|
||||
package egovframework.com.cmm;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 교차접속 스크립트 공격 취약성 방지(파라미터 문자열 교체)
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2011.10.10 한성곤 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public class EgovWebUtil {
|
||||
public static String clearXSSMinimum(String value) {
|
||||
if (value == null || value.trim().equals("")) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String returnValue = value;
|
||||
|
||||
returnValue = returnValue.replaceAll("&", "&");
|
||||
returnValue = returnValue.replaceAll("<", "<");
|
||||
returnValue = returnValue.replaceAll(">", ">");
|
||||
returnValue = returnValue.replaceAll("\"", """);
|
||||
returnValue = returnValue.replaceAll("\'", "'");
|
||||
returnValue = returnValue.replaceAll(".", ".");
|
||||
returnValue = returnValue.replaceAll("%2E", ".");
|
||||
returnValue = returnValue.replaceAll("%2F", "/");
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public static String clearXSSMaximum(String value) {
|
||||
String returnValue = value;
|
||||
returnValue = clearXSSMinimum(returnValue);
|
||||
|
||||
returnValue = returnValue.replaceAll("%00", null);
|
||||
|
||||
returnValue = returnValue.replaceAll("%", "%");
|
||||
|
||||
// \\. => .
|
||||
|
||||
returnValue = returnValue.replaceAll("\\.\\./", ""); // ../
|
||||
returnValue = returnValue.replaceAll("\\.\\.\\\\", ""); // ..\
|
||||
returnValue = returnValue.replaceAll("\\./", ""); // ./
|
||||
returnValue = returnValue.replaceAll("%2F", "");
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public static String filePathBlackList(String value) {
|
||||
String returnValue = value;
|
||||
if (returnValue == null || returnValue.trim().equals("")) {
|
||||
return "";
|
||||
}
|
||||
|
||||
returnValue = returnValue.replaceAll("\\.\\./", ""); // ../
|
||||
returnValue = returnValue.replaceAll("\\.\\.\\\\", ""); // ..\
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 행안부 보안취약점 점검 조치 방안.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static String filePathReplaceAll(String value) {
|
||||
String returnValue = value;
|
||||
if (returnValue == null || returnValue.trim().equals("")) {
|
||||
return "";
|
||||
}
|
||||
|
||||
returnValue = returnValue.replaceAll("/", "");
|
||||
returnValue = returnValue.replaceAll("\\", "");
|
||||
returnValue = returnValue.replaceAll("\\.\\.", ""); // ..
|
||||
returnValue = returnValue.replaceAll("&", "");
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public static String filePathWhiteList(String value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static boolean isIPAddress(String str) {
|
||||
Pattern ipPattern = Pattern.compile("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}");
|
||||
|
||||
return ipPattern.matcher(str).matches();
|
||||
}
|
||||
|
||||
public static String removeCRLF(String parameter) {
|
||||
return parameter.replaceAll("\r", "").replaceAll("\n", "");
|
||||
}
|
||||
|
||||
public static String removeSQLInjectionRisk(String parameter) {
|
||||
return parameter.replaceAll("\\p{Space}", "").replaceAll("\\*", "").replaceAll("%", "").replaceAll(";", "").replaceAll("-", "").replaceAll("\\+", "").replaceAll(",", "");
|
||||
}
|
||||
|
||||
public static String removeOSCmdRisk(String parameter) {
|
||||
return parameter.replaceAll("\\p{Space}", "").replaceAll("\\*", "").replaceAll("|", "").replaceAll(";", "");
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,85 @@
|
||||
package egovframework.com.cmm;
|
||||
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.AbstractPaginationRenderer;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
/**
|
||||
* ImagePaginationRenderer.java 클래스
|
||||
*
|
||||
* @author 서준식
|
||||
* @since 2011. 9. 16.
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------------- ----------------------
|
||||
* 2011. 9. 16. 서준식 이미지 경로에 ContextPath추가
|
||||
* </pre>
|
||||
*/
|
||||
public class ImagePaginationRenderer extends AbstractPaginationRenderer implements ServletContextAware{
|
||||
|
||||
private ServletContext servletContext;
|
||||
|
||||
String type ;
|
||||
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public ImagePaginationRenderer() {
|
||||
// no-op
|
||||
}
|
||||
|
||||
public void initVariables(){
|
||||
String strWebDir = "/resource/common/img/common/";
|
||||
firstPageLabel = "<li class=\"paginate_button btn prevAll\"><a href=\"#\" onclick=\"{0}({1}); return false;\">" +
|
||||
"<<</a></li>";
|
||||
previousPageLabel = "<li class=\"paginate_button btn prev\"><a href=\"#\" onclick=\"{0}({1}); return false;\">" +
|
||||
"<</a></li>";
|
||||
currentPageLabel = "<li class=\"paginate_button active on \"><a href=\"#none\">{0}</a></li>";
|
||||
otherPageLabel = "<li class=\"paginate_button\"><a href=\"#\" onclick=\"{0}({1}); return false;\">{2}</a></li>";
|
||||
nextPageLabel = "<li class=\"paginate_button btn next\"><a href=\"#\" onclick=\"{0}({1}); return false;\">" +
|
||||
"></a></li>";
|
||||
lastPageLabel = "<li class=\"paginate_button btn nextAll\"><a href=\"#\" onclick=\"{0}({1}); return false;\">" +
|
||||
">></a></li>";
|
||||
|
||||
/*//이미지 방식
|
||||
firstPageLabel = "<a class=\"btn prevAll\" href=\"#\" onclick=\"{0}({1}); return false;\">" +
|
||||
"<img src='" + strWebDir + "prevAll.png' border='0' alt='첫페이지'/></a> ";
|
||||
previousPageLabel = "<a class=\"btn prev\" href=\"#\" onclick=\"{0}({1}); return false;\">" +
|
||||
"<img src='" + strWebDir + "prev.png' border='0' alt='이전페이지'/></a> ";
|
||||
currentPageLabel = "<strong class='on'>{0}</strong> ";
|
||||
otherPageLabel = "<a href=\"#\" onclick=\"{0}({1}); return false;\">{2}</a> ";
|
||||
nextPageLabel = "<a class=\"btn next\" href=\"#\" onclick=\"{0}({1}); return false;\">" +
|
||||
"<img src='" + strWebDir + "next.png' border='0' alt='다음페이지'/></a> ";
|
||||
lastPageLabel = "<a class=\"btn nextAll\" href=\"#\" onclick=\"{0}({1}); return false;\">" +
|
||||
"<img src='" + strWebDir + "nextAll.png' border='0' alt='마지막페이지'/></a> ";
|
||||
|
||||
*/
|
||||
/*
|
||||
firstPageLabel = "<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/egovframework/com/cmm/icon/icon_prevend.gif\" alt=\"처음\" border=\"0\"/></a> ";
|
||||
previousPageLabel = "<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/egovframework/com/cmm/icon/icon_prev.gif\" alt=\"이전\" border=\"0\"/></a> ";
|
||||
currentPageLabel = "<strong>{0}</strong> ";
|
||||
otherPageLabel = "<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \">{2}</a> ";
|
||||
nextPageLabel = "<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/egovframework/com/cmm/icon/icon_next.gif\" alt=\"다음\" border=\"0\"/></a> ";
|
||||
lastPageLabel = "<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/egovframework/com/cmm/icon/icon_nextend.gif\" alt=\"마지막\" border=\"0\"/></a> ";
|
||||
*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setServletContext(ServletContext servletContext) {
|
||||
this.servletContext = servletContext;
|
||||
initVariables();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package egovframework.com.cmm;
|
||||
|
||||
/**
|
||||
* IncludedInfo annotation을 바탕으로 화면에 표시할 정보를 구성하기 위한 VO 클래스
|
||||
* @author 공통컴포넌트 정진오
|
||||
* @since 2011.08.26
|
||||
* @version 2.0.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2011.08.26 정진오 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class IncludedCompInfoVO {
|
||||
|
||||
private String name;
|
||||
private String listUrl;
|
||||
private int order;
|
||||
private int gid;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getListUrl() {
|
||||
return listUrl;
|
||||
}
|
||||
public void setListUrl(String listUrl) {
|
||||
this.listUrl = listUrl;
|
||||
}
|
||||
public int getOrder() {
|
||||
return order;
|
||||
}
|
||||
public void setOrder(int order) {
|
||||
this.order = order;
|
||||
}
|
||||
public int getGid() {
|
||||
return gid;
|
||||
}
|
||||
public void setGid(int gid) {
|
||||
this.gid = gid;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,250 @@
|
||||
package egovframework.com.cmm;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Class Name : LoginVO.java
|
||||
* @Description : Login VO class
|
||||
* @Modification Information
|
||||
* @
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------- -------- ---------------------------
|
||||
* @ 2009.03.03 박지욱 최초 생성
|
||||
*
|
||||
* @author 공통서비스 개발팀 박지욱
|
||||
* @since 2009.03.03
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
public class LoginVO implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -8274004534207618049L;
|
||||
|
||||
/** 아이디 */
|
||||
private String id;
|
||||
/** 이름 */
|
||||
private String name;
|
||||
/** 주민등록번호 */
|
||||
private String ihidNum;
|
||||
/** 이메일주소 */
|
||||
private String email;
|
||||
/** 비밀번호 */
|
||||
private String password;
|
||||
/** 비밀번호 힌트 */
|
||||
private String passwordHint;
|
||||
/** 비밀번호 정답 */
|
||||
private String passwordCnsr;
|
||||
/** 사용자구분 */
|
||||
private String userSe;
|
||||
/** 조직(부서)ID */
|
||||
private String orgnztId;
|
||||
/** 조직(부서)명 */
|
||||
private String orgnztNm;
|
||||
/** 고유아이디 */
|
||||
private String uniqId;
|
||||
/** 로그인 후 이동할 페이지 */
|
||||
private String url;
|
||||
/** 사용자 IP정보 */
|
||||
private String ip;
|
||||
/** GPKI인증 DN */
|
||||
private String dn;
|
||||
/**
|
||||
* id attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
* id attribute 값을 설정한다.
|
||||
* @param id String
|
||||
*/
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
/**
|
||||
* name attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
/**
|
||||
* name attribute 값을 설정한다.
|
||||
* @param name String
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
/**
|
||||
* ihidNum attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getIhidNum() {
|
||||
return ihidNum;
|
||||
}
|
||||
/**
|
||||
* ihidNum attribute 값을 설정한다.
|
||||
* @param ihidNum String
|
||||
*/
|
||||
public void setIhidNum(String ihidNum) {
|
||||
this.ihidNum = ihidNum;
|
||||
}
|
||||
/**
|
||||
* email attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
/**
|
||||
* email attribute 값을 설정한다.
|
||||
* @param email String
|
||||
*/
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
/**
|
||||
* password attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
/**
|
||||
* password attribute 값을 설정한다.
|
||||
* @param password String
|
||||
*/
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
/**
|
||||
* passwordHint attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getPasswordHint() {
|
||||
return passwordHint;
|
||||
}
|
||||
/**
|
||||
* passwordHint attribute 값을 설정한다.
|
||||
* @param passwordHint String
|
||||
*/
|
||||
public void setPasswordHint(String passwordHint) {
|
||||
this.passwordHint = passwordHint;
|
||||
}
|
||||
/**
|
||||
* passwordCnsr attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getPasswordCnsr() {
|
||||
return passwordCnsr;
|
||||
}
|
||||
/**
|
||||
* passwordCnsr attribute 값을 설정한다.
|
||||
* @param passwordCnsr String
|
||||
*/
|
||||
public void setPasswordCnsr(String passwordCnsr) {
|
||||
this.passwordCnsr = passwordCnsr;
|
||||
}
|
||||
/**
|
||||
* userSe attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getUserSe() {
|
||||
return userSe;
|
||||
}
|
||||
/**
|
||||
* userSe attribute 값을 설정한다.
|
||||
* @param userSe String
|
||||
*/
|
||||
public void setUserSe(String userSe) {
|
||||
this.userSe = userSe;
|
||||
}
|
||||
/**
|
||||
* orgnztId attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getOrgnztId() {
|
||||
return orgnztId;
|
||||
}
|
||||
/**
|
||||
* orgnztId attribute 값을 설정한다.
|
||||
* @param orgnztId String
|
||||
*/
|
||||
public void setOrgnztId(String orgnztId) {
|
||||
this.orgnztId = orgnztId;
|
||||
}
|
||||
/**
|
||||
* uniqId attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getUniqId() {
|
||||
return uniqId;
|
||||
}
|
||||
/**
|
||||
* uniqId attribute 값을 설정한다.
|
||||
* @param uniqId String
|
||||
*/
|
||||
public void setUniqId(String uniqId) {
|
||||
this.uniqId = uniqId;
|
||||
}
|
||||
/**
|
||||
* url attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
/**
|
||||
* url attribute 값을 설정한다.
|
||||
* @param url String
|
||||
*/
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
/**
|
||||
* ip attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
/**
|
||||
* ip attribute 값을 설정한다.
|
||||
* @param ip String
|
||||
*/
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
/**
|
||||
* dn attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getDn() {
|
||||
return dn;
|
||||
}
|
||||
/**
|
||||
* dn attribute 값을 설정한다.
|
||||
* @param dn String
|
||||
*/
|
||||
public void setDn(String dn) {
|
||||
this.dn = dn;
|
||||
}
|
||||
/**
|
||||
* @return the orgnztNm
|
||||
*/
|
||||
public String getOrgnztNm() {
|
||||
return orgnztNm;
|
||||
}
|
||||
/**
|
||||
* @param orgnztNm the orgnztNm to set
|
||||
*/
|
||||
public void setOrgnztNm(String orgnztNm) {
|
||||
this.orgnztNm = orgnztNm;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,120 @@
|
||||
package egovframework.com.cmm;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 세션 VO 클래스
|
||||
* @author 공통서비스 개발팀 박지욱
|
||||
* @since 2009.03.06
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.06 박지욱 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class SessionVO implements Serializable {
|
||||
|
||||
/** 아이디 */
|
||||
private String sUserId;
|
||||
/** 이름 */
|
||||
private String sUserNm;
|
||||
/** 이메일 */
|
||||
private String sEmail;
|
||||
/** 사용자구분 */
|
||||
private String sUserSe;
|
||||
/** 조직(부서)ID */
|
||||
private String orgnztId;
|
||||
/** 고유아이디 */
|
||||
private String uniqId;
|
||||
/**
|
||||
* sUserId attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getSUserId() {
|
||||
return sUserId;
|
||||
}
|
||||
/**
|
||||
* sUserId attribute 값을 설정한다.
|
||||
* @param sUserId String
|
||||
*/
|
||||
public void setSUserId(String userId) {
|
||||
sUserId = userId;
|
||||
}
|
||||
/**
|
||||
* sUserNm attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getSUserNm() {
|
||||
return sUserNm;
|
||||
}
|
||||
/**
|
||||
* sUserNm attribute 값을 설정한다.
|
||||
* @param sUserNm String
|
||||
*/
|
||||
public void setSUserNm(String userNm) {
|
||||
sUserNm = userNm;
|
||||
}
|
||||
/**
|
||||
* sEmail attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getSEmail() {
|
||||
return sEmail;
|
||||
}
|
||||
/**
|
||||
* sEmail attribute 값을 설정한다.
|
||||
* @param sEmail String
|
||||
*/
|
||||
public void setSEmail(String email) {
|
||||
sEmail = email;
|
||||
}
|
||||
/**
|
||||
* sUserSe attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getSUserSe() {
|
||||
return sUserSe;
|
||||
}
|
||||
/**
|
||||
* sUserSe attribute 값을 설정한다.
|
||||
* @param sUserSe String
|
||||
*/
|
||||
public void setSUserSe(String userSe) {
|
||||
sUserSe = userSe;
|
||||
}
|
||||
/**
|
||||
* orgnztId attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getOrgnztId() {
|
||||
return orgnztId;
|
||||
}
|
||||
/**
|
||||
* orgnztId attribute 값을 설정한다.
|
||||
* @param orgnztId String
|
||||
*/
|
||||
public void setOrgnztId(String orgnztId) {
|
||||
this.orgnztId = orgnztId;
|
||||
}
|
||||
/**
|
||||
* uniqId attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getUniqId() {
|
||||
return uniqId;
|
||||
}
|
||||
/**
|
||||
* uniqId attribute 값을 설정한다.
|
||||
* @param uniqId String
|
||||
*/
|
||||
public void setUniqId(String uniqId) {
|
||||
this.uniqId = uniqId;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package egovframework.com.cmm.annotation;
|
||||
|
||||
/**
|
||||
* 컴포넌트의 포함 정보 표현을 위한 annotation 클래스
|
||||
* 기본적으로 Controller 클래스에 annotation을 부여하되,
|
||||
* 하나의 Controller에 여러 개의 목록성 url mapping이 제공되는 경우에는
|
||||
* 메소드에 annotation을 부여한다.
|
||||
* @author 공통컴포넌트 정진오
|
||||
* @since 2011.08.26
|
||||
* @version 2.0.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2011.08.26 정진오 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface IncludedInfo {
|
||||
String name() default ""; // 컴포넌트의 한글 이름
|
||||
String listUrl() default ""; // 컴포넌트의 목록정보조회를 위한 URL
|
||||
int order() default 0; // 자동 생성되는 메뉴 목록에 표시되는 순서
|
||||
int gid() default 0; // 컴포넌트의 Group ID(대분류 구분)
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright 2008-2009 MOPAS(MINISTRY OF SECURITY AND PUBLIC ADMINISTRATION).
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package egovframework.com.cmm.filter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class HTMLTagFilter implements Filter{
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private FilterConfig config;
|
||||
|
||||
public void doFilter(ServletRequest request, ServletResponse response,
|
||||
FilterChain chain) throws IOException, ServletException {
|
||||
|
||||
chain.doFilter(new HTMLTagFilterRequestWrapper((HttpServletRequest)request), response);
|
||||
}
|
||||
|
||||
public void init(FilterConfig config) throws ServletException {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Copyright 2008-2009 MOPAS(MINISTRY OF SECURITY AND PUBLIC ADMINISTRATION).
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package egovframework.com.cmm.filter;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
|
||||
public class HTMLTagFilterRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
public HTMLTagFilterRequestWrapper(HttpServletRequest request) {
|
||||
super(request);
|
||||
}
|
||||
|
||||
public String[] getParameterValues(String parameter) {
|
||||
|
||||
String[] values = super.getParameterValues(parameter);
|
||||
|
||||
if(values==null){
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
if (values[i] != null) {
|
||||
StringBuffer strBuff = new StringBuffer();
|
||||
for (int j = 0; j < values[i].length(); j++) {
|
||||
char c = values[i].charAt(j);
|
||||
switch (c) {
|
||||
case '<':
|
||||
strBuff.append("<");
|
||||
break;
|
||||
case '>':
|
||||
strBuff.append(">");
|
||||
break;
|
||||
//case '&':
|
||||
//strBuff.append("&");
|
||||
//break;
|
||||
case '"':
|
||||
strBuff.append(""");
|
||||
break;
|
||||
case '\'':
|
||||
strBuff.append("'");
|
||||
break;
|
||||
default:
|
||||
strBuff.append(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
values[i] = strBuff.toString();
|
||||
} else {
|
||||
values[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
public String getParameter(String parameter) {
|
||||
|
||||
String value = super.getParameter(parameter);
|
||||
|
||||
if(value==null){
|
||||
return null;
|
||||
}
|
||||
|
||||
StringBuffer strBuff = new StringBuffer();
|
||||
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
char c = value.charAt(i);
|
||||
switch (c) {
|
||||
case '<':
|
||||
strBuff.append("<");
|
||||
break;
|
||||
case '>':
|
||||
strBuff.append(">");
|
||||
break;
|
||||
case '&':
|
||||
strBuff.append("&");
|
||||
break;
|
||||
case '"':
|
||||
strBuff.append(""");
|
||||
break;
|
||||
case '\'':
|
||||
strBuff.append("'");
|
||||
break;
|
||||
default:
|
||||
strBuff.append(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
value = strBuff.toString();
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,54 @@
|
||||
package egovframework.com.cmm.interceptor;
|
||||
|
||||
import egovframework.com.cmm.LoginVO;
|
||||
import egovframework.com.cmm.util.EgovUserDetailsHelper;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.ModelAndViewDefiningException;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
|
||||
/**
|
||||
* 인증여부 체크 인터셉터
|
||||
* @author 공통서비스 개발팀 서준식
|
||||
* @since 2011.07.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2011.07.01 서준식 최초 생성
|
||||
* 2011.09.07 서준식 인증이 필요없는 URL을 패스하는 로직 추가
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
|
||||
public class AuthenticInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
/**
|
||||
* 세션에 계정정보(LoginVO)가 있는지 여부로 인증 여부를 체크한다.
|
||||
* 계정정보(LoginVO)가 없다면, 로그인 페이지로 이동한다.
|
||||
*/
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
|
||||
boolean isPermittedURL = false;
|
||||
|
||||
LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
if(loginVO != null){
|
||||
return true;
|
||||
} else if(!isPermittedURL){
|
||||
ModelAndView modelAndView = new ModelAndView("redirect:/uat/uia/egovLoginUsr.do");
|
||||
throw new ModelAndViewDefiningException(modelAndView);
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package egovframework.com.cmm.interceptor;
|
||||
|
||||
import egovframework.com.cmm.LoginVO;
|
||||
import egovframework.com.cmm.util.EgovUserDetailsHelper;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
|
||||
/**
|
||||
* 사용자IP 체크 인터셉터
|
||||
* @author 유지보수팀 이기하
|
||||
* @since 2013.03.28
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2013.03.28 이기하 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public class IpObtainInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
|
||||
String clientIp = request.getRemoteAddr();
|
||||
|
||||
LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
if (loginVO != null) {
|
||||
loginVO.setIp(clientIp);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,194 @@
|
||||
package egovframework.com.cmm.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 공통상세코드 모델 클래스
|
||||
* @author 공통서비스 개발팀 이중호
|
||||
* @since 2009.04.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.04.01 이중호 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class CmmnDetailCode implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/*
|
||||
* 코드ID
|
||||
*/
|
||||
private String codeId = "";
|
||||
|
||||
/*
|
||||
* 코드ID명
|
||||
*/
|
||||
private String codeIdNm = "";
|
||||
|
||||
/*
|
||||
* 코드
|
||||
*/
|
||||
private String code = "";
|
||||
|
||||
/*
|
||||
* 코드명
|
||||
*/
|
||||
private String codeNm = "";
|
||||
|
||||
/*
|
||||
* 코드설명
|
||||
*/
|
||||
private String codeDc = "";
|
||||
|
||||
/*
|
||||
* 사용여부
|
||||
*/
|
||||
private String useAt = "";
|
||||
|
||||
/*
|
||||
* 최초등록자ID
|
||||
*/
|
||||
private String frstRegisterId = "";
|
||||
|
||||
/*
|
||||
* 최종수정자ID
|
||||
*/
|
||||
private String lastUpdusrId = "";
|
||||
|
||||
/**
|
||||
* codeId attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getCodeId() {
|
||||
return codeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* codeId attribute 값을 설정한다.
|
||||
* @param codeId String
|
||||
*/
|
||||
public void setCodeId(String codeId) {
|
||||
this.codeId = codeId;
|
||||
}
|
||||
|
||||
/**
|
||||
* codeIdNm attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getCodeIdNm() {
|
||||
return codeIdNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* codeIdNm attribute 값을 설정한다.
|
||||
* @param codeIdNm String
|
||||
*/
|
||||
public void setCodeIdNm(String codeIdNm) {
|
||||
this.codeIdNm = codeIdNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* code attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* code attribute 값을 설정한다.
|
||||
* @param code String
|
||||
*/
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* codeNm attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getCodeNm() {
|
||||
return codeNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* codeNm attribute 값을 설정한다.
|
||||
* @param codeNm String
|
||||
*/
|
||||
public void setCodeNm(String codeNm) {
|
||||
this.codeNm = codeNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* codeDc attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getCodeDc() {
|
||||
return codeDc;
|
||||
}
|
||||
|
||||
/**
|
||||
* codeDc attribute 값을 설정한다.
|
||||
* @param codeDc String
|
||||
*/
|
||||
public void setCodeDc(String codeDc) {
|
||||
this.codeDc = codeDc;
|
||||
}
|
||||
|
||||
/**
|
||||
* useAt attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getUseAt() {
|
||||
return useAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* useAt attribute 값을 설정한다.
|
||||
* @param useAt String
|
||||
*/
|
||||
public void setUseAt(String useAt) {
|
||||
this.useAt = useAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterId attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getFrstRegisterId() {
|
||||
return frstRegisterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterId attribute 값을 설정한다.
|
||||
* @param frstRegisterId String
|
||||
*/
|
||||
public void setFrstRegisterId(String frstRegisterId) {
|
||||
this.frstRegisterId = frstRegisterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrId attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getLastUpdusrId() {
|
||||
return lastUpdusrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrId attribute 값을 설정한다.
|
||||
* @param lastUpdusrId String
|
||||
*/
|
||||
public void setLastUpdusrId(String lastUpdusrId) {
|
||||
this.lastUpdusrId = lastUpdusrId;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package egovframework.com.cmm.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultCodeVO;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 공통코드등 전체 업무에서 공용해서 사용해야 하는 서비스를 정의하기 위한 서비스 인터페이스
|
||||
* @author 공통서비스 개발팀 이삼섭
|
||||
* @since 2009.04.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.11 이삼섭 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public interface EgovCmmUseService {
|
||||
|
||||
/**
|
||||
* 공통코드를 조회한다.
|
||||
*
|
||||
* @param vo
|
||||
* @return List(코드)
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<CmmnDetailCode> selectCmmCodeDetail(ComDefaultCodeVO vo) throws Exception;
|
||||
|
||||
/**
|
||||
* ComDefaultCodeVO의 리스트를 받아서 여러개의 코드 리스트를 맵에 담아서 리턴한다.
|
||||
*
|
||||
* @param voList
|
||||
* @return Map(코드)
|
||||
* @throws Exception
|
||||
*/
|
||||
public Map<String, List<CmmnDetailCode>> selectCmmCodeDetails(List<?> voList) throws Exception;
|
||||
|
||||
/**
|
||||
* 조직정보를 코드형태로 리턴한다.
|
||||
*
|
||||
* @param 조회조건정보 vo
|
||||
* @return 조직정보 List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<CmmnDetailCode> selectOgrnztIdDetail(ComDefaultCodeVO vo) throws Exception;
|
||||
|
||||
/**
|
||||
* 그룹정보를 코드형태로 리턴한다.
|
||||
*
|
||||
* @param 조회조건정보 vo
|
||||
* @return 그룹정보 List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<CmmnDetailCode> selectGroupIdDetail(ComDefaultCodeVO vo) throws Exception;
|
||||
}
|
||||
@ -0,0 +1,115 @@
|
||||
package egovframework.com.cmm.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovFileMngService.java
|
||||
* @Description : 파일정보의 관리를 위한 서비스 인터페이스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 25. 이삼섭 최초생성
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 25.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
public interface EgovFileMngService {
|
||||
|
||||
/**
|
||||
* 파일에 대한 목록을 조회한다.
|
||||
*
|
||||
* @param fvo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<FileVO> selectFileInfs(FileVO fvo) throws Exception;
|
||||
|
||||
/**
|
||||
* 하나의 파일에 대한 정보(속성 및 상세)를 등록한다.
|
||||
*
|
||||
* @param fvo
|
||||
* @throws Exception
|
||||
*/
|
||||
public String insertFileInf(FileVO fvo) throws Exception;
|
||||
|
||||
/**
|
||||
* 여러 개의 파일에 대한 정보(속성 및 상세)를 등록한다.
|
||||
*
|
||||
* @param fvoList
|
||||
* @throws Exception
|
||||
*/
|
||||
public String insertFileInfs(List<?> fvoList) throws Exception;
|
||||
|
||||
/**
|
||||
* 여러 개의 파일에 대한 정보(속성 및 상세)를 수정한다.
|
||||
*
|
||||
* @param fvoList
|
||||
* @throws Exception
|
||||
*/
|
||||
public void updateFileInfs(List<?> fvoList) throws Exception;
|
||||
|
||||
/**
|
||||
* 여러 개의 파일을 삭제한다.
|
||||
*
|
||||
* @param fvoList
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteFileInfs(List<?> fvoList) throws Exception;
|
||||
|
||||
/**
|
||||
* 하나의 파일을 삭제한다.
|
||||
*
|
||||
* @param fvo
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteFileInf(FileVO fvo) throws Exception;
|
||||
|
||||
/**
|
||||
* 파일에 대한 상세정보를 조회한다.
|
||||
*
|
||||
* @param fvo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public FileVO selectFileInf(FileVO fvo) throws Exception;
|
||||
|
||||
/**
|
||||
* 파일 구분자에 대한 최대값을 구한다.
|
||||
*
|
||||
* @param fvo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int getMaxFileSN(FileVO fvo) throws Exception;
|
||||
|
||||
/**
|
||||
* 전체 파일을 삭제한다.
|
||||
*
|
||||
* @param fvo
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAllFileInf(FileVO fvo) throws Exception;
|
||||
|
||||
/**
|
||||
* 파일명 검색에 대한 목록을 조회한다.
|
||||
*
|
||||
* @param fvo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Map<String, Object> selectFileListByFileNm(FileVO fvo) throws Exception;
|
||||
|
||||
/**
|
||||
* 이미지 파일에 대한 목록을 조회한다.
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<FileVO> selectImageFileList(FileVO vo) throws Exception;
|
||||
}
|
||||
@ -0,0 +1,421 @@
|
||||
package egovframework.com.cmm.service;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import egovframework.com.cmm.EgovWebUtil;
|
||||
import egovframework.com.cmm.util.EgovResourceCloseHelper;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovFileMngUtil.java
|
||||
* @Description : 메시지 처리 관련 유틸리티
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.02.13 이삼섭 최초 생성
|
||||
* 2011.08.09 서준식 utl.fcc패키지와 Dependency제거를 위해 getTimeStamp()메서드 추가
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 02. 13
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@Component("EgovFileMngUtil")
|
||||
public class EgovFileMngUtil {
|
||||
|
||||
public static final int BUFF_SIZE = 2048;
|
||||
|
||||
@Resource(name = "egovFileIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
/**
|
||||
* 첨부파일에 대한 목록 정보를 취득한다.
|
||||
*
|
||||
* @param files
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<FileVO> parseFileInf(Map<String, MultipartFile> files, String KeyStr, int fileKeyParam, String atchFileId, String storePath) throws Exception {
|
||||
int fileKey = fileKeyParam;
|
||||
|
||||
String storePathString = "";
|
||||
String atchFileIdString = "";
|
||||
|
||||
if ("".equals(storePath) || storePath == null) {
|
||||
storePathString = EgovProperties.getProperty("Globals.fileStorePath");
|
||||
} else {
|
||||
storePathString = EgovProperties.getProperty(storePath);
|
||||
}
|
||||
|
||||
if ("".equals(atchFileId) || atchFileId == null) {
|
||||
atchFileIdString = idgenService.getNextStringId();
|
||||
} else {
|
||||
atchFileIdString = atchFileId;
|
||||
}
|
||||
|
||||
File saveFolder = new File(EgovWebUtil.filePathBlackList(storePathString));
|
||||
|
||||
if (!saveFolder.exists() || saveFolder.isFile()) {
|
||||
saveFolder.mkdirs();
|
||||
}
|
||||
|
||||
Iterator<Entry<String, MultipartFile>> itr = files.entrySet().iterator();
|
||||
MultipartFile file;
|
||||
String filePath = "";
|
||||
List<FileVO> result = new ArrayList<FileVO>();
|
||||
FileVO fvo;
|
||||
|
||||
while (itr.hasNext()) {
|
||||
Entry<String, MultipartFile> entry = itr.next();
|
||||
|
||||
file = entry.getValue();
|
||||
String orginFileName = file.getOriginalFilename();
|
||||
|
||||
//--------------------------------------
|
||||
// 원 파일명이 없는 경우 처리
|
||||
// (첨부가 되지 않은 input file type)
|
||||
//--------------------------------------
|
||||
if ("".equals(orginFileName)) {
|
||||
continue;
|
||||
}
|
||||
////------------------------------------
|
||||
|
||||
int index = orginFileName.lastIndexOf(".");
|
||||
//String fileName = orginFileName.substring(0, index);
|
||||
String fileExt = orginFileName.substring(index + 1);
|
||||
String newName = KeyStr + getTimeStamp() + fileKey;
|
||||
long size = file.getSize();
|
||||
|
||||
if (!"".equals(orginFileName)) {
|
||||
filePath = storePathString + File.separator + newName;
|
||||
file.transferTo(new File(EgovWebUtil.filePathBlackList(filePath)));
|
||||
}
|
||||
|
||||
fvo = new FileVO();
|
||||
fvo.setFileExtsn(fileExt);
|
||||
fvo.setFileStreCours(storePathString);
|
||||
fvo.setFileMg(Long.toString(size));
|
||||
fvo.setOrignlFileNm(orginFileName);
|
||||
fvo.setStreFileNm(newName);
|
||||
fvo.setAtchFileId(atchFileIdString);
|
||||
fvo.setFileSn(String.valueOf(fileKey));
|
||||
|
||||
result.add(fvo);
|
||||
|
||||
fileKey++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 첨부파일을 서버에 저장한다.
|
||||
*
|
||||
* @param file
|
||||
* @param newName
|
||||
* @param stordFilePath
|
||||
* @throws Exception
|
||||
*/
|
||||
protected void writeUploadedFile(MultipartFile file, String newName, String stordFilePath) throws Exception {
|
||||
InputStream stream = null;
|
||||
OutputStream bos = null;
|
||||
|
||||
try {
|
||||
stream = file.getInputStream();
|
||||
File cFile = new File(stordFilePath);
|
||||
|
||||
if (!cFile.isDirectory()) {
|
||||
boolean _flag = cFile.mkdir();
|
||||
if (!_flag) {
|
||||
throw new IOException("Directory creation Failed ");
|
||||
}
|
||||
}
|
||||
|
||||
bos = new FileOutputStream(stordFilePath + File.separator + newName);
|
||||
|
||||
int bytesRead = 0;
|
||||
byte[] buffer = new byte[BUFF_SIZE];
|
||||
|
||||
while ((bytesRead = stream.read(buffer, 0, BUFF_SIZE)) != -1) {
|
||||
bos.write(buffer, 0, bytesRead);
|
||||
}
|
||||
} finally {
|
||||
EgovResourceCloseHelper.close(bos, stream);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 서버의 파일을 다운로드한다.
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void downFile(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
|
||||
String downFileName = "";
|
||||
String orgFileName = "";
|
||||
|
||||
if ((String) request.getAttribute("downFile") == null) {
|
||||
downFileName = "";
|
||||
} else {
|
||||
downFileName = (String) request.getAttribute("downFile");
|
||||
}
|
||||
|
||||
if ((String) request.getAttribute("orgFileName") == null) {
|
||||
orgFileName = "";
|
||||
} else {
|
||||
orgFileName = (String) request.getAttribute("orginFile");
|
||||
}
|
||||
|
||||
orgFileName = orgFileName.replaceAll("\r", "").replaceAll("\n", "");
|
||||
|
||||
File file = new File(EgovWebUtil.filePathBlackList(downFileName));
|
||||
|
||||
if (!file.exists()) {
|
||||
throw new FileNotFoundException(downFileName);
|
||||
}
|
||||
|
||||
if (!file.isFile()) {
|
||||
throw new FileNotFoundException(downFileName);
|
||||
}
|
||||
|
||||
byte[] buffer = new byte[BUFF_SIZE]; //buffer size 2K.
|
||||
|
||||
response.setContentType("application/x-msdownload");
|
||||
response.setHeader("Content-Disposition:", "attachment; filename=" + new String(orgFileName.getBytes(), "UTF-8"));
|
||||
response.setHeader("Content-Transfer-Encoding", "binary");
|
||||
response.setHeader("Pragma", "no-cache");
|
||||
response.setHeader("Expires", "0");
|
||||
|
||||
BufferedInputStream fin = null;
|
||||
BufferedOutputStream outs = null;
|
||||
|
||||
try {
|
||||
fin = new BufferedInputStream(new FileInputStream(file));
|
||||
outs = new BufferedOutputStream(response.getOutputStream());
|
||||
int read = 0;
|
||||
|
||||
while ((read = fin.read(buffer)) != -1) {
|
||||
outs.write(buffer, 0, read);
|
||||
}
|
||||
} finally {
|
||||
EgovResourceCloseHelper.close(outs, fin);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 첨부로 등록된 파일을 서버에 업로드한다.
|
||||
*
|
||||
* @param file
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static HashMap<String, String> uploadFile(MultipartFile file) throws Exception {
|
||||
|
||||
HashMap<String, String> map = new HashMap<String, String>();
|
||||
//Write File 이후 Move File????
|
||||
String newName = "";
|
||||
String stordFilePath = EgovProperties.getProperty("Globals.fileStorePath");
|
||||
String orginFileName = file.getOriginalFilename();
|
||||
|
||||
int index = orginFileName.lastIndexOf(".");
|
||||
//String fileName = orginFileName.substring(0, _index);
|
||||
String fileExt = orginFileName.substring(index + 1);
|
||||
long size = file.getSize();
|
||||
|
||||
//newName 은 Naming Convention에 의해서 생성
|
||||
newName = getTimeStamp(); // 2012.11 KISA 보안조치
|
||||
writeFile(file, newName, stordFilePath);
|
||||
//storedFilePath는 지정
|
||||
map.put(Globals.ORIGIN_FILE_NM, orginFileName);
|
||||
map.put(Globals.UPLOAD_FILE_NM, newName);
|
||||
map.put(Globals.FILE_EXT, fileExt);
|
||||
map.put(Globals.FILE_PATH, stordFilePath);
|
||||
map.put(Globals.FILE_SIZE, String.valueOf(size));
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일을 실제 물리적인 경로에 생성한다.
|
||||
*
|
||||
* @param file
|
||||
* @param newName
|
||||
* @param stordFilePath
|
||||
* @throws Exception
|
||||
*/
|
||||
protected static void writeFile(MultipartFile file, String newName, String stordFilePath) throws Exception {
|
||||
InputStream stream = null;
|
||||
OutputStream bos = null;
|
||||
|
||||
try {
|
||||
stream = file.getInputStream();
|
||||
File cFile = new File(EgovWebUtil.filePathBlackList(stordFilePath));
|
||||
|
||||
if (!cFile.isDirectory())
|
||||
cFile.mkdir();
|
||||
|
||||
bos = new FileOutputStream(EgovWebUtil.filePathBlackList(stordFilePath + File.separator + newName));
|
||||
|
||||
int bytesRead = 0;
|
||||
byte[] buffer = new byte[BUFF_SIZE];
|
||||
|
||||
while ((bytesRead = stream.read(buffer, 0, BUFF_SIZE)) != -1) {
|
||||
bos.write(buffer, 0, bytesRead);
|
||||
}
|
||||
} finally {
|
||||
EgovResourceCloseHelper.close(bos, stream);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 서버 파일에 대하여 다운로드를 처리한다.
|
||||
*
|
||||
* @param response
|
||||
* @param streFileNm 파일저장 경로가 포함된 형태
|
||||
* @param orignFileNm
|
||||
* @throws Exception
|
||||
*/
|
||||
public void downFile(HttpServletResponse response, String streFileNm, String orignFileNm) throws Exception {
|
||||
String downFileName = streFileNm;
|
||||
String orgFileName = orignFileNm;
|
||||
|
||||
File file = new File(downFileName);
|
||||
|
||||
if (!file.exists()) {
|
||||
throw new FileNotFoundException(downFileName);
|
||||
}
|
||||
|
||||
if (!file.isFile()) {
|
||||
throw new FileNotFoundException(downFileName);
|
||||
}
|
||||
|
||||
int fSize = (int) file.length();
|
||||
if (fSize > 0) {
|
||||
BufferedInputStream in = null;
|
||||
|
||||
try {
|
||||
in = new BufferedInputStream(new FileInputStream(file));
|
||||
|
||||
String mimetype = "application/x-msdownload";
|
||||
|
||||
//response.setBufferSize(fSize);
|
||||
response.setContentType(mimetype);
|
||||
response.setHeader("Content-Disposition:", "attachment; filename=" + orgFileName);
|
||||
response.setContentLength(fSize);
|
||||
//response.setHeader("Content-Transfer-Encoding","binary");
|
||||
//response.setHeader("Pragma","no-cache");
|
||||
//response.setHeader("Expires","0");
|
||||
FileCopyUtils.copy(in, response.getOutputStream());
|
||||
} finally {
|
||||
EgovResourceCloseHelper.close(in);
|
||||
}
|
||||
response.getOutputStream().flush();
|
||||
response.getOutputStream().close();
|
||||
}
|
||||
|
||||
/*
|
||||
String uploadPath = propertiesService.getString("fileDir");
|
||||
|
||||
File uFile = new File(uploadPath, requestedFile);
|
||||
int fSize = (int) uFile.length();
|
||||
|
||||
if (fSize > 0) {
|
||||
BufferedInputStream in = new BufferedInputStream(new FileInputStream(uFile));
|
||||
|
||||
String mimetype = "text/html";
|
||||
|
||||
//response.setBufferSize(fSize);
|
||||
response.setContentType(mimetype);
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + requestedFile + "\"");
|
||||
response.setContentLength(fSize);
|
||||
|
||||
FileCopyUtils.copy(in, response.getOutputStream());
|
||||
in.close();
|
||||
response.getOutputStream().flush();
|
||||
response.getOutputStream().close();
|
||||
} else {
|
||||
response.setContentType("text/html");
|
||||
PrintWriter printwriter = response.getWriter();
|
||||
printwriter.println("<html>");
|
||||
printwriter.println("<br><br><br><h2>Could not get file name:<br>" + requestedFile + "</h2>");
|
||||
printwriter.println("<br><br><br><center><h3><a href='javascript: history.go(-1)'>Back</a></h3></center>");
|
||||
printwriter.println("<br><br><br>© webAccess");
|
||||
printwriter.println("</html>");
|
||||
printwriter.flush();
|
||||
printwriter.close();
|
||||
}
|
||||
//*/
|
||||
|
||||
/*
|
||||
response.setContentType("application/x-msdownload");
|
||||
response.setHeader("Content-Disposition:", "attachment; filename=" + new String(orgFileName.getBytes(),"UTF-8" ));
|
||||
response.setHeader("Content-Transfer-Encoding","binary");
|
||||
response.setHeader("Pragma","no-cache");
|
||||
response.setHeader("Expires","0");
|
||||
|
||||
BufferedInputStream fin = new BufferedInputStream(new FileInputStream(file));
|
||||
BufferedOutputStream outs = new BufferedOutputStream(response.getOutputStream());
|
||||
int read = 0;
|
||||
|
||||
while ((read = fin.read(b)) != -1) {
|
||||
outs.write(b,0,read);
|
||||
}
|
||||
log.debug(this.getClass().getName()+" BufferedOutputStream Write Complete!!! ");
|
||||
|
||||
outs.close();
|
||||
fin.close();
|
||||
//*/
|
||||
}
|
||||
|
||||
/**
|
||||
* 공통 컴포넌트 utl.fcc 패키지와 Dependency제거를 위해 내부 메서드로 추가 정의함
|
||||
* 응용어플리케이션에서 고유값을 사용하기 위해 시스템에서17자리의TIMESTAMP값을 구하는 기능
|
||||
*
|
||||
* @param
|
||||
* @return Timestamp 값
|
||||
* @see
|
||||
*/
|
||||
private static String getTimeStamp() {
|
||||
|
||||
String rtnStr = null;
|
||||
|
||||
// 문자열로 변환하기 위한 패턴 설정(년도-월-일 시:분:초:초(자정이후 초))
|
||||
String pattern = "yyyyMMddhhmmssSSS";
|
||||
|
||||
SimpleDateFormat sdfCurrent = new SimpleDateFormat(pattern, Locale.KOREA);
|
||||
Timestamp ts = new Timestamp(System.currentTimeMillis());
|
||||
|
||||
rtnStr = sdfCurrent.format(ts.getTime());
|
||||
|
||||
return rtnStr;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,220 @@
|
||||
package egovframework.com.cmm.service;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import egovframework.com.cmm.EgovWebUtil;
|
||||
import egovframework.com.cmm.util.EgovResourceCloseHelper;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Class Name : EgovProperties.java
|
||||
* Description : properties값들을 파일로부터 읽어와 Globals클래스의 정적변수로 로드시켜주는 클래스로
|
||||
* 문자열 정보 기준으로 사용할 전역변수를 시스템 재시작으로 반영할 수 있도록 한다.
|
||||
* Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.01.19 박지욱 최초 생성
|
||||
* 2011.07.20 서준식 Globals파일의 상대경로를 읽은 메서드 추가
|
||||
* 2014.10.13 이기하 Globals.properties 값이 null일 경우 오류처리
|
||||
* @author 공통 서비스 개발팀 박지욱
|
||||
* @since 2009. 01. 19
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
|
||||
public class EgovProperties {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovProperties.class);
|
||||
|
||||
//파일구분자
|
||||
final static String FILE_SEPARATOR = System.getProperty("file.separator");
|
||||
|
||||
//프로퍼티 파일의 물리적 위치
|
||||
//public static final String GLOBALS_PROPERTIES_FILE = System.getProperty("user.home") + FILE_SEPARATOR + "egovProps" +FILE_SEPARATOR + "globals.properties";
|
||||
|
||||
//public static final String RELATIVE_PATH_PREFIX = EgovProperties.class.getResource("").getPath() + FILE_SEPARATOR+ ".." + FILE_SEPARATOR + ".." + FILE_SEPARATOR;
|
||||
|
||||
public static final String RELATIVE_PATH_PREFIX = EgovProperties.class.getResource("").getPath().substring(0, EgovProperties.class.getResource("").getPath().lastIndexOf("com"));
|
||||
|
||||
public static final String GLOBALS_PROPERTIES_FILE = RELATIVE_PATH_PREFIX + "egovProps" + FILE_SEPARATOR + "globals.properties";
|
||||
|
||||
/**
|
||||
* 인자로 주어진 문자열을 Key값으로 하는 상대경로 프로퍼티 값을 절대경로로 반환한다(Globals.java 전용)
|
||||
* @param keyName String
|
||||
* @return String
|
||||
*/
|
||||
public static String getPathProperty(String keyName) {
|
||||
String value = "";
|
||||
|
||||
// LOGGER.debug("getPathProperty : {} = {}", GLOBALS_PROPERTIES_FILE, keyName);
|
||||
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
Properties props = new Properties();
|
||||
|
||||
fis = new FileInputStream(EgovWebUtil.filePathBlackList(GLOBALS_PROPERTIES_FILE));
|
||||
props.load(new BufferedInputStream(fis));
|
||||
|
||||
value = props.getProperty(keyName).trim();
|
||||
value = RELATIVE_PATH_PREFIX + "egovProps" + System.getProperty("file.separator") + value;
|
||||
} catch (FileNotFoundException fne) {
|
||||
LOGGER.debug("Property file not found.", fne);
|
||||
throw new RuntimeException("Property file not found", fne);
|
||||
} catch (IOException ioe) {
|
||||
LOGGER.debug("Property file IO exception", ioe);
|
||||
throw new RuntimeException("Property file IO exception", ioe);
|
||||
} finally {
|
||||
EgovResourceCloseHelper.close(fis);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 인자로 주어진 문자열을 Key값으로 하는 프로퍼티 값을 반환한다(Globals.java 전용)
|
||||
* @param keyName String
|
||||
* @return String
|
||||
*/
|
||||
public static String getProperty(String keyName) {
|
||||
String value = "";
|
||||
|
||||
// LOGGER.debug("getProperty : {} = {}", GLOBALS_PROPERTIES_FILE, keyName);
|
||||
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
Properties props = new Properties();
|
||||
|
||||
fis = new FileInputStream(EgovWebUtil.filePathBlackList(GLOBALS_PROPERTIES_FILE));
|
||||
|
||||
props.load(new BufferedInputStream(fis));
|
||||
if (props.getProperty(keyName) == null) {
|
||||
return "";
|
||||
}
|
||||
value = props.getProperty(keyName).trim();
|
||||
} catch (FileNotFoundException fne) {
|
||||
LOGGER.debug("Property file not found.", fne);
|
||||
throw new RuntimeException("Property file not found", fne);
|
||||
} catch (IOException ioe) {
|
||||
LOGGER.debug("Property file IO exception", ioe);
|
||||
throw new RuntimeException("Property file IO exception", ioe);
|
||||
} finally {
|
||||
EgovResourceCloseHelper.close(fis);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 파일에서 인자로 주어진 문자열을 Key값으로 하는 프로퍼티 상대 경로값을 절대 경로값으로 반환한다
|
||||
* @param fileName String
|
||||
* @param key String
|
||||
* @return String
|
||||
*/
|
||||
public static String getPathProperty(String fileName, String key) {
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
Properties props = new Properties();
|
||||
|
||||
fis = new FileInputStream(EgovWebUtil.filePathBlackList(fileName));
|
||||
props.load(new BufferedInputStream(fis));
|
||||
fis.close();
|
||||
|
||||
String value = props.getProperty(key);
|
||||
value = RELATIVE_PATH_PREFIX + "egovProps" + System.getProperty("file.separator") + value;
|
||||
|
||||
return value;
|
||||
} catch (FileNotFoundException fne) {
|
||||
LOGGER.debug("Property file not found.", fne);
|
||||
throw new RuntimeException("Property file not found", fne);
|
||||
} catch (IOException ioe) {
|
||||
LOGGER.debug("Property file IO exception", ioe);
|
||||
throw new RuntimeException("Property file IO exception", ioe);
|
||||
} finally {
|
||||
EgovResourceCloseHelper.close(fis);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 파일에서 인자로 주어진 문자열을 Key값으로 하는 프로퍼티 값을 반환한다
|
||||
* @param fileName String
|
||||
* @param key String
|
||||
* @return String
|
||||
*/
|
||||
public static String getProperty(String fileName, String key) {
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
Properties props = new Properties();
|
||||
|
||||
fis = new FileInputStream(EgovWebUtil.filePathBlackList(fileName));
|
||||
props.load(new BufferedInputStream(fis));
|
||||
fis.close();
|
||||
|
||||
String value = props.getProperty(key);
|
||||
|
||||
return value;
|
||||
} catch (FileNotFoundException fne) {
|
||||
LOGGER.debug("Property file not found.", fne);
|
||||
throw new RuntimeException("Property file not found", fne);
|
||||
} catch (IOException ioe) {
|
||||
LOGGER.debug("Property file IO exception", ioe);
|
||||
throw new RuntimeException("Property file IO exception", ioe);
|
||||
} finally {
|
||||
EgovResourceCloseHelper.close(fis);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 프로파일의 내용을 파싱하여 (key-value) 형태의 구조체 배열을 반환한다.
|
||||
* @param property String
|
||||
* @return ArrayList
|
||||
*/
|
||||
public static ArrayList<Map<String, String>> loadPropertyFile(String property) {
|
||||
|
||||
// key - value 형태로 된 배열 결과
|
||||
ArrayList<Map<String, String>> keyList = new ArrayList<Map<String, String>>();
|
||||
|
||||
String src = property.replace('\\', File.separatorChar).replace('/', File.separatorChar);
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
|
||||
File srcFile = new File(EgovWebUtil.filePathBlackList(src));
|
||||
if (srcFile.exists()) {
|
||||
|
||||
Properties props = new Properties();
|
||||
fis = new FileInputStream(src);
|
||||
props.load(new BufferedInputStream(fis));
|
||||
fis.close();
|
||||
|
||||
Enumeration<?> plist = props.propertyNames();
|
||||
if (plist != null) {
|
||||
while (plist.hasMoreElements()) {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
String key = (String) plist.nextElement();
|
||||
map.put(key, props.getProperty(key));
|
||||
keyList.add(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
LOGGER.debug("IO Exception", ex);
|
||||
throw new RuntimeException(ex);
|
||||
} finally {
|
||||
EgovResourceCloseHelper.close(fis);
|
||||
}
|
||||
|
||||
return keyList;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package egovframework.com.cmm.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EgovUserDetailsService {
|
||||
|
||||
/**
|
||||
* 인증된 사용자객체를 VO형식으로 가져온다.
|
||||
* @return Object - 사용자 ValueObject
|
||||
*/
|
||||
public Object getAuthenticatedUser();
|
||||
|
||||
/**
|
||||
* 인증된 사용자의 권한 정보를 가져온다.
|
||||
* 예) [ROLE_ADMIN, ROLE_USER, ROLE_A, ROLE_B, ROLE_RESTRICTED, IS_AUTHENTICATED_FULLY, IS_AUTHENTICATED_REMEMBERED, IS_AUTHENTICATED_ANONYMOUSLY]
|
||||
* @return List - 사용자 권한정보 목록
|
||||
*/
|
||||
public List<String> getAuthorities();
|
||||
|
||||
/**
|
||||
* 인증된 사용자 여부를 체크한다.
|
||||
* @return Boolean - 인증된 사용자 여부(TRUE / FALSE)
|
||||
*/
|
||||
public Boolean isAuthenticated();
|
||||
|
||||
}
|
||||
@ -0,0 +1,240 @@
|
||||
package egovframework.com.cmm.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
/**
|
||||
* @Class Name : FileVO.java
|
||||
* @Description : 파일정보 처리를 위한 VO 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 25. 이삼섭
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 25.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class FileVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 첨부파일 아이디
|
||||
*/
|
||||
public String atchFileId = "";
|
||||
/**
|
||||
* 생성일자
|
||||
*/
|
||||
public String creatDt = "";
|
||||
/**
|
||||
* 파일내용
|
||||
*/
|
||||
public String fileCn = "";
|
||||
/**
|
||||
* 파일확장자
|
||||
*/
|
||||
public String fileExtsn = "";
|
||||
/**
|
||||
* 파일크기
|
||||
*/
|
||||
public String fileMg = "";
|
||||
/**
|
||||
* 파일연번
|
||||
*/
|
||||
public String fileSn = "";
|
||||
/**
|
||||
* 파일저장경로
|
||||
*/
|
||||
public String fileStreCours = "";
|
||||
/**
|
||||
* 원파일명
|
||||
*/
|
||||
public String orignlFileNm = "";
|
||||
/**
|
||||
* 저장파일명
|
||||
*/
|
||||
public String streFileNm = "";
|
||||
|
||||
/**
|
||||
* atchFileId attribute를 리턴한다.
|
||||
*
|
||||
* @return the atchFileId
|
||||
*/
|
||||
public String getAtchFileId() {
|
||||
return atchFileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* atchFileId attribute 값을 설정한다.
|
||||
*
|
||||
* @param atchFileId
|
||||
* the atchFileId to set
|
||||
*/
|
||||
public void setAtchFileId(String atchFileId) {
|
||||
this.atchFileId = atchFileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* creatDt attribute를 리턴한다.
|
||||
*
|
||||
* @return the creatDt
|
||||
*/
|
||||
public String getCreatDt() {
|
||||
return creatDt;
|
||||
}
|
||||
|
||||
/**
|
||||
* creatDt attribute 값을 설정한다.
|
||||
*
|
||||
* @param creatDt
|
||||
* the creatDt to set
|
||||
*/
|
||||
public void setCreatDt(String creatDt) {
|
||||
this.creatDt = creatDt;
|
||||
}
|
||||
|
||||
/**
|
||||
* fileCn attribute를 리턴한다.
|
||||
*
|
||||
* @return the fileCn
|
||||
*/
|
||||
public String getFileCn() {
|
||||
return fileCn;
|
||||
}
|
||||
|
||||
/**
|
||||
* fileCn attribute 값을 설정한다.
|
||||
*
|
||||
* @param fileCn
|
||||
* the fileCn to set
|
||||
*/
|
||||
public void setFileCn(String fileCn) {
|
||||
this.fileCn = fileCn;
|
||||
}
|
||||
|
||||
/**
|
||||
* fileExtsn attribute를 리턴한다.
|
||||
*
|
||||
* @return the fileExtsn
|
||||
*/
|
||||
public String getFileExtsn() {
|
||||
return fileExtsn;
|
||||
}
|
||||
|
||||
/**
|
||||
* fileExtsn attribute 값을 설정한다.
|
||||
*
|
||||
* @param fileExtsn
|
||||
* the fileExtsn to set
|
||||
*/
|
||||
public void setFileExtsn(String fileExtsn) {
|
||||
this.fileExtsn = fileExtsn;
|
||||
}
|
||||
|
||||
/**
|
||||
* fileMg attribute를 리턴한다.
|
||||
*
|
||||
* @return the fileMg
|
||||
*/
|
||||
public String getFileMg() {
|
||||
return fileMg;
|
||||
}
|
||||
|
||||
/**
|
||||
* fileMg attribute 값을 설정한다.
|
||||
*
|
||||
* @param fileMg
|
||||
* the fileMg to set
|
||||
*/
|
||||
public void setFileMg(String fileMg) {
|
||||
this.fileMg = fileMg;
|
||||
}
|
||||
|
||||
/**
|
||||
* fileSn attribute를 리턴한다.
|
||||
*
|
||||
* @return the fileSn
|
||||
*/
|
||||
public String getFileSn() {
|
||||
return fileSn;
|
||||
}
|
||||
|
||||
/**
|
||||
* fileSn attribute 값을 설정한다.
|
||||
*
|
||||
* @param fileSn
|
||||
* the fileSn to set
|
||||
*/
|
||||
public void setFileSn(String fileSn) {
|
||||
this.fileSn = fileSn;
|
||||
}
|
||||
|
||||
/**
|
||||
* fileStreCours attribute를 리턴한다.
|
||||
*
|
||||
* @return the fileStreCours
|
||||
*/
|
||||
public String getFileStreCours() {
|
||||
return fileStreCours;
|
||||
}
|
||||
|
||||
/**
|
||||
* fileStreCours attribute 값을 설정한다.
|
||||
*
|
||||
* @param fileStreCours
|
||||
* the fileStreCours to set
|
||||
*/
|
||||
public void setFileStreCours(String fileStreCours) {
|
||||
this.fileStreCours = fileStreCours;
|
||||
}
|
||||
|
||||
/**
|
||||
* orignlFileNm attribute를 리턴한다.
|
||||
*
|
||||
* @return the orignlFileNm
|
||||
*/
|
||||
public String getOrignlFileNm() {
|
||||
return orignlFileNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* orignlFileNm attribute 값을 설정한다.
|
||||
*
|
||||
* @param orignlFileNm
|
||||
* the orignlFileNm to set
|
||||
*/
|
||||
public void setOrignlFileNm(String orignlFileNm) {
|
||||
this.orignlFileNm = orignlFileNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* streFileNm attribute를 리턴한다.
|
||||
*
|
||||
* @return the streFileNm
|
||||
*/
|
||||
public String getStreFileNm() {
|
||||
return streFileNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* streFileNm attribute 값을 설정한다.
|
||||
*
|
||||
* @param streFileNm
|
||||
* the streFileNm to set
|
||||
*/
|
||||
public void setStreFileNm(String streFileNm) {
|
||||
this.streFileNm = streFileNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* toString 메소드를 대치한다.
|
||||
*/
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package egovframework.com.cmm.service;
|
||||
|
||||
/**
|
||||
* Class Name : Globals.java
|
||||
* Description : 시스템 구동 시 프로퍼티를 통해 사용될 전역변수를 정의한다.
|
||||
* Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2019.05.xx 윤상근 최초 생성
|
||||
*
|
||||
*/
|
||||
|
||||
public class Globals {
|
||||
//OS 유형
|
||||
public static final String OS_TYPE = EgovProperties.getProperty("Globals.OsType");
|
||||
//DB 유형
|
||||
public static final String DB_TYPE = EgovProperties.getProperty("Globals.DbType");
|
||||
//메인 페이지
|
||||
public static final String MAIN_PAGE = EgovProperties.getProperty("Globals.MainPage");
|
||||
//ShellFile 경로
|
||||
public static final String SHELL_FILE_PATH = EgovProperties.getPathProperty("Globals.ShellFilePath");
|
||||
//퍼로퍼티 파일 위치
|
||||
public static final String CONF_PATH = EgovProperties.getPathProperty("Globals.ConfPath");
|
||||
//Server정보 프로퍼티 위치
|
||||
public static final String SERVER_CONF_PATH = EgovProperties.getPathProperty("Globals.ServerConfPath");
|
||||
//Client정보 프로퍼티 위치
|
||||
public static final String CLIENT_CONF_PATH = EgovProperties.getPathProperty("Globals.ClientConfPath");
|
||||
//파일포맷 정보 프로퍼티 위치
|
||||
public static final String FILE_FORMAT_PATH = EgovProperties.getPathProperty("Globals.FileFormatPath");
|
||||
|
||||
//파일 업로드 원 파일명
|
||||
public static final String ORIGIN_FILE_NM = "originalFileName";
|
||||
//파일 확장자
|
||||
public static final String FILE_EXT = "fileExtension";
|
||||
//파일크기
|
||||
public static final String FILE_SIZE = "fileSize";
|
||||
//업로드된 파일명
|
||||
public static final String UPLOAD_FILE_NM = "uploadFileName";
|
||||
//파일경로
|
||||
public static final String FILE_PATH = "filePath";
|
||||
|
||||
//메일발송요청 XML파일경로
|
||||
public static final String MAIL_REQUEST_PATH = EgovProperties.getPathProperty("Globals.MailRequestPath");
|
||||
//메일발송응답 XML파일경로
|
||||
public static final String MAIL_RESPONSE_PATH = EgovProperties.getPathProperty("Globals.MailRResponsePath");
|
||||
|
||||
// G4C 연결용 IP (localhost)
|
||||
public static final String LOCAL_IP = EgovProperties.getProperty("Globals.LocalIp");
|
||||
|
||||
//연계서버 사용 구분(Y/N)
|
||||
public static final String LINK_ON = EgovProperties.getProperty("Link.LinkOn");
|
||||
//타이머 사용 구분(Y/N)
|
||||
public static final String TIME_ON = EgovProperties.getProperty("Link.TimeOn");
|
||||
//타임 구분(1.시간, 2.분, 3.초)
|
||||
public static final String TIME_DIV = EgovProperties.getProperty("Link.TimeDiv");
|
||||
//딜레이 타임
|
||||
public static final String TIMEINTERVAL = EgovProperties.getProperty("Link.TimeInterval");
|
||||
public static final long TIME_INTERVAL = Integer.parseInt(TIMEINTERVAL);
|
||||
|
||||
// 푸시서버 사용 구분(Y/N)
|
||||
public static final String PUSH_ON = EgovProperties.getProperty("Push.PushOn");
|
||||
// 푸시서버 타이머 사용 구분(Y/N)
|
||||
public static final String PUSH_TIME_ON = EgovProperties.getProperty("Push.TimeOn");
|
||||
// 푸시서버 타임 구분(1.시간, 2.분, 3.초)
|
||||
public static final String PUSH_TIME_DIV = EgovProperties.getProperty("Push.TimeDiv");
|
||||
// 푸시서버 딜레이 타임
|
||||
public static final String PUSHTIMEINTERVAL = EgovProperties.getProperty("Push.TimeInterval");
|
||||
public static final long PUSH_TIME_INTERVAL = Integer.parseInt(PUSHTIMEINTERVAL);
|
||||
|
||||
//과태료관리 시스템 sftp 디렉토리
|
||||
public static final String topisSftpServerIp = EgovProperties.getProperty("Topis.sftp.server.ip");
|
||||
public static final String topisSftpIntPort = EgovProperties.getProperty("Topis.sftp.server.port");
|
||||
public static final int topisSftpServerPort = Integer.parseInt(topisSftpIntPort);
|
||||
public static final String topisSftpUserId = EgovProperties.getProperty("Topis.sftp.user.id");
|
||||
public static final String topisSftpUserPw = EgovProperties.getProperty("Topis.sftp.user.pw");
|
||||
public static final String topisSftpRecvPath = EgovProperties.getProperty("Topis.sftp.recvPath");
|
||||
public static final String topisSftpSendPath = EgovProperties.getProperty("Topis.sftp.sendPath");
|
||||
|
||||
//과태료관리 시스템 정보 연계 디렉토리
|
||||
public static final String topisLocaRecvPath = EgovProperties.getProperty("Topis.loca.recvPath");
|
||||
public static final String topisRecvErrPath = EgovProperties.getProperty("Topis.recv.errPath");
|
||||
public static final String topisRecvSuccPath = EgovProperties.getProperty("Topis.recv.succPath");
|
||||
|
||||
public static final String topisLocaSendPath = EgovProperties.getProperty("Topis.loca.sendPath");
|
||||
public static final String topisSendErrPath = EgovProperties.getProperty("Topis.send.errPath");
|
||||
public static final String topisSendSuccPath = EgovProperties.getProperty("Topis.send.succPath");
|
||||
|
||||
//과태료관리 시스템 정보 Image 연계 디렉토리
|
||||
public static final String topisImgSendPath = EgovProperties.getProperty("Topis.img.sendPath");
|
||||
public static final String topisImgErrPath = EgovProperties.getProperty("Topis.img.errPath");
|
||||
public static final String topisImgSuccPath = EgovProperties.getProperty("Topis.img.succPath");
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package egovframework.com.cmm.service;
|
||||
|
||||
/**
|
||||
* @파일명 : IpCountryService.java
|
||||
* @파일정보 : 아이피 국가정보 조회 interface
|
||||
* @수정이력
|
||||
* @수정자 수정일 수정내용
|
||||
* @------- ------------ ----------------
|
||||
* @woonee 2014. 9. 5. 최초생성
|
||||
* @---------------------------------------
|
||||
* @author (주)아이티굿 개발팀
|
||||
* @since 2009. 01.14
|
||||
* @version 1.0 Copyright (C) ITGOOD All right reserved.
|
||||
*/
|
||||
|
||||
public interface IpCountryService {
|
||||
|
||||
IpCountryVO getCountryNameAndCode(String ip);
|
||||
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
package egovframework.com.cmm.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class IpCountryVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 4272890967100979951L;
|
||||
|
||||
private String countryCode;
|
||||
private String countryName;
|
||||
|
||||
public String getCountryCode() {
|
||||
return countryCode;
|
||||
}
|
||||
|
||||
public void setCountryCode(String countryCode) {
|
||||
this.countryCode = countryCode;
|
||||
}
|
||||
|
||||
public String getCountryName() {
|
||||
return countryName;
|
||||
}
|
||||
|
||||
public void setCountryName(String countryName) {
|
||||
this.countryName = countryName;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package egovframework.com.cmm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultCodeVO;
|
||||
import egovframework.com.cmm.service.CmmnDetailCode;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Class Name : CmmUseDAO.java
|
||||
* @Description : 공통코드등 전체 업무에서 공용해서 사용해야 하는 서비스를 정의하기위한 데이터 접근 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 11. 이삼섭
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 11.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@Repository("cmmUseDAO")
|
||||
public class CmmUseDAO extends EgovComAbstractDAO {
|
||||
|
||||
/**
|
||||
* 주어진 조건에 따른 공통코드를 불러온다.
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<CmmnDetailCode> selectCmmCodeDetail(ComDefaultCodeVO vo) throws Exception {
|
||||
return (List<CmmnDetailCode>) list("CmmUseDAO.selectCmmCodeDetail", vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 공통코드로 사용할 조직정보를 를 불러온다.
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<CmmnDetailCode> selectOgrnztIdDetail(ComDefaultCodeVO vo) throws Exception {
|
||||
return (List<CmmnDetailCode>) list("CmmUseDAO.selectOgrnztIdDetail", vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 공통코드로 사용할그룹정보를 를 불러온다.
|
||||
* @param vo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<CmmnDetailCode> selectGroupIdDetail(ComDefaultCodeVO vo) throws Exception {
|
||||
return (List<CmmnDetailCode>) list("CmmUseDAO.selectGroupIdDetail", vo);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,91 @@
|
||||
package egovframework.com.cmm.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultCodeVO;
|
||||
import egovframework.com.cmm.service.CmmnDetailCode;
|
||||
import egovframework.com.cmm.service.EgovCmmUseService;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovCmmUseServiceImpl.java
|
||||
* @Description : 공통코드등 전체 업무에서 공용해서 사용해야 하는 서비스를 정의하기위한 서비스 구현 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 11. 이삼섭
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 11.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@Service("EgovCmmUseService")
|
||||
public class EgovCmmUseServiceImpl extends EgovAbstractServiceImpl implements EgovCmmUseService {
|
||||
|
||||
@Resource(name = "cmmUseDAO")
|
||||
private CmmUseDAO cmmUseDAO;
|
||||
|
||||
/**
|
||||
* 공통코드를 조회한다.
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<CmmnDetailCode> selectCmmCodeDetail(ComDefaultCodeVO vo) throws Exception {
|
||||
return cmmUseDAO.selectCmmCodeDetail(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* ComDefaultCodeVO의 리스트를 받아서 여러개의 코드 리스트를 맵에 담아서 리턴한다.
|
||||
*
|
||||
* @param voList
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public Map<String, List<CmmnDetailCode>> selectCmmCodeDetails(List<?> voList) throws Exception {
|
||||
ComDefaultCodeVO vo;
|
||||
Map<String, List<CmmnDetailCode>> map = new HashMap<String, List<CmmnDetailCode>>();
|
||||
|
||||
Iterator<?> iter = voList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
vo = (ComDefaultCodeVO)iter.next();
|
||||
map.put(vo.getCodeId(), cmmUseDAO.selectCmmCodeDetail(vo));
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 조직정보를 코드형태로 리턴한다.
|
||||
*
|
||||
* @param 조회조건정보 vo
|
||||
* @return 조직정보 List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<CmmnDetailCode> selectOgrnztIdDetail(ComDefaultCodeVO vo) throws Exception {
|
||||
return cmmUseDAO.selectOgrnztIdDetail(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 그룹정보를 코드형태로 리턴한다.
|
||||
*
|
||||
* @param 조회조건정보 vo
|
||||
* @return 그룹정보 List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<CmmnDetailCode> selectGroupIdDetail(ComDefaultCodeVO vo) throws Exception {
|
||||
return cmmUseDAO.selectGroupIdDetail(vo);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,36 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package egovframework.com.cmm.service.impl;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import com.ibatis.sqlmap.client.SqlMapClient;
|
||||
|
||||
/**
|
||||
* EgovComAbstractDAO.java 클래스
|
||||
*
|
||||
* @author 서준식
|
||||
* @since 2011. 9. 23.
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------------- ----------------------
|
||||
* 2011. 9. 23. 서준식 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
public abstract class EgovComAbstractDAO extends EgovAbstractDAO{
|
||||
|
||||
@Resource(name="egov.sqlMapClient")
|
||||
public void setSuperSqlMapClient(SqlMapClient sqlMapClient) {
|
||||
super.setSuperSqlMapClient(sqlMapClient);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,156 @@
|
||||
package egovframework.com.cmm.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.service.EgovFileMngService;
|
||||
import egovframework.com.cmm.service.FileVO;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovFileMngServiceImpl.java
|
||||
* @Description : 파일정보의 관리를 위한 구현 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 25. 이삼섭 최초생성
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 25.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@Service("EgovFileMngService")
|
||||
public class EgovFileMngServiceImpl extends EgovAbstractServiceImpl implements EgovFileMngService {
|
||||
|
||||
@Resource(name = "FileManageDAO")
|
||||
private FileManageDAO fileMngDAO;
|
||||
|
||||
/**
|
||||
* 여러 개의 파일을 삭제한다.
|
||||
*
|
||||
* @see egovframework.com.cmm.service.EgovFileMngService#deleteFileInfs(java.util.List)
|
||||
*/
|
||||
public void deleteFileInfs(List<?> fvoList) throws Exception {
|
||||
fileMngDAO.deleteFileInfs(fvoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 하나의 파일에 대한 정보(속성 및 상세)를 등록한다.
|
||||
*
|
||||
* @see egovframework.com.cmm.service.EgovFileMngService#insertFileInf(egovframework.com.cmm.service.FileVO)
|
||||
*/
|
||||
public String insertFileInf(FileVO fvo) throws Exception {
|
||||
String atchFileId = fvo.getAtchFileId();
|
||||
|
||||
fileMngDAO.insertFileInf(fvo);
|
||||
|
||||
return atchFileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 여러 개의 파일에 대한 정보(속성 및 상세)를 등록한다.
|
||||
*
|
||||
* @see egovframework.com.cmm.service.EgovFileMngService#insertFileInfs(java.util.List)
|
||||
*/
|
||||
public String insertFileInfs(List<?> fvoList) throws Exception {
|
||||
String atchFileId = "";
|
||||
|
||||
if (fvoList.size() != 0) {
|
||||
atchFileId = fileMngDAO.insertFileInfs(fvoList);
|
||||
}
|
||||
if (atchFileId == "") {
|
||||
atchFileId = null;
|
||||
}
|
||||
return atchFileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일에 대한 목록을 조회한다.
|
||||
*
|
||||
* @see egovframework.com.cmm.service.EgovFileMngService#selectFileInfs(egovframework.com.cmm.service.FileVO)
|
||||
*/
|
||||
public List<FileVO> selectFileInfs(FileVO fvo) throws Exception {
|
||||
return fileMngDAO.selectFileInfs(fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 여러 개의 파일에 대한 정보(속성 및 상세)를 수정한다.
|
||||
*
|
||||
* @see egovframework.com.cmm.service.EgovFileMngService#updateFileInfs(java.util.List)
|
||||
*/
|
||||
public void updateFileInfs(List<?> fvoList) throws Exception {
|
||||
//Delete & Insert
|
||||
fileMngDAO.updateFileInfs(fvoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 하나의 파일을 삭제한다.
|
||||
*
|
||||
* @see egovframework.com.cmm.service.EgovFileMngService#deleteFileInf(egovframework.com.cmm.service.FileVO)
|
||||
*/
|
||||
public void deleteFileInf(FileVO fvo) throws Exception {
|
||||
fileMngDAO.deleteFileInf(fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일에 대한 상세정보를 조회한다.
|
||||
*
|
||||
* @see egovframework.com.cmm.service.EgovFileMngService#selectFileInf(egovframework.com.cmm.service.FileVO)
|
||||
*/
|
||||
public FileVO selectFileInf(FileVO fvo) throws Exception {
|
||||
return fileMngDAO.selectFileInf(fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일 구분자에 대한 최대값을 구한다.
|
||||
*
|
||||
* @see egovframework.com.cmm.service.EgovFileMngService#getMaxFileSN(egovframework.com.cmm.service.FileVO)
|
||||
*/
|
||||
public int getMaxFileSN(FileVO fvo) throws Exception {
|
||||
return fileMngDAO.getMaxFileSN(fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 전체 파일을 삭제한다.
|
||||
*
|
||||
* @see egovframework.com.cmm.service.EgovFileMngService#deleteAllFileInf(egovframework.com.cmm.service.FileVO)
|
||||
*/
|
||||
public void deleteAllFileInf(FileVO fvo) throws Exception {
|
||||
fileMngDAO.deleteAllFileInf(fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일명 검색에 대한 목록을 조회한다.
|
||||
*
|
||||
* @see egovframework.com.cmm.service.EgovFileMngService#selectFileListByFileNm(egovframework.com.cmm.service.FileVO)
|
||||
*/
|
||||
public Map<String, Object> selectFileListByFileNm(FileVO fvo) throws Exception {
|
||||
List<FileVO> result = fileMngDAO.selectFileListByFileNm(fvo);
|
||||
int cnt = fileMngDAO.selectFileListCntByFileNm(fvo);
|
||||
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
|
||||
map.put("resultList", result);
|
||||
map.put("resultCnt", Integer.toString(cnt));
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 이미지 파일에 대한 목록을 조회한다.
|
||||
*
|
||||
* @see egovframework.com.cmm.service.EgovFileMngService#selectImageFileList(egovframework.com.cmm.service.FileVO)
|
||||
*/
|
||||
public List<FileVO> selectImageFileList(FileVO vo) throws Exception {
|
||||
return fileMngDAO.selectImageFileList(vo);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,87 @@
|
||||
package egovframework.com.cmm.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.LoginVO;
|
||||
import egovframework.com.cmm.service.EgovUserDetailsService;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author 공통서비스 개발팀 서준식
|
||||
* @since 2011. 8. 12.
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* 개정이력(Modification Information)
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2011. 8. 12. 서준식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public class EgovTestUserDetailsServiceImpl extends EgovAbstractServiceImpl implements
|
||||
EgovUserDetailsService {
|
||||
|
||||
@Override
|
||||
public Object getAuthenticatedUser() {
|
||||
|
||||
LoginVO loginVO = new LoginVO();
|
||||
loginVO.setId("TEST1");
|
||||
loginVO.setPassword("raHLBnHFcunwNzcDcfad4PhD11hHgXSUr7fc1Jk9uoQ=");
|
||||
loginVO.setUserSe("USR");
|
||||
loginVO.setEmail("egovframe@nia.or.kr");
|
||||
loginVO.setIhidNum("");
|
||||
loginVO.setName("더미사용자");
|
||||
loginVO.setOrgnztId("ORGNZT_0000000000000");
|
||||
loginVO.setUniqId("USRCNFRM_00000000000");
|
||||
return loginVO;
|
||||
|
||||
// return
|
||||
// RequestContextHolder.getRequestAttributes().getAttribute("loginVO",
|
||||
// RequestAttributes.SCOPE_SESSION);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAuthorities() {
|
||||
|
||||
// 권한 설정을 리턴한다.
|
||||
|
||||
List<String> listAuth = new ArrayList<String>();
|
||||
listAuth.add("IS_AUTHENTICATED_ANONYMOUSLY");
|
||||
listAuth.add("IS_AUTHENTICATED_FULLY");
|
||||
listAuth.add("IS_AUTHENTICATED_REMEMBERED");
|
||||
listAuth.add("ROLE_ADMIN");
|
||||
listAuth.add("ROLE_ANONYMOUS");
|
||||
listAuth.add("ROLE_RESTRICTED");
|
||||
listAuth.add("ROLE_USER");
|
||||
|
||||
return listAuth;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean isAuthenticated() {
|
||||
// 인증된 유저인지 확인한다.
|
||||
|
||||
/*if (RequestContextHolder.getRequestAttributes() == null) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
if (RequestContextHolder.getRequestAttributes().getAttribute(
|
||||
"loginVO", RequestAttributes.SCOPE_SESSION) == null) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}*/
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package egovframework.com.cmm.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.service.EgovUserDetailsService;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author 공통서비스 개발팀 서준식
|
||||
* @since 2011. 6. 25.
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* 개정이력(Modification Information)
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2011. 8. 12. 서준식 최초생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public class EgovUserDetailsSessionServiceImpl extends EgovAbstractServiceImpl implements EgovUserDetailsService {
|
||||
|
||||
public Object getAuthenticatedUser() {
|
||||
if (RequestContextHolder.getRequestAttributes() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return RequestContextHolder.getRequestAttributes().getAttribute("loginVO", RequestAttributes.SCOPE_SESSION);
|
||||
|
||||
}
|
||||
|
||||
public List<String> getAuthorities() {
|
||||
|
||||
// 권한 설정을 리턴한다.
|
||||
List<String> listAuth = new ArrayList<String>();
|
||||
|
||||
return listAuth;
|
||||
}
|
||||
|
||||
public Boolean isAuthenticated() {
|
||||
// 인증된 유저인지 확인한다.
|
||||
|
||||
if (RequestContextHolder.getRequestAttributes() == null) {
|
||||
return false;
|
||||
} else {
|
||||
|
||||
if (RequestContextHolder.getRequestAttributes().getAttribute("loginVO", RequestAttributes.SCOPE_SESSION) == null) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,181 @@
|
||||
package egovframework.com.cmm.service.impl;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.service.FileVO;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovFileMngDAO.java
|
||||
* @Description : 파일정보 관리를 위한 데이터 처리 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 25. 이삼섭 최초생성
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 25.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@Repository("FileManageDAO")
|
||||
public class FileManageDAO extends EgovComAbstractDAO {
|
||||
|
||||
/**
|
||||
* 여러 개의 파일에 대한 정보(속성 및 상세)를 등록한다.
|
||||
*
|
||||
* @param fileList
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public String insertFileInfs(List<?> fileList) throws Exception {
|
||||
FileVO vo = (FileVO) fileList.get(0);
|
||||
String atchFileId = vo.getAtchFileId();
|
||||
|
||||
insert("FileManageDAO.insertFileMaster", vo);
|
||||
|
||||
Iterator<?> iter = fileList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
vo = (FileVO) iter.next();
|
||||
|
||||
insert("FileManageDAO.insertFileDetail", vo);
|
||||
}
|
||||
|
||||
return atchFileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 하나의 파일에 대한 정보(속성 및 상세)를 등록한다.
|
||||
*
|
||||
* @param vo
|
||||
* @throws Exception
|
||||
*/
|
||||
public void insertFileInf(FileVO vo) throws Exception {
|
||||
insert("FileManageDAO.insertFileMaster", vo);
|
||||
insert("FileManageDAO.insertFileDetail", vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 여러 개의 파일에 대한 정보(속성 및 상세)를 수정한다.
|
||||
*
|
||||
* @param fileList
|
||||
* @throws Exception
|
||||
*/
|
||||
public void updateFileInfs(List<?> fileList) throws Exception {
|
||||
FileVO vo;
|
||||
Iterator<?> iter = fileList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
vo = (FileVO) iter.next();
|
||||
insert("FileManageDAO.insertFileDetail", vo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 여러 개의 파일을 삭제한다.
|
||||
*
|
||||
* @param fileList
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteFileInfs(List<?> fileList) throws Exception {
|
||||
Iterator<?> iter = fileList.iterator();
|
||||
FileVO vo;
|
||||
while (iter.hasNext()) {
|
||||
vo = (FileVO) iter.next();
|
||||
|
||||
delete("FileManageDAO.deleteFileDetail", vo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 하나의 파일을 삭제한다.
|
||||
*
|
||||
* @param fvo
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteFileInf(FileVO fvo) throws Exception {
|
||||
delete("FileManageDAO.deleteFileDetail", fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일에 대한 목록을 조회한다.
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<FileVO> selectFileInfs(FileVO vo) throws Exception {
|
||||
return (List<FileVO>) list("FileManageDAO.selectFileList", vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일 구분자에 대한 최대값을 구한다.
|
||||
*
|
||||
* @param fvo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int getMaxFileSN(FileVO fvo) throws Exception {
|
||||
return (Integer) select("FileManageDAO.getMaxFileSN", fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일에 대한 상세정보를 조회한다.
|
||||
*
|
||||
* @param fvo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public FileVO selectFileInf(FileVO fvo) throws Exception {
|
||||
return (FileVO) select("FileManageDAO.selectFileInf", fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 전체 파일을 삭제한다.
|
||||
*
|
||||
* @param fvo
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteAllFileInf(FileVO fvo) throws Exception {
|
||||
update("FileManageDAO.deleteCOMTNFILE", fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일명 검색에 대한 목록을 조회한다.
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<FileVO> selectFileListByFileNm(FileVO fvo) throws Exception {
|
||||
return (List<FileVO>) list("FileManageDAO.selectFileListByFileNm", fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일명 검색에 대한 목록 전체 건수를 조회한다.
|
||||
*
|
||||
* @param fvo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int selectFileListCntByFileNm(FileVO fvo) throws Exception {
|
||||
return (Integer) select("FileManageDAO.selectFileListCntByFileNm", fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 이미지 파일에 대한 목록을 조회한다.
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<FileVO> selectImageFileList(FileVO vo) throws Exception {
|
||||
return (List<FileVO>) list("FileManageDAO.selectImageFileList", vo);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package egovframework.com.cmm.service.impl;
|
||||
|
||||
import egovframework.com.cmm.service.IpCountryVO;
|
||||
import egovframework.rte.psl.dataaccess.mapper.Mapper;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @파일명 : IpCountryMapper.java
|
||||
* @파일정보 : 아이피 국가정보 조회
|
||||
* @수정이력
|
||||
* @수정자 수정일 수정내용
|
||||
* @------- ------------ ----------------
|
||||
* @woonee 2014. 9. 5. 최초생성
|
||||
* @---------------------------------------
|
||||
* @author (주)아이티굿 개발팀
|
||||
* @since 2009. 01.14
|
||||
* @version 1.0 Copyright (C) ITGOOD All right reserved.
|
||||
*/
|
||||
|
||||
@Mapper("ipCountryMapper")
|
||||
public interface IpCountryMapper {
|
||||
|
||||
IpCountryVO getCountryNameAndCode(long ipConvertNumber);
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package egovframework.com.cmm.service.impl;
|
||||
|
||||
import egovframework.com.cmm.service.IpCountryService;
|
||||
import egovframework.com.cmm.service.IpCountryVO;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @파일명 : IpCountryServiceImpl.java
|
||||
* @파일정보 : 아이피 국가정보 조회 interface
|
||||
* @수정이력
|
||||
* @수정자 수정일 수정내용
|
||||
* @------- ------------ ----------------
|
||||
* @woonee 2014. 9. 5. 최초생성
|
||||
* @---------------------------------------
|
||||
* @author (주)아이티굿 개발팀
|
||||
* @since 2009. 01.14
|
||||
* @version 1.0 Copyright (C) ITGOOD All right reserved.
|
||||
*/
|
||||
|
||||
@Service("ipCountryService")
|
||||
public class IpCountryServiceImpl implements IpCountryService {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
@Resource(name = "ipCountryMapper")
|
||||
private IpCountryMapper ipCountryMapper;
|
||||
|
||||
@Override
|
||||
public IpCountryVO getCountryNameAndCode(String ip) {
|
||||
|
||||
IpCountryVO ipCountryVO;
|
||||
|
||||
//로컬아이피
|
||||
if ("127.0.0.1".equals(ip) || "0:0:0:0:0:0:0:1".equals(ip)) {
|
||||
ipCountryVO = new IpCountryVO();
|
||||
ipCountryVO.setCountryCode("");
|
||||
ipCountryVO.setCountryName("");
|
||||
return ipCountryVO;
|
||||
}
|
||||
|
||||
String[] tmpIp = ip.split("\\.");
|
||||
|
||||
long w = Integer.parseInt(tmpIp[0]) * 16777216L;
|
||||
long x = Integer.parseInt(tmpIp[1]) * 65536L;
|
||||
long y = Integer.parseInt(tmpIp[2]) * 256L;
|
||||
long z = Integer.parseInt(tmpIp[3]);
|
||||
|
||||
long ipConvertNumber = w + x + y + z;
|
||||
|
||||
ipCountryVO = ipCountryMapper.getCountryNameAndCode(ipConvertNumber);
|
||||
if (ipCountryVO == null) {
|
||||
ipCountryVO = new IpCountryVO();
|
||||
ipCountryVO.setCountryCode("");
|
||||
ipCountryVO.setCountryName("");
|
||||
}
|
||||
|
||||
return ipCountryVO;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
package egovframework.com.cmm.servlet;
|
||||
|
||||
import nl.captcha.Captcha;
|
||||
import nl.captcha.audio.AudioCaptcha;
|
||||
import nl.captcha.servlet.CaptchaServletUtil;
|
||||
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.io.IOException;
|
||||
|
||||
public class CaptchaGenAudioServlet extends HttpServlet {
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
|
||||
HttpSession session = req.getSession();
|
||||
|
||||
String answer = (String) session.getAttribute("CMS_CAPTCHA");
|
||||
|
||||
if (answer != null && !answer.equals("")) {
|
||||
AudioCaptcha audiocaptcha = new AudioCaptcha.Builder()
|
||||
.addAnswer(new SetTextProducer(answer))
|
||||
.addNoise() //잡음추가
|
||||
.build();
|
||||
|
||||
CaptchaServletUtil.writeAudio(resp, audiocaptcha.getChallenge());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package egovframework.com.cmm.servlet;
|
||||
|
||||
import nl.captcha.Captcha;
|
||||
import nl.captcha.backgrounds.GradiatedBackgroundProducer;
|
||||
import nl.captcha.gimpy.FishEyeGimpyRenderer;
|
||||
import nl.captcha.noise.StraightLineNoiseProducer;
|
||||
import nl.captcha.servlet.CaptchaServletUtil;
|
||||
import nl.captcha.text.producer.NumbersAnswerProducer;
|
||||
import nl.captcha.text.renderer.DefaultWordRenderer;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.awt.*;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CaptchaGenServlet extends HttpServlet {
|
||||
|
||||
@Override
|
||||
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||
java.util.List<Font> fontList = new ArrayList<>();
|
||||
fontList.add(new Font("", Font.HANGING_BASELINE, 40));
|
||||
fontList.add(new Font("Courier", Font.ITALIC, 40));
|
||||
fontList.add(new Font("", Font.PLAIN, 40));
|
||||
|
||||
java.util.List<Color> colorList = new ArrayList<>();
|
||||
colorList.add(Color.black);
|
||||
|
||||
Captcha captcha = new Captcha.Builder(230, 60)
|
||||
.addText(new NumbersAnswerProducer(6), new DefaultWordRenderer(colorList, fontList))
|
||||
.addBackground(new GradiatedBackgroundProducer())
|
||||
.gimp(new FishEyeGimpyRenderer())
|
||||
.addNoise(new StraightLineNoiseProducer())
|
||||
.addBorder()
|
||||
.build();
|
||||
|
||||
resp.setContentType("image/jpeg");
|
||||
CaptchaServletUtil.writeImage(resp, captcha.getImage());
|
||||
req.getSession().setAttribute("CMS_CAPTCHA", captcha.getAnswer());
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package egovframework.com.cmm.servlet;
|
||||
|
||||
import nl.captcha.text.producer.TextProducer;
|
||||
|
||||
public class SetTextProducer implements TextProducer {
|
||||
private final String srcStr;
|
||||
|
||||
public SetTextProducer(String answer) {
|
||||
srcStr = answer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return srcStr;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package egovframework.com.cmm.taglibs;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.util.EgovDoubleSubmitHelper;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.JspTagException;
|
||||
import javax.servlet.jsp.tagext.TagSupport;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* TagSupport to support to double submit preventer
|
||||
* @author Vincent Han
|
||||
* @since 2014.08.07
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2014.08.07 표준프레임워크센터 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class DoubleSubmitTag extends TagSupport {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(DoubleSubmitTag.class);
|
||||
|
||||
/**
|
||||
* Generated Serial Version UID
|
||||
*/
|
||||
private static final long serialVersionUID = 5242217605452312594L;
|
||||
|
||||
private String tokenKey = EgovDoubleSubmitHelper.DEFAULT_TOKEN_KEY;
|
||||
|
||||
public String getTokenKey() {
|
||||
return tokenKey;
|
||||
}
|
||||
|
||||
public void setTokenKey(String tokenKey) {
|
||||
this.tokenKey = tokenKey;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public int doStartTag() throws JspException {
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
|
||||
HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
|
||||
HttpSession session = request.getSession();
|
||||
|
||||
Map<String, String> map = null;
|
||||
|
||||
if (session.getAttribute(EgovDoubleSubmitHelper.SESSION_TOKEN_KEY) == null) {
|
||||
map = new HashMap<String, String>();
|
||||
|
||||
session.setAttribute(EgovDoubleSubmitHelper.SESSION_TOKEN_KEY, map);
|
||||
} else {
|
||||
map = (Map<String, String>) session.getAttribute(EgovDoubleSubmitHelper.SESSION_TOKEN_KEY);
|
||||
}
|
||||
|
||||
// First call (check session)
|
||||
if (map.get(tokenKey) == null) {
|
||||
|
||||
map.put(tokenKey, EgovDoubleSubmitHelper.getNewUUID());
|
||||
|
||||
LOGGER.debug("[Double Submit] session token created({}) : {}", tokenKey, map.get(tokenKey));
|
||||
}
|
||||
|
||||
buffer.append("<input type='hidden' name='").append(EgovDoubleSubmitHelper.PARAMETER_NAME).append("' value='").append(map.get(tokenKey)).append("'/>");
|
||||
|
||||
try {
|
||||
pageContext.getOut().print(buffer.toString());
|
||||
} catch (IOException e) {
|
||||
throw new JspTagException("Error: IOException while writing to the user");
|
||||
}
|
||||
|
||||
return SKIP_BODY;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,83 @@
|
||||
package egovframework.com.cmm.util;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* Utility class to support to logging information
|
||||
* @author Vincent Han
|
||||
* @since 2014.09.18
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2014.09.18 표준프레임워크센터 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class EgovBasicLogger {
|
||||
private static final Level IGNORE_INFO_LEVEL = Level.OFF;
|
||||
private static final Level DEBUG_INFO_LEVEL = Level.FINEST;
|
||||
private static final Level INFO_INFO_LEVEL = Level.INFO;
|
||||
|
||||
private static final Logger ignoreLogger = Logger.getLogger("ignore");
|
||||
private static final Logger debugLogger = Logger.getLogger("debug");
|
||||
private static final Logger infoLogger = Logger.getLogger("info");
|
||||
|
||||
/**
|
||||
* 기록이나 처리가 불필요한 경우 사용.
|
||||
* @param message
|
||||
* @param exception
|
||||
*/
|
||||
public static void ignore(String message, Exception exception) {
|
||||
if (exception == null) {
|
||||
ignoreLogger.log(IGNORE_INFO_LEVEL, message);
|
||||
} else {
|
||||
ignoreLogger.log(IGNORE_INFO_LEVEL, message, exception);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 기록이나 처리가 불필요한 경우 사용.
|
||||
* @param message
|
||||
* @param exception
|
||||
*/
|
||||
public static void ignore(String message) {
|
||||
ignore(message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 디버그 정보를 기록하는 경우 사용.
|
||||
* @param message
|
||||
* @param exception
|
||||
*/
|
||||
public static void debug(String message, Exception exception) {
|
||||
if (exception == null) {
|
||||
debugLogger.log(DEBUG_INFO_LEVEL, message);
|
||||
} else {
|
||||
debugLogger.log(DEBUG_INFO_LEVEL, message, exception);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 디버그 정보를 기록하는 경우 사용.
|
||||
* @param message
|
||||
* @param exception
|
||||
*/
|
||||
public static void debug(String message) {
|
||||
debug(message, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 일반적이 정보를 기록하는 경우 사용.
|
||||
* @param message
|
||||
* @param exception
|
||||
*/
|
||||
public static void info(String message) {
|
||||
infoLogger.log(INFO_INFO_LEVEL, message);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package egovframework.com.cmm.util;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
/**
|
||||
* Utility class to support to double submit preventer
|
||||
* @author Vincent Han
|
||||
* @since 2014.08.07
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2014.08.07 표준프레임워크센터 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class EgovDoubleSubmitHelper {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovDoubleSubmitHelper.class);
|
||||
|
||||
public final static String SESSION_TOKEN_KEY = "egovframework.double.submit.preventer.session.key";
|
||||
|
||||
public final static String PARAMETER_NAME = "egovframework.double.submit.preventer.parameter.name";
|
||||
|
||||
public final static String DEFAULT_TOKEN_KEY = "DEFAULT";
|
||||
|
||||
public static String getNewUUID() {
|
||||
return UUID.randomUUID().toString().toUpperCase();
|
||||
}
|
||||
|
||||
public static boolean checkAndSaveToken() {
|
||||
return checkAndSaveToken(DEFAULT_TOKEN_KEY);
|
||||
}
|
||||
|
||||
public static boolean checkAndSaveToken(String tokenKey) {
|
||||
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
HttpSession session = request.getSession();
|
||||
|
||||
// check session...
|
||||
if (session.getAttribute(EgovDoubleSubmitHelper.SESSION_TOKEN_KEY) == null) {
|
||||
throw new RuntimeException("Double Submit Preventer TagLig isn't set. Check JSP.");
|
||||
}
|
||||
|
||||
String parameter = request.getParameter(EgovDoubleSubmitHelper.PARAMETER_NAME);
|
||||
|
||||
// check parameter
|
||||
if (parameter == null) {
|
||||
throw new RuntimeException("Double Submit Preventer parameter isn't set. Check JSP.");
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, String> map = (Map<String, String>) session.getAttribute(EgovDoubleSubmitHelper.SESSION_TOKEN_KEY);
|
||||
|
||||
if (parameter.equals(map.get(tokenKey))) {
|
||||
|
||||
LOGGER.debug("[Double Submit] session token ({}) equals to parameter token.", tokenKey);
|
||||
|
||||
map.put(tokenKey, getNewUUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
LOGGER.debug("[Double Submit] session token ({}) isn't equal to parameter token.", tokenKey);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,56 @@
|
||||
package egovframework.com.cmm.util;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovHttpRequestHelper.java
|
||||
* @Description : HTTP Request 정보 취득 Helper 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2014.09.11 표준프레임워크 최초생성
|
||||
* @author Vincent Han
|
||||
* @since 2014.09.11
|
||||
* @version 3.5
|
||||
* @see <pre>
|
||||
* web.xml 상에 다음과 같은 Listener 등록 필요
|
||||
* <listener>
|
||||
* <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
|
||||
* </listener>
|
||||
* </pre>
|
||||
*/
|
||||
public class EgovHttpRequestHelper {
|
||||
|
||||
public static boolean isInHttpRequest() {
|
||||
try {
|
||||
getCurrentRequest();
|
||||
} catch (IllegalStateException ise) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static HttpServletRequest getCurrentRequest() {
|
||||
ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes();
|
||||
|
||||
return sra.getRequest();
|
||||
}
|
||||
|
||||
public static String getRequestIp() {
|
||||
return getCurrentRequest().getRemoteAddr();
|
||||
}
|
||||
|
||||
public static String getRequestURI() {
|
||||
return getCurrentRequest().getRequestURI();
|
||||
}
|
||||
|
||||
public static HttpSession getCurrentSession() {
|
||||
return getCurrentRequest().getSession();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,126 @@
|
||||
package egovframework.com.cmm.util;
|
||||
|
||||
import java.io.Closeable;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.Socket;
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Statement;
|
||||
import java.sql.Wrapper;
|
||||
|
||||
/**
|
||||
* Utility class to support to close resources
|
||||
* @author Vincent Han
|
||||
* @since 2014.09.18
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2014.09.18 표준프레임워크센터 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class EgovResourceCloseHelper {
|
||||
/**
|
||||
* Resource close 처리.
|
||||
* @param resources
|
||||
*/
|
||||
public static void close(Closeable ... resources) {
|
||||
for (Closeable resource : resources) {
|
||||
if (resource != null) {
|
||||
try {
|
||||
resource.close();
|
||||
} catch (Exception ignore) {
|
||||
EgovBasicLogger.ignore("Occurred Exception to close resource is ingored!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* JDBC 관련 resource 객체 close 처리
|
||||
* @param objects
|
||||
*/
|
||||
public static void closeDBObjects(Wrapper ... objects) {
|
||||
for (Object object : objects) {
|
||||
if (object != null) {
|
||||
if (object instanceof ResultSet) {
|
||||
try {
|
||||
((ResultSet)object).close();
|
||||
} catch (Exception ignore) {
|
||||
EgovBasicLogger.ignore("Occurred Exception to close resource is ingored!!");
|
||||
}
|
||||
} else if (object instanceof Statement) {
|
||||
try {
|
||||
((Statement)object).close();
|
||||
} catch (Exception ignore) {
|
||||
EgovBasicLogger.ignore("Occurred Exception to close resource is ingored!!");
|
||||
}
|
||||
} else if (object instanceof Connection) {
|
||||
try {
|
||||
((Connection)object).close();
|
||||
} catch (Exception ignore) {
|
||||
EgovBasicLogger.ignore("Occurred Exception to close resource is ingored!!");
|
||||
}
|
||||
} else {
|
||||
throw new IllegalArgumentException("Wrapper type is not found : " + object.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Socket 관련 resource 객체 close 처리
|
||||
* @param objects
|
||||
*/
|
||||
public static void closeSocketObjects(Socket socket, ServerSocket server) {
|
||||
if (socket != null) {
|
||||
try {
|
||||
socket.shutdownOutput();
|
||||
} catch (Exception ignore) {
|
||||
EgovBasicLogger.ignore("Occurred Exception to shutdown ouput is ignored!!");
|
||||
}
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignore) {
|
||||
EgovBasicLogger.ignore("Occurred Exception to close resource is ignored!!");
|
||||
}
|
||||
}
|
||||
|
||||
if (server != null) {
|
||||
try {
|
||||
server.close();
|
||||
} catch (Exception ignore) {
|
||||
EgovBasicLogger.ignore("Occurred Exception to close resource is ignored!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Socket 관련 resource 객체 close 처리
|
||||
*
|
||||
* @param sockets
|
||||
*/
|
||||
public static void closeSockets(Socket ... sockets) {
|
||||
for (Socket socket : sockets) {
|
||||
if (socket != null) {
|
||||
try {
|
||||
socket.shutdownOutput();
|
||||
} catch (Exception ignore) {
|
||||
EgovBasicLogger.ignore("Occurred Exception to shutdown ouput is ignored!!");
|
||||
}
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
} catch (Exception ignore) {
|
||||
EgovBasicLogger.ignore("Occurred Exception to close resource is ignored!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,109 @@
|
||||
package egovframework.com.cmm.util;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
|
||||
/**
|
||||
* @Class Name : UrlRewriteFilter.java
|
||||
* @Description : UrlRewriteFilter Class
|
||||
* @Modification Information
|
||||
* @
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ --------- --------- -------------------------------
|
||||
* @ 2014.09.30 최초생성
|
||||
*
|
||||
* @author 전자정부 표준프레임워크 유지보수
|
||||
* @since 2014. 09.30
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* Copyright (C) by MOPAS All right reserved.
|
||||
*/
|
||||
public class EgovUrlRewriteFilter implements Filter {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private FilterConfig config;
|
||||
|
||||
private String targetURI;
|
||||
private String httpsPort;
|
||||
private String httpPort;
|
||||
|
||||
private String[] uriPatterns;
|
||||
|
||||
@Override
|
||||
public void init(FilterConfig config) throws ServletException {
|
||||
|
||||
String delimiter = ",";
|
||||
this.config = config;
|
||||
|
||||
this.targetURI = config.getInitParameter("targetURI");
|
||||
this.httpsPort = config.getInitParameter("httpsPort");
|
||||
this.httpPort = config.getInitParameter("httpPort");
|
||||
|
||||
this.uriPatterns = targetURI.split(delimiter);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException {
|
||||
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
HttpServletResponse res = (HttpServletResponse) response;
|
||||
|
||||
String uri = req.getRequestURI();
|
||||
String getProtocol = req.getScheme();
|
||||
String getDomain = req.getServerName();
|
||||
|
||||
AntPathMatcher pm = new AntPathMatcher();
|
||||
|
||||
for (String uriPattern : uriPatterns) {
|
||||
|
||||
if (pm.match(uriPattern.trim(), uri)) {
|
||||
|
||||
if (getProtocol.toLowerCase().equals("http")) {
|
||||
|
||||
response.setContentType("text/html");
|
||||
|
||||
String httpsPath = "https" + "://" + getDomain + ":" + httpsPort + uri;
|
||||
String site = new String(httpsPath);
|
||||
res.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
|
||||
res.setHeader("Location", site);
|
||||
|
||||
}
|
||||
|
||||
}else if(getProtocol.toLowerCase().equals("https")){
|
||||
|
||||
response.setContentType("text/html");
|
||||
|
||||
String httpPath = "http" + "://" + getDomain + ":" + httpPort + uri;
|
||||
|
||||
String site = new String(httpPath);
|
||||
res.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
|
||||
res.setHeader("Location", site);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
chain.doFilter(req, res);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.targetURI = null;
|
||||
this.httpsPort = null;
|
||||
this.httpPort = null;
|
||||
this.uriPatterns = null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package egovframework.com.cmm.util;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.service.EgovUserDetailsService;
|
||||
|
||||
/**
|
||||
* EgovUserDetails Helper 클래스
|
||||
*
|
||||
* @author sjyoon
|
||||
* @since 2009.06.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------------- ----------------------
|
||||
* 2009.03.10 sjyoon 최초 생성
|
||||
* 2011.07.01 서준식 interface 생성후 상세 로직의 분리
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public class EgovUserDetailsHelper {
|
||||
|
||||
static EgovUserDetailsService egovUserDetailsService;
|
||||
|
||||
public EgovUserDetailsService getEgovUserDetailsService() {
|
||||
return egovUserDetailsService;
|
||||
}
|
||||
|
||||
public void setEgovUserDetailsService(EgovUserDetailsService egovUserDetailsService) {
|
||||
EgovUserDetailsHelper.egovUserDetailsService = egovUserDetailsService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 인증된 사용자객체를 VO형식으로 가져온다.
|
||||
* @return Object - 사용자 ValueObject
|
||||
*/
|
||||
public static Object getAuthenticatedUser() {
|
||||
return egovUserDetailsService.getAuthenticatedUser();
|
||||
}
|
||||
|
||||
/**
|
||||
* 인증된 사용자의 권한 정보를 가져온다.
|
||||
*
|
||||
* @return List - 사용자 권한정보 목록
|
||||
*/
|
||||
public static List<String> getAuthorities() {
|
||||
return egovUserDetailsService.getAuthorities();
|
||||
}
|
||||
|
||||
/**
|
||||
* 인증된 사용자 여부를 체크한다.
|
||||
* @return Boolean - 인증된 사용자 여부(TRUE / FALSE)
|
||||
*/
|
||||
public static Boolean isAuthenticated() {
|
||||
return egovUserDetailsService.isAuthenticated();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package egovframework.com.cmm.web;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
import org.springframework.beans.propertyeditors.CustomDateEditor;
|
||||
import org.springframework.beans.propertyeditors.StringTrimmerEditor;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.bind.support.WebBindingInitializer;
|
||||
import org.springframework.web.context.request.WebRequest;
|
||||
|
||||
public class EgovBindingInitializer implements WebBindingInitializer {
|
||||
|
||||
|
||||
public void initBinder(WebDataBinder binder, WebRequest request) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
dateFormat.setLenient(false);
|
||||
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
|
||||
binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,169 @@
|
||||
package egovframework.com.cmm.web;
|
||||
|
||||
/**
|
||||
* 컴포넌트 설치 후 설치된 컴포넌트들을 IncludedInfo annotation을 통해 찾아낸 후
|
||||
* 화면에 표시할 정보를 처리하는 Controller 클래스
|
||||
* <Notice>
|
||||
* 개발시 메뉴 구조가 잡히기 전에 배포파일들에 포함된 공통 컴포넌트들의 목록성 화면에
|
||||
* URL을 제공하여 개발자가 편하게 활용하도록 하기 위해 작성된 것으로,
|
||||
* 실제 운영되는 시스템에서는 적용해서는 안 됨
|
||||
* 실 운영 시에는 삭제해서 배포해도 좋음
|
||||
* <Disclaimer>
|
||||
* 운영시에 본 컨트롤을 사용하여 메뉴를 구성하는 경우 성능 문제를 일으키거나
|
||||
* 사용자별 메뉴 구성에 오류를 발생할 수 있음
|
||||
* @author 공통컴포넌트 정진오
|
||||
* @since 2011.08.26
|
||||
* @version 2.0.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2011.08.26 정진오 최초 생성
|
||||
* 2011.09.16 서준식 컨텐츠 페이지 생성
|
||||
* 2011.09.26 이기하 header, footer 페이지 생성
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import egovframework.com.cmm.IncludedCompInfoVO;
|
||||
import egovframework.com.cmm.LoginVO;
|
||||
import egovframework.com.cmm.annotation.IncludedInfo;
|
||||
import egovframework.com.cmm.util.EgovUserDetailsHelper;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
public class EgovComIndexController implements ApplicationContextAware, InitializingBean {
|
||||
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovComIndexController.class);
|
||||
|
||||
private Map<Integer, IncludedCompInfoVO> map;
|
||||
|
||||
public void afterPropertiesSet() throws Exception {}
|
||||
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
this.applicationContext = applicationContext;
|
||||
|
||||
// LOGGER.info("EgovComIndexController setApplicationContext method has called!");
|
||||
}
|
||||
|
||||
@RequestMapping("/index.do")
|
||||
public String index(ModelMap model) {
|
||||
return "com/cmm/EgovUnitMain";
|
||||
}
|
||||
|
||||
@RequestMapping("/EgovTop.do")
|
||||
public String top() {
|
||||
return "com/cmm/EgovUnitTop";
|
||||
}
|
||||
|
||||
@RequestMapping("/EgovBottom.do")
|
||||
public String bottom() {
|
||||
return "com/cmm/EgovUnitBottom";
|
||||
}
|
||||
|
||||
@RequestMapping("/EgovContent.do")
|
||||
public String setContent(ModelMap model) {
|
||||
|
||||
LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
model.addAttribute("loginVO", loginVO);
|
||||
|
||||
return "com/cmm/EgovUnitContent";
|
||||
}
|
||||
|
||||
@RequestMapping("/EgovLeft.do")
|
||||
public String setLeftMenu(ModelMap model) {
|
||||
|
||||
/* 최초 한 번만 실행하여 map에 저장해 놓는다. */
|
||||
if (map == null) {
|
||||
map = new TreeMap<Integer, IncludedCompInfoVO>();
|
||||
RequestMapping rmAnnotation;
|
||||
IncludedInfo annotation;
|
||||
IncludedCompInfoVO zooVO;
|
||||
|
||||
/*
|
||||
* EgovLoginController가 AOP Proxy되는 바람에 클래스를 reflection으로 가져올 수 없음
|
||||
*/
|
||||
try {
|
||||
Class<?> loginController = Class.forName("egovframework.com.uat.uia.web.EgovLoginController");
|
||||
Method[] methods = loginController.getMethods();
|
||||
for (int i = 0; i < methods.length; i++) {
|
||||
annotation = methods[i].getAnnotation(IncludedInfo.class);
|
||||
|
||||
if (annotation != null) {
|
||||
LOGGER.debug("Found @IncludedInfo Method : {}", methods[i]);
|
||||
zooVO = new IncludedCompInfoVO();
|
||||
zooVO.setName(annotation.name());
|
||||
zooVO.setOrder(annotation.order());
|
||||
zooVO.setGid(annotation.gid());
|
||||
|
||||
rmAnnotation = methods[i].getAnnotation(RequestMapping.class);
|
||||
if ("".equals(annotation.listUrl()) && rmAnnotation != null) {
|
||||
zooVO.setListUrl(rmAnnotation.value()[0]);
|
||||
} else {
|
||||
zooVO.setListUrl(annotation.listUrl());
|
||||
}
|
||||
map.put(zooVO.getOrder(), zooVO);
|
||||
}
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
LOGGER.error("No egovframework.com.uat.uia.web.EgovLoginController!!");
|
||||
}
|
||||
/* 여기까지 AOP Proxy로 인한 코드 */
|
||||
|
||||
/*@Controller Annotation 처리된 클래스를 모두 찾는다.*/
|
||||
Map<String, Object> myZoos = applicationContext.getBeansWithAnnotation(Controller.class);
|
||||
LOGGER.debug("How many Controllers : ", myZoos.size());
|
||||
for (final Object myZoo : myZoos.values()) {
|
||||
Class<? extends Object> zooClass = myZoo.getClass();
|
||||
|
||||
Method[] methods = zooClass.getMethods();
|
||||
LOGGER.debug("Controller Detected {}", zooClass);
|
||||
for (int i = 0; i < methods.length; i++) {
|
||||
annotation = methods[i].getAnnotation(IncludedInfo.class);
|
||||
|
||||
if (annotation != null) {
|
||||
//LOG.debug("Found @IncludedInfo Method : " + methods[i] );
|
||||
zooVO = new IncludedCompInfoVO();
|
||||
zooVO.setName(annotation.name());
|
||||
zooVO.setOrder(annotation.order());
|
||||
zooVO.setGid(annotation.gid());
|
||||
/*
|
||||
* 목록형 조회를 위한 url 매핑은 @IncludedInfo나 @RequestMapping에서 가져온다
|
||||
*/
|
||||
rmAnnotation = methods[i].getAnnotation(RequestMapping.class);
|
||||
if ("".equals(annotation.listUrl())) {
|
||||
zooVO.setListUrl(rmAnnotation.value()[0]);
|
||||
} else {
|
||||
zooVO.setListUrl(annotation.listUrl());
|
||||
}
|
||||
|
||||
map.put(zooVO.getOrder(), zooVO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
model.addAttribute("resultList", map.values());
|
||||
|
||||
LOGGER.debug("EgovComIndexController index is called ");
|
||||
|
||||
return "com/cmm/EgovUnitLeft";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package egovframework.com.cmm.web;
|
||||
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovComUtlController.java
|
||||
* @Description : 공통유틸리티성 작업을 위한 Controller
|
||||
* @Modification Information
|
||||
* @
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------- -------- ---------------------------
|
||||
* @ 2009.03.02 조재영 최초 생성
|
||||
* @ 2011.10.07 이기하 .action -> .do로 변경하면서 동일 매핑이 되어 삭제처리
|
||||
*
|
||||
* @author 공통서비스 개발팀 조재영
|
||||
* @since 2009.03.02
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
public class EgovComUtlController {
|
||||
|
||||
//@Resource(name = "egovUserManageService")
|
||||
//private EgovUserManageService egovUserManageService;
|
||||
|
||||
/** EgovPropertyService */
|
||||
@Resource(name = "propertiesService")
|
||||
protected EgovPropertyService propertiesService;
|
||||
|
||||
/**
|
||||
* JSP 호출작업만 처리하는 공통 함수
|
||||
*/
|
||||
@RequestMapping(value="/EgovPageLink.do")
|
||||
public String moveToPage(@RequestParam("link") String linkPage){
|
||||
String link = linkPage;
|
||||
// service 사용하여 리턴할 결과값 처리하는 부분은 생략하고 단순 페이지 링크만 처리함
|
||||
if (linkPage==null || linkPage.equals("")){
|
||||
link="egovframework/com/cmm/egovError";
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
||||
/**
|
||||
* validato rule dynamic Javascript
|
||||
*/
|
||||
@RequestMapping("/validator.do")
|
||||
public String validate(){
|
||||
return "egovframework/com/cmm/validator";
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,188 @@
|
||||
package egovframework.com.cmm.web;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.service.EgovFileMngService;
|
||||
import egovframework.com.cmm.service.FileVO;
|
||||
import egovframework.com.cmm.util.EgovBasicLogger;
|
||||
import egovframework.com.cmm.util.EgovResourceCloseHelper;
|
||||
import egovframework.com.cmm.util.EgovUserDetailsHelper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 파일 다운로드를 위한 컨트롤러 클래스
|
||||
* @author 공통서비스개발팀 이삼섭
|
||||
* @since 2009.06.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------------ -------- ---------------------------
|
||||
* 2009.03.25 이삼섭 최초 생성
|
||||
* 2014.02.24 이기하 IE11 브라우저 한글 파일 다운로드시 에러 수정
|
||||
*
|
||||
* Copyright (C) 2009 by MOPAS All right reserved.
|
||||
* </pre>
|
||||
*/
|
||||
@Controller
|
||||
public class EgovFileDownloadController {
|
||||
|
||||
@Resource(name = "EgovFileMngService")
|
||||
private EgovFileMngService fileService;
|
||||
|
||||
/**
|
||||
* 브라우저 구분 얻기.
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
private String getBrowser(HttpServletRequest request) {
|
||||
String header = request.getHeader("User-Agent");
|
||||
if (header.indexOf("MSIE") > -1) {
|
||||
return "MSIE";
|
||||
} else if (header.indexOf("Trident") > -1) { // IE11 문자열 깨짐 방지
|
||||
return "Trident";
|
||||
} else if (header.indexOf("Chrome") > -1) {
|
||||
return "Chrome";
|
||||
} else if (header.indexOf("Opera") > -1) {
|
||||
return "Opera";
|
||||
}
|
||||
return "Firefox";
|
||||
}
|
||||
|
||||
/**
|
||||
* Disposition 지정하기.
|
||||
*
|
||||
* @param filename
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
private void setDisposition(String filename, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
String browser = getBrowser(request);
|
||||
|
||||
String dispositionPrefix = "attachment; filename=";
|
||||
String encodedFilename = null;
|
||||
|
||||
if (browser.equals("MSIE")) {
|
||||
encodedFilename = URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20");
|
||||
} else if (browser.equals("Trident")) { // IE11 문자열 깨짐 방지
|
||||
encodedFilename = URLEncoder.encode(filename, "UTF-8").replaceAll("\\+", "%20");
|
||||
} else if (browser.equals("Firefox")) {
|
||||
encodedFilename = "\"" + new String(filename.getBytes("UTF-8"), "8859_1") + "\"";
|
||||
} else if (browser.equals("Opera")) {
|
||||
encodedFilename = "\"" + new String(filename.getBytes("UTF-8"), "8859_1") + "\"";
|
||||
} else if (browser.equals("Chrome")) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int i = 0; i < filename.length(); i++) {
|
||||
char c = filename.charAt(i);
|
||||
if (c > '~') {
|
||||
sb.append(URLEncoder.encode("" + c, "UTF-8"));
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
encodedFilename = sb.toString();
|
||||
} else {
|
||||
throw new IOException("Not supported browser");
|
||||
}
|
||||
|
||||
response.setHeader("Content-Disposition", dispositionPrefix + encodedFilename);
|
||||
|
||||
if ("Opera".equals(browser)) {
|
||||
response.setContentType("application/octet-stream;charset=UTF-8");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 첨부파일로 등록된 파일에 대하여 다운로드를 제공한다.
|
||||
*
|
||||
* @param commandMap
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/cmm/fms/FileDown.do")
|
||||
public void cvplFileDownload(@RequestParam Map<String, Object> commandMap, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
|
||||
String atchFileId = (String) commandMap.get("atchFileId");
|
||||
String fileSn = (String) commandMap.get("fileSn");
|
||||
|
||||
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
|
||||
if (isAuthenticated) {
|
||||
|
||||
FileVO fileVO = new FileVO();
|
||||
fileVO.setAtchFileId(atchFileId);
|
||||
fileVO.setFileSn(fileSn);
|
||||
FileVO fvo = fileService.selectFileInf(fileVO);
|
||||
|
||||
File uFile = new File(fvo.getFileStreCours(), fvo.getStreFileNm());
|
||||
int fSize = (int) uFile.length();
|
||||
|
||||
if (fSize > 0) {
|
||||
String mimetype = "application/x-msdownload";
|
||||
|
||||
//response.setBufferSize(fSize); // OutOfMemeory 발생
|
||||
response.setContentType(mimetype);
|
||||
//response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(fvo.getOrignlFileNm(), "UTF-8") + "\"");
|
||||
setDisposition(fvo.getOrignlFileNm(), request, response);
|
||||
response.setContentLength(fSize);
|
||||
|
||||
/*
|
||||
* FileCopyUtils.copy(in, response.getOutputStream());
|
||||
* in.close();
|
||||
* response.getOutputStream().flush();
|
||||
* response.getOutputStream().close();
|
||||
*/
|
||||
BufferedInputStream in = null;
|
||||
BufferedOutputStream out = null;
|
||||
|
||||
try {
|
||||
in = new BufferedInputStream(new FileInputStream(uFile));
|
||||
out = new BufferedOutputStream(response.getOutputStream());
|
||||
|
||||
FileCopyUtils.copy(in, out);
|
||||
out.flush();
|
||||
} catch (IOException ex) {
|
||||
// 다음 Exception 무시 처리
|
||||
// Connection reset by peer: socket write error
|
||||
EgovBasicLogger.ignore("IO Exception", ex);
|
||||
} finally {
|
||||
EgovResourceCloseHelper.close(in, out);
|
||||
}
|
||||
|
||||
} else {
|
||||
response.setContentType("application/x-msdownload");
|
||||
|
||||
PrintWriter printwriter = response.getWriter();
|
||||
|
||||
printwriter.println("<html>");
|
||||
printwriter.println("<br><br><br><h2>Could not get file name:<br>" + fvo.getOrignlFileNm() + "</h2>");
|
||||
printwriter.println("<br><br><br><center><h3><a href='javascript: history.go(-1)'>Back</a></h3></center>");
|
||||
printwriter.println("<br><br><br>© webAccess");
|
||||
printwriter.println("</html>");
|
||||
|
||||
printwriter.flush();
|
||||
printwriter.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,159 @@
|
||||
package egovframework.com.cmm.web;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.service.EgovFileMngService;
|
||||
import egovframework.com.cmm.service.FileVO;
|
||||
import egovframework.com.cmm.util.EgovUserDetailsHelper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 파일 조회, 삭제, 다운로드 처리를 위한 컨트롤러 클래스
|
||||
* @author 공통서비스개발팀 이삼섭
|
||||
* @since 2009.06.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.3.25 이삼섭 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Controller
|
||||
public class EgovFileMngController {
|
||||
|
||||
@Resource(name = "EgovFileMngService")
|
||||
private EgovFileMngService fileService;
|
||||
|
||||
/**
|
||||
* 첨부파일에 대한 목록을 조회한다.
|
||||
*
|
||||
* @param fileVO
|
||||
* @param atchFileId
|
||||
* @param sessionVO
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/cmm/fms/selectFileInfs.do")
|
||||
public String selectFileInfs(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
|
||||
String atchFileId = (String)commandMap.get("param_atchFileId");
|
||||
|
||||
fileVO.setAtchFileId(atchFileId);
|
||||
List<FileVO> result = fileService.selectFileInfs(fileVO);
|
||||
|
||||
model.addAttribute("fileList", result);
|
||||
model.addAttribute("updateFlag", "N");
|
||||
model.addAttribute("fileListCnt", result.size());
|
||||
model.addAttribute("atchFileId", atchFileId);
|
||||
|
||||
return "egovframework/com/cmm/fms/EgovFileList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 첨부파일 변경을 위한 수정페이지로 이동한다.
|
||||
*
|
||||
* @param fileVO
|
||||
* @param atchFileId
|
||||
* @param sessionVO
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/cmm/fms/selectFileInfsForUpdate.do")
|
||||
public String selectFileInfsForUpdate(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam Map<String, Object> commandMap,
|
||||
//SessionVO sessionVO,
|
||||
ModelMap model) throws Exception {
|
||||
|
||||
String atchFileId = (String)commandMap.get("param_atchFileId");
|
||||
|
||||
fileVO.setAtchFileId(atchFileId);
|
||||
|
||||
List<FileVO> result = fileService.selectFileInfs(fileVO);
|
||||
|
||||
model.addAttribute("fileList", result);
|
||||
model.addAttribute("updateFlag", "Y");
|
||||
model.addAttribute("fileListCnt", result.size());
|
||||
model.addAttribute("atchFileId", atchFileId);
|
||||
|
||||
return "egovframework/com/cmm/fms/EgovFileList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 첨부파일에 대한 삭제를 처리한다.
|
||||
*
|
||||
* @param fileVO
|
||||
* @param returnUrl
|
||||
* @param sessionVO
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/cmm/fms/deleteFileInfs.do")
|
||||
public String deleteFileInf(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam("returnUrl") String returnUrl,
|
||||
//SessionVO sessionVO,
|
||||
HttpServletRequest request,
|
||||
ModelMap model) throws Exception {
|
||||
|
||||
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
|
||||
if (isAuthenticated) {
|
||||
fileService.deleteFileInf(fileVO);
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// contextRoot가 있는 경우 제외 시켜야 함
|
||||
//--------------------------------------------
|
||||
////return "forward:/cmm/fms/selectFileInfs.do";
|
||||
//return "forward:" + returnUrl;
|
||||
|
||||
if ("".equals(request.getContextPath()) || "/".equals(request.getContextPath())) {
|
||||
return "forward:" + returnUrl;
|
||||
}
|
||||
|
||||
if (returnUrl.startsWith(request.getContextPath())) {
|
||||
return "forward:" + returnUrl.substring(returnUrl.indexOf("/", 1));
|
||||
} else {
|
||||
return "forward:" + returnUrl;
|
||||
}
|
||||
////------------------------------------------
|
||||
}
|
||||
|
||||
/**
|
||||
* 이미지 첨부파일에 대한 목록을 조회한다.
|
||||
*
|
||||
* @param fileVO
|
||||
* @param atchFileId
|
||||
* @param sessionVO
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/cmm/fms/selectImageFileInfs.do")
|
||||
public String selectImageFileInfs(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam Map<String, Object> commandMap,
|
||||
//SessionVO sessionVO,
|
||||
ModelMap model) throws Exception {
|
||||
|
||||
String atchFileId = (String)commandMap.get("atchFileId");
|
||||
|
||||
fileVO.setAtchFileId(atchFileId);
|
||||
List<FileVO> result = fileService.selectImageFileList(fileVO);
|
||||
|
||||
model.addAttribute("fileList", result);
|
||||
|
||||
return "egovframework/com/cmm/fms/EgovImgFileList";
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,131 @@
|
||||
package egovframework.com.cmm.web;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.SessionVO;
|
||||
import egovframework.com.cmm.service.EgovFileMngService;
|
||||
import egovframework.com.cmm.service.FileVO;
|
||||
import egovframework.com.cmm.util.EgovResourceCloseHelper;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
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 org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
|
||||
/**
|
||||
* @Class Name : EgovImageProcessController.java
|
||||
* @Description :
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- --------- -------------------
|
||||
* 2009.04.02 이삼섭 최초생성
|
||||
* 2014.03.31 유지보수 fileSn 오류수정
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 4. 2.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
@Controller
|
||||
public class EgovImageProcessController extends HttpServlet {
|
||||
|
||||
@Resource(name = "EgovFileMngService")
|
||||
private EgovFileMngService fileService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovImageProcessController.class);
|
||||
|
||||
/**
|
||||
* 첨부된 이미지에 대한 미리보기 기능을 제공한다.
|
||||
*
|
||||
* @param atchFileId
|
||||
* @param fileSn
|
||||
* @param sessionVO
|
||||
* @param model
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/cmm/fms/getImage.do")
|
||||
public void getImageInf(SessionVO sessionVO, ModelMap model, @RequestParam Map<String, Object> commandMap, HttpServletResponse response) throws Exception {
|
||||
|
||||
//@RequestParam("atchFileId") String atchFileId,
|
||||
//@RequestParam("fileSn") String fileSn,
|
||||
String atchFileId = (String)commandMap.get("atchFileId");
|
||||
String fileSn = (String)commandMap.get("fileSn");
|
||||
|
||||
FileVO vo = new FileVO();
|
||||
|
||||
vo.setAtchFileId(atchFileId);
|
||||
vo.setFileSn(fileSn);
|
||||
|
||||
//------------------------------------------------------------
|
||||
// fileSn이 없는 경우 마지막 파일 참조
|
||||
//------------------------------------------------------------
|
||||
if (fileSn == null || fileSn.equals("")) {
|
||||
int newMaxFileSN = fileService.getMaxFileSN(vo);
|
||||
vo.setFileSn(Integer.toString(newMaxFileSN - 1));
|
||||
}
|
||||
//------------------------------------------------------------
|
||||
|
||||
FileVO fvo = fileService.selectFileInf(vo);
|
||||
|
||||
//String fileLoaction = fvo.getFileStreCours() + fvo.getStreFileNm();
|
||||
|
||||
File file = null;
|
||||
FileInputStream fis = null;
|
||||
|
||||
BufferedInputStream in = null;
|
||||
ByteArrayOutputStream bStream = null;
|
||||
|
||||
try {
|
||||
file = new File(fvo.getFileStreCours(), fvo.getStreFileNm());
|
||||
fis = new FileInputStream(file);
|
||||
|
||||
in = new BufferedInputStream(fis);
|
||||
bStream = new ByteArrayOutputStream();
|
||||
|
||||
int imgByte;
|
||||
while ((imgByte = in.read()) != -1) {
|
||||
bStream.write(imgByte);
|
||||
}
|
||||
|
||||
String type = "";
|
||||
|
||||
if (fvo.getFileExtsn() != null && !"".equals(fvo.getFileExtsn())) {
|
||||
if ("jpg".equals(fvo.getFileExtsn().toLowerCase())) {
|
||||
type = "image/jpeg";
|
||||
} else {
|
||||
type = "image/" + fvo.getFileExtsn().toLowerCase();
|
||||
}
|
||||
type = "image/" + fvo.getFileExtsn().toLowerCase();
|
||||
|
||||
} else {
|
||||
LOGGER.debug("Image fileType is null.");
|
||||
}
|
||||
|
||||
response.setHeader("Content-Type", type);
|
||||
response.setContentLength(bStream.size());
|
||||
|
||||
bStream.writeTo(response.getOutputStream());
|
||||
|
||||
response.getOutputStream().flush();
|
||||
response.getOutputStream().close();
|
||||
|
||||
} finally {
|
||||
EgovResourceCloseHelper.close(bStream, in, fis);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,130 @@
|
||||
package egovframework.com.cmm.web;
|
||||
|
||||
/*
|
||||
* Copyright 2001-2006 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the ";License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS"; BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.apache.commons.fileupload.FileItem;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.multipart.MultipartException;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
||||
|
||||
/**
|
||||
* 실행환경의 파일업로드 처리를 위한 기능 클래스
|
||||
* @author 공통서비스개발팀 이삼섭
|
||||
* @since 2009.06.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.3.25 이삼섭 최초 생성
|
||||
* 2011.06.11 서준식 스프링 3.0 업그레이드 API변경으로인한 수정
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class EgovMultipartResolver extends CommonsMultipartResolver {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovMultipartResolver.class);
|
||||
|
||||
public EgovMultipartResolver() {}
|
||||
|
||||
/**
|
||||
* 첨부파일 처리를 위한 multipart resolver를 생성한다.
|
||||
*
|
||||
* @param servletContext
|
||||
*/
|
||||
public EgovMultipartResolver(ServletContext servletContext) {
|
||||
super(servletContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* multipart에 대한 parsing을 처리한다.
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
protected MultipartParsingResult parseFileItems(List fileItems, String encoding) {
|
||||
|
||||
//스프링 3.0변경으로 수정한 부분
|
||||
MultiValueMap<String, MultipartFile> multipartFiles = new LinkedMultiValueMap<String, MultipartFile>();
|
||||
Map<String, String[]> multipartParameters = new HashMap<String, String[]>();
|
||||
|
||||
// Extract multipart files and multipart parameters.
|
||||
for (Iterator<?> it = fileItems.iterator(); it.hasNext();) {
|
||||
FileItem fileItem = (FileItem)it.next();
|
||||
|
||||
if (fileItem.isFormField()) {
|
||||
|
||||
String value = null;
|
||||
if (encoding != null) {
|
||||
try {
|
||||
value = fileItem.getString(encoding);
|
||||
} catch (UnsupportedEncodingException ex) {
|
||||
LOGGER.warn("Could not decode multipart item '{}' with encoding '{}': using platform default"
|
||||
, fileItem.getFieldName(), encoding);
|
||||
value = fileItem.getString();
|
||||
}
|
||||
} else {
|
||||
value = fileItem.getString();
|
||||
}
|
||||
String[] curParam = (String[])multipartParameters.get(fileItem.getFieldName());
|
||||
if (curParam == null) {
|
||||
// simple form field
|
||||
multipartParameters.put(fileItem.getFieldName(), new String[] { value });
|
||||
} else {
|
||||
// array of simple form fields
|
||||
String[] newParam = StringUtils.addStringToArray(curParam, value);
|
||||
multipartParameters.put(fileItem.getFieldName(), newParam);
|
||||
}
|
||||
} else {
|
||||
|
||||
if (fileItem.getSize() > 0) {
|
||||
// multipart file field
|
||||
CommonsMultipartFile file = new CommonsMultipartFile(fileItem);
|
||||
|
||||
//스프링 3.0 업그레이드 API변경으로인한 수정
|
||||
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
|
||||
fileList.add(file);
|
||||
|
||||
if (multipartFiles.put(fileItem.getName(), fileList) != null) { // CHANGED!!
|
||||
throw new MultipartException("Multiple files for field name [" + file.getName() + "] found - not supported by MultipartResolver");
|
||||
}
|
||||
//LOGGER.debug("Found multipart file [{}] of size {} bytes with original filename [{}], stored {}"
|
||||
//, file.getName(), file.getSize(), file.getOriginalFilename(), file.getStorageDescription());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return new MultipartParsingResult(multipartFiles, multipartParameters, null);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,226 @@
|
||||
package egovframework.com.sym.bat.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.quartz.JobListener;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* 배치작업의 실행시작, 완료를 저장하는 Quartz JobListener 클래스를 정의한다.
|
||||
*
|
||||
* @author 김진만
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.08.30 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public class BatchJobListener implements JobListener {
|
||||
|
||||
/** egovBatchSchdulService */
|
||||
private EgovBatchSchdulService egovBatchSchdulService;
|
||||
|
||||
/** ID Generation */
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
/** logger */
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(BatchJobListener.class);
|
||||
|
||||
/**
|
||||
* 배치스케줄 서비스를 설정한다.
|
||||
*
|
||||
* @param egovBatchSchdulService the egovBatchSchdulService to set
|
||||
*/
|
||||
public void setEgovBatchSchdulService(EgovBatchSchdulService egovBatchSchdulService) {
|
||||
this.egovBatchSchdulService = egovBatchSchdulService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과ID 생성서비스
|
||||
* @param idgenService the idgenService to set
|
||||
*/
|
||||
public void setIdgenService(EgovIdGnrService idgenService) {
|
||||
this.idgenService = idgenService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Job Listener 이름을 리턴한다.
|
||||
* @see org.quartz.JobListener#getName()
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.getClass().getName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch 작업을 실행하기전에 Batch결과 '수행중'상태로 저장한다.
|
||||
*
|
||||
* @param jobContext JobExecutionContext
|
||||
* @see org.quartz.JobListener#jobToBeExecuted(JobExecutionContext jobContext)
|
||||
*/
|
||||
@Override
|
||||
public void jobToBeExecuted(JobExecutionContext jobContext) {
|
||||
// LOGGER.debug("job[{}] jobToBeExecuted ", jobContext.getJobDetail().getKey().getName());
|
||||
BatchResult batchResult = new BatchResult();
|
||||
JobDataMap dataMap = jobContext.getJobDetail().getJobDataMap();
|
||||
try {
|
||||
// 결과 값 세팅.
|
||||
batchResult.setBatchResultId(idgenService.getNextStringId());
|
||||
batchResult.setBatchSchdulId(dataMap.getString("batchSchdulId"));
|
||||
batchResult.setBatchOpertId(dataMap.getString("batchOpertId"));
|
||||
batchResult.setParamtr(dataMap.getString("paramtr"));
|
||||
batchResult.setSttus("03"); // 상태는 수행중
|
||||
batchResult.setErrorInfo("");
|
||||
|
||||
String executBeginTimeStr = null;
|
||||
Date executBeginTime = new Date();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault());
|
||||
executBeginTimeStr = formatter.format(executBeginTime);
|
||||
batchResult.setExecutBeginTime(executBeginTimeStr);
|
||||
|
||||
batchResult.setRegmemid("SYSTEM");
|
||||
batchResult.setUpdmemid("SYSTEM");
|
||||
|
||||
// egovBatchSchdulService.insertBatchResult(batchResult);
|
||||
|
||||
// 저장이 이상없이 완료되면 datamap에 배치결과ID를 저장한다.
|
||||
dataMap.put("batchResultId", batchResult.getBatchResultId());
|
||||
|
||||
// } catch (IOException e) {
|
||||
// LOGGER.error("배치스케줄ID : {}, 배치작업ID : {}, 배치결과저장(insert) 에러 : {}", batchResult.getBatchSchdulId(), batchResult.getBatchOpertId(), e.getMessage());
|
||||
// LOGGER.debug(e.getMessage(), e);
|
||||
// } catch (ClassNotFoundException e) {
|
||||
// LOGGER.error("예외 상황 발생");
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("예외 상황 발생");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch 작업을 완료한후 Batch결과 '완료'상태로 저장한다.
|
||||
*
|
||||
* @param jobContext JobExecutionContext
|
||||
* @see org.quartz.JobListener#jobWasExecuted(JobExecutionContext jobContext)
|
||||
*/
|
||||
@Override
|
||||
public void jobWasExecuted(JobExecutionContext jobContext, JobExecutionException jee) {
|
||||
// LOGGER.debug("job[{}] jobWasExecuted", jobContext.getJobDetail().getKey().getName());
|
||||
// LOGGER.debug("job[{}] 수행시간 : {}, {}", jobContext.getJobDetail().getKey().getName(), jobContext.getFireTime(), jobContext.getJobRunTime());
|
||||
|
||||
int jobResult = 99;
|
||||
BatchResult batchResult = new BatchResult();
|
||||
JobDataMap dataMap = jobContext.getJobDetail().getJobDataMap();
|
||||
try {
|
||||
// 결과 값 세팅.
|
||||
batchResult.setBatchResultId(dataMap.getString("batchResultId"));
|
||||
batchResult.setBatchSchdulId(dataMap.getString("batchSchdulId"));
|
||||
batchResult.setBatchOpertId(dataMap.getString("batchOpertId"));
|
||||
batchResult.setParamtr(dataMap.getString("paramtr"));
|
||||
if (jobContext.getResult() != null) {
|
||||
jobResult = (Integer) jobContext.getResult();
|
||||
}
|
||||
if (jobResult == 0) {
|
||||
// 배치작업 성공.
|
||||
batchResult.setSttus("01");
|
||||
batchResult.setErrorInfo("");
|
||||
|
||||
} else {
|
||||
|
||||
Object errorMsg = jobContext.get("errorMsg");
|
||||
|
||||
// 배치작업이 0이 아닌값을 리턴하면 에러 상황임.
|
||||
batchResult.setSttus("02");
|
||||
batchResult.setErrorInfo("배치작업이 결과값 [" + jobResult + "]를 리턴했습니다. \n" + "배치프로그램 [" + dataMap.getString("batchProgrm") + "]의 로그를 확인하세요. \n" + "에러 메세지 ["+errorMsg+"]");
|
||||
}
|
||||
// 수행중 exception이 발생한 경우
|
||||
if (jee != null) {
|
||||
LOGGER.error("JobExecutionException 발생 : {}", jee);
|
||||
batchResult.setSttus("02");
|
||||
String errorInfo = batchResult.getErrorInfo();
|
||||
batchResult.setErrorInfo(errorInfo + "\n" + "JobExecutionException 발생 : " + jee);
|
||||
}
|
||||
|
||||
String executEndTimeStr = null;
|
||||
Date executEndTime = new Date();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault());
|
||||
executEndTimeStr = formatter.format(executEndTime);
|
||||
batchResult.setExecutEndTime(executEndTimeStr);
|
||||
|
||||
batchResult.setUpdmemid("SYSTEM");
|
||||
|
||||
egovBatchSchdulService.updateBatchResult(batchResult);
|
||||
|
||||
// 저장이 이상없이 완료되면 datamap에 배치결과ID를 저장한다.
|
||||
dataMap.put("batchResultId", batchResult.getBatchResultId());
|
||||
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("배치결과ID : {}, 배치스케줄ID : {}, 배치작업ID : {}, 배치결과저장(update) 에러 : {}", batchResult.getBatchResultId(), batchResult.getBatchSchdulId(),
|
||||
batchResult.getBatchOpertId(), e.getMessage());
|
||||
LOGGER.debug(e.getMessage(), e);
|
||||
} catch (ClassNotFoundException e) {
|
||||
LOGGER.error("예외 상황 발생");
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("예외 상황 발생");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch 작업을 실행한 후에 Batch결과 '에러'상태로 저장한다.
|
||||
*
|
||||
* @param jobContext JobExecutionContext
|
||||
*
|
||||
* @see org.quartz.JobListener#jobExecutionVetoed(JobExecutionContext jobContext)
|
||||
*/
|
||||
@Override
|
||||
public void jobExecutionVetoed(JobExecutionContext jobContext) {
|
||||
// LOGGER.debug("job[{}] jobExecutionVetoed", jobContext.getJobDetail().getKey().getName());
|
||||
|
||||
BatchResult batchResult = new BatchResult();
|
||||
JobDataMap dataMap = jobContext.getJobDetail().getJobDataMap();
|
||||
try {
|
||||
// 결과 값 세팅.
|
||||
batchResult.setBatchResultId(dataMap.getString("batchResultId"));
|
||||
batchResult.setBatchSchdulId(dataMap.getString("batchSchdulId"));
|
||||
batchResult.setBatchOpertId(dataMap.getString("batchOpertId"));
|
||||
batchResult.setParamtr(dataMap.getString("paramtr"));
|
||||
// 스케줄러가 배치작업을 실행하지 않음.
|
||||
batchResult.setSttus("02");
|
||||
batchResult.setErrorInfo("스케줄러가 배치작업을 실행하지 않았습니다(jobExecutionVetoed 이벤트). 스케줄러 로그를 확인하세요");
|
||||
|
||||
String executEndTimeStr = null;
|
||||
Date executEndTime = new Date();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault());
|
||||
executEndTimeStr = formatter.format(executEndTime);
|
||||
batchResult.setExecutEndTime(executEndTimeStr);
|
||||
|
||||
batchResult.setUpdmemid("SYSTEM");
|
||||
|
||||
egovBatchSchdulService.updateBatchResult(batchResult);
|
||||
|
||||
// 저장이 이상없이 완료되면 datamap에 배치결과ID를 저장한다.
|
||||
dataMap.put("batchResultId", batchResult.getBatchResultId());
|
||||
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("배치결과ID : {}, 배치스케줄ID : {}, 배치작업ID : {}, 배치결과저장(update) 에러 : {}", batchResult.getBatchResultId(), batchResult.getBatchSchdulId(),
|
||||
batchResult.getBatchOpertId(), e.getMessage());
|
||||
LOGGER.debug(e.getMessage(), e);
|
||||
} catch (ClassNotFoundException e) {
|
||||
LOGGER.error("예외 상황 발생");
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("예외 상황 발생");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,322 @@
|
||||
package egovframework.com.sym.bat.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
|
||||
/**
|
||||
* 배치작업관리에 대한 model 클래스
|
||||
*
|
||||
* @author 김진만
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 17-6-2010 오전 10:27:13
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.06.17 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
public class BatchOpert extends ComDefaultVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8854151716958649397L;
|
||||
/**
|
||||
* 배치작업ID
|
||||
*/
|
||||
private String batchOpertId;
|
||||
/**
|
||||
* 배치작업명
|
||||
*/
|
||||
private String batchOpertNm;
|
||||
/**
|
||||
* 배치프로그램
|
||||
*/
|
||||
private String batchProgrm;
|
||||
/**
|
||||
* 배치작업구분
|
||||
*/
|
||||
private String batchOpertDiv;
|
||||
/**
|
||||
* 배치작업구분명
|
||||
*/
|
||||
private String batchOpertDivNm;
|
||||
/**
|
||||
* 파라미터
|
||||
*/
|
||||
private String paramtr;
|
||||
/**
|
||||
* 패키지
|
||||
*/
|
||||
private String batchPackage;
|
||||
/**
|
||||
* 메소드
|
||||
*/
|
||||
private String batchMethod;
|
||||
/**
|
||||
* 최초등록자 아이디
|
||||
*/
|
||||
private String regmemid;
|
||||
/**
|
||||
* 최초등록시점
|
||||
*/
|
||||
private String regdt;
|
||||
/**
|
||||
* 최종수정자 아이디
|
||||
*/
|
||||
private String updmemid;
|
||||
/**
|
||||
* 최종수정일
|
||||
*/
|
||||
private String upddt;
|
||||
/**
|
||||
* 삭제자 아이디
|
||||
*/
|
||||
private String delmemid;
|
||||
/**
|
||||
* 삭제일
|
||||
*/
|
||||
private String deldt;
|
||||
/**
|
||||
* 삭제여부
|
||||
*/
|
||||
private String delyn;
|
||||
|
||||
/**
|
||||
* 배치작업ID를 리턴한다.
|
||||
* @return the batchOpertId
|
||||
*/
|
||||
public String getBatchOpertId() {
|
||||
return batchOpertId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업ID를 설정한다.
|
||||
* @param batchOpertId 설정할 배치작업ID
|
||||
*/
|
||||
public void setBatchOpertId(String batchOpertId) {
|
||||
this.batchOpertId = batchOpertId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업명을 리턴한다.
|
||||
* @return the batchOpertNm
|
||||
*/
|
||||
public String getBatchOpertNm() {
|
||||
return batchOpertNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업명을 설정한다.
|
||||
* @param batchOpertNm 설정할 배치작업명
|
||||
*/
|
||||
public void setBatchOpertNm(String batchOpertNm) {
|
||||
this.batchOpertNm = batchOpertNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치프로그램을 리턴한다.
|
||||
* @return the batchProgrm
|
||||
*/
|
||||
public String getBatchProgrm() {
|
||||
return batchProgrm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치프로그램을 설정한다.
|
||||
* @param batchProgrm 설정할 배치프로그램
|
||||
*/
|
||||
public void setBatchProgrm(String batchProgrm) {
|
||||
this.batchProgrm = batchProgrm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업구분을 리턴한다.
|
||||
* @return the batchOpertDiv
|
||||
*/
|
||||
public String getBatchOpertDiv() {
|
||||
return batchOpertDiv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업구분을 설정한다.
|
||||
* @param batchOpertDiv 설정할 배치프로그램
|
||||
*/
|
||||
public void setBatchOpertDiv(String batchOpertDiv) {
|
||||
this.batchOpertDiv = batchOpertDiv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업구분명을 리턴한다.
|
||||
* @return the batchOpertDivNm
|
||||
*/
|
||||
public String getBatchOpertDivNm() {
|
||||
return batchOpertDivNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업구분명을 설정한다.
|
||||
* @param batchOpertDivNm 설정할 배치프로그램명
|
||||
*/
|
||||
public void setBatchOpertDivNm(String batchOpertDivNm) {
|
||||
this.batchOpertDivNm = batchOpertDivNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 파라미터를 리턴한다.
|
||||
* @return the paramtr
|
||||
*/
|
||||
public String getParamtr() {
|
||||
return paramtr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 파라미터를 설정한다.
|
||||
* @param paramtr 설정할 파라미터
|
||||
*/
|
||||
public void setParamtr(String paramtr) {
|
||||
this.paramtr = paramtr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 패키지를 리턴한다.
|
||||
* @return the batchPackage
|
||||
*/
|
||||
public String getBatchPackage() {
|
||||
return batchPackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 패키지를 설정한다.
|
||||
* @param batchPackage 설정할 패키지
|
||||
*/
|
||||
public void setBatchPackage(String batchPackage) {
|
||||
this.batchPackage = batchPackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 메소드를 리턴한다.
|
||||
* @return the batchMethod
|
||||
*/
|
||||
public String getBatchMethod() {
|
||||
return batchMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* 메소드를 설정한다.
|
||||
* @param batchMethod 설정할 메소드
|
||||
*/
|
||||
public void setBatchMethod(String batchMethod) {
|
||||
this.batchMethod = batchMethod;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the regmemid
|
||||
*/
|
||||
public String getRegmemid() {
|
||||
return regmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param regmemid the regmemid to set
|
||||
*/
|
||||
public void setRegmemid(String regmemid) {
|
||||
this.regmemid = regmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the regdt
|
||||
*/
|
||||
public String getRegdt() {
|
||||
return regdt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param regdt the regdt to set
|
||||
*/
|
||||
public void setRegdt(String regdt) {
|
||||
this.regdt = regdt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 최종수정자ID를 리턴한다.
|
||||
* @return the updmemid
|
||||
*/
|
||||
public String getUpdmemid() {
|
||||
return updmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 최종수정자ID를 설정한다.
|
||||
* @param updmemid 설정할 최종수정자ID
|
||||
*/
|
||||
public void setUpdmemid(String updmemid) {
|
||||
this.updmemid = updmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 최종수정시점을 리턴한다.
|
||||
* @return the upddt
|
||||
*/
|
||||
public String getUpddt() {
|
||||
return upddt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 최종수정시점을 설정한다.
|
||||
* @param upddt 설정할 최종수정시점
|
||||
*/
|
||||
public void setUpddt(String upddt) {
|
||||
this.upddt = upddt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제자ID를 리턴한다.
|
||||
* @return the delmemid
|
||||
*/
|
||||
public String getDelmemid() {
|
||||
return delmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제자ID를 설정한다.
|
||||
* @param updmemid 설정할 삭제자ID
|
||||
*/
|
||||
public void setDelmemid(String delmemid) {
|
||||
this.delmemid = delmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제시점을 리턴한다.
|
||||
* @return the deldt
|
||||
*/
|
||||
public String getDeldt() {
|
||||
return deldt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제시점을 설정한다.
|
||||
* @param upddt 설정할 삭제시점
|
||||
*/
|
||||
public void setDeldt(String deldt) {
|
||||
this.deldt = deldt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제여부를 리턴한다.
|
||||
* @return the delyn
|
||||
*/
|
||||
public String getDelyn() {
|
||||
return delyn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제여부를 설정한다.
|
||||
* @param delyn 설정할 사용여부
|
||||
*/
|
||||
public void setDelyn(String delyn) {
|
||||
this.delyn = delyn;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,569 @@
|
||||
package egovframework.com.sym.bat.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
|
||||
/**
|
||||
* 배치결과관리에 대한 model 클래스
|
||||
*
|
||||
* @author 김진만
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 17-6-2010 오전 10:27:13
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.06.17 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
public class BatchResult extends ComDefaultVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8673713935753272633L;
|
||||
/**
|
||||
* 배치결과ID
|
||||
*/
|
||||
private String batchResultId;
|
||||
/**
|
||||
* 배치스케줄ID
|
||||
*/
|
||||
private String batchSchdulId;
|
||||
|
||||
/**
|
||||
* 배치작업ID
|
||||
*/
|
||||
private String batchOpertId;
|
||||
/**
|
||||
* 파라미터
|
||||
*/
|
||||
private String paramtr;
|
||||
/**
|
||||
* 상태
|
||||
*/
|
||||
private String sttus;
|
||||
/**
|
||||
* 실행시작시각
|
||||
*/
|
||||
private String executBeginTime;
|
||||
/**
|
||||
* 실행종료시각
|
||||
*/
|
||||
private String executEndTime;
|
||||
/**
|
||||
* 최종수정자 아이디
|
||||
*/
|
||||
private String updmemid;
|
||||
/**
|
||||
* 최종수정시점
|
||||
*/
|
||||
private String upddt;
|
||||
/**
|
||||
* 최초등록자 아이디
|
||||
*/
|
||||
private String regmemid;
|
||||
/**
|
||||
* 최초등록시점
|
||||
*/
|
||||
private String regdt;
|
||||
/**
|
||||
* 에러정보
|
||||
*/
|
||||
private String errorInfo;
|
||||
|
||||
/**
|
||||
* 배치작업명
|
||||
*/
|
||||
private String batchOpertNm;
|
||||
/**
|
||||
* 배치작업구분
|
||||
*/
|
||||
private String batchOpertDiv;
|
||||
/**
|
||||
* 배치작업구분명
|
||||
*/
|
||||
private String batchOpertDivNm;
|
||||
/**
|
||||
* 배치프로그램
|
||||
*/
|
||||
private String batchProgrm;
|
||||
/**
|
||||
* 상태명
|
||||
*/
|
||||
private String sttusNm;
|
||||
/**
|
||||
* 삭제자 아이디
|
||||
*/
|
||||
private String delmemid;
|
||||
/**
|
||||
* 삭제일
|
||||
*/
|
||||
private String deldt;
|
||||
/**
|
||||
* 삭제여부
|
||||
*/
|
||||
private String delyn;
|
||||
|
||||
private String schOption = "";
|
||||
|
||||
private String schDate = "";
|
||||
|
||||
private String schDateFrom = "";
|
||||
|
||||
private String schDateEnd = "";
|
||||
|
||||
private String cntOption = "";
|
||||
|
||||
private String cntYear = "";
|
||||
|
||||
private String cntMonth = "";
|
||||
|
||||
private String startDate = "";
|
||||
|
||||
private String endDate = "";
|
||||
|
||||
private String cntDate = "";
|
||||
|
||||
private int cntSum;
|
||||
|
||||
private int cntMethodSucc;
|
||||
|
||||
private int cntMethodFail;
|
||||
|
||||
private int cntBatchSucc;
|
||||
|
||||
private int cntBatchFail;
|
||||
|
||||
private String query = "";
|
||||
|
||||
private String excelDown = "";
|
||||
|
||||
/**
|
||||
* @return the batchResultId
|
||||
*/
|
||||
public String getBatchResultId() {
|
||||
return batchResultId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the batchOpertId
|
||||
*/
|
||||
public String getBatchOpertId() {
|
||||
return batchOpertId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the paramtr
|
||||
*/
|
||||
public String getParamtr() {
|
||||
return paramtr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the sttus
|
||||
*/
|
||||
public String getSttus() {
|
||||
return sttus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the executBeginTime
|
||||
*/
|
||||
public String getExecutBeginTime() {
|
||||
return executBeginTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the executEndTime
|
||||
*/
|
||||
public String getExecutEndTime() {
|
||||
return executEndTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the updmemid
|
||||
*/
|
||||
public String getUpdmemid() {
|
||||
return updmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the upddt
|
||||
*/
|
||||
public String getUpddt() {
|
||||
return upddt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the regmemid
|
||||
*/
|
||||
public String getRegmemid() {
|
||||
return regmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the regdt
|
||||
*/
|
||||
public String getRegdt() {
|
||||
return regdt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the errorInfo
|
||||
*/
|
||||
public String getErrorInfo() {
|
||||
return errorInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the batchOpertNm
|
||||
*/
|
||||
public String getBatchOpertNm() {
|
||||
return batchOpertNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업구분을 리턴한다.
|
||||
* @return the batchOpertDiv
|
||||
*/
|
||||
public String getBatchOpertDiv() {
|
||||
return batchOpertDiv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업구분을 설정한다.
|
||||
* @param batchOpertDiv 설정할 배치프로그램
|
||||
*/
|
||||
public void setBatchOpertDiv(String batchOpertDiv) {
|
||||
this.batchOpertDiv = batchOpertDiv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업구분명을 리턴한다.
|
||||
* @return the batchOpertDivNm
|
||||
*/
|
||||
public String getBatchOpertDivNm() {
|
||||
return batchOpertDivNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업구분명을 설정한다.
|
||||
* @param batchOpertDivNm 설정할 배치프로그램명
|
||||
*/
|
||||
public void setBatchOpertDivNm(String batchOpertDivNm) {
|
||||
this.batchOpertDivNm = batchOpertDivNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the batchProgrm
|
||||
*/
|
||||
public String getBatchProgrm() {
|
||||
return batchProgrm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the sttusNm
|
||||
*/
|
||||
public String getSttusNm() {
|
||||
return sttusNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param batchResultId the batchResultId to set
|
||||
*/
|
||||
public void setBatchResultId(String batchResultId) {
|
||||
this.batchResultId = batchResultId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param batchOpertId the batchOpertId to set
|
||||
*/
|
||||
public void setBatchOpertId(String batchOpertId) {
|
||||
this.batchOpertId = batchOpertId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param paramtr the paramtr to set
|
||||
*/
|
||||
public void setParamtr(String paramtr) {
|
||||
this.paramtr = paramtr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param sttus the sttus to set
|
||||
*/
|
||||
public void setSttus(String sttus) {
|
||||
this.sttus = sttus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param executBeginTime the executBeginTime to set
|
||||
*/
|
||||
public void setExecutBeginTime(String executBeginTime) {
|
||||
this.executBeginTime = executBeginTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param executEndTime the executEndTime to set
|
||||
*/
|
||||
public void setExecutEndTime(String executEndTime) {
|
||||
this.executEndTime = executEndTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param updmemid the updmemid to set
|
||||
*/
|
||||
public void setUpdmemid(String updmemid) {
|
||||
this.updmemid = updmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param upddt the upddt to set
|
||||
*/
|
||||
public void setUpddt(String upddt) {
|
||||
this.upddt = upddt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param regmemid the regmemid to set
|
||||
*/
|
||||
public void setRegmemid(String regmemid) {
|
||||
this.regmemid = regmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param regdt the regdt to set
|
||||
*/
|
||||
public void setRegdt(String regdt) {
|
||||
this.regdt = regdt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param errorInfo the errorInfo to set
|
||||
*/
|
||||
public void setErrorInfo(String errorInfo) {
|
||||
this.errorInfo = errorInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param batchOpertNm the batchOpertNm to set
|
||||
*/
|
||||
public void setBatchOpertNm(String batchOpertNm) {
|
||||
this.batchOpertNm = batchOpertNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param batchProgrm the batchProgrm to set
|
||||
*/
|
||||
public void setBatchProgrm(String batchProgrm) {
|
||||
this.batchProgrm = batchProgrm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param sttusNm the sttusNm to set
|
||||
*/
|
||||
public void setSttusNm(String sttusNm) {
|
||||
this.sttusNm = sttusNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the batchSchdulId
|
||||
*/
|
||||
public String getBatchSchdulId() {
|
||||
return batchSchdulId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param batchSchdulId the batchSchdulId to set
|
||||
*/
|
||||
public void setBatchSchdulId(String batchSchdulId) {
|
||||
this.batchSchdulId = batchSchdulId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제자ID를 리턴한다.
|
||||
* @return the delmemid
|
||||
*/
|
||||
public String getDelmemid() {
|
||||
return delmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제자ID를 설정한다.
|
||||
* @param updmemid 설정할 삭제자ID
|
||||
*/
|
||||
public void setDelmemid(String delmemid) {
|
||||
this.delmemid = delmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제시점을 리턴한다.
|
||||
* @return the deldt
|
||||
*/
|
||||
public String getDeldt() {
|
||||
return deldt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제시점을 설정한다.
|
||||
* @param upddt 설정할 삭제시점
|
||||
*/
|
||||
public void setDeldt(String deldt) {
|
||||
this.deldt = deldt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제여부를 리턴한다.
|
||||
* @return the delyn
|
||||
*/
|
||||
public String getDelyn() {
|
||||
return delyn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제여부를 설정한다.
|
||||
* @param delyn 설정할 사용여부
|
||||
*/
|
||||
public void setDelyn(String delyn) {
|
||||
this.delyn = delyn;
|
||||
}
|
||||
|
||||
public String getSchOption() {
|
||||
return schOption;
|
||||
}
|
||||
|
||||
public void setSchOption(String schOption) {
|
||||
this.schOption = schOption;
|
||||
}
|
||||
|
||||
public String getSchDate() {
|
||||
return schDate;
|
||||
}
|
||||
|
||||
public void setSchDate(String schDate) {
|
||||
this.schDate = schDate;
|
||||
}
|
||||
|
||||
public String getCntOption() {
|
||||
return cntOption;
|
||||
}
|
||||
|
||||
public void setCntOption(String cntOption) {
|
||||
this.cntOption = cntOption;
|
||||
}
|
||||
|
||||
public String getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getCntDate() {
|
||||
return cntDate;
|
||||
}
|
||||
|
||||
public void setCntDate(String cntDate) {
|
||||
this.cntDate = cntDate;
|
||||
}
|
||||
|
||||
public int getCntSum() {
|
||||
return cntSum;
|
||||
}
|
||||
|
||||
public void setCntSum(int cntSum) {
|
||||
this.cntSum = cntSum;
|
||||
}
|
||||
|
||||
public int getCntMethodSucc() {
|
||||
return cntMethodSucc;
|
||||
}
|
||||
|
||||
public void setCntMethodSucc(int cntMethodSucc) {
|
||||
this.cntMethodSucc = cntMethodSucc;
|
||||
}
|
||||
|
||||
public int getCntMethodFail() {
|
||||
return cntMethodFail;
|
||||
}
|
||||
|
||||
public void setCntMethodFail(int cntMethodFail) {
|
||||
this.cntMethodFail = cntMethodFail;
|
||||
}
|
||||
|
||||
public int getCntBatchSucc() {
|
||||
return cntBatchSucc;
|
||||
}
|
||||
|
||||
public void setCntBatchSucc(int cntBatchSucc) {
|
||||
this.cntBatchSucc = cntBatchSucc;
|
||||
}
|
||||
|
||||
public int getCntBatchFail() {
|
||||
return cntBatchFail;
|
||||
}
|
||||
|
||||
public void setCntBatchFail(int cntBatchFail) {
|
||||
this.cntBatchFail = cntBatchFail;
|
||||
}
|
||||
|
||||
public String getQuery() {
|
||||
return query;
|
||||
}
|
||||
|
||||
public void setQuery(String query) {
|
||||
this.query = query;
|
||||
}
|
||||
|
||||
public String getExcelDown() {
|
||||
return excelDown;
|
||||
}
|
||||
|
||||
public void setExcelDown(String excelDown) {
|
||||
this.excelDown = excelDown;
|
||||
}
|
||||
|
||||
public String getCntYear() {
|
||||
return cntYear;
|
||||
}
|
||||
|
||||
public void setCntYear(String cntYear) {
|
||||
this.cntYear = cntYear;
|
||||
}
|
||||
|
||||
public String getCntMonth() {
|
||||
return cntMonth;
|
||||
}
|
||||
|
||||
public void setCntMonth(String cntMonth) {
|
||||
this.cntMonth = cntMonth;
|
||||
}
|
||||
|
||||
public String getSchDateFrom() {
|
||||
return schDateFrom;
|
||||
}
|
||||
|
||||
public void setSchDateFrom(String schDateFrom) {
|
||||
this.schDateFrom = schDateFrom;
|
||||
}
|
||||
|
||||
public String getSchDateEnd() {
|
||||
return schDateEnd;
|
||||
}
|
||||
|
||||
public void setSchDateEnd(String schDateEnd) {
|
||||
this.schDateEnd = schDateEnd;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,632 @@
|
||||
package egovframework.com.sym.bat.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
|
||||
/**
|
||||
* 배치스케줄관리에 대한 model 클래스
|
||||
*
|
||||
* @author 김진만
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 17-6-2010 오전 10:27:13
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.06.17 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class BatchSchdul extends ComDefaultVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 배치스케줄ID
|
||||
*/
|
||||
private String batchSchdulId;
|
||||
/**
|
||||
* 배치작업ID
|
||||
*/
|
||||
private String batchOpertId;
|
||||
/**
|
||||
* 실행주기
|
||||
*/
|
||||
private String executCycle;
|
||||
/**
|
||||
* 실행스케줄일자
|
||||
*/
|
||||
private String executSchdulDe;
|
||||
/**
|
||||
* 실행스케줄시
|
||||
*/
|
||||
private String executSchdulHour;
|
||||
/**
|
||||
* 실행스케줄분
|
||||
*/
|
||||
private String executSchdulMnt;
|
||||
/**
|
||||
* 실행스케줄초
|
||||
*/
|
||||
private String executSchdulSecnd;
|
||||
/**
|
||||
* 실행스케줄요일
|
||||
*/
|
||||
private String[] executSchdulDfkSes;
|
||||
/**
|
||||
* 배치작업명
|
||||
*/
|
||||
private String batchOpertNm;
|
||||
/**
|
||||
* 배치작업구분
|
||||
*/
|
||||
private String batchOpertDiv;
|
||||
/**
|
||||
* 배치작업구분명
|
||||
*/
|
||||
private String batchOpertDivNm;
|
||||
/**
|
||||
* 배치프로그램
|
||||
*/
|
||||
private String batchProgrm;
|
||||
/**
|
||||
* 파라미터
|
||||
*/
|
||||
private String paramtr;
|
||||
/**
|
||||
* 실행주기명
|
||||
*/
|
||||
private String executCycleNm;
|
||||
/**
|
||||
* 실행스케줄
|
||||
*/
|
||||
private String executSchdul;
|
||||
/**
|
||||
* 실행주기
|
||||
*/
|
||||
private String cycleCode;
|
||||
/**
|
||||
* 최초등록자 아이디
|
||||
*/
|
||||
private String regmemid;
|
||||
/**
|
||||
* 최초등록시점
|
||||
*/
|
||||
private String regdt;
|
||||
/**
|
||||
* 최종수정자 아이디
|
||||
*/
|
||||
private String updmemid;
|
||||
/**
|
||||
* 최종수정일
|
||||
*/
|
||||
private String upddt;
|
||||
/**
|
||||
* 삭제자 아이디
|
||||
*/
|
||||
private String delmemid;
|
||||
/**
|
||||
* 삭제일
|
||||
*/
|
||||
private String deldt;
|
||||
/**
|
||||
* 삭제여부
|
||||
*/
|
||||
private String delyn;
|
||||
|
||||
/**
|
||||
* @return the batchSchdulId
|
||||
*/
|
||||
public String getBatchSchdulId() {
|
||||
return batchSchdulId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the batchOpertId
|
||||
*/
|
||||
public String getBatchOpertId() {
|
||||
return batchOpertId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the executCycle
|
||||
*/
|
||||
public String getExecutCycle() {
|
||||
return executCycle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the executSchdulDe
|
||||
*/
|
||||
public String getExecutSchdulDe() {
|
||||
return executSchdulDe;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the executSchdulHour
|
||||
*/
|
||||
public String getExecutSchdulHour() {
|
||||
return executSchdulHour;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the executSchdulMnt
|
||||
*/
|
||||
public String getExecutSchdulMnt() {
|
||||
return executSchdulMnt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the executSchdulSecnd
|
||||
*/
|
||||
public String getExecutSchdulSecnd() {
|
||||
return executSchdulSecnd;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the executSchdulDfkSes
|
||||
*/
|
||||
public String[] getExecutSchdulDfkSes() {
|
||||
//return executSchdulDfkSes;
|
||||
String[] ret = null;
|
||||
if (this.executSchdulDfkSes != null) {
|
||||
ret = new String[executSchdulDfkSes.length];
|
||||
for (int i = 0; i < executSchdulDfkSes.length; i++) {
|
||||
ret[i] = this.executSchdulDfkSes[i];
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the batchOpertNm
|
||||
*/
|
||||
public String getBatchOpertNm() {
|
||||
return batchOpertNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업구분을 리턴한다.
|
||||
* @return the batchOpertDiv
|
||||
*/
|
||||
public String getBatchOpertDiv() {
|
||||
return batchOpertDiv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업구분을 설정한다.
|
||||
* @param batchOpertDiv 설정할 배치프로그램
|
||||
*/
|
||||
public void setBatchOpertDiv(String batchOpertDiv) {
|
||||
this.batchOpertDiv = batchOpertDiv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업구분명을 리턴한다.
|
||||
* @return the batchOpertDivNm
|
||||
*/
|
||||
public String getBatchOpertDivNm() {
|
||||
return batchOpertDivNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업구분명을 설정한다.
|
||||
* @param batchOpertDivNm 설정할 배치프로그램명
|
||||
*/
|
||||
public void setBatchOpertDivNm(String batchOpertDivNm) {
|
||||
this.batchOpertDivNm = batchOpertDivNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the batchProgrm
|
||||
*/
|
||||
public String getBatchProgrm() {
|
||||
return batchProgrm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the executCycleNm
|
||||
*/
|
||||
public String getExecutCycleNm() {
|
||||
return executCycleNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param batchSchdulId the batchSchdulId to set
|
||||
*/
|
||||
public void setBatchSchdulId(String batchSchdulId) {
|
||||
this.batchSchdulId = batchSchdulId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param batchOpertId the batchOpertId to set
|
||||
*/
|
||||
public void setBatchOpertId(String batchOpertId) {
|
||||
this.batchOpertId = batchOpertId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param executCycle the executCycle to set
|
||||
*/
|
||||
public void setExecutCycle(String executCycle) {
|
||||
this.executCycle = executCycle;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param executSchdulDe the executSchdulDe to set
|
||||
*/
|
||||
public void setExecutSchdulDe(String executSchdulDe) {
|
||||
this.executSchdulDe = executSchdulDe;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param executSchdulHour the executSchdulHour to set
|
||||
*/
|
||||
public void setExecutSchdulHour(String executSchdulHour) {
|
||||
this.executSchdulHour = executSchdulHour;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param executSchdulMnt the executSchdulMnt to set
|
||||
*/
|
||||
public void setExecutSchdulMnt(String executSchdulMnt) {
|
||||
this.executSchdulMnt = executSchdulMnt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param executSchdulSecnd the executSchdulSecnd to set
|
||||
*/
|
||||
public void setExecutSchdulSecnd(String executSchdulSecnd) {
|
||||
this.executSchdulSecnd = executSchdulSecnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param executSchdulDfkSes the executSchdulDfkSes to set
|
||||
*/
|
||||
public void setExecutSchdulDfkSes(String[] executSchdulDfkSes) {
|
||||
//this.executSchdulDfkSes = executSchdulDfkSes;
|
||||
this.executSchdulDfkSes = new String[executSchdulDfkSes.length];
|
||||
for (int i = 0; i < executSchdulDfkSes.length; ++i) {
|
||||
this.executSchdulDfkSes[i] = executSchdulDfkSes[i];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param batchOpertNm the batchOpertNm to set
|
||||
*/
|
||||
public void setBatchOpertNm(String batchOpertNm) {
|
||||
this.batchOpertNm = batchOpertNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param batchProgrm the batchProgrm to set
|
||||
*/
|
||||
public void setBatchProgrm(String batchProgrm) {
|
||||
this.batchProgrm = batchProgrm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param executCycleNm the executCycleNm to set
|
||||
*/
|
||||
public void setExecutCycleNm(String executCycleNm) {
|
||||
this.executCycleNm = executCycleNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the executSchdul
|
||||
*/
|
||||
public String getExecutSchdul() {
|
||||
return executSchdul;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param executSchdul the executSchdul to set
|
||||
*/
|
||||
public void setExecutSchdul(String executSchdul) {
|
||||
this.executSchdul = executSchdul;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the cycleCode
|
||||
*/
|
||||
public String getCycleCode() {
|
||||
return cycleCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param cycleCode the cycleCode to set
|
||||
*/
|
||||
public void setCycleCode(String cycleCode) {
|
||||
this.cycleCode = cycleCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the regmemid
|
||||
*/
|
||||
public String getRegmemid() {
|
||||
return regmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param regmemid the regmemid to set
|
||||
*/
|
||||
public void setRegmemid(String regmemid) {
|
||||
this.regmemid = regmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the regdt
|
||||
*/
|
||||
public String getRegdt() {
|
||||
return regdt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param regdt the regdt to set
|
||||
*/
|
||||
public void setRegdt(String regdt) {
|
||||
this.regdt = regdt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 최종수정자ID를 리턴한다.
|
||||
* @return the updmemid
|
||||
*/
|
||||
public String getUpdmemid() {
|
||||
return updmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 최종수정자ID를 설정한다.
|
||||
* @param updmemid 설정할 최종수정자ID
|
||||
*/
|
||||
public void setUpdmemid(String updmemid) {
|
||||
this.updmemid = updmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 최종수정시점을 리턴한다.
|
||||
* @return the upddt
|
||||
*/
|
||||
public String getUpddt() {
|
||||
return upddt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 최종수정시점을 설정한다.
|
||||
* @param upddt 설정할 최종수정시점
|
||||
*/
|
||||
public void setUpddt(String upddt) {
|
||||
this.upddt = upddt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제자ID를 리턴한다.
|
||||
* @return the delmemid
|
||||
*/
|
||||
public String getDelmemid() {
|
||||
return delmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제자ID를 설정한다.
|
||||
* @param updmemid 설정할 삭제자ID
|
||||
*/
|
||||
public void setDelmemid(String delmemid) {
|
||||
this.delmemid = delmemid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제시점을 리턴한다.
|
||||
* @return the deldt
|
||||
*/
|
||||
public String getDeldt() {
|
||||
return deldt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제시점을 설정한다.
|
||||
* @param upddt 설정할 삭제시점
|
||||
*/
|
||||
public void setDeldt(String deldt) {
|
||||
this.deldt = deldt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제여부를 리턴한다.
|
||||
* @return the delyn
|
||||
*/
|
||||
public String getDelyn() {
|
||||
return delyn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 삭제여부를 설정한다.
|
||||
* @param delyn 설정할 사용여부
|
||||
*/
|
||||
public void setDelyn(String delyn) {
|
||||
this.delyn = delyn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 리스트, 상세화면 화면표시용 실행스케줄속성을 만들어 executSchdul 필드에 저장한다.
|
||||
*
|
||||
* @param dfkSeList List<BatchSchdulDfk>형의 요일구분코드정보리스트
|
||||
*/
|
||||
public void makeExecutSchdul(List<BatchSchdulDfk> dfkSeList) {
|
||||
String executSchdul = "";
|
||||
String executSchdulDeNm = "";
|
||||
|
||||
// 날짜 출력
|
||||
if (this.executCycle.equals("01") || this.executCycle.equals("02") || this.executCycle.equals("04")
|
||||
|| this.executCycle.equals("05") || this.executCycle.equals("06") || this.executCycle.equals("07")) {
|
||||
// 매주, 매일인 경우는 스케줄일자를 사용하지 않는다.
|
||||
executSchdulDeNm = "";
|
||||
} else if (this.executCycle.equals("03")) {
|
||||
// 매월 처리
|
||||
if (!"".equals(this.executSchdulDe)) {
|
||||
executSchdulDeNm = executSchdulDeNm + this.executSchdulDe.substring(6, 8) + "일 ";
|
||||
}
|
||||
// } else if (this.executCycle.equals("04")) {
|
||||
// // 매년의경우 처리
|
||||
// if (!"".equals(this.executSchdulDe)) {
|
||||
// executSchdulDeNm = executSchdulDeNm + this.executSchdulDe.substring(4, 6) + "-" + this.executSchdulDe.substring(6, 8) + " ";
|
||||
// }
|
||||
} else {
|
||||
// 이외의경우 처리
|
||||
if (!"".equals(this.executSchdulDe)) {
|
||||
executSchdulDeNm = executSchdulDeNm + this.executSchdulDe.substring(0, 4) + "-" + this.executSchdulDe.substring(4, 6) + "-" + this.executSchdulDe.substring(6, 8)
|
||||
+ " ";
|
||||
}
|
||||
}
|
||||
|
||||
// 날짜 출력
|
||||
executSchdul = executSchdul + executSchdulDeNm;
|
||||
|
||||
// 요일출력
|
||||
if (this.executCycle.equals("02")) {
|
||||
// 실행주기가 매주인 경우에만 출력한다.
|
||||
if (dfkSeList.size() != 0) {
|
||||
for (int i = 0; i < dfkSeList.size(); i++) {
|
||||
if (i != 0) {
|
||||
executSchdul = executSchdul + ",";
|
||||
}
|
||||
executSchdul = executSchdul + dfkSeList.get(i).getExecutSchdulDfkSeNm();
|
||||
}
|
||||
executSchdul = executSchdul + " ";
|
||||
}
|
||||
}
|
||||
|
||||
// 시, 분, 초 출력
|
||||
if (this.executCycle.equals("04")) {
|
||||
executSchdul = "XX:XX:" + this.executSchdulSecnd;
|
||||
} else if (this.executCycle.equals("05")) {
|
||||
executSchdul = "XX:"+ this.executSchdulMnt + ":" + this.executSchdulSecnd;
|
||||
} else if (this.executCycle.equals("06")) {
|
||||
executSchdul = "XX:"+ this.executSchdulMnt.substring(1) + ":XX";
|
||||
} else if (this.executCycle.equals("07")) {
|
||||
executSchdul = "XX:XX:" + this.executSchdulSecnd.substring(1);
|
||||
} else {
|
||||
// 나머지 시분초는 항상출력한다.
|
||||
executSchdul = executSchdul + this.executSchdulHour + ":" + this.executSchdulMnt + ":" + this.executSchdulSecnd;
|
||||
}
|
||||
|
||||
// 값지정.
|
||||
this.executSchdul = executSchdul;
|
||||
}
|
||||
|
||||
/**
|
||||
* 실행스케줄을 CronExpression으로 바꿔서 리턴한다.
|
||||
**/
|
||||
public String toCronExpression() {
|
||||
|
||||
String cronExpression = "";
|
||||
String cronExpressionS = "";
|
||||
String cronExpressionM = "";
|
||||
String cronExpression4 = "";
|
||||
String cronExpression5 = "";
|
||||
|
||||
// 초변환
|
||||
cronExpressionS = cronExpression + this.executSchdulSecnd;
|
||||
cronExpression = cronExpression + this.executSchdulSecnd;
|
||||
|
||||
// 분변환
|
||||
cronExpressionM = cronExpression + " " + this.executSchdulMnt;
|
||||
cronExpression = cronExpression + " " + this.executSchdulMnt;
|
||||
|
||||
// 시변환
|
||||
cronExpression = cronExpression + " " + this.executSchdulHour;
|
||||
|
||||
// 일변환
|
||||
if (this.executCycle.equals("01")) {
|
||||
// 매일인경우 "*" 출력
|
||||
cronExpression = cronExpression + " " + "*";
|
||||
|
||||
} else if (this.executCycle.equals("02")) {
|
||||
// 매주인 경우 "?" 출력
|
||||
cronExpression = cronExpression + " " + "?";
|
||||
|
||||
} else if (this.executCycle.equals("04")) {
|
||||
// 매분(초침 일치)인경우 "*" 출력
|
||||
cronExpression4 = cronExpressionS + " " + "* * *";;
|
||||
cronExpression = "";
|
||||
cronExpression = cronExpression4;
|
||||
|
||||
} else if (this.executCycle.equals("05")) {
|
||||
// 매시간(분침 일치)인경우 "*" 출력
|
||||
cronExpression5 = cronExpressionM + " " + "* *";;
|
||||
cronExpression = "";
|
||||
cronExpression = cronExpression5;
|
||||
|
||||
} else if (this.executCycle.equals("06")) {
|
||||
// 분간격 인경우 "*" 출력
|
||||
cronExpression5 = cronExpressionM + " " + "* *";;
|
||||
cronExpression = "";
|
||||
cronExpression = cronExpression5;
|
||||
|
||||
} else if (this.executCycle.equals("07")) {
|
||||
// 초간격 인경우 "*" 출력
|
||||
cronExpression4 = cronExpressionS + " " + "* * *";;
|
||||
cronExpression = "";
|
||||
cronExpression = cronExpression4;
|
||||
|
||||
} else {
|
||||
// 이외의 경우 그대로 출력
|
||||
cronExpression = cronExpression + " " + this.executSchdulDe.substring(6, 8);
|
||||
}
|
||||
|
||||
// 월변환
|
||||
if (this.executCycle.equals("01") || this.executCycle.equals("02") || this.executCycle.equals("03")
|
||||
|| this.executCycle.equals("04") || this.executCycle.equals("05") || this.executCycle.equals("06") || this.executCycle.equals("07")) {
|
||||
// 매일,매월,매주인경우 "*" 출력 + 매분, 매시간 추가
|
||||
cronExpression = cronExpression + " " + "*";
|
||||
} else {
|
||||
// 이외의 경우 그대로 출력
|
||||
cronExpression = cronExpression + " " + this.executSchdulDe.substring(4, 6);
|
||||
}
|
||||
|
||||
// 주 변환
|
||||
if (this.executCycle.equals("02")) {
|
||||
// 매주인경우 day of week를 출력
|
||||
String dayOfWeek = "";
|
||||
for (int i = 0; i < this.executSchdulDfkSes.length; i++) {
|
||||
if (i != 0) {
|
||||
dayOfWeek = dayOfWeek + ",";
|
||||
}
|
||||
dayOfWeek = dayOfWeek + this.executSchdulDfkSes[i];
|
||||
}
|
||||
cronExpression = cronExpression + " " + dayOfWeek;
|
||||
} else {
|
||||
// 이외의 경우 "?" 출력
|
||||
cronExpression = cronExpression + " " + "?";
|
||||
}
|
||||
|
||||
// 년변환
|
||||
// if (this.executCycle.equals("05")) {
|
||||
// // 한번만인경우 년도 출력
|
||||
// cronExpression = cronExpression + " " + this.executSchdulDe.substring(0, 4);
|
||||
// }
|
||||
|
||||
return cronExpression;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the paramtr
|
||||
*/
|
||||
public String getParamtr() {
|
||||
return paramtr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param paramtr the paramtr to set
|
||||
*/
|
||||
public void setParamtr(String paramtr) {
|
||||
this.paramtr = paramtr;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package egovframework.com.sym.bat.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 배치스케줄요일에 대한 model 클래스
|
||||
*
|
||||
* @author 김진만
|
||||
* @version 1.0
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.08.23 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
public class BatchSchdulDfk implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4152071306992470303L;
|
||||
|
||||
/**
|
||||
* 배치스케줄ID
|
||||
*/
|
||||
private String batchSchdulId;
|
||||
|
||||
/**
|
||||
* 실행스케줄요일
|
||||
*/
|
||||
private String executSchdulDfkSe;
|
||||
|
||||
/**
|
||||
* 실행스케줄요일명
|
||||
*/
|
||||
private String executSchdulDfkSeNm;
|
||||
|
||||
|
||||
/**
|
||||
* @return the batchSchdulId
|
||||
*/
|
||||
public String getBatchSchdulId() {
|
||||
return batchSchdulId;
|
||||
}
|
||||
/**
|
||||
* @return the executSchdulDfkSe
|
||||
*/
|
||||
public String getExecutSchdulDfkSe() {
|
||||
return executSchdulDfkSe;
|
||||
}
|
||||
/**
|
||||
* @param batchSchdulId the batchSchdulId to set
|
||||
*/
|
||||
public void setBatchSchdulId(String batchSchdulId) {
|
||||
this.batchSchdulId = batchSchdulId;
|
||||
}
|
||||
/**
|
||||
* @param executSchdulDfkSe the executSchdulDfkSe to set
|
||||
*/
|
||||
public void setExecutSchdulDfkSe(String executSchdulDfkSe) {
|
||||
this.executSchdulDfkSe = executSchdulDfkSe;
|
||||
}
|
||||
/**
|
||||
* @return the executSchdulDfkSeNm
|
||||
*/
|
||||
public String getExecutSchdulDfkSeNm() {
|
||||
return executSchdulDfkSeNm;
|
||||
}
|
||||
/**
|
||||
* @param executSchdulDfkSeNm the executSchdulDfkSeNm to set
|
||||
*/
|
||||
public void setExecutSchdulDfkSeNm(String executSchdulDfkSeNm) {
|
||||
this.executSchdulDfkSeNm = executSchdulDfkSeNm;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,237 @@
|
||||
package egovframework.com.sym.bat.service;
|
||||
|
||||
import static org.quartz.CronScheduleBuilder.cronSchedule;
|
||||
import static org.quartz.JobBuilder.newJob;
|
||||
import static org.quartz.TriggerBuilder.newTrigger;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
|
||||
import org.quartz.CronTrigger;
|
||||
import org.quartz.JobDetail;
|
||||
import org.quartz.JobKey;
|
||||
import org.quartz.Scheduler;
|
||||
import org.quartz.SchedulerException;
|
||||
import org.quartz.SchedulerFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Quartz Scheduler를 실행하는 스케줄러 클래스를 정의한다.
|
||||
*
|
||||
* @author 김진만
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.08.30 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public class BatchScheduler {
|
||||
|
||||
private EgovBatchSchdulService egovBatchSchdulService;
|
||||
|
||||
/** ID Generation */
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
/** Quartz 스케줄러 */
|
||||
private Scheduler sched;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(BatchScheduler.class);
|
||||
|
||||
// 실행 대상을 읽기위한 페이지 크기
|
||||
private static final int RECORD_COUNT_PER_PAGE = 10000;
|
||||
|
||||
/**
|
||||
* 배치스케줄러에 batchSchdul 파라미터를 이용하여 Job , Trigger를 Add 한다.
|
||||
*
|
||||
* @param batchSchdul 배치스케줄러에 등록할 스케줄정보
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void insertBatchSchdul(BatchSchdul batchSchdul) throws Exception {
|
||||
// Job 만들기
|
||||
JobDetail jobDetail = newJob(BatchShellScriptJob.class).withIdentity(batchSchdul.getBatchSchdulId()).build();
|
||||
|
||||
// Trigger 만들기
|
||||
CronTrigger trigger = newTrigger().withIdentity(batchSchdul.getBatchSchdulId()).withSchedule(cronSchedule(batchSchdul.toCronExpression())).forJob(jobDetail.getKey().getName()).build();
|
||||
|
||||
// LOGGER.debug("배치스케줄을 등록합니다. 배치스케줄ID : {}", batchSchdul.getBatchSchdulId());
|
||||
// LOGGER.debug("{} - cronexpression : {}", batchSchdul.getBatchSchdulId(), trigger.getCronExpression());
|
||||
BatchJobListener listener = new BatchJobListener();
|
||||
|
||||
listener.setEgovBatchSchdulService(egovBatchSchdulService);
|
||||
listener.setIdgenService(idgenService);
|
||||
|
||||
sched.getListenerManager().addJobListener(listener);
|
||||
|
||||
// 데이터 전달
|
||||
jobDetail.getJobDataMap().put("batchOpertId", batchSchdul.getBatchOpertId());
|
||||
jobDetail.getJobDataMap().put("batchOpertDiv", batchSchdul.getBatchOpertDiv());
|
||||
jobDetail.getJobDataMap().put("batchSchdulId", batchSchdul.getBatchSchdulId());
|
||||
jobDetail.getJobDataMap().put("batchProgrm", batchSchdul.getBatchProgrm());
|
||||
jobDetail.getJobDataMap().put("paramtr", batchSchdul.getParamtr());
|
||||
|
||||
try {
|
||||
// 스케줄러에 추가하기
|
||||
sched.scheduleJob(jobDetail, trigger);
|
||||
} catch (SchedulerException e) {
|
||||
// SchedulerException 이 발생하면 로그를 출력하고 다음 배치작업으로 넘어간다.
|
||||
// 트리거의 실행시각이 현재 시각보다 이전이면 SchedulerException이 발생한다.
|
||||
LOGGER.error("스케줄러에 배치작업추가할때 에러가 발생했습니다. 배치스케줄ID : {}, 배치작업ID : {}", batchSchdul.getBatchSchdulId(), batchSchdul.getBatchOpertId());
|
||||
LOGGER.error("에러내용 : {}", e.getMessage());
|
||||
LOGGER.debug(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄러에 batchSchdul 파라미터를 이용하여 Job , Trigger를 갱신 한다.
|
||||
*
|
||||
* @param batchSchdul 배치스케줄러에 갱신할 스케줄정보
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void updateBatchSchdul(BatchSchdul batchSchdul) throws Exception {
|
||||
// Job 만들기
|
||||
JobDetail jobDetail = newJob(BatchShellScriptJob.class).withIdentity(batchSchdul.getBatchSchdulId()).build();
|
||||
// Trigger 만들기
|
||||
CronTrigger trigger = newTrigger().withIdentity(batchSchdul.getBatchSchdulId()).withSchedule(cronSchedule(batchSchdul.toCronExpression())).forJob(jobDetail.getKey().getName()).build();
|
||||
|
||||
// LOGGER.debug("배치스케줄을 갱신합니다. 배치스케줄ID : {}", batchSchdul.getBatchSchdulId());
|
||||
// LOGGER.debug("{} - cronexpression : {}", batchSchdul.getBatchSchdulId(), trigger.getCronExpression());
|
||||
|
||||
BatchJobListener listener = new BatchJobListener();
|
||||
|
||||
listener.setEgovBatchSchdulService(egovBatchSchdulService);
|
||||
listener.setIdgenService(idgenService);
|
||||
|
||||
sched.getListenerManager().addJobListener(listener);
|
||||
|
||||
// 데이터 전달
|
||||
jobDetail.getJobDataMap().put("batchOpertId", batchSchdul.getBatchOpertId());
|
||||
jobDetail.getJobDataMap().put("batchOpertDiv", batchSchdul.getBatchOpertDiv());
|
||||
jobDetail.getJobDataMap().put("batchSchdulId", batchSchdul.getBatchSchdulId());
|
||||
jobDetail.getJobDataMap().put("batchProgrm", batchSchdul.getBatchProgrm());
|
||||
jobDetail.getJobDataMap().put("paramtr", batchSchdul.getParamtr());
|
||||
|
||||
try {
|
||||
// 스케줄러에서 기존Job, Trigger 삭제하기
|
||||
sched.deleteJob(JobKey.jobKey(batchSchdul.getBatchSchdulId()));
|
||||
// 스케줄러에 추가하기
|
||||
sched.scheduleJob(jobDetail, trigger);
|
||||
} catch (SchedulerException e) {
|
||||
// SchedulerException 이 발생하면 로그를 출력하고 다음 배치작업으로 넘어간다.
|
||||
// 트리거의 실행시각이 현재 시각보다 이전이면 SchedulerException이 발생한다.
|
||||
LOGGER.error("스케줄러에 배치작업갱신할때 에러가 발생했습니다. 배치스케줄ID : {}, 배치작업ID : {}", batchSchdul.getBatchSchdulId(), batchSchdul.getBatchOpertId());
|
||||
LOGGER.error("에러내용 : {}", e.getMessage());
|
||||
LOGGER.debug(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄러에 batchSchdul 파라미터를 이용하여 Job , Trigger를 삭제한다.
|
||||
*
|
||||
* @param batchSchdul 배치스케줄러에 삭제할 스케줄정보
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void deleteBatchSchdul(BatchSchdul batchSchdul) throws Exception {
|
||||
|
||||
try {
|
||||
// 스케줄러에서 기존Job, Trigger 삭제하기
|
||||
// LOGGER.debug("배치스케줄을 삭제합니다. 배치스케줄ID : {}", batchSchdul.getBatchSchdulId());
|
||||
sched.deleteJob(JobKey.jobKey(batchSchdul.getBatchSchdulId()));
|
||||
} catch (SchedulerException e) {
|
||||
// SchedulerException 이 발생하면 로그를 출력하고 다음 배치작업으로 넘어간다.
|
||||
// 트리거의 실행시각이 현재 시각보다 이전이면 SchedulerException이 발생한다.
|
||||
LOGGER.error("스케줄러에 배치작업을 삭제할때 에러가 발생했습니다. 배치스케줄ID : {}, 배치작업ID : ", batchSchdul.getBatchSchdulId(), batchSchdul.getBatchOpertId());
|
||||
LOGGER.error("에러내용 : {}", e.getMessage());
|
||||
LOGGER.debug(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 클래스 초기화메소드.
|
||||
* 배치스케줄테이블을 읽어서 Quartz 스케줄러를 초기화한다.
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void init() throws Exception {
|
||||
// 모니터링 대상 정보 읽어들이기~~~
|
||||
List<BatchSchdul> targetList = null;
|
||||
BatchSchdul searchVO = new BatchSchdul();
|
||||
// 모니터링 대상 검색 조건 초기화
|
||||
searchVO.setPageIndex(1);
|
||||
searchVO.setFirstIndex(0);
|
||||
searchVO.setRecordCountPerPage(RECORD_COUNT_PER_PAGE);
|
||||
targetList = (List<BatchSchdul>) egovBatchSchdulService.selectBatchSchdulList(searchVO);
|
||||
// LOGGER.debug("조회조건 {}", searchVO);
|
||||
// LOGGER.debug("Result 건수 : {}", targetList.size());
|
||||
|
||||
// 스케줄러 생성하기
|
||||
SchedulerFactory schedFact = new org.quartz.impl.StdSchedulerFactory();
|
||||
sched = schedFact.getScheduler();
|
||||
|
||||
// Set up the listener
|
||||
BatchJobListener listener = new BatchJobListener();
|
||||
|
||||
listener.setEgovBatchSchdulService(egovBatchSchdulService);
|
||||
listener.setIdgenService(idgenService);
|
||||
|
||||
//sched.addGlobalJobListener(listener);
|
||||
sched.getListenerManager().addJobListener(listener);
|
||||
|
||||
// 스케줄러에 Job, Trigger 등록하기
|
||||
BatchSchdul target = null;
|
||||
for (int i = 0; i < targetList.size(); i++) {
|
||||
target = targetList.get(i);
|
||||
// LOGGER.debug("Data : {}", target);
|
||||
|
||||
insertBatchSchdul(target);
|
||||
}
|
||||
|
||||
sched.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 클래스 destroy메소드.
|
||||
* Quartz 스케줄러를 shutdown한다.
|
||||
*
|
||||
*/
|
||||
public void destroy() throws Exception {
|
||||
sched.shutdown();
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄 서비스 리턴
|
||||
* @return the egovBatchSchdulService
|
||||
*/
|
||||
public EgovBatchSchdulService getEgovBatchSchdulService() {
|
||||
return egovBatchSchdulService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄 서비스 저장.
|
||||
* @param egovBatchSchdulService the egovBatchSchdulService to set
|
||||
*/
|
||||
public void setEgovBatchSchdulService(EgovBatchSchdulService egovBatchSchdulService) {
|
||||
this.egovBatchSchdulService = egovBatchSchdulService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과ID 생성서비스 리턴
|
||||
* @return the idgenService
|
||||
*/
|
||||
public EgovIdGnrService getIdgenService() {
|
||||
return idgenService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과ID 생성서비스 저장.
|
||||
* @param idgenService the idgenService to set
|
||||
*/
|
||||
public void setIdgenService(EgovIdGnrService idgenService) {
|
||||
this.idgenService = idgenService;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,172 @@
|
||||
package egovframework.com.sym.bat.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* 배치쉘스크립트를 실행하는 Quartz Job 클래스를 정의한다.
|
||||
*
|
||||
* @author 김진만
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.08.30 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public class BatchShellScriptJob implements Job {
|
||||
|
||||
/** logger */
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(BatchShellScriptJob.class);
|
||||
|
||||
/**
|
||||
* (non-Javadoc)
|
||||
* @see org.quartz.Job#execute(org.quartz.JobExecutionContext)
|
||||
*/
|
||||
|
||||
public void execute(JobExecutionContext jobContext) throws JobExecutionException {
|
||||
|
||||
JobDataMap dataMap = jobContext.getJobDetail().getJobDataMap();
|
||||
|
||||
// LOGGER.debug("job[{}] Trigger이름 : ", jobContext.getJobDetail().getKey().getName(), jobContext.getTrigger().getKey().getName());
|
||||
// LOGGER.debug("job[{}] BatchOpert이름 : ", jobContext.getJobDetail().getKey().getName(), dataMap.getString("batchOpertId"));
|
||||
// LOGGER.debug("job[{}] BatchOpert구분 : ", jobContext.getJobDetail().getKey().getName(), dataMap.getString("batchOpertDiv"));
|
||||
// LOGGER.debug("job[{}] BatchProgram이름 : ", jobContext.getJobDetail().getKey().getName(), dataMap.getString("batchProgrm"));
|
||||
// LOGGER.debug("job[{}] Parameter이름 : ", jobContext.getJobDetail().getKey().getName(), dataMap.getString("paramtr"));
|
||||
|
||||
//int result;
|
||||
HashMap resultMap = new HashMap();
|
||||
|
||||
try {
|
||||
if(dataMap.getString("batchOpertDiv").equals("1")){//메소드
|
||||
resultMap = executeMethod(dataMap.getString("batchProgrm"), dataMap.getString("paramtr"));
|
||||
} else {//배치프로그램
|
||||
resultMap = executeProgram(dataMap.getString("batchProgrm"), dataMap.getString("paramtr"));
|
||||
}
|
||||
|
||||
// jobContext에 결과값을 저장한다.
|
||||
jobContext.setResult(Integer.parseInt(String.valueOf(resultMap.get("result"))));
|
||||
|
||||
//jobContext.setErrorMsg(resultMap.get("errorMsg"));
|
||||
jobContext.put("errorMsg", resultMap.get("errorMsg"));
|
||||
|
||||
} catch (IllegalAccessException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException e) {
|
||||
// TODO Auto-generated catch block
|
||||
// e.printStackTrace();
|
||||
LOGGER.error("예외 상황 발생");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 시스템에서 특정 쉘프로그램을 실행한다.
|
||||
* @param batchProgrm 배치실행 메소드
|
||||
* @param paramtr 배치실행화일에 전달될 파라미터
|
||||
* @return 배치실행화일리턴값(integer)
|
||||
* @throws ClassNotFoundException
|
||||
* @throws IllegalAccessException
|
||||
* @throws InstantiationException
|
||||
* @throws SecurityException
|
||||
* @throws NoSuchMethodException
|
||||
* @throws InvocationTargetException
|
||||
* @throws IllegalArgumentException
|
||||
* @exception Exception
|
||||
*/
|
||||
private HashMap executeMethod(String batchProgrm, String paramtr) throws IllegalAccessException, NoSuchMethodException, SecurityException, IllegalArgumentException, InvocationTargetException {
|
||||
|
||||
HashMap resultMap = new HashMap();
|
||||
|
||||
Class noparams[] = {};
|
||||
int result = 0;
|
||||
try {
|
||||
|
||||
// Process p = null;
|
||||
String cmdStr = batchProgrm + " " + paramtr;
|
||||
// p = Runtime.getRuntime().exec(cmdStr);
|
||||
// p.waitFor();
|
||||
// result = p.exitValue();
|
||||
|
||||
Class cls = Class.forName(batchProgrm);
|
||||
Object obj = cls.newInstance();
|
||||
//call the printIt method
|
||||
Method method = cls.getDeclaredMethod(paramtr, noparams);
|
||||
method.invoke(obj, null);
|
||||
// LOGGER.debug("배치실행화일 - {} 실행완료, 결과값: {}", cmdStr, result);
|
||||
|
||||
resultMap.put("result", result);
|
||||
resultMap.put("errorMsg", "");
|
||||
|
||||
} catch (ClassNotFoundException e) {
|
||||
result = 1;
|
||||
LOGGER.error("배치스크립트 실행 에러 : {}", e.getMessage());
|
||||
LOGGER.debug(e.getMessage(), e);
|
||||
|
||||
resultMap.put("result", result);
|
||||
resultMap.put("errorMsg", e.getMessage());
|
||||
|
||||
} catch (InstantiationException e) {
|
||||
result = 1;
|
||||
LOGGER.error("배치스크립트 실행 에러 : {}", e.getMessage());
|
||||
LOGGER.debug(e.getMessage(), e);
|
||||
|
||||
resultMap.put("result", result);
|
||||
resultMap.put("errorMsg", e.getMessage());
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 시스템에서 특정 쉘프로그램을 실행한다.
|
||||
* @param batchProgrm 배치실행 화일
|
||||
* @param paramtr 배치실행화일에 전달될 파라미터
|
||||
* @return 배치실행화일리턴값(integer)
|
||||
* @exception Exception
|
||||
*/
|
||||
private HashMap executeProgram(String batchProgrm, String paramtr) {
|
||||
|
||||
HashMap resultMap = new HashMap();
|
||||
|
||||
int result = 0;
|
||||
try {
|
||||
Process p = null;
|
||||
String cmdStr = batchProgrm + " " + paramtr;
|
||||
p = Runtime.getRuntime().exec(cmdStr);
|
||||
p.waitFor();
|
||||
result = p.exitValue();
|
||||
// LOGGER.debug("배치실행화일 - {} 실행완료, 결과값: {}", cmdStr, result);
|
||||
|
||||
resultMap.put("result", result);
|
||||
resultMap.put("errorMsg", "");
|
||||
|
||||
} catch (IOException e) {
|
||||
result = 1;
|
||||
LOGGER.error("배치스크립트 실행 에러 : {}", e.getMessage());
|
||||
LOGGER.debug(e.getMessage(), e);
|
||||
|
||||
resultMap.put("result", result);
|
||||
resultMap.put("errorMsg", e.getMessage());
|
||||
|
||||
} catch (InterruptedException e) {
|
||||
result = 1;
|
||||
LOGGER.error("배치스크립트 실행 에러 : {}", e.getMessage());
|
||||
LOGGER.debug(e.getMessage(), e);
|
||||
|
||||
resultMap.put("result", result);
|
||||
resultMap.put("errorMsg", e.getMessage());
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,74 @@
|
||||
package egovframework.com.sym.bat.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 배치작업관리에 대한 Service Interface를 정의한다.
|
||||
*
|
||||
* @author 김진만
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 17-6-2010 오전 10:27:13
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.06.17 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
public interface EgovBatchOpertService {
|
||||
|
||||
/**
|
||||
* 배치작업을 삭제한다.
|
||||
*
|
||||
* @param batchOpert 삭제대상 배치작업model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void deleteBatchOpert(BatchOpert batchOpert) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치작업을 등록한다.
|
||||
*
|
||||
* @param batchOpert 등록대상 배치작업model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void insertBatchOpert(BatchOpert batchOpert) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치작업을 상세조회 한다.
|
||||
* @return 배치작업정보
|
||||
*
|
||||
* @param batchOpert 조회대상 배치작업model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public BatchOpert selectBatchOpert(BatchOpert batchOpert) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치작업 목록을 조회한다.
|
||||
* @return 배치작업목록
|
||||
*
|
||||
* @param searchVO 조회조건VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public List<?> selectBatchOpertList(BatchOpert searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치작업 목록 전체 건수를(을) 조회한다.
|
||||
* @return 목록건수
|
||||
*
|
||||
* @param searchVO 조회할 정보가 담긴 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public int selectBatchOpertListCnt(BatchOpert searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치작업을 수정한다.
|
||||
*
|
||||
* @param batchOpert 수정대상 배치작업model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void updateBatchOpert(BatchOpert batchOpert) throws Exception;
|
||||
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package egovframework.com.sym.bat.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import egovframework.itgcms.module.link.service.LinkVO;
|
||||
|
||||
/**
|
||||
* 배치결과관리에 대한 Service Interface를 정의한다.
|
||||
*
|
||||
* @author 김진만
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 17-6-2010 오전 10:27:13
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.06.17 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
public interface EgovBatchResultService {
|
||||
|
||||
/**
|
||||
* 배치결과을 삭제한다.
|
||||
*
|
||||
* @param batchResult 삭제대상 배치결과model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void deleteBatchResult(BatchResult batchResult) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치결과을 상세조회 한다.
|
||||
* @return 배치결과정보
|
||||
*
|
||||
* @param batchResult 조회대상 배치결과model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public BatchResult selectBatchResult(BatchResult batchResult) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치결과 목록을 조회한다.
|
||||
* @return 배치결과목록
|
||||
*
|
||||
* @param searchVO 조회조건VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public List<?> selectBatchResultList(BatchResult searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치스케줄 목록 전체 건수를(을) 조회한다.
|
||||
* @return 목록건수
|
||||
*
|
||||
* @param searchVO 조회할 정보가 담긴 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public int selectBatchResultListCnt(BatchResult searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치 결과 통계 view 조회 서비스 구현
|
||||
* @param searchVO
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws SQLException
|
||||
* @throws IOException
|
||||
*/
|
||||
public List EgovBatchStatsView(BatchResult searchVO, ModelMap model, HttpServletRequest request, HttpServletResponse response) throws SQLException, IOException;
|
||||
|
||||
/**
|
||||
* 배치 결과 통계 엑셀 다운로드 서비스 구현
|
||||
* @param searchVO
|
||||
* @param request
|
||||
* @return ModelAndView
|
||||
* @throws SQLException
|
||||
* @throws IOException
|
||||
*/
|
||||
ModelAndView EgovBatchStatsExcelDown(BatchResult searchVO, HttpServletRequest request) throws SQLException, IOException;
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package egovframework.com.sym.bat.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 배치스케줄관리에 대한 Service Interface를 정의한다.
|
||||
*
|
||||
* @author 김진만
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 17-6-2010 오전 10:27:13
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.06.17 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
public interface EgovBatchSchdulService {
|
||||
|
||||
/**
|
||||
* 배치스케줄을 삭제한다.
|
||||
*
|
||||
* @param batchSchdul 삭제대상 배치스케줄model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void deleteBatchSchdul(BatchSchdul batchSchdul) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치스케줄을 등록한다.
|
||||
*
|
||||
* @param batchSchdul 등록대상 배치스케줄model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void insertBatchSchdul(BatchSchdul batchSchdul) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치스케줄을 상세조회 한다.
|
||||
* @return 배치스케줄정보
|
||||
*
|
||||
* @param batchSchdul 조회대상 배치스케줄model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public BatchSchdul selectBatchSchdul(BatchSchdul batchSchdul) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치스케줄 목록을 조회한다.
|
||||
* @return 배치스케줄목록
|
||||
*
|
||||
* @param searchVO 조회조건VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public List<?> selectBatchSchdulList(BatchSchdul searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치스케줄 목록 전체 건수를(을) 조회한다.
|
||||
* @return 목록건수
|
||||
*
|
||||
* @param searchVO 조회할 정보가 담긴 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public int selectBatchSchdulListCnt(BatchSchdul searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치스케줄을 수정한다.
|
||||
*
|
||||
* @param batchSchdul 수정대상 배치스케줄model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void updateBatchSchdul(BatchSchdul batchSchdul) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치결과를 등록한다.
|
||||
* @param batchResult 등록대상 배치결과model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void insertBatchResult(BatchResult batchResult) throws Exception;
|
||||
|
||||
/**
|
||||
* 배치결과정보를 수정한다.
|
||||
*
|
||||
* @param batchResult 수정대상 배치결과model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void updateBatchResult(BatchResult batchResult) throws Exception;
|
||||
|
||||
}
|
||||
@ -0,0 +1,92 @@
|
||||
package egovframework.com.sym.bat.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
|
||||
import egovframework.com.sym.bat.service.BatchOpert;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 배치작업관리에 대한 DAO 클래스를 정의한다.
|
||||
*
|
||||
* @author 김진만
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 17-6-2010 오전 10:27:13
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.06.17 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@Repository("batchOpertDao")
|
||||
public class BatchOpertDao extends EgovComAbstractDAO {
|
||||
|
||||
/**
|
||||
* 배치작업을 삭제한다.
|
||||
*
|
||||
* @param batchOpert 삭제할 배치작업 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void deleteBatchOpert(BatchOpert batchOpert) throws Exception {
|
||||
delete("BatchOpertDao.deleteBatchOpert", batchOpert);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업을 등록한다.
|
||||
*
|
||||
* @param batchOpert 저장할 배치작업 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void insertBatchOpert(BatchOpert batchOpert) throws Exception {
|
||||
insert("BatchOpertDao.insertBatchOpert", batchOpert);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업정보를 상세조회 한다.
|
||||
* @return 배치작업정보
|
||||
*
|
||||
* @param batchOpert 조회할 KEY가 있는 배치작업 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public BatchOpert selectBatchOpert(BatchOpert batchOpert) throws Exception {
|
||||
return (BatchOpert) select("BatchOpertDao.selectBatchOpert", batchOpert);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업정보목록을 조회한다.
|
||||
* @return 배치작업목록
|
||||
*
|
||||
* @param searchVO 조회조건이 저장된 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public List<?> selectBatchOpertList(BatchOpert searchVO) throws Exception {
|
||||
return list("BatchOpertDao.selectBatchOpertList", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업 목록 전체 건수를(을) 조회한다.
|
||||
* @return 목록건수
|
||||
*
|
||||
* @param searchVO 조회할 정보가 담긴 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public int selectBatchOpertListCnt(BatchOpert searchVO) throws Exception {
|
||||
return (Integer) select("BatchOpertDao.selectBatchOpertListCnt", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업정보를 수정한다.
|
||||
*
|
||||
* @param batchOpert 수정대상 배치작업 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void updateBatchOpert(BatchOpert batchOpert) throws Exception {
|
||||
update("BatchOpertDao.updateBatchOpert", batchOpert);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
package egovframework.com.sym.bat.service.impl;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
|
||||
import egovframework.com.sym.bat.service.BatchResult;
|
||||
import egovframework.itgcms.common.ItgMap;
|
||||
import egovframework.itgcms.module.link.service.LinkVO;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 배치결과관리에 대한 DAO 클래스를 정의한다.
|
||||
*
|
||||
* @author 김진만
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 17-6-2010 오전 10:27:13
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.06.17 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@Repository("batchResultDao")
|
||||
public class BatchResultDao extends EgovComAbstractDAO {
|
||||
|
||||
/**
|
||||
* 배치결과을 삭제한다.
|
||||
*
|
||||
* @param batchResult 삭제할 배치결과 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void deleteBatchResult(BatchResult batchResult) throws Exception {
|
||||
delete("BatchResultDao.deleteBatchResult", batchResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과을 등록한다.
|
||||
*
|
||||
* @param batchResult 저장할 배치결과 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void insertBatchResult(BatchResult batchResult) throws Exception {
|
||||
insert("BatchResultDao.insertBatchResult", batchResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과정보를 상세조회 한다.
|
||||
* @return 배치결과정보
|
||||
*
|
||||
* @param batchResult 조회할 KEY가 있는 배치결과 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public BatchResult selectBatchResult(BatchResult batchResult) throws Exception {
|
||||
return (BatchResult) select("BatchResultDao.selectBatchResult", batchResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과정보목록을 조회한다.
|
||||
* @return 배치결과목록
|
||||
*
|
||||
* @param searchVO 조회조건이 저장된 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public List<?> selectBatchResultList(BatchResult searchVO) throws Exception {
|
||||
return list("BatchResultDao.selectBatchResultList", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과 목록 전체 건수를(을) 조회한다.
|
||||
* @return 목록건수
|
||||
*
|
||||
* @param searchVO 조회할 정보가 담긴 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public int selectBatchResultListCnt(BatchResult searchVO) throws Exception {
|
||||
return (Integer) select("BatchResultDao.selectBatchResultListCnt", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과정보를 수정한다.
|
||||
*
|
||||
* @param batchResult 수정대상 배치결과 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void updateBatchResult(BatchResult batchResult) throws Exception {
|
||||
update("BatchResultDao.updateBatchResult", batchResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치 결과 통계 View 조회
|
||||
* @param linkVO
|
||||
* @return List<ItgMap>
|
||||
* @throws SQLException
|
||||
*/
|
||||
public List<ItgMap> selectBatchStatsView(BatchResult searchVO) throws SQLException{
|
||||
return (List<ItgMap>) list("BatchResultDao.selectBatchStatsView", searchVO);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,153 @@
|
||||
package egovframework.com.sym.bat.service.impl;
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
|
||||
import egovframework.com.sym.bat.service.BatchOpert;
|
||||
import egovframework.com.sym.bat.service.BatchSchdul;
|
||||
import egovframework.com.sym.bat.service.BatchSchdulDfk;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 배치스케줄관리에 대한 DAO 클래스를 정의한다.
|
||||
*
|
||||
* @author 김진만
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 17-6-2010 오전 10:27:13
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.06.17 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@Repository("batchSchdulDao")
|
||||
public class BatchSchdulDao extends EgovComAbstractDAO {
|
||||
|
||||
/**
|
||||
* 배치스케줄을 삭제한다.
|
||||
*
|
||||
* @param batchSchdul 삭제할 배치스케줄 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void deleteBatchSchdul(BatchSchdul batchSchdul)
|
||||
throws Exception{
|
||||
// slave 테이블 삭제
|
||||
delete("BatchSchdulDao.deleteBatchSchdulDfk", batchSchdul.getBatchSchdulId());
|
||||
// master 테이블 삭제
|
||||
delete("BatchSchdulDao.deleteBatchSchdul", batchSchdul);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄을 등록한다.
|
||||
*
|
||||
* @param batchSchdul 저장할 배치스케줄 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void insertBatchSchdul(BatchSchdul batchSchdul)
|
||||
throws Exception{
|
||||
// master 테이블 인서트
|
||||
insert("BatchSchdulDao.insertBatchSchdul", batchSchdul);
|
||||
// slave 테이블 인서트
|
||||
if (batchSchdul.getExecutSchdulDfkSes() != null && batchSchdul.getExecutSchdulDfkSes().length != 0) {
|
||||
String batchSchdulId = batchSchdul.getBatchSchdulId();
|
||||
String [] dfkSes = batchSchdul.getExecutSchdulDfkSes();
|
||||
for (int i = 0; i < dfkSes.length; i++) {
|
||||
BatchSchdulDfk batchSchdulDfk = new BatchSchdulDfk();
|
||||
batchSchdulDfk.setBatchSchdulId(batchSchdulId);
|
||||
batchSchdulDfk.setExecutSchdulDfkSe(dfkSes[i]);
|
||||
insert("BatchSchdulDao.insertBatchSchdulDfk", batchSchdulDfk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄정보를 상세조회 한다.
|
||||
* @return 배치스케줄정보
|
||||
*
|
||||
* @param batchSchdul 조회할 KEY가 있는 배치스케줄 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public BatchSchdul selectBatchSchdul(BatchSchdul batchSchdul)
|
||||
throws Exception{
|
||||
BatchSchdul result = (BatchSchdul)select("BatchSchdulDao.selectBatchSchdul", batchSchdul);
|
||||
// 스케줄요일정보를 가져온다.
|
||||
List<BatchSchdulDfk> dfkSeList = (List<BatchSchdulDfk>) list("BatchSchdulDao.selectBatchSchdulDfkList", result.getBatchSchdulId());
|
||||
String [] dfkSes = new String [dfkSeList.size()];
|
||||
for (int j = 0; j < dfkSeList.size(); j++) {
|
||||
dfkSes[j] = dfkSeList.get(j).getExecutSchdulDfkSe();
|
||||
}
|
||||
result.setExecutSchdulDfkSes(dfkSes);
|
||||
// 화면표시용 실행스케줄 속성을 만든다.
|
||||
result.makeExecutSchdul(dfkSeList);
|
||||
|
||||
return result ;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄정보목록을 조회한다.
|
||||
* @return 배치스케줄목록
|
||||
*
|
||||
* @param searchVO 조회조건이 저장된 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<?> selectBatchSchdulList(BatchSchdul searchVO)
|
||||
throws Exception{
|
||||
List<?> resultList = list("BatchSchdulDao.selectBatchSchdulList", searchVO);
|
||||
|
||||
for (int i = 0; i < resultList.size(); i++) {
|
||||
BatchSchdul result = (BatchSchdul) resultList.get(i);
|
||||
// 스케줄요일정보를 가져온다.
|
||||
List<BatchSchdulDfk> dfkSeList = (List<BatchSchdulDfk>) list("BatchSchdulDao.selectBatchSchdulDfkList", result.getBatchSchdulId());
|
||||
String [] dfkSes = new String [dfkSeList.size()];
|
||||
for (int j = 0; j < dfkSeList.size(); j++) {
|
||||
dfkSes[j] = dfkSeList.get(j).getExecutSchdulDfkSe();
|
||||
}
|
||||
result.setExecutSchdulDfkSes(dfkSes);
|
||||
// 화면표시용 실행스케줄 속성을 만든다.
|
||||
result.makeExecutSchdul(dfkSeList);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄 목록 전체 건수를(을) 조회한다.
|
||||
* @return 목록건수
|
||||
*
|
||||
* @param searchVO 조회할 정보가 담긴 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public int selectBatchSchdulListCnt(BatchSchdul searchVO)
|
||||
throws Exception{
|
||||
return (Integer)select("BatchSchdulDao.selectBatchSchdulListCnt", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄정보를 수정한다.
|
||||
*
|
||||
* @param batchSchdul 수정대상 배치스케줄 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
public void updateBatchSchdul(BatchSchdul batchSchdul)
|
||||
throws Exception{
|
||||
update("BatchSchdulDao.updateBatchSchdul", batchSchdul);
|
||||
// slave 테이블 삭제
|
||||
delete("BatchSchdulDao.deleteBatchSchdulDfk", batchSchdul.getBatchSchdulId());
|
||||
// slave 테이블 인서트
|
||||
if (batchSchdul.getExecutSchdulDfkSes() != null && batchSchdul.getExecutSchdulDfkSes().length != 0) {
|
||||
String batchSchdulId = batchSchdul.getBatchSchdulId();
|
||||
String [] dfkSes = batchSchdul.getExecutSchdulDfkSes();
|
||||
for (int i = 0; i < dfkSes.length; i++) {
|
||||
BatchSchdulDfk batchSchdulDfk = new BatchSchdulDfk();
|
||||
batchSchdulDfk.setBatchSchdulId(batchSchdulId);
|
||||
batchSchdulDfk.setExecutSchdulDfkSe(dfkSes[i]);
|
||||
insert("BatchSchdulDao.insertBatchSchdulDfk", batchSchdulDfk);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,108 @@
|
||||
package egovframework.com.sym.bat.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.sym.bat.service.BatchOpert;
|
||||
import egovframework.com.sym.bat.service.EgovBatchOpertService;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 배치작업관리에 대한 ServiceImpl 클래스를 정의한다.
|
||||
*
|
||||
* @author 김진만
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 17-6-2010 오전 10:27:13
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.06.17 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@Service("egovBatchOpertService")
|
||||
public class EgovBatchOpertServiceImpl extends EgovAbstractServiceImpl implements EgovBatchOpertService {
|
||||
|
||||
/**
|
||||
* 배치작업DAO
|
||||
*/
|
||||
@Resource(name = "batchOpertDao")
|
||||
private BatchOpertDao dao;
|
||||
|
||||
/**
|
||||
* 배치작업을 삭제한다.
|
||||
* @param batchOpert 삭제대상 배치작업model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public void deleteBatchOpert(BatchOpert batchOpert) throws Exception {
|
||||
dao.deleteBatchOpert(batchOpert);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업을 등록한다.
|
||||
* @param batchOpert 등록대상 배치작업model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public void insertBatchOpert(BatchOpert batchOpert) throws Exception {
|
||||
dao.insertBatchOpert(batchOpert);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업을 상세조회 한다.
|
||||
* @return 배치작업정보
|
||||
*
|
||||
* @param batchOpert 조회대상 배치작업model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public BatchOpert selectBatchOpert(BatchOpert batchOpert) throws Exception {
|
||||
return dao.selectBatchOpert(batchOpert);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업의 목록을 조회 한다.
|
||||
* @return 배치작업목록
|
||||
*
|
||||
* @param searchVO 조회정보가 담긴 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectBatchOpertList(BatchOpert searchVO) throws Exception {
|
||||
List<?> result = dao.selectBatchOpertList(searchVO);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업 목록 전체 건수를(을) 조회한다.
|
||||
* @return 목록건수
|
||||
*
|
||||
* @param searchVO 조회할 정보가 담긴 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public int selectBatchOpertListCnt(BatchOpert searchVO) throws Exception {
|
||||
int cnt = dao.selectBatchOpertListCnt(searchVO);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업정보를 수정한다.
|
||||
*
|
||||
* @param batchOpert 수정대상 배치작업model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public void updateBatchOpert(BatchOpert batchOpert) throws Exception {
|
||||
dao.updateBatchOpert(batchOpert);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,240 @@
|
||||
package egovframework.com.sym.bat.service.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.sym.bat.service.BatchResult;
|
||||
import egovframework.com.sym.bat.service.EgovBatchResultService;
|
||||
import egovframework.itgcms.common.ItgMap;
|
||||
import egovframework.itgcms.util.CommUtil;
|
||||
import egovframework.itgcms.util.ExcelDownloadView;
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* 배치결과관리에 대한 ServiceImpl 클래스를 정의한다.
|
||||
*
|
||||
* @author 김진만
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 17-6-2010 오전 10:27:13
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.06.17 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@Service("egovBatchResultService")
|
||||
public class EgovBatchResultServiceImpl extends EgovAbstractServiceImpl implements EgovBatchResultService {
|
||||
|
||||
/**
|
||||
* 배치결과DAO
|
||||
*/
|
||||
@Resource(name = "batchResultDao")
|
||||
private BatchResultDao dao;
|
||||
|
||||
/**
|
||||
* 배치결과을 삭제한다.
|
||||
* @param batchResult 삭제대상 배치결과model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public void deleteBatchResult(BatchResult batchResult) throws Exception {
|
||||
dao.deleteBatchResult(batchResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과을 상세조회 한다.
|
||||
* @return 배치결과정보
|
||||
*
|
||||
* @param batchResult 조회대상 배치결과model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public BatchResult selectBatchResult(BatchResult batchResult) throws Exception {
|
||||
return dao.selectBatchResult(batchResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과의 목록을 조회 한다.
|
||||
* @return 배치결과목록
|
||||
*
|
||||
* @param searchVO 조회정보가 담긴 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectBatchResultList(BatchResult searchVO) throws Exception {
|
||||
List<?> result = dao.selectBatchResultList(searchVO);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄 목록 전체 건수를(을) 조회한다.
|
||||
* @return 목록건수
|
||||
*
|
||||
* @param searchVO 조회할 정보가 담긴 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public int selectBatchResultListCnt(BatchResult searchVO) throws Exception {
|
||||
int cnt = dao.selectBatchResultListCnt(searchVO);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List EgovBatchStatsView(BatchResult searchVO, ModelMap model, HttpServletRequest request, HttpServletResponse response) throws SQLException, IOException {
|
||||
//배치 결과 통계 List 조회 서비스 구현
|
||||
if("".equals(searchVO.getSchOption())){
|
||||
searchVO.setSchOption("DAY_M");
|
||||
}
|
||||
|
||||
String schDate = CommUtil.isNull(searchVO.getSchDate(), "");
|
||||
if("".equals(schDate)){
|
||||
schDate = CommUtil.getDatePattern("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
String date = CommUtil.getDateforStat(schDate, searchVO.getSchOption());
|
||||
|
||||
searchVO.setSchDateFrom(date);
|
||||
searchVO.setSchDateEnd(date);
|
||||
|
||||
String dateArr[] = date.split("-");
|
||||
// String dateEndArr[] = dateEnd.split("-");
|
||||
|
||||
if("DAY_M".equals(searchVO.getSchOption())) {
|
||||
|
||||
searchVO.setCntOption("DAY");
|
||||
searchVO.setCntYear(dateArr[0]);
|
||||
searchVO.setCntMonth(dateArr[1]);
|
||||
searchVO.setSchDate(dateArr[0]+"-"+dateArr[1]);
|
||||
searchVO.setStartDate(dateArr[0]+"-"+dateArr[1]);
|
||||
searchVO.setEndDate(dateArr[0]+"-"+dateArr[1]);
|
||||
|
||||
} else if("MONTH".equals(searchVO.getSchOption())) {
|
||||
|
||||
searchVO.setCntOption("MONTH");
|
||||
// searchVO.setStartDate(dateArr[0]);
|
||||
//// int lastDate = Integer.parseInt(dateEndArr[0])+1;
|
||||
// int lastDate = Integer.parseInt(dateArr[0]);
|
||||
// String lastDateStr = "";
|
||||
// if(lastDate<10){
|
||||
// lastDateStr += "0"+lastDate;
|
||||
// } else {
|
||||
// lastDateStr += lastDate;
|
||||
// }
|
||||
// searchVO.setEndDate(lastDateStr);
|
||||
|
||||
searchVO.setCntYear(dateArr[0]);
|
||||
searchVO.setSchDate(dateArr[0]);
|
||||
searchVO.setStartDate(dateArr[0]);
|
||||
searchVO.setEndDate(dateArr[0]);
|
||||
|
||||
} else if("YEAR".equals(searchVO.getSchOption())) {
|
||||
|
||||
searchVO.setCntOption("YEAR");
|
||||
searchVO.setCntYear(dateArr[0]);
|
||||
searchVO.setSchDate(dateArr[0]);
|
||||
searchVO.setStartDate(dateArr[0]);
|
||||
searchVO.setEndDate(dateArr[0]);
|
||||
}
|
||||
|
||||
List<ItgMap> resultList = dao.selectBatchStatsView(searchVO);
|
||||
|
||||
model.addAttribute("resultList", resultList);
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView EgovBatchStatsExcelDown(BatchResult searchVO, HttpServletRequest request) throws SQLException, IOException {
|
||||
//배치 결과 통계 엑셀 다운로드 서비스 구현
|
||||
ModelAndView mav = new ModelAndView(ExcelDownloadView.EXCEL_DOWN);
|
||||
|
||||
Map paramMap = CommUtil.getParameterMap(request);
|
||||
|
||||
/************************ S: 출력목록 ************************/
|
||||
if("".equals(searchVO.getSchOption())){
|
||||
searchVO.setSchOption("DAY_M");
|
||||
}
|
||||
|
||||
String schDate = CommUtil.isNull(searchVO.getSchDate(), "");
|
||||
if("".equals(schDate)){
|
||||
schDate = CommUtil.getDatePattern("yyyy-MM-dd");
|
||||
}
|
||||
|
||||
String date = CommUtil.getDateforStat(schDate, searchVO.getSchOption());
|
||||
String cntOptName = "";
|
||||
String cntOptTitle = "";
|
||||
|
||||
String dateArr[] = date.split("-");
|
||||
|
||||
if("DAY_M".equals(searchVO.getSchOption())) {
|
||||
|
||||
cntOptName = "일단위";
|
||||
cntOptTitle = "일자";
|
||||
searchVO.setCntOption("DAY");
|
||||
searchVO.setCntYear(dateArr[0]);
|
||||
searchVO.setCntMonth(dateArr[1]);
|
||||
searchVO.setSchDate(dateArr[0]+"-"+dateArr[1]);
|
||||
searchVO.setStartDate(dateArr[0]+"-"+dateArr[1]);
|
||||
searchVO.setEndDate(dateArr[0]+"-"+dateArr[1]);
|
||||
|
||||
} else if("MONTH".equals(searchVO.getSchOption())) {
|
||||
|
||||
cntOptName = "월단위";
|
||||
cntOptTitle = "월";
|
||||
searchVO.setCntOption("MONTH");
|
||||
searchVO.setCntYear(dateArr[0]);
|
||||
searchVO.setSchDate(dateArr[0]);
|
||||
searchVO.setStartDate(dateArr[0]);
|
||||
searchVO.setEndDate(dateArr[0]);
|
||||
|
||||
} else if("YEAR".equals(searchVO.getSchOption())) {
|
||||
|
||||
cntOptName = "년단위";
|
||||
cntOptTitle = "년";
|
||||
searchVO.setCntOption("YEAR");
|
||||
searchVO.setCntYear(dateArr[0]);
|
||||
searchVO.setSchDate(dateArr[0]);
|
||||
searchVO.setStartDate(dateArr[0]);
|
||||
searchVO.setEndDate(dateArr[0]);
|
||||
}
|
||||
|
||||
List<ItgMap> resultList = dao.selectBatchStatsView(searchVO);
|
||||
/************************ E: 출력목록 ************************/
|
||||
|
||||
/************************ S: 엑셀출력목록저장 ************************/
|
||||
paramMap.put("dataList", resultList);
|
||||
paramMap.put("cntOption", searchVO.getCntOption());
|
||||
//시작일~종료일
|
||||
paramMap.put("startDate", date);
|
||||
paramMap.put("endDate", date);
|
||||
paramMap.put("schDate", date);
|
||||
paramMap.put("cntOptName", cntOptName);
|
||||
paramMap.put("cntOptTitle", cntOptTitle);
|
||||
|
||||
//엑셀 템플릿에 넘겨줄 데이타
|
||||
mav.addObject("data", paramMap);
|
||||
|
||||
//다운로드에 사용되어질 엑셀파일 템플릿
|
||||
mav.addObject(ExcelDownloadView.DOWN_EXCEL_TEMPLATE, CommUtil.getExcelTemplateName(request, "mngr"));
|
||||
|
||||
//다운로드시 표시될 파일명 (확장자는 자동으로 xls로 지정된다.)
|
||||
mav.addObject(ExcelDownloadView.DOWN_FILE_NM, "배치 결과 통계("+searchVO.getCntOption()+")_"+ CommUtil.getDatePattern("yyyy-MM-dd"));
|
||||
|
||||
return mav;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,135 @@
|
||||
package egovframework.com.sym.bat.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.sym.bat.service.BatchResult;
|
||||
import egovframework.com.sym.bat.service.BatchSchdul;
|
||||
import egovframework.com.sym.bat.service.EgovBatchSchdulService;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 배치스케줄관리에 대한 ServiceImpl 클래스를 정의한다.
|
||||
*
|
||||
* @author 김진만
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 17-6-2010 오전 10:27:13
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.06.17 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@Service("egovBatchSchdulService")
|
||||
public class EgovBatchSchdulServiceImpl extends EgovAbstractServiceImpl implements EgovBatchSchdulService {
|
||||
|
||||
/**
|
||||
* 배치스케줄DAO
|
||||
*/
|
||||
@Resource(name = "batchSchdulDao")
|
||||
private BatchSchdulDao batchSchdulDao;
|
||||
|
||||
/**
|
||||
* 배치결과DAO
|
||||
*/
|
||||
@Resource(name = "batchResultDao")
|
||||
private BatchResultDao batchResultDao;
|
||||
|
||||
/**
|
||||
* 배치스케줄을 삭제한다.
|
||||
* @param batchSchdul 삭제대상 배치스케줄model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public void deleteBatchSchdul(BatchSchdul batchSchdul) throws Exception {
|
||||
batchSchdulDao.deleteBatchSchdul(batchSchdul);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄을 등록한다.
|
||||
* @param batchSchdul 등록대상 배치스케줄model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public void insertBatchSchdul(BatchSchdul batchSchdul) throws Exception {
|
||||
batchSchdulDao.insertBatchSchdul(batchSchdul);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄을 상세조회 한다.
|
||||
* @return 배치스케줄정보
|
||||
*
|
||||
* @param batchSchdul 조회대상 배치스케줄model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public BatchSchdul selectBatchSchdul(BatchSchdul batchSchdul) throws Exception {
|
||||
return batchSchdulDao.selectBatchSchdul(batchSchdul);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄의 목록을 조회 한다.
|
||||
* @return 배치스케줄목록
|
||||
*
|
||||
* @param searchVO 조회정보가 담긴 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectBatchSchdulList(BatchSchdul searchVO) throws Exception {
|
||||
List<?> result = batchSchdulDao.selectBatchSchdulList(searchVO);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄 목록 전체 건수를(을) 조회한다.
|
||||
* @return 목록건수
|
||||
*
|
||||
* @param searchVO 조회할 정보가 담긴 VO
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public int selectBatchSchdulListCnt(BatchSchdul searchVO) throws Exception {
|
||||
int cnt = batchSchdulDao.selectBatchSchdulListCnt(searchVO);
|
||||
return cnt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄정보를 수정한다.
|
||||
*
|
||||
* @param batchSchdul 수정대상 배치스케줄model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public void updateBatchSchdul(BatchSchdul batchSchdul) throws Exception {
|
||||
batchSchdulDao.updateBatchSchdul(batchSchdul);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과를 등록한다.
|
||||
* @param batchResult 등록대상 배치결과model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public void insertBatchResult(BatchResult batchResult) throws Exception {
|
||||
batchResultDao.insertBatchResult(batchResult);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과정보를 수정한다.
|
||||
*
|
||||
* @param batchResult 수정대상 배치결과model
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@Override
|
||||
public void updateBatchResult(BatchResult batchResult) throws Exception {
|
||||
batchResultDao.updateBatchResult(batchResult);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package egovframework.com.sym.bat.validation;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import egovframework.com.sym.bat.service.BatchOpert;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.validation.Errors;
|
||||
import org.springframework.validation.Validator;
|
||||
|
||||
/**
|
||||
* BatchOpert클래스에대한 validator 클래스.
|
||||
* common validator가 처리하지 못하는 부분 검사.
|
||||
*
|
||||
* @author 김진만
|
||||
* @version 1.0
|
||||
* @see
|
||||
* <pre>
|
||||
* == 개정이력(Modification Information) ==
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.08.20 김진만 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@Component("batchOpertValidator")
|
||||
public class BatchOpertValidator implements Validator {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.validation.Validator#supports(java.lang.Class)
|
||||
*/
|
||||
@Override
|
||||
public boolean supports(Class<?> clazz) {
|
||||
return BatchOpert.class.isAssignableFrom(clazz);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.validation.Validator#validate(java.lang.Object, org.springframework.validation.Errors)
|
||||
*/
|
||||
@Override
|
||||
public void validate(Object obj, Errors errors) {
|
||||
// 배치프로그램으로 지정된 값이 파일로 존재하는지 검사한다.
|
||||
BatchOpert batchOpert = (BatchOpert) obj;
|
||||
File file = new File(batchOpert.getBatchProgrm());
|
||||
|
||||
try {
|
||||
if (!file.exists()) {
|
||||
errors.rejectValue("batchProgrm", "errors.batchProgrm", new Object[] { batchOpert.getBatchProgrm() }, "배치프로그램 {0}이 존재하지 않습니다.");
|
||||
return;
|
||||
}
|
||||
if (!file.isFile()) {
|
||||
errors.rejectValue("batchProgrm", "errors.batchProgrm", new Object[] { batchOpert.getBatchProgrm() }, "배치프로그램 {0}이 파일이 아닙니다.");
|
||||
return;
|
||||
}
|
||||
} catch (SecurityException se) {
|
||||
errors.rejectValue("batchProgrm", "errors.batchProgrm", new Object[] { batchOpert.getBatchProgrm() }, " 배치프로그램 {0}에 접근할 수 없습니다. 파일접근권한을 확인하세요.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,276 @@
|
||||
package egovframework.com.sym.bat.web;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.EgovMessageSource;
|
||||
import egovframework.com.cmm.LoginVO;
|
||||
import egovframework.com.cmm.annotation.IncludedInfo;
|
||||
import egovframework.com.cmm.util.EgovUserDetailsHelper;
|
||||
import egovframework.com.sym.bat.service.BatchOpert;
|
||||
import egovframework.com.sym.bat.service.EgovBatchOpertService;
|
||||
import egovframework.com.sym.bat.validation.BatchOpertValidator;
|
||||
import egovframework.itgcms.util.CommUtil;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springmodules.validation.commons.DefaultBeanValidator;
|
||||
|
||||
/**
|
||||
* 배치작업관리에 대한 controller 클래스를 정의한다.
|
||||
*
|
||||
* 배치작업관리에 대한 등록, 수정, 삭제, 조회 기능을 제공한다.
|
||||
* 배치작업관리의 조회기능은 목록조회, 상세조회로 구분된다.
|
||||
* @author sanguri
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 2018-10-05
|
||||
*/
|
||||
|
||||
@Controller
|
||||
public class EgovBatchOpertController {
|
||||
|
||||
/** egovBatchOpertService */
|
||||
@Resource(name = "egovBatchOpertService")
|
||||
private EgovBatchOpertService egovBatchOpertService;
|
||||
|
||||
/* Property 서비스 */
|
||||
@Resource(name = "propertiesService")
|
||||
private EgovPropertyService propertyService;
|
||||
|
||||
/* 메세지 서비스 */
|
||||
@Resource(name = "egovMessageSource")
|
||||
private EgovMessageSource egovMessageSource;
|
||||
|
||||
/* common validator */
|
||||
@Autowired
|
||||
private DefaultBeanValidator beanValidator;
|
||||
|
||||
/* batchOpert bean validator */
|
||||
@Resource(name = "batchOpertValidator")
|
||||
private BatchOpertValidator batchOpertValidator;
|
||||
|
||||
/** ID Generation */
|
||||
@Resource(name = "egovBatchOpertIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
/** logger */
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovBatchOpertController.class);
|
||||
|
||||
/**
|
||||
* 배치작업을 삭제한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchOpert 삭제대상 배치작업model
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/deleteBatchOpert.do")
|
||||
public String deleteBatchOpert(BatchOpert batchOpert, ModelMap model) throws Exception {
|
||||
|
||||
batchOpert.setDelmemid("SYSTEM");
|
||||
|
||||
egovBatchOpertService.deleteBatchOpert(batchOpert);
|
||||
|
||||
// return "forward:/_mngr_/bat/getBatchOpertList.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "삭제 되었습니다", "/_mngr_/bat/getBatchOpertList.do");
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업을 등록한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchOpert 등록대상 배치작업model
|
||||
* @param bindingResult BindingResult
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/addBatchOpert.do")
|
||||
public String insertBatchOpert(BatchOpert batchOpert, BindingResult bindingResult, ModelMap model) throws Exception {
|
||||
|
||||
beanValidator.validate(batchOpert, bindingResult);
|
||||
|
||||
if(batchOpert.getBatchOpertDiv().equals("2")){//배치작업구분 1:메소드, 2:배치프로그램
|
||||
batchOpertValidator.validate(batchOpert, bindingResult);//파일 validate
|
||||
} else {
|
||||
batchOpert.setBatchProgrm(batchOpert.getBatchPackage());
|
||||
batchOpert.setParamtr(batchOpert.getBatchMethod());
|
||||
}
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
return "itgcms/global/module/bat/EgovBatchOpertRegist";
|
||||
} else {
|
||||
batchOpert.setBatchOpertId(idgenService.getNextStringId());
|
||||
//아이디 설정
|
||||
batchOpert.setRegmemid("SYSTEM");
|
||||
batchOpert.setUpdmemid("SYSTEM");
|
||||
|
||||
egovBatchOpertService.insertBatchOpert(batchOpert);
|
||||
//Exception 없이 진행시 등록성공메시지
|
||||
}
|
||||
// return "forward:/_mngr_/bat/getBatchOpertList.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "저장 되었습니다", "/_mngr_/bat/getBatchOpertList.do");
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업정보을 상세조회한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchOpert 조회대상 배치작업model
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/getBatchOpert.do")
|
||||
public String selectBatchOpert(@ModelAttribute("searchVO") BatchOpert batchOpert, ModelMap model) throws Exception {
|
||||
LOGGER.debug(" 조회조건 : {}", batchOpert);
|
||||
BatchOpert result = egovBatchOpertService.selectBatchOpert(batchOpert);
|
||||
model.addAttribute("resultInfo", result);
|
||||
LOGGER.debug(" 결과값 : {}", result);
|
||||
|
||||
return "itgcms/global/module/bat/EgovBatchOpertDetail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 등록화면을 위한 배치작업정보을 조회한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchOpert 조회대상 배치작업model
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/getBatchOpertForRegist.do")
|
||||
public String selectBatchOpertForRegist(@ModelAttribute("searchVO") BatchOpert batchOpert, ModelMap model) throws Exception {
|
||||
model.addAttribute("batchOpert", batchOpert);
|
||||
|
||||
return "itgcms/global/module/bat/EgovBatchOpertRegist";
|
||||
}
|
||||
|
||||
/**
|
||||
* 수정화면을 위한 배치작업정보을 조회한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchOpert 조회대상 배치작업model
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/getBatchOpertForUpdate.do")
|
||||
public String selectBatchOpertForUpdate(@ModelAttribute("searchVO") BatchOpert batchOpert, ModelMap model) throws Exception {
|
||||
LOGGER.debug(" 조회조건 : {}", batchOpert);
|
||||
BatchOpert result = egovBatchOpertService.selectBatchOpert(batchOpert);
|
||||
|
||||
if(result.getBatchOpertDiv().equals("1")){//배치작업구분 1:메소드, 2:배치프로그램
|
||||
result.setBatchPackage(result.getBatchProgrm());
|
||||
result.setBatchMethod(result.getParamtr());
|
||||
}
|
||||
|
||||
model.addAttribute("batchOpert", result);
|
||||
LOGGER.debug(" 결과값 : {}", result);
|
||||
|
||||
return "itgcms/global/module/bat/EgovBatchOpertUpdt";
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업 목록을 조회한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param searchVO 목록조회조건VO
|
||||
* @param model ModelMap
|
||||
* @param popupAt 팝업여부
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@IncludedInfo(name = "배치작업관리", listUrl = "/_mngr_/bat/getBatchOpertList.do", order = 1120, gid = 60)
|
||||
@RequestMapping("/_mngr_/bat/getBatchOpertList.do")
|
||||
public String selectBatchOpertList(@ModelAttribute("searchVO") BatchOpert searchVO, ModelMap model, @RequestParam(value = "popupAt", required = false) String popupAt)
|
||||
throws Exception {
|
||||
searchVO.setPageUnit(propertyService.getInt("pageUnit"));
|
||||
searchVO.setPageSize(propertyService.getInt("pageSize"));
|
||||
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
|
||||
paginationInfo.setPageSize(searchVO.getPageSize());
|
||||
|
||||
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
List<BatchOpert> resultList = (List<BatchOpert>) egovBatchOpertService.selectBatchOpertList(searchVO);
|
||||
int totCnt = egovBatchOpertService.selectBatchOpertListCnt(searchVO);
|
||||
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
|
||||
model.addAttribute("resultList", resultList);
|
||||
model.addAttribute("resultCnt", totCnt);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
|
||||
if ("Y".equals(popupAt)) {
|
||||
// Popup 화면이면
|
||||
return "itgcms/global/module/bat/EgovBatchOpertListPopup";
|
||||
} else {
|
||||
// 메인화면 호출이면
|
||||
return "itgcms/global/module/bat/EgovBatchOpertList";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업을 수정한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchOpert 수정대상 배치작업model
|
||||
* @param bindingResult BindingResult
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/updateBatchOpert.do")
|
||||
public String updateBatchOpert(BatchOpert batchOpert, BindingResult bindingResult, ModelMap model) throws Exception {
|
||||
|
||||
beanValidator.validate(batchOpert, bindingResult);
|
||||
|
||||
if(batchOpert.getBatchOpertDiv().equals("2")){//배치작업구분 1:메소드, 2:배치프로그램
|
||||
batchOpertValidator.validate(batchOpert, bindingResult);//파일 validate
|
||||
} else {
|
||||
batchOpert.setBatchProgrm(batchOpert.getBatchPackage());
|
||||
batchOpert.setParamtr(batchOpert.getBatchMethod());
|
||||
}
|
||||
|
||||
if (bindingResult.hasErrors()) {
|
||||
model.addAttribute("batchOpert", batchOpert);
|
||||
return "itgcms/global/module/bat/EgovBatchOpertUpdt";
|
||||
}
|
||||
|
||||
// 정보 업데이트
|
||||
batchOpert.setUpdmemid("SYSTEM");
|
||||
egovBatchOpertService.updateBatchOpert(batchOpert);
|
||||
|
||||
model.addAttribute("batchOpert", batchOpert);
|
||||
|
||||
//return "forward:/_mngr_/bat/getBatchOpert.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "수정 되었습니다", "/_mngr_/bat/getBatchOpert.do");
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치작업 조회팝업을 실행한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param searchVO 목록조회조건VO
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/getBatchOpertListPopup.do")
|
||||
public String openPopupWindow(@ModelAttribute("searchVO") BatchOpert searchVO, ModelMap model) throws Exception {
|
||||
return "itgcms/global/module/bat/EgovBatchOpertListPopupFrame";
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,166 @@
|
||||
package egovframework.com.sym.bat.web;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.EgovMessageSource;
|
||||
import egovframework.com.cmm.annotation.IncludedInfo;
|
||||
import egovframework.com.cmm.util.EgovUserDetailsHelper;
|
||||
import egovframework.com.sym.bat.service.BatchResult;
|
||||
import egovframework.com.sym.bat.service.EgovBatchResultService;
|
||||
import egovframework.itgcms.common.ItgMap;
|
||||
import egovframework.itgcms.module.link.service.LinkVO;
|
||||
import egovframework.itgcms.util.CommUtil;
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
* 배치결과관리에 대한 controller 클래스
|
||||
*
|
||||
* @author sanguri
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 2018-10-11
|
||||
*/
|
||||
|
||||
@Controller
|
||||
public class EgovBatchResultController {
|
||||
|
||||
/** egovBatchResultService */
|
||||
@Resource(name = "egovBatchResultService")
|
||||
private EgovBatchResultService egovBatchResultService;
|
||||
|
||||
/* Property 서비스 */
|
||||
@Resource(name = "propertiesService")
|
||||
private EgovPropertyService propertyService;
|
||||
|
||||
/* 메세지 서비스 */
|
||||
@Resource(name = "egovMessageSource")
|
||||
private EgovMessageSource egovMessageSource;
|
||||
|
||||
/** logger */
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovBatchResultController.class);
|
||||
|
||||
/**
|
||||
* 배치결과을 삭제한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchResult 삭제대상 배치결과model
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/deleteBatchResult.do")
|
||||
public String deleteBatchResult(BatchResult batchResult, ModelMap model) throws Exception {
|
||||
|
||||
batchResult.setDelmemid("SYSTEM");
|
||||
|
||||
egovBatchResultService.deleteBatchResult(batchResult);
|
||||
|
||||
// return "forward:/_mngr_/bat/getBatchResultList.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "삭제 되었습니다", "/_mngr_/bat/getBatchResultList.do");
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과정보을 상세조회한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchResult 조회대상 배치결과model
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/getBatchResult.do")
|
||||
public String selectBatchResult(@ModelAttribute("searchVO") BatchResult batchResult, ModelMap model) throws Exception {
|
||||
LOGGER.debug(" 조회조건 : {}", batchResult);
|
||||
BatchResult result = egovBatchResultService.selectBatchResult(batchResult);
|
||||
model.addAttribute("resultInfo", result);
|
||||
LOGGER.debug(" 결과값 : {}", result);
|
||||
|
||||
return "itgcms/global/module/bat/EgovBatchResultDetail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치결과 목록을 조회한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param searchVO 목록조회조건VO
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@IncludedInfo(name = "배치결과관리", listUrl = "/_mngr_/bat/getBatchResultList.do", order = 1130, gid = 60)
|
||||
@RequestMapping("/_mngr_/bat/getBatchResultList.do")
|
||||
public String selectBatchResultList(@ModelAttribute("searchVO") BatchResult searchVO, ModelMap model) throws Exception {
|
||||
searchVO.setPageUnit(propertyService.getInt("pageUnit"));
|
||||
searchVO.setPageSize(propertyService.getInt("pageSize"));
|
||||
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
|
||||
paginationInfo.setPageSize(searchVO.getPageSize());
|
||||
|
||||
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
List<BatchResult> resultList = (List<BatchResult>) egovBatchResultService.selectBatchResultList(searchVO);
|
||||
int totCnt = egovBatchResultService.selectBatchResultListCnt(searchVO);
|
||||
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
|
||||
model.addAttribute("resultList", resultList);
|
||||
model.addAttribute("resultCnt", totCnt);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
|
||||
return "itgcms/global/module/bat/EgovBatchResultList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치 결과 통계 view 서비스 구현
|
||||
* @param searchVO
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
* @return String
|
||||
* @throws IOException
|
||||
* @throws SQLException
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
@RequestMapping(value = "/_mngr_/bat/EgovBatchStatsView.do")
|
||||
public String EgovBatchStatsView(@ModelAttribute("searchVO") BatchResult searchVO, ModelMap model,
|
||||
HttpServletRequest request, HttpServletResponse response) throws IOException, SQLException, RuntimeException {
|
||||
|
||||
List resultList = egovBatchResultService.EgovBatchStatsView(searchVO, model, request, response);
|
||||
|
||||
model.addAttribute("resultList", resultList);
|
||||
|
||||
return "itgcms/global/module/bat/EgovBatchStatsView";
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치 결과 통계 엑셀 다운로드 서비스 구현
|
||||
* @param searchVO
|
||||
* @param request
|
||||
* @return ModelAndView
|
||||
* @throws IOException
|
||||
* @throws SQLException
|
||||
* @throws RuntimeException
|
||||
*/
|
||||
@RequestMapping(value = "/_mngr_/bat/mngrBatchStatsExcelDown.do")
|
||||
public ModelAndView EgovBatchStatsExcelDown(@ModelAttribute("searchVO") BatchResult searchVO, HttpServletRequest request) throws IOException, SQLException, RuntimeException {
|
||||
|
||||
return egovBatchResultService.EgovBatchStatsExcelDown(searchVO, request);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,322 @@
|
||||
package egovframework.com.sym.bat.web;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultCodeVO;
|
||||
import egovframework.com.cmm.EgovMessageSource;
|
||||
import egovframework.com.cmm.LoginVO;
|
||||
import egovframework.com.cmm.annotation.IncludedInfo;
|
||||
import egovframework.com.cmm.service.CmmnDetailCode;
|
||||
import egovframework.com.cmm.service.EgovCmmUseService;
|
||||
import egovframework.com.cmm.util.EgovUserDetailsHelper;
|
||||
import egovframework.com.sym.bat.service.BatchSchdul;
|
||||
import egovframework.com.sym.bat.service.BatchScheduler;
|
||||
import egovframework.com.sym.bat.service.EgovBatchSchdulService;
|
||||
import egovframework.itgcms.util.CommUtil;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springmodules.validation.commons.DefaultBeanValidator;
|
||||
|
||||
/**
|
||||
* 배치스케줄관리에 대한 controller 클래스
|
||||
*
|
||||
* @author sanguri
|
||||
* @since 2010.06.17
|
||||
* @version 1.0
|
||||
* @updated 2018-10-10
|
||||
*/
|
||||
|
||||
@Controller
|
||||
public class EgovBatchSchdulController {
|
||||
|
||||
/** egovBatchSchdulService */
|
||||
@Resource(name = "egovBatchSchdulService")
|
||||
private EgovBatchSchdulService egovBatchSchdulService;
|
||||
|
||||
/* Property 서비스 */
|
||||
@Resource(name = "propertiesService")
|
||||
private EgovPropertyService propertyService;
|
||||
|
||||
/* 메세지 서비스 */
|
||||
@Resource(name = "egovMessageSource")
|
||||
private EgovMessageSource egovMessageSource;
|
||||
|
||||
/* common validator */
|
||||
@Autowired
|
||||
private DefaultBeanValidator beanValidator;
|
||||
|
||||
/** ID Generation */
|
||||
@Resource(name = "egovBatchSchdulIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
/** cmmUseService */
|
||||
@Resource(name = "EgovCmmUseService")
|
||||
private EgovCmmUseService cmmUseService;
|
||||
|
||||
/** 배치스케줄러 서비스 */
|
||||
@Resource(name = "batchScheduler")
|
||||
private BatchScheduler batchScheduler;
|
||||
|
||||
/** logger */
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovBatchSchdulController.class);
|
||||
|
||||
/**
|
||||
* 배치스케줄을 삭제한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchSchdul 삭제대상 배치스케줄model
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/deleteBatchSchdul.do")
|
||||
public String deleteBatchSchdul(BatchSchdul batchSchdul, ModelMap model) throws Exception {
|
||||
|
||||
batchSchdul.setDelmemid("SYSTEM");
|
||||
|
||||
// 배치스케줄러에 스케줄정보반영
|
||||
batchScheduler.deleteBatchSchdul(batchSchdul);
|
||||
|
||||
egovBatchSchdulService.deleteBatchSchdul(batchSchdul);
|
||||
|
||||
// return "forward:/_mngr_/bat/getBatchSchdulList.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "삭제 되었습니다", "/_mngr_/bat/getBatchSchdulList.do");
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄을 등록한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchSchdul 등록대상 배치스케줄model
|
||||
* @param bindingResult BindingResult
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/addBatchSchdul.do")
|
||||
public String insertBatchSchdul(BatchSchdul batchSchdul, BindingResult bindingResult, ModelMap model) throws Exception {
|
||||
LOGGER.debug(" 인서트 대상정보 : {}", batchSchdul);
|
||||
|
||||
beanValidator.validate(batchSchdul, bindingResult);
|
||||
if (bindingResult.hasErrors()) {
|
||||
referenceData(model);
|
||||
return "itgcms/global/module/bat/EgovBatchSchdulRegist";
|
||||
} else {
|
||||
batchSchdul.setBatchSchdulId(idgenService.getNextStringId());
|
||||
//아이디 설정
|
||||
batchSchdul.setRegmemid("SYSTEM");
|
||||
batchSchdul.setUpdmemid("SYSTEM");
|
||||
|
||||
if(batchSchdul.getExecutCycle().equals("06")){
|
||||
batchSchdul.setExecutSchdulMnt("/"+batchSchdul.getExecutSchdulMnt());
|
||||
}
|
||||
if(batchSchdul.getExecutCycle().equals("07")){
|
||||
batchSchdul.setExecutSchdulSecnd("/"+batchSchdul.getExecutSchdulSecnd());
|
||||
}
|
||||
egovBatchSchdulService.insertBatchSchdul(batchSchdul);
|
||||
|
||||
// 배치스케줄러에 스케줄정보반영
|
||||
BatchSchdul target = egovBatchSchdulService.selectBatchSchdul(batchSchdul);
|
||||
batchScheduler.insertBatchSchdul(target);
|
||||
}
|
||||
// return "forward:/_mngr_/bat/getBatchSchdulList.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "저장 되었습니다", "/_mngr_/bat/getBatchSchdulList.do");
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄정보을 상세조회한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchSchdul 조회대상 배치스케줄model
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/getBatchSchdul.do")
|
||||
public String selectBatchSchdul(@ModelAttribute("searchVO") BatchSchdul batchSchdul, ModelMap model) throws Exception {
|
||||
LOGGER.debug(" 조회조건 : {}", batchSchdul);
|
||||
|
||||
BatchSchdul result = egovBatchSchdulService.selectBatchSchdul(batchSchdul);
|
||||
|
||||
model.addAttribute("resultInfo", result);
|
||||
LOGGER.debug(" 결과값 : {}", result);
|
||||
|
||||
return "itgcms/global/module/bat/EgovBatchSchdulDetail";
|
||||
}
|
||||
|
||||
/**
|
||||
* 등록화면을 위한 배치스케줄정보을 조회한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchSchdul 조회대상 배치스케줄model
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/getBatchSchdulForRegist.do")
|
||||
public String selectBatchSchdulForRegist(@ModelAttribute("searchVO") BatchSchdul batchSchdul, ModelMap model) throws Exception {
|
||||
referenceData(model);
|
||||
|
||||
model.addAttribute("batchSchdul", batchSchdul);
|
||||
|
||||
return "itgcms/global/module/bat/EgovBatchSchdulRegist";
|
||||
}
|
||||
|
||||
/**
|
||||
* 수정화면을 위한 배치스케줄정보을 조회한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchSchdul 조회대상 배치스케줄model
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/getBatchSchdulForUpdate.do")
|
||||
public String selectBatchSchdulForUpdate(@ModelAttribute("searchVO") BatchSchdul batchSchdul, ModelMap model) throws Exception {
|
||||
referenceData(model);
|
||||
|
||||
LOGGER.debug(" 조회조건 : {}", batchSchdul);
|
||||
BatchSchdul result = egovBatchSchdulService.selectBatchSchdul(batchSchdul);
|
||||
if(result.getExecutCycle().equals("06")){//분간격
|
||||
result.setExecutSchdulMnt(result.getExecutSchdulMnt().substring(1));
|
||||
}
|
||||
if(result.getExecutCycle().equals("07")){//초간격
|
||||
result.setExecutSchdulSecnd(result.getExecutSchdulSecnd().substring(1));
|
||||
}
|
||||
model.addAttribute("batchSchdul", result);
|
||||
LOGGER.debug(" 결과값 : {}", result);
|
||||
|
||||
return "itgcms/global/module/bat/EgovBatchSchdulUpdt";
|
||||
}
|
||||
|
||||
/**
|
||||
* Reference Data 를 설정한다.
|
||||
* @param model 화면용spring Model객체
|
||||
* @throws Exception
|
||||
*/
|
||||
private void referenceData(ModelMap model) throws Exception {
|
||||
ComDefaultCodeVO vo = new ComDefaultCodeVO();
|
||||
//DBMS종류코드목록을 코드정보로부터 조회
|
||||
vo.setCodeId("COM047");
|
||||
List<CmmnDetailCode> executCycleList = cmmUseService.selectCmmCodeDetail(vo);
|
||||
model.addAttribute("executCycleList", executCycleList);
|
||||
//요일구분코드목록을 코드정보로부터 조회
|
||||
vo.setCodeId("COM074");
|
||||
List<CmmnDetailCode> executSchdulDfkSeList = cmmUseService.selectCmmCodeDetail(vo);
|
||||
model.addAttribute("executSchdulDfkSeList", executSchdulDfkSeList);
|
||||
|
||||
// 실행스케줄 시, 분, 초 값 설정.
|
||||
Map<String, String> executSchdulHourList = new LinkedHashMap<String, String>();
|
||||
for (int i = 0; i < 24; i++) {
|
||||
if (i < 10) {
|
||||
executSchdulHourList.put("0" + Integer.toString(i), "0" + Integer.toString(i));
|
||||
} else {
|
||||
executSchdulHourList.put(Integer.toString(i), Integer.toString(i));
|
||||
}
|
||||
}
|
||||
model.addAttribute("executSchdulHourList", executSchdulHourList);
|
||||
Map<String, String> executSchdulMntList = new LinkedHashMap<String, String>();
|
||||
for (int i = 0; i < 60; i++) {
|
||||
if (i < 10) {
|
||||
executSchdulMntList.put("0" + Integer.toString(i), "0" + Integer.toString(i));
|
||||
} else {
|
||||
executSchdulMntList.put(Integer.toString(i), Integer.toString(i));
|
||||
}
|
||||
}
|
||||
model.addAttribute("executSchdulMntList", executSchdulMntList);
|
||||
Map<String, String> executSchdulSecndList = new LinkedHashMap<String, String>();
|
||||
for (int i = 0; i < 60; i++) {
|
||||
if (i < 10) {
|
||||
executSchdulSecndList.put("0" + Integer.toString(i), "0" + Integer.toString(i));
|
||||
} else {
|
||||
executSchdulSecndList.put(Integer.toString(i), Integer.toString(i));
|
||||
}
|
||||
}
|
||||
model.addAttribute("executSchdulSecndList", executSchdulSecndList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄 목록을 조회한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param searchVO 목록조회조건VO
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@IncludedInfo(name = "스케줄처리", listUrl = "/_mngr_/bat/getBatchSchdulList.do", order = 1140, gid = 60)
|
||||
@RequestMapping("/_mngr_/bat/getBatchSchdulList.do")
|
||||
public String selectBatchSchdulList(@ModelAttribute("searchVO") BatchSchdul searchVO, ModelMap model) throws Exception {
|
||||
searchVO.setPageUnit(propertyService.getInt("pageUnit"));
|
||||
searchVO.setPageSize(propertyService.getInt("pageSize"));
|
||||
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
|
||||
paginationInfo.setPageSize(searchVO.getPageSize());
|
||||
|
||||
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
List<BatchSchdul> resultList = (List<BatchSchdul>) egovBatchSchdulService.selectBatchSchdulList(searchVO);
|
||||
int totCnt = egovBatchSchdulService.selectBatchSchdulListCnt(searchVO);
|
||||
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
|
||||
model.addAttribute("resultList", resultList);
|
||||
model.addAttribute("resultCnt", totCnt);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
|
||||
return "itgcms/global/module/bat/EgovBatchSchdulList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 배치스케줄을 수정한다.
|
||||
* @return 리턴URL
|
||||
*
|
||||
* @param batchSchdul 수정대상 배치스케줄model
|
||||
* @param bindingResult BindingResult
|
||||
* @param model ModelMap
|
||||
* @exception Exception Exception
|
||||
*/
|
||||
@RequestMapping("/_mngr_/bat/updateBatchSchdul.do")
|
||||
public String updateBatchSchdul(BatchSchdul batchSchdul, BindingResult bindingResult, ModelMap model) throws Exception {
|
||||
|
||||
beanValidator.validate(batchSchdul, bindingResult);
|
||||
if (bindingResult.hasErrors()) {
|
||||
referenceData(model);
|
||||
model.addAttribute("batchSchdul", batchSchdul);
|
||||
return "itgcms/global/module/bat/EgovBatchSchdulUpdt";
|
||||
}
|
||||
|
||||
// 정보 업데이트
|
||||
batchSchdul.setUpdmemid("SYSTEM");
|
||||
if(batchSchdul.getExecutCycle().equals("06")){
|
||||
batchSchdul.setExecutSchdulMnt("/"+batchSchdul.getExecutSchdulMnt());
|
||||
}
|
||||
if(batchSchdul.getExecutCycle().equals("07")){
|
||||
batchSchdul.setExecutSchdulSecnd("/"+batchSchdul.getExecutSchdulSecnd());
|
||||
}
|
||||
egovBatchSchdulService.updateBatchSchdul(batchSchdul);
|
||||
|
||||
// 배치스케줄러에 스케줄정보반영
|
||||
BatchSchdul target = egovBatchSchdulService.selectBatchSchdul(batchSchdul);
|
||||
batchScheduler.updateBatchSchdul(target);
|
||||
|
||||
model.addAttribute("batchSchdul", batchSchdul);
|
||||
|
||||
// return "forward:/_mngr_/bat/getBatchSchdul.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "수정 되었습니다", "/_mngr_/bat/getBatchSchdul.do");
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,132 @@
|
||||
package egovframework.com.sym.cal.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* 휴일에 관한 서비스 인터페이스 클래스를 정의한다
|
||||
* @author 공통서비스 개발팀 이중호
|
||||
* @since 2009.04.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.04.01 이중호 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public interface EgovCalRestdeManageService {
|
||||
|
||||
/**
|
||||
* 일반달력 팝업 정보를 조회한다.
|
||||
* @param restde
|
||||
* @return List(일반달력 팝업 날짜정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
List<?> selectNormalRestdePopup(Restde restde) throws Exception;
|
||||
|
||||
/**
|
||||
* 행정달력 팝업 정보를 조회한다.
|
||||
* @param restde
|
||||
* @return List(행정달력 팝업 날짜정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
List<?> selectAdministRestdePopup(Restde restde) throws Exception;
|
||||
|
||||
/**
|
||||
* 일반달력 일간 정보를 조회한다.
|
||||
* @param restde
|
||||
* @return List(일반달력 일간 날짜정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
List<?> selectNormalDayCal(Restde restde) throws Exception;
|
||||
|
||||
/**
|
||||
* 일반달력 일간 휴일을 조회한다.
|
||||
* @param restde
|
||||
* @return List(일반달력 일간 휴일정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
List<?> selectNormalDayRestde(Restde restde) throws Exception;
|
||||
|
||||
/**
|
||||
* 일반달력 월간 휴일을 조회한다.
|
||||
* @param restde
|
||||
* @return List(일반달력 월간 휴일정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
List<?> selectNormalMonthRestde(Restde restde) throws Exception;
|
||||
|
||||
/**
|
||||
* 행정달력 일간 정보를 조회한다.
|
||||
* @param restde
|
||||
* @return List(행정달력 일간 날짜정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
List<?> selectAdministDayCal(Restde restde) throws Exception;
|
||||
|
||||
/**
|
||||
* 행정달력 일간 휴일을 조회한다.
|
||||
* @param restde
|
||||
* @return List(행정달력 일간 휴일정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
List<?> selectAdministDayRestde(Restde restde) throws Exception;
|
||||
|
||||
/**
|
||||
* 행정달력 월간 휴일을 조회한다.
|
||||
* @param restde
|
||||
* @return List(행정달력 월간 휴일정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
List<?> selectAdministMonthRestde(Restde restde) throws Exception;
|
||||
|
||||
/**
|
||||
* 휴일을 삭제한다.
|
||||
* @param restde
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteRestde(Restde restde) throws Exception;
|
||||
|
||||
/**
|
||||
* 휴일을 등록한다.
|
||||
* @param restde
|
||||
* @throws Exception
|
||||
*/
|
||||
void insertRestde(Restde restde) throws Exception;
|
||||
|
||||
/**
|
||||
* 휴일 상세항목을 조회한다.
|
||||
* @param restde
|
||||
* @return Restde(휴일)
|
||||
* @throws Exception
|
||||
*/
|
||||
Restde selectRestdeDetail(Restde restde) throws Exception;
|
||||
|
||||
/**
|
||||
* 휴일 목록을 조회한다.
|
||||
* @param searchVO
|
||||
* @return List(휴일 목록)
|
||||
* @throws Exception
|
||||
*/
|
||||
List<?> selectRestdeList(RestdeVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 휴일 총 갯수를 조회한다.
|
||||
* @param searchVO
|
||||
* @return int(휴일 총 갯수)
|
||||
*/
|
||||
int selectRestdeListTotCnt(RestdeVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 휴일을 수정한다.
|
||||
* @param restde
|
||||
* @throws Exception
|
||||
*/
|
||||
void updateRestde(Restde restde) throws Exception;
|
||||
|
||||
}
|
||||
@ -0,0 +1,404 @@
|
||||
package egovframework.com.sym.cal.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 휴일 모델 클래스
|
||||
* @author 공통서비스 개발팀 이중호
|
||||
* @since 2009.04.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.04.01 이중호 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class Restde implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8509545779844669658L;
|
||||
|
||||
/*
|
||||
* 휴일번호
|
||||
*/
|
||||
private int restdeNo = 0;
|
||||
|
||||
/*
|
||||
* 휴일일자
|
||||
*/
|
||||
private String restdeDe = "";
|
||||
|
||||
/*
|
||||
* 휴일명
|
||||
*/
|
||||
private String restdeNm = "";
|
||||
|
||||
/*
|
||||
* 휴일설명
|
||||
*/
|
||||
private String restdeDc = "";
|
||||
|
||||
/*
|
||||
* 휴일구분
|
||||
*/
|
||||
private String restdeSe = "";
|
||||
|
||||
/*
|
||||
* 휴일구분코드
|
||||
*/
|
||||
private String restdeSeCode = "";
|
||||
|
||||
/*
|
||||
* 최초등록자ID
|
||||
*/
|
||||
private String frstRegisterId = "";
|
||||
|
||||
/*
|
||||
* 최종수정자ID
|
||||
*/
|
||||
private String lastUpdusrId = "";
|
||||
|
||||
/*
|
||||
* 년
|
||||
*/
|
||||
private String year = "";
|
||||
|
||||
/*
|
||||
* 월
|
||||
*/
|
||||
private String month = "";
|
||||
|
||||
/*
|
||||
* 일
|
||||
*/
|
||||
private String day = "";
|
||||
|
||||
/*
|
||||
* 휴일여부
|
||||
*/
|
||||
private String restdeAt = "";
|
||||
|
||||
/*
|
||||
* 달력셀
|
||||
*/
|
||||
private int cellNum = 0;
|
||||
|
||||
/*
|
||||
* 월별 주순위
|
||||
*/
|
||||
private int weeks = 0;
|
||||
|
||||
/*
|
||||
* 월 주수
|
||||
*/
|
||||
private int maxWeeks = 0;
|
||||
|
||||
/*
|
||||
* 요일
|
||||
*/
|
||||
private int week = 0;
|
||||
|
||||
/*
|
||||
* 시작요일
|
||||
*/
|
||||
private int startWeekMonth = 0;
|
||||
|
||||
/*
|
||||
* 마지막 일자
|
||||
*/
|
||||
private int lastDayMonth = 0;
|
||||
|
||||
/**
|
||||
* restdeNo attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getRestdeNo() {
|
||||
return restdeNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeNo attribute 값을 설정한다.
|
||||
* @param restdeNo int
|
||||
*/
|
||||
public void setRestdeNo(int restdeNo) {
|
||||
this.restdeNo = restdeNo;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeDe attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getRestdeDe() {
|
||||
return restdeDe;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeDe attribute 값을 설정한다.
|
||||
* @param restdeDe String
|
||||
*/
|
||||
public void setRestdeDe(String restdeDe) {
|
||||
this.restdeDe = restdeDe;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeNm attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getRestdeNm() {
|
||||
return restdeNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeNm attribute 값을 설정한다.
|
||||
* @param restdeNm String
|
||||
*/
|
||||
public void setRestdeNm(String restdeNm) {
|
||||
this.restdeNm = restdeNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeDc attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getRestdeDc() {
|
||||
return restdeDc;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeDc attribute 값을 설정한다.
|
||||
* @param restdeDc String
|
||||
*/
|
||||
public void setRestdeDc(String restdeDc) {
|
||||
this.restdeDc = restdeDc;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeSe attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getRestdeSe() {
|
||||
return restdeSe;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeSe attribute 값을 설정한다.
|
||||
* @param restdeSe String
|
||||
*/
|
||||
public void setRestdeSe(String restdeSe) {
|
||||
this.restdeSe = restdeSe;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeSeCode attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getRestdeSeCode() {
|
||||
return restdeSeCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeSeCode attribute 값을 설정한다.
|
||||
* @param restdeSeCode String
|
||||
*/
|
||||
public void setRestdeSeCode(String restdeSeCode) {
|
||||
this.restdeSeCode = restdeSeCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterId attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getFrstRegisterId() {
|
||||
return frstRegisterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterId attribute 값을 설정한다.
|
||||
* @param frstRegisterId String
|
||||
*/
|
||||
public void setFrstRegisterId(String frstRegisterId) {
|
||||
this.frstRegisterId = frstRegisterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrId attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getLastUpdusrId() {
|
||||
return lastUpdusrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrId attribute 값을 설정한다.
|
||||
* @param lastUpdusrId String
|
||||
*/
|
||||
public void setLastUpdusrId(String lastUpdusrId) {
|
||||
this.lastUpdusrId = lastUpdusrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* year attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getYear() {
|
||||
return year;
|
||||
}
|
||||
|
||||
/**
|
||||
* year attribute 값을 설정한다.
|
||||
* @param year String
|
||||
*/
|
||||
public void setYear(String year) {
|
||||
this.year = year;
|
||||
}
|
||||
|
||||
/**
|
||||
* month attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
/**
|
||||
* month attribute 값을 설정한다.
|
||||
* @param month String
|
||||
*/
|
||||
public void setMonth(String month) {
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
/**
|
||||
* day attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getDay() {
|
||||
return day;
|
||||
}
|
||||
|
||||
/**
|
||||
* day attribute 값을 설정한다.
|
||||
* @param day String
|
||||
*/
|
||||
public void setDay(String day) {
|
||||
this.day = day;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeAt attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getRestdeAt() {
|
||||
return restdeAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* restdeAt attribute 값을 설정한다.
|
||||
* @param restdeAt String
|
||||
*/
|
||||
public void setRestdeAt(String restdeAt) {
|
||||
this.restdeAt = restdeAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* cellNum attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getCellNum() {
|
||||
return cellNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* cellNum attribute 값을 설정한다.
|
||||
* @param cellNum int
|
||||
*/
|
||||
public void setCellNum(int cellNum) {
|
||||
this.cellNum = cellNum;
|
||||
}
|
||||
|
||||
/**
|
||||
* weeks attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getWeeks() {
|
||||
return weeks;
|
||||
}
|
||||
|
||||
/**
|
||||
* weeks attribute 값을 설정한다.
|
||||
* @param weeks int
|
||||
*/
|
||||
public void setWeeks(int weeks) {
|
||||
this.weeks = weeks;
|
||||
}
|
||||
|
||||
/**
|
||||
* maxWeeks attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getMaxWeeks() {
|
||||
return maxWeeks;
|
||||
}
|
||||
|
||||
/**
|
||||
* maxWeeks attribute 값을 설정한다.
|
||||
* @param maxWeeks int
|
||||
*/
|
||||
public void setMaxWeeks(int maxWeeks) {
|
||||
this.maxWeeks = maxWeeks;
|
||||
}
|
||||
|
||||
/**
|
||||
* week attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getWeek() {
|
||||
return week;
|
||||
}
|
||||
|
||||
/**
|
||||
* week attribute 값을 설정한다.
|
||||
* @param week int
|
||||
*/
|
||||
public void setWeek(int week) {
|
||||
this.week = week;
|
||||
}
|
||||
|
||||
/**
|
||||
* startWeekMonth attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getStartWeekMonth() {
|
||||
return startWeekMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* startWeekMonth attribute 값을 설정한다.
|
||||
* @param startWeekMonth int
|
||||
*/
|
||||
public void setStartWeekMonth(int startWeekMonth) {
|
||||
this.startWeekMonth = startWeekMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastDayMonth attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getLastDayMonth() {
|
||||
return lastDayMonth;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastDayMonth attribute 값을 설정한다.
|
||||
* @param lastDayMonth int
|
||||
*/
|
||||
public void setLastDayMonth(int lastDayMonth) {
|
||||
this.lastDayMonth = lastDayMonth;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,199 @@
|
||||
package egovframework.com.sym.cal.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* 휴일 VO 클래스
|
||||
* @author 공통서비스 개발팀 이중호
|
||||
* @since 2009.04.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.04.01 이중호 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class RestdeVO extends Restde implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 2548377950888283294L;
|
||||
|
||||
/** 검색조건 */
|
||||
private String searchCondition = "";
|
||||
|
||||
/** 검색Keyword */
|
||||
private String searchKeyword = "";
|
||||
|
||||
/** 검색사용여부 */
|
||||
private String searchUseYn = "";
|
||||
|
||||
/** 현재페이지 */
|
||||
private int pageIndex = 1;
|
||||
|
||||
/** 페이지갯수 */
|
||||
private int pageUnit = 10;
|
||||
|
||||
/** 페이지사이즈 */
|
||||
private int pageSize = 10;
|
||||
|
||||
/** firstIndex */
|
||||
private int firstIndex = 1;
|
||||
|
||||
/** lastIndex */
|
||||
private int lastIndex = 1;
|
||||
|
||||
/** recordCountPerPage */
|
||||
private int recordCountPerPage = 10;
|
||||
|
||||
/**
|
||||
* searchCondition attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getSearchCondition() {
|
||||
return searchCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* searchCondition attribute 값을 설정한다.
|
||||
* @param searchCondition String
|
||||
*/
|
||||
public void setSearchCondition(String searchCondition) {
|
||||
this.searchCondition = searchCondition;
|
||||
}
|
||||
|
||||
/**
|
||||
* searchKeyword attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getSearchKeyword() {
|
||||
return searchKeyword;
|
||||
}
|
||||
|
||||
/**
|
||||
* searchKeyword attribute 값을 설정한다.
|
||||
* @param searchKeyword String
|
||||
*/
|
||||
public void setSearchKeyword(String searchKeyword) {
|
||||
this.searchKeyword = searchKeyword;
|
||||
}
|
||||
|
||||
/**
|
||||
* searchUseYn attribute 를 리턴한다.
|
||||
* @return String
|
||||
*/
|
||||
public String getSearchUseYn() {
|
||||
return searchUseYn;
|
||||
}
|
||||
|
||||
/**
|
||||
* searchUseYn attribute 값을 설정한다.
|
||||
* @param searchUseYn String
|
||||
*/
|
||||
public void setSearchUseYn(String searchUseYn) {
|
||||
this.searchUseYn = searchUseYn;
|
||||
}
|
||||
|
||||
/**
|
||||
* pageIndex attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getPageIndex() {
|
||||
return pageIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* pageIndex attribute 값을 설정한다.
|
||||
* @param pageIndex int
|
||||
*/
|
||||
public void setPageIndex(int pageIndex) {
|
||||
this.pageIndex = pageIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* pageUnit attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getPageUnit() {
|
||||
return pageUnit;
|
||||
}
|
||||
|
||||
/**
|
||||
* pageUnit attribute 값을 설정한다.
|
||||
* @param pageUnit int
|
||||
*/
|
||||
public void setPageUnit(int pageUnit) {
|
||||
this.pageUnit = pageUnit;
|
||||
}
|
||||
|
||||
/**
|
||||
* pageSize attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* pageSize attribute 값을 설정한다.
|
||||
* @param pageSize int
|
||||
*/
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* firstIndex attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getFirstIndex() {
|
||||
return firstIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* firstIndex attribute 값을 설정한다.
|
||||
* @param firstIndex int
|
||||
*/
|
||||
public void setFirstIndex(int firstIndex) {
|
||||
this.firstIndex = firstIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastIndex attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getLastIndex() {
|
||||
return lastIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastIndex attribute 값을 설정한다.
|
||||
* @param lastIndex int
|
||||
*/
|
||||
public void setLastIndex(int lastIndex) {
|
||||
this.lastIndex = lastIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* recordCountPerPage attribute 를 리턴한다.
|
||||
* @return int
|
||||
*/
|
||||
public int getRecordCountPerPage() {
|
||||
return recordCountPerPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* recordCountPerPage attribute 값을 설정한다.
|
||||
* @param recordCountPerPage int
|
||||
*/
|
||||
public void setRecordCountPerPage(int recordCountPerPage) {
|
||||
this.recordCountPerPage = recordCountPerPage;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,153 @@
|
||||
package egovframework.com.sym.cal.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.sym.cal.service.EgovCalRestdeManageService;
|
||||
import egovframework.com.sym.cal.service.Restde;
|
||||
import egovframework.com.sym.cal.service.RestdeVO;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 휴일에 대한 서비스 구현클래스를 정의한다
|
||||
* @author 공통서비스 개발팀 이중호
|
||||
* @since 2009.04.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.04.01 이중호 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Service("RestdeManageService")
|
||||
public class EgovCalRestdeManageServiceImpl extends EgovAbstractServiceImpl implements EgovCalRestdeManageService {
|
||||
|
||||
@Resource(name="RestdeManageDAO")
|
||||
private RestdeManageDAO restdeManageDAO;
|
||||
|
||||
/**
|
||||
* 일반달력 팝업 정보를 조회한다.
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectNormalRestdePopup(Restde restde) throws Exception {
|
||||
return restdeManageDAO.selectNormalRestdePopup(restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 행정달력 팝업 정보를 조회한다.
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectAdministRestdePopup(Restde restde) throws Exception {
|
||||
return restdeManageDAO.selectAdministRestdePopup(restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 일반달력 일간 정보를 조회한다.
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectNormalDayCal(Restde restde) throws Exception {
|
||||
return restdeManageDAO.selectNormalDayCal(restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 일반달력 일간 휴일을 조회한다.
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectNormalDayRestde(Restde restde) throws Exception {
|
||||
return restdeManageDAO.selectNormalDayRestde(restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 일반달력 월간 휴일을 조회한다.
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectNormalMonthRestde(Restde restde) throws Exception {
|
||||
return restdeManageDAO.selectNormalMonthRestde(restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 행정달력 일간 정보를 조회한다.
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectAdministDayCal(Restde restde) throws Exception {
|
||||
return restdeManageDAO.selectAdministDayCal(restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 행정달력 일간 휴일을 조회한다.
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectAdministDayRestde(Restde restde) throws Exception {
|
||||
return restdeManageDAO.selectAdministDayRestde(restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 행정달력 월간 휴일을 조회한다.
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectAdministMonthRestde(Restde restde) throws Exception {
|
||||
return restdeManageDAO.selectAdministMonthRestde(restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴일을 삭제한다.
|
||||
*/
|
||||
@Override
|
||||
public void deleteRestde(Restde restde) throws Exception {
|
||||
restdeManageDAO.deleteRestde(restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴일을 등록한다.
|
||||
*/
|
||||
@Override
|
||||
public void insertRestde(Restde restde) throws Exception {
|
||||
restdeManageDAO.insertRestde(restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴일 상세항목을 조회한다.
|
||||
*/
|
||||
@Override
|
||||
public Restde selectRestdeDetail(Restde restde) throws Exception {
|
||||
Restde ret = restdeManageDAO.selectRestdeDetail(restde);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴일 목록을 조회한다.
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectRestdeList(RestdeVO searchVO) throws Exception {
|
||||
return restdeManageDAO.selectRestdeList(searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴일 총 갯수를 조회한다.
|
||||
*/
|
||||
@Override
|
||||
public int selectRestdeListTotCnt(RestdeVO searchVO) throws Exception {
|
||||
return restdeManageDAO.selectRestdeListTotCnt(searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴일을 수정한다.
|
||||
*/
|
||||
@Override
|
||||
public void updateRestde(Restde restde) throws Exception {
|
||||
restdeManageDAO.updateRestde(restde);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,170 @@
|
||||
package egovframework.com.sym.cal.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
|
||||
import egovframework.com.sym.cal.service.Restde;
|
||||
import egovframework.com.sym.cal.service.RestdeVO;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
*
|
||||
* 휴일에 대한 데이터 접근 클래스를 정의한다
|
||||
* @author 공통서비스 개발팀 이중호
|
||||
* @since 2009.04.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.04.01 이중호 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Repository("RestdeManageDAO")
|
||||
public class RestdeManageDAO extends EgovComAbstractDAO {
|
||||
|
||||
/**
|
||||
* 일반달력 팝업 정보를 조회한다.
|
||||
* @param restde
|
||||
* @return List(일반달력 팝업 날짜정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectNormalRestdePopup(Restde restde) throws Exception {
|
||||
return list("RestdeManageDAO.selectNormalRestdePopup", restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 행정달력 팝업 정보를 조회한다.
|
||||
* @param restde
|
||||
* @return List(행정달력 팝업 날짜정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectAdministRestdePopup(Restde restde) throws Exception {
|
||||
return list("RestdeManageDAO.selectAdministRestdePopup", restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 일반달력 일간 정보를 조회한다.
|
||||
* @param restde
|
||||
* @return List(일반달력 일간 날짜정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectNormalDayCal(Restde restde) throws Exception {
|
||||
return list("RestdeManageDAO.selectNormalDayCal", restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 일반달력 일간 휴일을 조회한다.
|
||||
* @param restde
|
||||
* @return List(일반달력 일간 휴일정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectNormalDayRestde(Restde restde) throws Exception {
|
||||
return list("RestdeManageDAO.selectNormalDayRestde", restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 일반달력 월간 휴일을 조회한다.
|
||||
* @param restde
|
||||
* @return List(일반달력 월간 휴일정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectNormalMonthRestde(Restde restde) throws Exception {
|
||||
return list("RestdeManageDAO.selectNormalMonthRestde", restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 행정달력 일간 정보를 조회한다.
|
||||
* @param restde
|
||||
* @return List(행정달력 일간 날짜정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectAdministDayCal(Restde restde) throws Exception {
|
||||
return list("RestdeManageDAO.selectAdministDayCal", restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 행정달력 일간 휴일을 조회한다.
|
||||
* @param restde
|
||||
* @return List(행정달력 일간 휴일정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectAdministDayRestde(Restde restde) throws Exception {
|
||||
return list("RestdeManageDAO.selectAdministDayRestde", restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 행정달력 월간 휴일을 조회한다.
|
||||
* @param restde
|
||||
* @return List(행정달력 월간 휴일정보)
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectAdministMonthRestde(Restde restde) throws Exception {
|
||||
return list("RestdeManageDAO.selectAdministMonthRestde", restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴일을 삭제한다.
|
||||
* @param restde
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteRestde(Restde restde) throws Exception {
|
||||
delete("RestdeManageDAO.deleteRestde", restde);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 휴일을 등록한다.
|
||||
* @param restde
|
||||
* @throws Exception
|
||||
*/
|
||||
public void insertRestde(Restde restde) throws Exception {
|
||||
insert("RestdeManageDAO.insertRestde", restde);
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴일 상세항목을 조회한다.
|
||||
* @param restde
|
||||
* @return Restde(휴일)
|
||||
* @throws Exception
|
||||
*/
|
||||
public Restde selectRestdeDetail(Restde restde) throws Exception {
|
||||
return (Restde) select("RestdeManageDAO.selectRestdeDetail", restde);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 휴일 목록을 조회한다.
|
||||
* @param searchVO
|
||||
* @return List(휴일 목록)
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectRestdeList(RestdeVO searchVO) throws Exception {
|
||||
return list("RestdeManageDAO.selectRestdeList", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 글 총 갯수를 조회한다.
|
||||
* @param searchVO
|
||||
* @return int(휴일 총 갯수)
|
||||
* @throws Exception
|
||||
*/
|
||||
public int selectRestdeListTotCnt(RestdeVO searchVO) throws Exception {
|
||||
return (Integer)select("RestdeManageDAO.selectRestdeListTotCnt", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴일을 수정한다.
|
||||
* @param restde
|
||||
* @throws Exception
|
||||
*/
|
||||
public void updateRestde(Restde restde) throws Exception {
|
||||
update("RestdeManageDAO.updateRestde", restde);
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,78 @@
|
||||
package egovframework.com.uss.olp.qim.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
/**
|
||||
* 설문항목관리를 처리하는 Service Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public interface EgovQustnrItemManageService {
|
||||
|
||||
/**
|
||||
* 설문템플릿(을)를 목록을 조회한다.
|
||||
* @param qustnrItemManageVO - 설문항목 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrTmplatManageList(QustnrItemManageVO qustnrItemManageVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문항목 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrItemManageList(ComDefaultVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 상세조회 한다.
|
||||
* @param qustnrItemManageVO - 설문항목 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrItemManageDetail(QustnrItemManageVO qustnrItemManageVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public int selectQustnrItemManageListCnt(ComDefaultVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 등록한다.
|
||||
* @param qustnrItemManageVO - 설문항목 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
void insertQustnrItemManage(QustnrItemManageVO qustnrItemManageVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 수정한다.
|
||||
* @param qustnrItemManageVO - 설문항목 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
void updateQustnrItemManage(QustnrItemManageVO qustnrItemManageVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 삭제한다.
|
||||
* @param qustnrItemManageVO - 설문항목 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteQustnrItemManage(QustnrItemManageVO qustnrItemManageVO) throws Exception;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,253 @@
|
||||
package egovframework.com.uss.olp.qim.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 설문항목관리 VO Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class QustnrItemManageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -8233519594470362395L;
|
||||
|
||||
/** 설문문항 아이디 */
|
||||
private String qestnrQesitmId = "";
|
||||
|
||||
/** 설문지 아이디 */
|
||||
private String qestnrId = "";
|
||||
|
||||
/** 항목순번 */
|
||||
private String iemSn = "";
|
||||
|
||||
/** 항목내용 */
|
||||
private String qustnrIemId = "";
|
||||
|
||||
/** 설문항목아이디 */
|
||||
private String iemCn = "";
|
||||
|
||||
/** 키타답변여부 */
|
||||
private String etcAnswerAt = "";
|
||||
|
||||
/** 설문항목(을)를 아이디 */
|
||||
private String qestnrTmplatId = "";
|
||||
|
||||
/** 최초등록시점 */
|
||||
private String frstRegisterPnttm = "";
|
||||
|
||||
/** 최초등록아이디 */
|
||||
private String frstRegisterId = "";
|
||||
|
||||
/** 최종수정일 */
|
||||
private String lastUpdusrPnttm = "";
|
||||
|
||||
/** 최종수정자 아이디 */
|
||||
private String lastUpdusrId = "";
|
||||
|
||||
/** 컨트롤 명령어 */
|
||||
private String cmd = "";
|
||||
|
||||
/**
|
||||
* qestnrQesitmId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrQesitmId() {
|
||||
return qestnrQesitmId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrQesitmId attribute 값을 설정한다.
|
||||
* @return qestnrQesitmId String
|
||||
*/
|
||||
public void setQestnrQesitmId(String qestnrQesitmId) {
|
||||
this.qestnrQesitmId = qestnrQesitmId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrId() {
|
||||
return qestnrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrId attribute 값을 설정한다.
|
||||
* @return qestnrId String
|
||||
*/
|
||||
public void setQestnrId(String qestnrId) {
|
||||
this.qestnrId = qestnrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* iemSn attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getIemSn() {
|
||||
return iemSn;
|
||||
}
|
||||
|
||||
/**
|
||||
* iemSn attribute 값을 설정한다.
|
||||
* @return iemSn String
|
||||
*/
|
||||
public void setIemSn(String iemSn) {
|
||||
this.iemSn = iemSn;
|
||||
}
|
||||
|
||||
/**
|
||||
* qustnrIemId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQustnrIemId() {
|
||||
return qustnrIemId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qustnrIemId attribute 값을 설정한다.
|
||||
* @return qustnrIemId String
|
||||
*/
|
||||
public void setQustnrIemId(String qustnrIemId) {
|
||||
this.qustnrIemId = qustnrIemId;
|
||||
}
|
||||
|
||||
/**
|
||||
* iemCn attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getIemCn() {
|
||||
return iemCn;
|
||||
}
|
||||
|
||||
/**
|
||||
* iemCn attribute 값을 설정한다.
|
||||
* @return iemCn String
|
||||
*/
|
||||
public void setIemCn(String iemCn) {
|
||||
this.iemCn = iemCn;
|
||||
}
|
||||
|
||||
/**
|
||||
* etcAnswerAt attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getEtcAnswerAt() {
|
||||
return etcAnswerAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* etcAnswerAt attribute 값을 설정한다.
|
||||
* @return etcAnswerAt String
|
||||
*/
|
||||
public void setEtcAnswerAt(String etcAnswerAt) {
|
||||
this.etcAnswerAt = etcAnswerAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrTmplatId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrTmplatId() {
|
||||
return qestnrTmplatId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrTmplatId attribute 값을 설정한다.
|
||||
* @return qestnrTmplatId String
|
||||
*/
|
||||
public void setQestnrTmplatId(String qestnrTmplatId) {
|
||||
this.qestnrTmplatId = qestnrTmplatId;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterPnttm attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getFrstRegisterPnttm() {
|
||||
return frstRegisterPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterPnttm attribute 값을 설정한다.
|
||||
* @return frstRegisterPnttm String
|
||||
*/
|
||||
public void setFrstRegisterPnttm(String frstRegisterPnttm) {
|
||||
this.frstRegisterPnttm = frstRegisterPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getFrstRegisterId() {
|
||||
return frstRegisterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterId attribute 값을 설정한다.
|
||||
* @return frstRegisterId String
|
||||
*/
|
||||
public void setFrstRegisterId(String frstRegisterId) {
|
||||
this.frstRegisterId = frstRegisterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrPnttm attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getLastUpdusrPnttm() {
|
||||
return lastUpdusrPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrPnttm attribute 값을 설정한다.
|
||||
* @return lastUpdusrPnttm String
|
||||
*/
|
||||
public void setLastUpdusrPnttm(String lastUpdusrPnttm) {
|
||||
this.lastUpdusrPnttm = lastUpdusrPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getLastUpdusrId() {
|
||||
return lastUpdusrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrId attribute 값을 설정한다.
|
||||
* @return lastUpdusrId String
|
||||
*/
|
||||
public void setLastUpdusrId(String lastUpdusrId) {
|
||||
this.lastUpdusrId = lastUpdusrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* cmd attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getCmd() {
|
||||
return cmd;
|
||||
}
|
||||
|
||||
/**
|
||||
* cmd attribute 값을 설정한다.
|
||||
* @return cmd String
|
||||
*/
|
||||
public void setCmd(String cmd) {
|
||||
this.cmd = cmd;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,120 @@
|
||||
package egovframework.com.uss.olp.qim.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
import egovframework.com.uss.olp.qim.service.EgovQustnrItemManageService;
|
||||
import egovframework.com.uss.olp.qim.service.QustnrItemManageVO;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* 설문항목관리를 처리하는 ServiceImpl Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Service("egovQustnrItemManageService")
|
||||
public class EgovQustnrItemManageServiceImpl extends EgovAbstractServiceImpl implements EgovQustnrItemManageService{
|
||||
|
||||
//final private Log log = LogFactory.getLog(this.getClass());
|
||||
|
||||
@Resource(name="qustnrItemManageDao")
|
||||
private QustnrItemManageDao dao;
|
||||
|
||||
@Resource(name="egovQustnrItemManageIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
/**
|
||||
* 설문템플릿(을)를 목록을 조회한다.
|
||||
* @param qustnrItemManageVO - 설문항목 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrTmplatManageList(QustnrItemManageVO qustnrItemManageVO) throws Exception{
|
||||
return dao.selectQustnrTmplatManageList(qustnrItemManageVO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 설문항목 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrItemManageList(ComDefaultVO searchVO) throws Exception{
|
||||
return dao.selectQustnrItemManageList(searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 상세조회 한다.
|
||||
* @param QustnrItemManage - 회정정보가 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrItemManageDetail(QustnrItemManageVO qustnrItemManageVO) throws Exception{
|
||||
return dao.selectQustnrItemManageDetail(qustnrItemManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public int selectQustnrItemManageListCnt(ComDefaultVO searchVO) throws Exception{
|
||||
return dao.selectQustnrItemManageListCnt(searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 등록한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void insertQustnrItemManage(QustnrItemManageVO qustnrItemManageVO) throws Exception {
|
||||
String sMakeId = idgenService.getNextStringId();
|
||||
|
||||
qustnrItemManageVO.setQustnrIemId(sMakeId);
|
||||
|
||||
dao.insertQustnrItemManage(qustnrItemManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 수정한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void updateQustnrItemManage(QustnrItemManageVO qustnrItemManageVO) throws Exception{
|
||||
dao.updateQustnrItemManage(qustnrItemManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 삭제한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void deleteQustnrItemManage(QustnrItemManageVO qustnrItemManageVO) throws Exception{
|
||||
dao.deleteQustnrItemManage(qustnrItemManageVO);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
package egovframework.com.uss.olp.qim.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
|
||||
import egovframework.com.uss.olp.qim.service.QustnrItemManageVO;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
/**
|
||||
* 설문항목관리를 처리하는 Dao Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Repository("qustnrItemManageDao")
|
||||
public class QustnrItemManageDao extends EgovComAbstractDAO {
|
||||
|
||||
|
||||
/**
|
||||
* 설문템플릿(을)를 목록을 조회한다.
|
||||
* @param qustnrItemManageVO - 설문항목 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrTmplatManageList(QustnrItemManageVO qustnrItemManageVO) throws Exception{
|
||||
return list("QustnrItemManage.selectQustnrTmplatManage", qustnrItemManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrItemManageList(ComDefaultVO searchVO) throws Exception{
|
||||
return list("QustnrItemManage.selectQustnrItemManage", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 상세조회 한다.
|
||||
* @param qustnrItemManageVO - 설문항목 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrItemManageDetail(QustnrItemManageVO qustnrItemManageVO) throws Exception{
|
||||
return list("QustnrItemManage.selectQustnrItemManageDetail", qustnrItemManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public int selectQustnrItemManageListCnt(ComDefaultVO searchVO) throws Exception{
|
||||
return (Integer)select("QustnrItemManage.selectQustnrItemManageCnt", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 등록한다.
|
||||
* @param qqustnrItemManageVO - 설문항목 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public void insertQustnrItemManage(QustnrItemManageVO qustnrItemManageVO) throws Exception{
|
||||
insert("QustnrItemManage.insertQustnrItemManage", qustnrItemManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 수정한다.
|
||||
* @param qustnrItemManageVO - 설문항목 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public void updateQustnrItemManage(QustnrItemManageVO qustnrItemManageVO) throws Exception{
|
||||
insert("QustnrItemManage.updateQustnrItemManage", qustnrItemManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목를(을) 삭제한다.
|
||||
* @param qustnrItemManageVO - 설문항목 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteQustnrItemManage(QustnrItemManageVO qustnrItemManageVO) throws Exception{
|
||||
//설문조사(설문결과) 삭제
|
||||
delete("QustnrItemManage.deleteQustnrRespondInfo", qustnrItemManageVO);
|
||||
|
||||
//설문항목 삭제
|
||||
insert("QustnrItemManage.deleteQustnrItemManage", qustnrItemManageVO);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,311 @@
|
||||
package egovframework.com.uss.olp.qim.web;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
import egovframework.com.cmm.EgovMessageSource;
|
||||
import egovframework.com.cmm.LoginVO;
|
||||
import egovframework.com.cmm.annotation.IncludedInfo;
|
||||
import egovframework.com.cmm.util.EgovUserDetailsHelper;
|
||||
import egovframework.com.uss.olp.qim.service.EgovQustnrItemManageService;
|
||||
import egovframework.com.uss.olp.qim.service.QustnrItemManageVO;
|
||||
import egovframework.itgcms.util.CommUtil;
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springmodules.validation.commons.DefaultBeanValidator;
|
||||
/**
|
||||
* 설문항목관리를 처리하는 Controller Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
* 2011.8.26 정진오 IncludedInfo annotation 추가
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@Controller
|
||||
public class EgovQustnrItemManageController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovQustnrItemManageController.class);
|
||||
|
||||
@Autowired
|
||||
private DefaultBeanValidator beanValidator;
|
||||
|
||||
/** EgovMessageSource */
|
||||
@Resource(name="egovMessageSource")
|
||||
EgovMessageSource egovMessageSource;
|
||||
|
||||
@Resource(name = "egovQustnrItemManageService")
|
||||
private EgovQustnrItemManageService egovQustnrItemManageService;
|
||||
|
||||
/** EgovPropertyService */
|
||||
@Resource(name = "propertiesService")
|
||||
protected EgovPropertyService propertiesService;
|
||||
|
||||
/**
|
||||
* 설문항목 팝업 목록을 조회한다.
|
||||
* @param searchVO
|
||||
* @param commandMap
|
||||
* @param qustnrItemManageVO
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qim/EgovQustnrItemManageListPopup"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qim/EgovQustnrItemManageListPopup.do")
|
||||
public String egovQustnrItemManageListPopup(@ModelAttribute("searchVO") ComDefaultVO searchVO, @RequestParam Map<?, ?> commandMap,
|
||||
QustnrItemManageVO qustnrItemManageVO, ModelMap model) throws Exception {
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
if(sCmd.equals("del")){
|
||||
egovQustnrItemManageService.deleteQustnrItemManage(qustnrItemManageVO);
|
||||
}
|
||||
|
||||
/** EgovPropertyService.sample */
|
||||
searchVO.setPageUnit(propertiesService.getInt("pageUnit"));
|
||||
searchVO.setPageSize(propertiesService.getInt("pageSize"));
|
||||
|
||||
/** pageing */
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
|
||||
paginationInfo.setPageSize(searchVO.getPageSize());
|
||||
|
||||
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
List<?> sampleList = egovQustnrItemManageService.selectQustnrItemManageList(searchVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
|
||||
model.addAttribute("searchKeyword", commandMap.get("searchKeyword") == null ? "" : (String)commandMap.get("searchKeyword"));
|
||||
model.addAttribute("searchCondition", commandMap.get("searchCondition") == null ? "" : (String)commandMap.get("searchCondition"));
|
||||
|
||||
int totCnt = egovQustnrItemManageService.selectQustnrItemManageListCnt(searchVO);
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
|
||||
return "egovframework/com/uss/olp/qim/EgovQustnrItemManageListPopup";
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목 목록을 조회한다.
|
||||
* @param searchVO
|
||||
* @param commandMap
|
||||
* @param qustnrItemManageVO
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qim/EgovQustnrItemManageList"
|
||||
* @throws Exception
|
||||
*/
|
||||
@IncludedInfo(name="항목관리", order = 640 ,gid = 50)
|
||||
@RequestMapping(value="/_mngr_/qim/EgovQustnrItemManageList.do")
|
||||
public String egovQustnrItemManageList(@ModelAttribute("searchVO") ComDefaultVO searchVO, @RequestParam Map<?, ?> commandMap,
|
||||
QustnrItemManageVO qustnrItemManageVO, ModelMap model) throws Exception {
|
||||
|
||||
String sSearchMode = commandMap.get("searchMode") == null ? "" : (String)commandMap.get("searchMode");
|
||||
|
||||
//설문문항에 넘어온 건에 대해 조회
|
||||
if(sSearchMode.equals("Y")){
|
||||
// searchVO.setSearchCondition("QUSTNR_QESITM_ID");//qestnrQesitmId
|
||||
searchVO.setSearchKeyword0(qustnrItemManageVO.getQestnrQesitmId());
|
||||
}
|
||||
|
||||
/** EgovPropertyService.sample */
|
||||
searchVO.setPageUnit(propertiesService.getInt("pageUnit"));
|
||||
searchVO.setPageSize(propertiesService.getInt("pageSize"));
|
||||
|
||||
/** pageing */
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
|
||||
paginationInfo.setPageSize(searchVO.getPageSize());
|
||||
|
||||
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
List<?> sampleList = egovQustnrItemManageService.selectQustnrItemManageList(searchVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
|
||||
model.addAttribute("searchKeyword", commandMap.get("searchKeyword") == null ? "" : (String)commandMap.get("searchKeyword"));
|
||||
model.addAttribute("searchCondition", commandMap.get("searchCondition") == null ? "" : (String)commandMap.get("searchCondition"));
|
||||
|
||||
int totCnt = egovQustnrItemManageService.selectQustnrItemManageListCnt(searchVO);
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
|
||||
return "egovframework/com/uss/olp/qim/EgovQustnrItemManageList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목 목록을 상세조회 조회한다.
|
||||
* @param searchVO
|
||||
* @param qustnrItemManageVO
|
||||
* @param commandMap
|
||||
* @param model
|
||||
* @return "/uss/olp/qim/EgovQustnrItemManageDetail"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qim/EgovQustnrItemManageDetail.do")
|
||||
public String egovQustnrItemManageDetail(@ModelAttribute("searchVO") ComDefaultVO searchVO, QustnrItemManageVO qustnrItemManageVO,
|
||||
@RequestParam Map<?, ?> commandMap, ModelMap model) throws Exception {
|
||||
|
||||
String sLocationUrl = "egovframework/com/uss/olp/qim/EgovQustnrItemManageDetail";
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
|
||||
if(sCmd.equals("del")){
|
||||
|
||||
egovQustnrItemManageService.deleteQustnrItemManage(qustnrItemManageVO);
|
||||
// sLocationUrl = "redirect:/_mngr_/qim/EgovQustnrItemManageList.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "삭제 되었습니다.", "/_mngr_/qim/EgovQustnrItemManageList.do");
|
||||
|
||||
} else {
|
||||
|
||||
List<?> sampleList = egovQustnrItemManageService.selectQustnrItemManageDetail(qustnrItemManageVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
}
|
||||
|
||||
return sLocationUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목를 수정한다.
|
||||
* @param searchVO
|
||||
* @param commandMap
|
||||
* @param qustnrItemManageVO
|
||||
* @param bindingResult
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qim/EgovQustnrItemManageModify"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qim/EgovQustnrItemManageModify.do")
|
||||
public String qustnrItemManageModify(@ModelAttribute("searchVO") ComDefaultVO searchVO, @RequestParam Map<?, ?> commandMap,
|
||||
@ModelAttribute("qustnrItemManageVO") QustnrItemManageVO qustnrItemManageVO, BindingResult bindingResult, ModelMap model) throws Exception {
|
||||
// 0. Spring Security 사용자권한 처리
|
||||
// Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
// if(!isAuthenticated) {
|
||||
// model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
|
||||
// return "egovframework/com/uat/uia/EgovLoginUsr";
|
||||
// }
|
||||
|
||||
//로그인 객체 선언
|
||||
// LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
String sLocationUrl = "egovframework/com/uss/olp/qim/EgovQustnrItemManageModify";
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
|
||||
if(sCmd.equals("save")){
|
||||
|
||||
//서버 validate 체크
|
||||
beanValidator.validate(qustnrItemManageVO, bindingResult);
|
||||
if(bindingResult.hasErrors()){
|
||||
//설문항목(을)를 정보 불러오기
|
||||
List<?> listQustnrTmplat = egovQustnrItemManageService.selectQustnrTmplatManageList(qustnrItemManageVO);
|
||||
model.addAttribute("listQustnrTmplat", listQustnrTmplat);
|
||||
//게시물 불러오기
|
||||
List<?> sampleList = egovQustnrItemManageService.selectQustnrItemManageDetail(qustnrItemManageVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
|
||||
return "egovframework/com/uss/olp/qim/EgovQustnrItemManageModify";
|
||||
}
|
||||
|
||||
//아이디 설정
|
||||
qustnrItemManageVO.setFrstRegisterId(CommUtil.getMngrMemId());
|
||||
qustnrItemManageVO.setLastUpdusrId(CommUtil.getMngrMemId());
|
||||
|
||||
egovQustnrItemManageService.updateQustnrItemManage(qustnrItemManageVO);
|
||||
// sLocationUrl = "redirect:/_mngr_/qim/EgovQustnrItemManageList.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "수정 되었습니다.", "/_mngr_/qim/EgovQustnrItemManageDetail.do");
|
||||
|
||||
} else {
|
||||
|
||||
List<?> sampleList = egovQustnrItemManageService.selectQustnrItemManageDetail(qustnrItemManageVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
|
||||
//설문항목(을)를 정보 불러오기
|
||||
List<?> listQustnrTmplat = egovQustnrItemManageService.selectQustnrTmplatManageList(qustnrItemManageVO);
|
||||
model.addAttribute("listQustnrTmplat", listQustnrTmplat);
|
||||
}
|
||||
|
||||
return sLocationUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문항목를 등록한다.
|
||||
* @param searchVO
|
||||
* @param commandMap
|
||||
* @param qustnrItemManageVO
|
||||
* @param bindingResult
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qim/EgovQustnrItemManageRegist"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qim/EgovQustnrItemManageRegist.do")
|
||||
public String qustnrItemManageRegist(@ModelAttribute("searchVO") ComDefaultVO searchVO, @RequestParam Map<?, ?> commandMap,
|
||||
@ModelAttribute("qustnrItemManageVO") QustnrItemManageVO qustnrItemManageVO, BindingResult bindingResult, ModelMap model) throws Exception {
|
||||
// 0. Spring Security 사용자권한 처리
|
||||
// Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
// if(!isAuthenticated) {
|
||||
// model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
|
||||
// return "egovframework/com/uat/uia/EgovLoginUsr";
|
||||
// }
|
||||
|
||||
//로그인 객체 선언
|
||||
// LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
String sLocationUrl = "egovframework/com/uss/olp/qim/EgovQustnrItemManageRegist";
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
LOGGER.info("cmd => {}", sCmd);
|
||||
|
||||
if(sCmd.equals("save")){
|
||||
|
||||
//서버 validate 체크
|
||||
beanValidator.validate(qustnrItemManageVO, bindingResult);
|
||||
if(bindingResult.hasErrors()){
|
||||
//설문항목(을)를 정보 불러오기
|
||||
List<?> listQustnrTmplat = egovQustnrItemManageService.selectQustnrTmplatManageList(qustnrItemManageVO);
|
||||
model.addAttribute("listQustnrTmplat", listQustnrTmplat);
|
||||
return "egovframework/com/uss/olp/qim/EgovQustnrItemManageRegist";
|
||||
}
|
||||
|
||||
//아이디 설정
|
||||
qustnrItemManageVO.setFrstRegisterId(CommUtil.getMngrMemId());
|
||||
qustnrItemManageVO.setLastUpdusrId(CommUtil.getMngrMemId());
|
||||
|
||||
egovQustnrItemManageService.insertQustnrItemManage(qustnrItemManageVO);
|
||||
// sLocationUrl = "redirect:/_mngr_/qim/EgovQustnrItemManageList.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "저장 되었습니다.", "/_mngr_/qim/EgovQustnrItemManageList.do");
|
||||
|
||||
} else {
|
||||
|
||||
//설문항목(을)를 정보 불러오기
|
||||
List<?> listQustnrTmplat = egovQustnrItemManageService.selectQustnrTmplatManageList(qustnrItemManageVO);
|
||||
model.addAttribute("listQustnrTmplat", listQustnrTmplat);
|
||||
}
|
||||
|
||||
return sLocationUrl;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,86 @@
|
||||
package egovframework.com.uss.olp.qmc.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
/**
|
||||
* 설문관리를 처리하는 Service Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public interface EgovQustnrManageService {
|
||||
|
||||
/**
|
||||
* 설문템플릿 목록을 조회한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrTmplatManageList(QustnrManageVO qustnrManageVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문관리 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrManageList(ComDefaultVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 상세조회 한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrManageDetail(QustnrManageVO qustnrManageVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문관리를 상세조회(Model) 한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public QustnrManageVO selectQustnrManageDetailModel(QustnrManageVO qustnrManageVO) throws Exception ;
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public int selectQustnrManageListCnt(ComDefaultVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 등록한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
void insertQustnrManage(QustnrManageVO qustnrManageVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 수정한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
void updateQustnrManage(QustnrManageVO qustnrManageVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 삭제한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteQustnrManage(QustnrManageVO qustnrManageVO) throws Exception;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,336 @@
|
||||
package egovframework.com.uss.olp.qmc.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 설문관리 VO Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class QustnrManageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1525075114445382036L;
|
||||
|
||||
/** 설문지ID */
|
||||
private String qestnrId = "";
|
||||
|
||||
/** 설문제목 */
|
||||
private String qestnrSj = "";
|
||||
|
||||
/** 설문목적 */
|
||||
private String qestnrPurps = "";
|
||||
|
||||
/** 설문목적 Notag*/
|
||||
private String qestnrPurpsNotag = "";
|
||||
|
||||
/** 설문작성안내내용 */
|
||||
private String qestnrWritngGuidanceCn = "";
|
||||
|
||||
/** 설문작성안내내용 Notag*/
|
||||
private String qestnrWritngNotag = "";
|
||||
|
||||
/** 설문시작일자 */
|
||||
private String qestnrBeginDe = "";
|
||||
|
||||
/** 설문종료일자 */
|
||||
private String qestnrEndDe = "";
|
||||
|
||||
/** 설문참여 인원 */
|
||||
private String respondCnt = "";
|
||||
|
||||
/** 설문대상 */
|
||||
private String qestnrTrget = "";
|
||||
|
||||
/** 설문대상명 */
|
||||
private String qestnrTrgetNm = "";
|
||||
|
||||
/** 설문시작일자 */
|
||||
private String qestnrTmplatId = "";
|
||||
|
||||
/** 설문사용여부 */
|
||||
private String qestnrUseAt = "";
|
||||
|
||||
/** 설문템플릿유형 */
|
||||
private String qestnrTmplatTy = "";
|
||||
|
||||
/** 최초등록시점 */
|
||||
private String frstRegisterPnttm = "";
|
||||
|
||||
/** 최초등록자아이디 */
|
||||
private String frstRegisterId = "";
|
||||
|
||||
/** 최종수정시점 */
|
||||
private String lastUpdusrPnttm = "";
|
||||
|
||||
/** 최종수정자아이디 */
|
||||
private String lastUpdusrId = "";
|
||||
|
||||
/** 설문기간 여부 */
|
||||
private String periodDiv = "";
|
||||
|
||||
/**
|
||||
* qestnrId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrId() {
|
||||
return qestnrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrId attribute 값을 설정한다.
|
||||
* @return qestnrId String
|
||||
*/
|
||||
public void setQestnrId(String qestnrId) {
|
||||
this.qestnrId = qestnrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrSj attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrSj() {
|
||||
return qestnrSj;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrSj attribute 값을 설정한다.
|
||||
* @return qestnrSj String
|
||||
*/
|
||||
public void setQestnrSj(String qestnrSj) {
|
||||
this.qestnrSj = qestnrSj;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrPurps attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrPurps() {
|
||||
return qestnrPurps;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrPurps attribute 값을 설정한다.
|
||||
* @return qestnrPurps String
|
||||
*/
|
||||
public void setQestnrPurps(String qestnrPurps) {
|
||||
this.qestnrPurps = qestnrPurps;
|
||||
}
|
||||
|
||||
public String getQestnrPurpsNotag() {
|
||||
return qestnrPurpsNotag;
|
||||
}
|
||||
|
||||
public void setQestnrPurpsNotag(String qestnrPurpsNotag) {
|
||||
this.qestnrPurpsNotag = qestnrPurpsNotag;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrWritngGuidanceCn attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrWritngGuidanceCn() {
|
||||
return qestnrWritngGuidanceCn;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrWritngGuidanceCn attribute 값을 설정한다.
|
||||
* @return qestnrWritngGuidanceCn String
|
||||
*/
|
||||
public void setQestnrWritngGuidanceCn(String qestnrWritngGuidanceCn) {
|
||||
this.qestnrWritngGuidanceCn = qestnrWritngGuidanceCn;
|
||||
}
|
||||
|
||||
public String getQestnrWritngNotag() {
|
||||
return qestnrWritngNotag;
|
||||
}
|
||||
|
||||
public void setQestnrWritngNotag(String qestnrWritngNotag) {
|
||||
this.qestnrWritngNotag = qestnrWritngNotag;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrBeginDe attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrBeginDe() {
|
||||
return qestnrBeginDe;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrBeginDe attribute 값을 설정한다.
|
||||
* @return qestnrBeginDe String
|
||||
*/
|
||||
public void setQestnrBeginDe(String qestnrBeginDe) {
|
||||
this.qestnrBeginDe = qestnrBeginDe;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrEndDe attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrEndDe() {
|
||||
return qestnrEndDe;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrEndDe attribute 값을 설정한다.
|
||||
* @return qestnrEndDe String
|
||||
*/
|
||||
public void setQestnrEndDe(String qestnrEndDe) {
|
||||
this.qestnrEndDe = qestnrEndDe;
|
||||
}
|
||||
|
||||
public String getRespondCnt() {
|
||||
return respondCnt;
|
||||
}
|
||||
|
||||
public void setRespondCnt(String respondCnt) {
|
||||
this.respondCnt = respondCnt;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrTrget attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrTrget() {
|
||||
return qestnrTrget;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrTrget attribute 값을 설정한다.
|
||||
* @return qestnrTrget String
|
||||
*/
|
||||
public void setQestnrTrget(String qestnrTrget) {
|
||||
this.qestnrTrget = qestnrTrget;
|
||||
}
|
||||
|
||||
public String getQestnrTrgetNm() {
|
||||
return qestnrTrgetNm;
|
||||
}
|
||||
|
||||
public void setQestnrTrgetNm(String qestnrTrgetNm) {
|
||||
this.qestnrTrgetNm = qestnrTrgetNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrTmplatId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrTmplatId() {
|
||||
return qestnrTmplatId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrTmplatId attribute 값을 설정한다.
|
||||
* @return qestnrTmplatId String
|
||||
*/
|
||||
public void setQestnrTmplatId(String qestnrTmplatId) {
|
||||
this.qestnrTmplatId = qestnrTmplatId;
|
||||
}
|
||||
|
||||
public String getQestnrUseAt() {
|
||||
return qestnrUseAt;
|
||||
}
|
||||
|
||||
public void setQestnrUseAt(String qestnrUseAt) {
|
||||
this.qestnrUseAt = qestnrUseAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrTmplatTy attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrTmplatTy() {
|
||||
return qestnrTmplatTy;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrTmplatTy attribute 값을 설정한다.
|
||||
* @return qestnrTmplatTy String
|
||||
*/
|
||||
public void setQestnrTmplatTy(String qestnrTmplatTy) {
|
||||
this.qestnrTmplatTy = qestnrTmplatTy;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterPnttm attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getFrstRegisterPnttm() {
|
||||
return frstRegisterPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterPnttm attribute 값을 설정한다.
|
||||
* @return frstRegisterPnttm String
|
||||
*/
|
||||
public void setFrstRegisterPnttm(String frstRegisterPnttm) {
|
||||
this.frstRegisterPnttm = frstRegisterPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getFrstRegisterId() {
|
||||
return frstRegisterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterId attribute 값을 설정한다.
|
||||
* @return frstRegisterId String
|
||||
*/
|
||||
public void setFrstRegisterId(String frstRegisterId) {
|
||||
this.frstRegisterId = frstRegisterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrPnttm attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getLastUpdusrPnttm() {
|
||||
return lastUpdusrPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrPnttm attribute 값을 설정한다.
|
||||
* @return lastUpdusrPnttm String
|
||||
*/
|
||||
public void setLastUpdusrPnttm(String lastUpdusrPnttm) {
|
||||
this.lastUpdusrPnttm = lastUpdusrPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getLastUpdusrId() {
|
||||
return lastUpdusrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrId attribute 값을 설정한다.
|
||||
* @return lastUpdusrId String
|
||||
*/
|
||||
public void setLastUpdusrId(String lastUpdusrId) {
|
||||
this.lastUpdusrId = lastUpdusrId;
|
||||
}
|
||||
|
||||
public String getPeriodDiv() {
|
||||
return periodDiv;
|
||||
}
|
||||
|
||||
public void setPeriodDiv(String periodDiv) {
|
||||
this.periodDiv = periodDiv;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,132 @@
|
||||
package egovframework.com.uss.olp.qmc.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
import egovframework.com.uss.olp.qmc.service.EgovQustnrManageService;
|
||||
import egovframework.com.uss.olp.qmc.service.QustnrManageVO;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* 설문관리를 처리하는 ServiceImpl Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Service("egovQustnrManageService")
|
||||
public class EgovQustnrManageServiceImpl extends EgovAbstractServiceImpl implements EgovQustnrManageService{
|
||||
|
||||
//final private Log log = LogFactory.getLog(this.getClass());
|
||||
|
||||
@Resource(name="qustnrManageDao")
|
||||
private QustnrManageDao dao;
|
||||
|
||||
@Resource(name="egovQustnrManageIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
|
||||
/**
|
||||
* 설문템플릿 목록을 조회한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrTmplatManageList(QustnrManageVO qustnrManageVO) throws Exception{
|
||||
return dao.selectQustnrTmplatManageList(qustnrManageVO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 설문관리 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrManageList(ComDefaultVO searchVO) throws Exception{
|
||||
return dao.selectQustnrManageList(searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를 상세조회(Model) 한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public QustnrManageVO selectQustnrManageDetailModel(QustnrManageVO qustnrManageVO) throws Exception {
|
||||
return dao.selectQustnrManageDetailModel(qustnrManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 상세조회 한다.
|
||||
* @param QustnrManage - 회정정보가 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrManageDetail(QustnrManageVO qustnrManageVO) throws Exception{
|
||||
return dao.selectQustnrManageDetail(qustnrManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public int selectQustnrManageListCnt(ComDefaultVO searchVO) throws Exception{
|
||||
return dao.selectQustnrManageListCnt(searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 등록한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void insertQustnrManage(QustnrManageVO qustnrManageVO) throws Exception {
|
||||
String sMakeId = idgenService.getNextStringId();
|
||||
|
||||
qustnrManageVO.setQestnrId(sMakeId);
|
||||
|
||||
dao.insertQustnrManage(qustnrManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 수정한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void updateQustnrManage(QustnrManageVO qustnrManageVO) throws Exception{
|
||||
dao.updateQustnrManage(qustnrManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 삭제한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void deleteQustnrManage(QustnrManageVO qustnrManageVO) throws Exception{
|
||||
dao.deleteQustnrManage(qustnrManageVO);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,114 @@
|
||||
package egovframework.com.uss.olp.qmc.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
|
||||
import egovframework.com.uss.olp.qmc.service.QustnrManageVO;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
/**
|
||||
* 설문관리를 처리하는 Dao Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Repository("qustnrManageDao")
|
||||
public class QustnrManageDao extends EgovComAbstractDAO {
|
||||
|
||||
/**
|
||||
* 설문템플릿 목록을 조회한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrTmplatManageList(QustnrManageVO qustnrManageVO) throws Exception{
|
||||
return list("QustnrManage.selectQustnrTmplatManage", qustnrManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrManageList(ComDefaultVO searchVO) throws Exception{
|
||||
return list("QustnrManage.selectQustnrManage", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를 상세조회(Model) 한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public QustnrManageVO selectQustnrManageDetailModel(QustnrManageVO qustnrManageVO) throws Exception {
|
||||
return (QustnrManageVO) select("QustnrManage.selectQustnrManageDetailModel", qustnrManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 상세조회 한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrManageDetail(QustnrManageVO qustnrManageVO) throws Exception{
|
||||
return list("QustnrManage.selectQustnrManageDetail", qustnrManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public int selectQustnrManageListCnt(ComDefaultVO searchVO) throws Exception{
|
||||
return (Integer)select("QustnrManage.selectQustnrManageCnt", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 등록한다.
|
||||
* @param qqustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public void insertQustnrManage(QustnrManageVO qustnrManageVO) throws Exception{
|
||||
insert("QustnrManage.insertQustnrManage", qustnrManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 수정한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public void updateQustnrManage(QustnrManageVO qustnrManageVO) throws Exception{
|
||||
insert("QustnrManage.updateQustnrManage", qustnrManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를(을) 삭제한다.
|
||||
* @param qustnrManageVO - 설문관리 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteQustnrManage(QustnrManageVO qustnrManageVO) throws Exception{
|
||||
//설문응답자 삭제
|
||||
delete("QustnrManage.deleteQustnrRespondManage", qustnrManageVO);
|
||||
//설문조사(설문결과) 삭제
|
||||
delete("QustnrManage.deleteQustnrRespondInfo", qustnrManageVO);
|
||||
//설문항목 삭제
|
||||
delete("QustnrManage.deleteQustnrItemManage", qustnrManageVO);
|
||||
//설문문항 삭제
|
||||
delete("QustnrManage.deleteQustnrQestnManage", qustnrManageVO);
|
||||
//설문관리 삭제
|
||||
delete("QustnrManage.deleteQustnrManage", qustnrManageVO);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,354 @@
|
||||
package egovframework.com.uss.olp.qmc.web;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultCodeVO;
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
import egovframework.com.cmm.EgovMessageSource;
|
||||
import egovframework.com.cmm.LoginVO;
|
||||
import egovframework.com.cmm.annotation.IncludedInfo;
|
||||
import egovframework.com.cmm.service.EgovCmmUseService;
|
||||
import egovframework.com.cmm.util.EgovUserDetailsHelper;
|
||||
import egovframework.com.sym.bat.service.BatchOpert;
|
||||
import egovframework.com.uss.olp.qmc.service.EgovQustnrManageService;
|
||||
import egovframework.com.uss.olp.qmc.service.QustnrManageVO;
|
||||
import egovframework.itgcms.util.CommUtil;
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springmodules.validation.commons.DefaultBeanValidator;
|
||||
/**
|
||||
* 설문관리를 처리하는 Controller Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
* 2011.8.26 정진오 IncludedInfo annotation 추가
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@Controller
|
||||
public class EgovQustnrManageController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovQustnrManageController.class);
|
||||
|
||||
@Autowired
|
||||
private DefaultBeanValidator beanValidator;
|
||||
|
||||
/** EgovMessageSource */
|
||||
@Resource(name="egovMessageSource")
|
||||
EgovMessageSource egovMessageSource;
|
||||
|
||||
@Resource(name = "egovQustnrManageService")
|
||||
private EgovQustnrManageService egovQustnrManageService;
|
||||
|
||||
/** EgovPropertyService */
|
||||
@Resource(name = "propertiesService")
|
||||
protected EgovPropertyService propertiesService;
|
||||
|
||||
@Resource(name="EgovCmmUseService")
|
||||
private EgovCmmUseService cmmUseService;
|
||||
|
||||
/**
|
||||
* 설문관리 팝업 프레임을 조회한다.
|
||||
* @param searchVO
|
||||
* @param commandMap
|
||||
* @param qustnrManageVO
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qmc/EgovQustnrManageListPopupFrame"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qmc/EgovQustnrManageListPopupFrame.do")
|
||||
public String egovQustnrManageListPopupFrame(@ModelAttribute("searchVO") ComDefaultVO searchVO, HttpServletRequest request, ModelMap model) throws Exception {
|
||||
|
||||
String schDiv = CommUtil.isNull(request.getParameter("schDiv"), "");
|
||||
model.addAttribute("schDiv", schDiv);
|
||||
|
||||
return "egovframework/com/uss/olp/qmc/EgovQustnrManageListPopupFrame";
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리 팝업 목록을 조회한다.
|
||||
* @param searchVO
|
||||
* @param commandMap
|
||||
* @param qustnrManageVO
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qmc/EgovQustnrManageListPopup"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qmc/EgovQustnrManageListPopup.do")
|
||||
public String egovQustnrManageListPopup(@ModelAttribute("searchVO") ComDefaultVO searchVO, @RequestParam Map<?, ?> commandMap,
|
||||
QustnrManageVO qustnrManageVO, ModelMap model) throws Exception {
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
if(sCmd.equals("del")){
|
||||
egovQustnrManageService.deleteQustnrManage(qustnrManageVO);
|
||||
}
|
||||
|
||||
/** EgovPropertyService.sample */
|
||||
searchVO.setPageUnit(propertiesService.getInt("pageUnit"));
|
||||
searchVO.setPageSize(propertiesService.getInt("pageSize"));
|
||||
|
||||
/** pageing */
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
|
||||
paginationInfo.setPageSize(searchVO.getPageSize());
|
||||
|
||||
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
List<?> sampleList = egovQustnrManageService.selectQustnrManageList(searchVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
|
||||
model.addAttribute("searchKeyword", commandMap.get("searchKeyword") == null ? "" : (String)commandMap.get("searchKeyword"));
|
||||
model.addAttribute("searchCondition", commandMap.get("searchCondition") == null ? "" : (String)commandMap.get("searchCondition"));
|
||||
|
||||
int totCnt = egovQustnrManageService.selectQustnrManageListCnt(searchVO);
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
|
||||
return "egovframework/com/uss/olp/qmc/EgovQustnrManageListPopup";
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리 목록을 조회한다.
|
||||
* @param searchVO
|
||||
* @param commandMap
|
||||
* @param qustnrManageVO
|
||||
* @param model
|
||||
* @return "/uss/olp/qmc/EgovQustnrManageList"
|
||||
* @throws Exception
|
||||
*/
|
||||
@IncludedInfo(name="설문관리", order = 590 ,gid = 50)
|
||||
@RequestMapping(value="/_mngr_/qmc/EgovQustnrManageList.do")
|
||||
public String egovQustnrManageList(@ModelAttribute("searchVO") ComDefaultVO searchVO, @RequestParam Map<?, ?> commandMap,
|
||||
QustnrManageVO qustnrManageVO, ModelMap model) throws Exception {
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
if(sCmd.equals("del")){
|
||||
egovQustnrManageService.deleteQustnrManage(qustnrManageVO);
|
||||
}
|
||||
|
||||
/** EgovPropertyService.sample */
|
||||
searchVO.setPageUnit(propertiesService.getInt("pageUnit"));
|
||||
searchVO.setPageSize(propertiesService.getInt("pageSize"));
|
||||
|
||||
/** pageing */
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
|
||||
paginationInfo.setPageSize(searchVO.getPageSize());
|
||||
|
||||
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
List<?> sampleList = egovQustnrManageService.selectQustnrManageList(searchVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
|
||||
model.addAttribute("searchKeyword", commandMap.get("searchKeyword") == null ? "" : (String)commandMap.get("searchKeyword"));
|
||||
model.addAttribute("searchCondition", commandMap.get("searchCondition") == null ? "" : (String)commandMap.get("searchCondition"));
|
||||
|
||||
int totCnt = egovQustnrManageService.selectQustnrManageListCnt(searchVO);
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
|
||||
return "egovframework/com/uss/olp/qmc/EgovQustnrManageList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리 목록을 상세조회 조회한다.
|
||||
* @param searchVO
|
||||
* @param qustnrManageVO
|
||||
* @param commandMap
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qmc/EgovQustnrManageDetail";
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qmc/EgovQustnrManageDetail.do")
|
||||
public String egovQustnrManageDetail(@ModelAttribute("searchVO") ComDefaultVO searchVO, QustnrManageVO qustnrManageVO,
|
||||
@RequestParam Map<?, ?> commandMap, ModelMap model) throws Exception {
|
||||
|
||||
String sLocationUrl = "egovframework/com/uss/olp/qmc/EgovQustnrManageDetail";
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
|
||||
if(sCmd.equals("del")){
|
||||
|
||||
egovQustnrManageService.deleteQustnrManage(qustnrManageVO);
|
||||
// sLocationUrl = "redirect:/_mngr_/qmc/EgovQustnrManageList.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "삭제 되었습니다.", "/_mngr_/qmc/EgovQustnrManageList.do");
|
||||
|
||||
} else {
|
||||
|
||||
//공통코드 직업유형 조회
|
||||
ComDefaultCodeVO voComCode = new ComDefaultCodeVO();
|
||||
voComCode.setCodeId("COM034");
|
||||
List<?> listComCode = cmmUseService.selectCmmCodeDetail(voComCode);
|
||||
model.addAttribute("comCode034", listComCode);
|
||||
|
||||
List<?> sampleList = egovQustnrManageService.selectQustnrManageDetail(qustnrManageVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
}
|
||||
|
||||
return sLocationUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를 수정한다.
|
||||
* @param searchVO
|
||||
* @param commandMap
|
||||
* @param qustnrManageVO
|
||||
* @param bindingResult
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qmc/EgovQustnrManageModify"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qmc/EgovQustnrManageModify.do")
|
||||
public String qustnrManageModify(@ModelAttribute("searchVO") ComDefaultVO searchVO, @RequestParam Map<?, ?> commandMap, QustnrManageVO qustnrManageVO,
|
||||
BindingResult bindingResult, ModelMap model) throws Exception {
|
||||
// 0. Spring Security 사용자권한 처리
|
||||
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
if(!isAuthenticated) {
|
||||
model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
|
||||
return "egovframework/com/uat/uia/EgovLoginUsr";
|
||||
}
|
||||
|
||||
//로그인 객체 선언
|
||||
// LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
String sLocationUrl = "egovframework/com/uss/olp/qmc/EgovQustnrManageModify";
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
|
||||
//공통코드 직업유형 조회
|
||||
ComDefaultCodeVO voComCode = new ComDefaultCodeVO();
|
||||
voComCode.setCodeId("COM034");
|
||||
List<?> listComCode = cmmUseService.selectCmmCodeDetail(voComCode);
|
||||
model.addAttribute("comCode034", listComCode);
|
||||
|
||||
if(sCmd.equals("save")){
|
||||
|
||||
beanValidator.validate(qustnrManageVO, bindingResult);
|
||||
if (bindingResult.hasErrors()){
|
||||
|
||||
List<?> sampleList = egovQustnrManageService.selectQustnrManageDetail(qustnrManageVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
|
||||
//설문템플릿 정보 불러오기
|
||||
List<?> listQustnrTmplat = egovQustnrManageService.selectQustnrTmplatManageList(qustnrManageVO);
|
||||
model.addAttribute("listQustnrTmplat", listQustnrTmplat);
|
||||
|
||||
return sLocationUrl;
|
||||
}
|
||||
|
||||
//아이디 설정
|
||||
qustnrManageVO.setFrstRegisterId(CommUtil.getMngrMemId());
|
||||
qustnrManageVO.setLastUpdusrId(CommUtil.getMngrMemId());
|
||||
|
||||
egovQustnrManageService.updateQustnrManage(qustnrManageVO);
|
||||
// sLocationUrl = "redirect:/uss/olp/qmc/EgovQustnrManageList.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "수정 되었습니다.", "/_mngr_/qmc/EgovQustnrManageDetail.do");
|
||||
|
||||
} else {
|
||||
|
||||
List<?> sampleList = egovQustnrManageService.selectQustnrManageDetail(qustnrManageVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
|
||||
QustnrManageVO newQustnrManageVO = egovQustnrManageService.selectQustnrManageDetailModel(qustnrManageVO);
|
||||
model.addAttribute("qustnrManageVO", newQustnrManageVO);
|
||||
|
||||
//설문템플릿 정보 불러오기
|
||||
List<?> listQustnrTmplat = egovQustnrManageService.selectQustnrTmplatManageList(qustnrManageVO);
|
||||
model.addAttribute("listQustnrTmplat", listQustnrTmplat);
|
||||
}
|
||||
|
||||
return sLocationUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문관리를 등록한다.
|
||||
* @param searchVO
|
||||
* @param commandMap
|
||||
* @param qustnrManageVO
|
||||
* @param bindingResult
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qmc/EgovQustnrManageRegist"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qmc/EgovQustnrManageRegist.do")
|
||||
public String qustnrManageRegist(@ModelAttribute("searchVO") ComDefaultVO searchVO, @RequestParam Map<?, ?> commandMap, @ModelAttribute("qustnrManageVO") QustnrManageVO qustnrManageVO,
|
||||
BindingResult bindingResult, ModelMap model) throws Exception {
|
||||
|
||||
// 0. Spring Security 사용자권한 처리
|
||||
// Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
// if(!isAuthenticated) {
|
||||
// model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
|
||||
// return "egovframework/com/uat/uia/EgovLoginUsr";
|
||||
// }
|
||||
|
||||
//로그인 객체 선언
|
||||
// LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
String sLocationUrl = "egovframework/com/uss/olp/qmc/EgovQustnrManageRegist";
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
LOGGER.info("cmd => {}", sCmd);
|
||||
|
||||
//공통코드 직업유형 조회
|
||||
ComDefaultCodeVO voComCode = new ComDefaultCodeVO();
|
||||
voComCode.setCodeId("COM034");
|
||||
List<?> listComCode = cmmUseService.selectCmmCodeDetail(voComCode);
|
||||
model.addAttribute("comCode034", listComCode);
|
||||
|
||||
if(sCmd.equals("save")){
|
||||
|
||||
beanValidator.validate(qustnrManageVO, bindingResult);
|
||||
if (bindingResult.hasErrors()){
|
||||
//설문템플릿 정보 불러오기
|
||||
List<?> listQustnrTmplat = egovQustnrManageService.selectQustnrTmplatManageList(qustnrManageVO);
|
||||
model.addAttribute("listQustnrTmplat", listQustnrTmplat);
|
||||
return sLocationUrl;
|
||||
}
|
||||
|
||||
//아이디 설정
|
||||
qustnrManageVO.setFrstRegisterId(CommUtil.getMngrMemId());
|
||||
qustnrManageVO.setLastUpdusrId(CommUtil.getMngrMemId());
|
||||
|
||||
egovQustnrManageService.insertQustnrManage(qustnrManageVO);
|
||||
// sLocationUrl = "redirect:/_mngr_/qmc/EgovQustnrManageList.do";
|
||||
return CommUtil.doCompleteUrl(model, "성공", "저장 되었습니다.", "/_mngr_/qmc/EgovQustnrManageList.do");
|
||||
|
||||
} else {
|
||||
|
||||
//설문템플릿 정보 불러오기
|
||||
List<?> listQustnrTmplat = egovQustnrManageService.selectQustnrTmplatManageList(qustnrManageVO);
|
||||
model.addAttribute("listQustnrTmplat", listQustnrTmplat);
|
||||
}
|
||||
|
||||
return sLocationUrl;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,95 @@
|
||||
package egovframework.com.uss.olp.qqm.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
/**
|
||||
* 설문문항을 처리하는 Service Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public interface EgovQustnrQestnManageService {
|
||||
|
||||
/**
|
||||
* 설문조사 응답자답변내용결과/기타답변내용결과 통계를 조회한다.
|
||||
* @param Map - 설문지 정보가 담김 Parameter
|
||||
* @return Map
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrManageStatistics2(Map<?, ?> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문조사 통계를 조회한다.
|
||||
* @param Map - 설문지 정보가 담김 Parameter
|
||||
* @return Map
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrManageStatistics(Map<?, ?> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문지정보 설문제목을 조회한다.
|
||||
* @param Map - 설문지 정보가 담김 Parameter
|
||||
* @return Map
|
||||
* @throws Exception
|
||||
*/
|
||||
public Map<?, ?> selectQustnrManageQestnrSj(Map<?, ?> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문문항 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrQestnManageList(ComDefaultVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 상세조회 한다.
|
||||
* @param qustnrQestnManageVO - 설문문항 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrQestnManageDetail(QustnrQestnManageVO qustnrQestnManageVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public int selectQustnrQestnManageListCnt(ComDefaultVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 등록한다.
|
||||
* @param qustnrQestnManageVO - 설문문항 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
void insertQustnrQestnManage(QustnrQestnManageVO qustnrQestnManageVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 수정한다.
|
||||
* @param qustnrQestnManageVO - 설문문항 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
void updateQustnrQestnManage(QustnrQestnManageVO qustnrQestnManageVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 삭제한다.
|
||||
* @param qustnrQestnManageVO - 설문문항 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteQustnrQestnManage(QustnrQestnManageVO qustnrQestnManageVO) throws Exception;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,272 @@
|
||||
package egovframework.com.uss.olp.qqm.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 설문문항 VO Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class QustnrQestnManageVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1010670861596333788L;
|
||||
|
||||
/** 설문제목 */
|
||||
private String qestnrSj = "";
|
||||
|
||||
/** 설문문항 ID */
|
||||
private String qestnrQesitmId = "";
|
||||
|
||||
/** 설문지 ID */
|
||||
private String qestnrId = "";
|
||||
|
||||
/** 질문순번 */
|
||||
private String qestnSn = "";
|
||||
|
||||
/** 질문유형코드 */
|
||||
private String qestnTyCode = "";
|
||||
|
||||
/** 질문내용 */
|
||||
private String qestnCn = "";
|
||||
|
||||
/** 초대선택건수 */
|
||||
private String mxmmChoiseCo = "";
|
||||
|
||||
/** 템플릿 ID */
|
||||
private String qestnrTmplatId = "";
|
||||
|
||||
/** 최초등록자아이디 */
|
||||
private String frstRegisterPnttm = "";
|
||||
|
||||
/** 최초등록시점 */
|
||||
private String frstRegisterId = "";
|
||||
|
||||
/** 최종수정시점 */
|
||||
private String lastUpdusrPnttm = "";
|
||||
|
||||
/** 최종수정시점아이디 */
|
||||
private String lastUpdusrId = "";
|
||||
|
||||
/** 검색모드설정 */
|
||||
private String searchMode = "";
|
||||
|
||||
/**
|
||||
* qestnrSj attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrSj() {
|
||||
return qestnrSj;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrSj attribute 값을 설정한다.
|
||||
* @return qestnrSj String
|
||||
*/
|
||||
public void setQestnrSj(String qestnrSj) {
|
||||
this.qestnrSj = qestnrSj;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrQesitmId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrQesitmId() {
|
||||
return qestnrQesitmId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrQesitmId attribute 값을 설정한다.
|
||||
* @return qestnrQesitmId String
|
||||
*/
|
||||
public void setQestnrQesitmId(String qestnrQesitmId) {
|
||||
this.qestnrQesitmId = qestnrQesitmId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrId() {
|
||||
return qestnrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrId attribute 값을 설정한다.
|
||||
* @return qestnrId String
|
||||
*/
|
||||
public void setQestnrId(String qestnrId) {
|
||||
this.qestnrId = qestnrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnSn attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnSn() {
|
||||
return qestnSn;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnSn attribute 값을 설정한다.
|
||||
* @return qestnSn String
|
||||
*/
|
||||
public void setQestnSn(String qestnSn) {
|
||||
this.qestnSn = qestnSn;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnTyCode attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnTyCode() {
|
||||
return qestnTyCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnTyCode attribute 값을 설정한다.
|
||||
* @return qestnTyCode String
|
||||
*/
|
||||
public void setQestnTyCode(String qestnTyCode) {
|
||||
this.qestnTyCode = qestnTyCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnCn attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnCn() {
|
||||
return qestnCn;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnCn attribute 값을 설정한다.
|
||||
* @return qestnCn String
|
||||
*/
|
||||
public void setQestnCn(String qestnCn) {
|
||||
this.qestnCn = qestnCn;
|
||||
}
|
||||
|
||||
/**
|
||||
* mxmmChoiseCo attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getMxmmChoiseCo() {
|
||||
return mxmmChoiseCo;
|
||||
}
|
||||
|
||||
/**
|
||||
* mxmmChoiseCo attribute 값을 설정한다.
|
||||
* @return mxmmChoiseCo String
|
||||
*/
|
||||
public void setMxmmChoiseCo(String mxmmChoiseCo) {
|
||||
this.mxmmChoiseCo = mxmmChoiseCo;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrTmplatId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrTmplatId() {
|
||||
return qestnrTmplatId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrTmplatId attribute 값을 설정한다.
|
||||
* @return qestnrTmplatId String
|
||||
*/
|
||||
public void setQestnrTmplatId(String qestnrTmplatId) {
|
||||
this.qestnrTmplatId = qestnrTmplatId;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterPnttm attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getFrstRegisterPnttm() {
|
||||
return frstRegisterPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterPnttm attribute 값을 설정한다.
|
||||
* @return frstRegisterPnttm String
|
||||
*/
|
||||
public void setFrstRegisterPnttm(String frstRegisterPnttm) {
|
||||
this.frstRegisterPnttm = frstRegisterPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getFrstRegisterId() {
|
||||
return frstRegisterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterId attribute 값을 설정한다.
|
||||
* @return frstRegisterId String
|
||||
*/
|
||||
public void setFrstRegisterId(String frstRegisterId) {
|
||||
this.frstRegisterId = frstRegisterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrPnttm attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getLastUpdusrPnttm() {
|
||||
return lastUpdusrPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrPnttm attribute 값을 설정한다.
|
||||
* @return lastUpdusrPnttm String
|
||||
*/
|
||||
public void setLastUpdusrPnttm(String lastUpdusrPnttm) {
|
||||
this.lastUpdusrPnttm = lastUpdusrPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getLastUpdusrId() {
|
||||
return lastUpdusrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrId attribute 값을 설정한다.
|
||||
* @return lastUpdusrId String
|
||||
*/
|
||||
public void setLastUpdusrId(String lastUpdusrId) {
|
||||
this.lastUpdusrId = lastUpdusrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* searchMode attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getSearchMode() {
|
||||
return searchMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* searchMode attribute 값을 설정한다.
|
||||
* @return searchMode String
|
||||
*/
|
||||
public void setSearchMode(String searchMode) {
|
||||
this.searchMode = searchMode;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,142 @@
|
||||
package egovframework.com.uss.olp.qqm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
import egovframework.com.uss.olp.qqm.service.EgovQustnrQestnManageService;
|
||||
import egovframework.com.uss.olp.qqm.service.QustnrQestnManageVO;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
/**
|
||||
* 설문문항을 처리하는 ServiceImpl Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Service("egovQustnrQestnManageService")
|
||||
public class EgovQustnrQestnManageServiceImpl extends EgovAbstractServiceImpl implements EgovQustnrQestnManageService{
|
||||
|
||||
//final private Log log = LogFactory.getLog(this.getClass());
|
||||
|
||||
@Resource(name="qustnrQestnManageDao")
|
||||
private QustnrQestnManageDao dao;
|
||||
|
||||
@Resource(name="egovQustnrQestnManageIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
|
||||
/**
|
||||
* 설문조사 응답자답변내용결과/기타답변내용결과 통계를 조회한다.
|
||||
* @param Map - 설문지 정보가 담김 Parameter
|
||||
* @return Map
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrManageStatistics2(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrManageStatistics2(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문조사 통계를 조회한다.
|
||||
* @param Map - 설문지 정보가 담김 Parameter
|
||||
* @return Map
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrManageStatistics(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrManageStatistics(map);
|
||||
}
|
||||
/**
|
||||
* 설문지정보 설문제목을 조회한다.
|
||||
* @param Map - 설문지 정보가 담김 Parameter
|
||||
* @return Map
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public Map<?, ?> selectQustnrManageQestnrSj(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrManageQestnrSj(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrQestnManageList(ComDefaultVO searchVO) throws Exception{
|
||||
return dao.selectQustnrQestnManageList(searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 상세조회 한다.
|
||||
* @param QustnrQestnManage - 회정정보가 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrQestnManageDetail(QustnrQestnManageVO qustnrQestnManageVO) throws Exception{
|
||||
return dao.selectQustnrQestnManageDetail(qustnrQestnManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public int selectQustnrQestnManageListCnt(ComDefaultVO searchVO) throws Exception{
|
||||
return dao.selectQustnrQestnManageListCnt(searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 등록한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void insertQustnrQestnManage(QustnrQestnManageVO qustnrQestnManageVO) throws Exception {
|
||||
String sMakeId = idgenService.getNextStringId();
|
||||
|
||||
qustnrQestnManageVO.setQestnrQesitmId(sMakeId);
|
||||
|
||||
dao.insertQustnrQestnManage(qustnrQestnManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 수정한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void updateQustnrQestnManage(QustnrQestnManageVO qustnrQestnManageVO) throws Exception{
|
||||
dao.updateQustnrQestnManage(qustnrQestnManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 삭제한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void deleteQustnrQestnManage(QustnrQestnManageVO qustnrQestnManageVO) throws Exception{
|
||||
dao.deleteQustnrQestnManage(qustnrQestnManageVO);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,123 @@
|
||||
package egovframework.com.uss.olp.qqm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
|
||||
import egovframework.com.uss.olp.qqm.service.QustnrQestnManageVO;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
/**
|
||||
* 설문문항을 처리하는 Dao Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Repository("qustnrQestnManageDao")
|
||||
public class QustnrQestnManageDao extends EgovComAbstractDAO {
|
||||
|
||||
/**
|
||||
* 설문조사 응답자답변내용결과/기타답변내용결과 통계를 조회한다.
|
||||
* @param Map - 설문지 정보가 담김 Parameter
|
||||
* @return Map
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrManageStatistics2(Map<?, ?> map) throws Exception{
|
||||
return list("QustnrQestnManage.selectQustnrManageStatistics2", map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문조사 통계를 조회한다.
|
||||
* @param Map - 설문지 정보가 담김 Parameter
|
||||
* @return Map
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrManageStatistics(Map<?, ?> map) throws Exception{
|
||||
return list("QustnrQestnManage.selectQustnrManageStatistics", map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문지정보 설문제목을 조회한다.
|
||||
* @param Map - 설문지 정보가 담김 Parameter
|
||||
* @return Map
|
||||
* @throws Exception
|
||||
*/
|
||||
public Map<?, ?> selectQustnrManageQestnrSj(Map<?, ?> map) throws Exception{
|
||||
return (Map<?, ?>)select("QustnrQestnManage.selectQustnrManageQestnrSj", map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrQestnManageList(ComDefaultVO searchVO) throws Exception{
|
||||
return list("QustnrQestnManage.selectQustnrQestnManage", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 상세조회 한다.
|
||||
* @param qustnrQestnManageVO - 설문문항 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrQestnManageDetail(QustnrQestnManageVO qustnrQestnManageVO) throws Exception{
|
||||
return list("QustnrQestnManage.selectQustnrQestnManageDetail", qustnrQestnManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public int selectQustnrQestnManageListCnt(ComDefaultVO searchVO) throws Exception{
|
||||
return (Integer)select("QustnrQestnManage.selectQustnrQestnManageCnt", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 등록한다.
|
||||
* @param qqustnrQestnManageVO - 설문문항 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public void insertQustnrQestnManage(QustnrQestnManageVO qustnrQestnManageVO) throws Exception{
|
||||
insert("QustnrQestnManage.insertQustnrQestnManage", qustnrQestnManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 수정한다.
|
||||
* @param qustnrQestnManageVO - 설문문항 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public void updateQustnrQestnManage(QustnrQestnManageVO qustnrQestnManageVO) throws Exception{
|
||||
insert("QustnrQestnManage.updateQustnrQestnManage", qustnrQestnManageVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항를(을) 삭제한다.
|
||||
* @param qustnrQestnManageVO - 설문문항 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteQustnrQestnManage(QustnrQestnManageVO qustnrQestnManageVO) throws Exception{
|
||||
|
||||
//설문조사(설문결과) 삭제
|
||||
delete("QustnrQestnManage.deleteQustnrRespondInfo", qustnrQestnManageVO);
|
||||
//설문항목 삭제
|
||||
delete("QustnrQestnManage.deleteQustnrItemManage", qustnrQestnManageVO);
|
||||
|
||||
//설문문항
|
||||
delete("QustnrQestnManage.deleteQustnrQestnManage", qustnrQestnManageVO);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,438 @@
|
||||
package egovframework.com.uss.olp.qqm.web;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultCodeVO;
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
import egovframework.com.cmm.EgovMessageSource;
|
||||
import egovframework.com.cmm.LoginVO;
|
||||
import egovframework.com.cmm.annotation.IncludedInfo;
|
||||
import egovframework.com.cmm.service.EgovCmmUseService;
|
||||
import egovframework.com.cmm.util.EgovUserDetailsHelper;
|
||||
import egovframework.com.sym.bat.service.BatchOpert;
|
||||
import egovframework.com.uss.olp.qqm.service.EgovQustnrQestnManageService;
|
||||
import egovframework.com.uss.olp.qqm.service.QustnrQestnManageVO;
|
||||
import egovframework.itgcms.util.CommUtil;
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springmodules.validation.commons.DefaultBeanValidator;
|
||||
/**
|
||||
* 설문문항을 처리하는 Controller Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
* 2011.8.26 정진오 IncludedInfo annotation 추가
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
@Controller
|
||||
public class EgovQustnrQestnManageController {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovQustnrQestnManageController.class);
|
||||
|
||||
@Autowired
|
||||
private DefaultBeanValidator beanValidator;
|
||||
|
||||
/** EgovMessageSource */
|
||||
@Resource(name="egovMessageSource")
|
||||
EgovMessageSource egovMessageSource;
|
||||
|
||||
@Resource(name = "egovQustnrQestnManageService")
|
||||
private EgovQustnrQestnManageService egovQustnrQestnManageService;
|
||||
|
||||
/** EgovPropertyService */
|
||||
@Resource(name = "propertiesService")
|
||||
protected EgovPropertyService propertiesService;
|
||||
|
||||
@Resource(name="EgovCmmUseService")
|
||||
private EgovCmmUseService cmmUseService;
|
||||
|
||||
/**
|
||||
* 설문항목 통계를 조회한다.
|
||||
* @param searchVO
|
||||
* @param qustnrQestnManageVO
|
||||
* @param commandMap
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageStatistics"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qqm/EgovQustnrQestnManageStatistics.do")
|
||||
public String egovQustnrQestnManageStatistics(@ModelAttribute("searchVO") ComDefaultVO searchVO, QustnrQestnManageVO qustnrQestnManageVO,
|
||||
@RequestParam Map<?, ?> commandMap, ModelMap model) throws Exception {
|
||||
|
||||
String sLocationUrl = "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageStatistics";
|
||||
|
||||
List<?> sampleList = egovQustnrQestnManageService.selectQustnrQestnManageDetail(qustnrQestnManageVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
|
||||
// 객관식설문통계
|
||||
HashMap<String, String> mapParam = new HashMap<String, String>();
|
||||
mapParam.put("qestnrQesitmId", qustnrQestnManageVO.getQestnrQesitmId());
|
||||
List<?> statisticsList = egovQustnrQestnManageService.selectQustnrManageStatistics(mapParam);
|
||||
model.addAttribute("statisticsList", statisticsList);
|
||||
|
||||
// 주관식설문통계
|
||||
List<?> statisticsList2 = egovQustnrQestnManageService.selectQustnrManageStatistics2(mapParam);
|
||||
model.addAttribute("statisticsList2", statisticsList2);
|
||||
|
||||
return sLocationUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항 팝업 프레임을 조회한다.
|
||||
* @param searchVO
|
||||
* @param commandMap
|
||||
* @param qustnrManageVO
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageListPopupFrame"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qqm/EgovQustnrQestnManageListPopupFrame.do")
|
||||
public String egovQustnrQestnManageListPopupFrame(@ModelAttribute("searchVO") ComDefaultVO searchVO, HttpServletRequest request, ModelMap model) throws Exception {
|
||||
|
||||
String searchKeyword0 = CommUtil.isNull(request.getParameter("searchKeyword0"), "");
|
||||
model.addAttribute("searchKeyword0", searchKeyword0);
|
||||
|
||||
return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageListPopupFrame";
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항 팝업 목록을 조회한다.
|
||||
* @param searchVO
|
||||
* @param qustnrQestnManageVO
|
||||
* @param commandMap
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageListPopup"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qqm/EgovQustnrQestnManageListPopup.do")
|
||||
public String egovQustnrQestnManageListPopup(@ModelAttribute("searchVO") ComDefaultVO searchVO, @ModelAttribute("qustnrQestnManageVO") QustnrQestnManageVO qustnrQestnManageVO,
|
||||
@RequestParam Map<?, ?> commandMap, ModelMap model) throws Exception {
|
||||
|
||||
String sSearchMode = commandMap.get("searchMode") == null ? "" : (String)commandMap.get("searchMode");
|
||||
|
||||
//설문지정보에서 넘어오면 자동검색 설정
|
||||
if(sSearchMode.equals("Y")){
|
||||
searchVO.setSearchCondition("QESTNR_ID");
|
||||
searchVO.setSearchKeyword(qustnrQestnManageVO.getQestnrId());
|
||||
}
|
||||
|
||||
/** EgovPropertyService.sample */
|
||||
searchVO.setPageUnit(propertiesService.getInt("pageUnit"));
|
||||
searchVO.setPageSize(propertiesService.getInt("pageSize"));
|
||||
|
||||
/** pageing */
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
|
||||
paginationInfo.setPageSize(searchVO.getPageSize());
|
||||
|
||||
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
List<?> resultList = egovQustnrQestnManageService.selectQustnrQestnManageList(searchVO);
|
||||
model.addAttribute("resultList", resultList);
|
||||
|
||||
int totCnt = egovQustnrQestnManageService.selectQustnrQestnManageListCnt(searchVO);
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
|
||||
return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageListPopup";
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항 목록을 조회한다.
|
||||
* @param searchVO
|
||||
* @param qustnrQestnManageVO
|
||||
* @param commandMap
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageList"
|
||||
* @throws Exception
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@IncludedInfo(name="질문관리", order = 630 ,gid = 50)
|
||||
@RequestMapping(value="/_mngr_/qqm/EgovQustnrQestnManageList.do")
|
||||
public String egovQustnrQestnManageList(@ModelAttribute("searchVO") ComDefaultVO searchVO, @ModelAttribute("qustnrQestnManageVO") QustnrQestnManageVO qustnrQestnManageVO,
|
||||
@RequestParam Map<?, ?> commandMap, ModelMap model) throws Exception {
|
||||
// 0. Spring Security 사용자권한 처리
|
||||
// Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
// if(!isAuthenticated) {
|
||||
// model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
|
||||
// return "egovframework/com/uat/uia/EgovLoginUsr";
|
||||
// }
|
||||
|
||||
//로그인 객체 선언
|
||||
// LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
String sSearchMode = commandMap.get("searchMode") == null ? "" : (String)commandMap.get("searchMode");
|
||||
|
||||
if(sCmd.equals("del")){
|
||||
egovQustnrQestnManageService.deleteQustnrQestnManage(qustnrQestnManageVO);
|
||||
}
|
||||
|
||||
//설문지정보에서 넘어오면 자동검색 설정
|
||||
if(sSearchMode.equals("Y")){
|
||||
// searchVO.setSearchCondition("QESTNR_ID");
|
||||
searchVO.setSearchKeyword0(qustnrQestnManageVO.getQestnrId());
|
||||
}
|
||||
|
||||
/** EgovPropertyService.sample */
|
||||
searchVO.setPageUnit(propertiesService.getInt("pageUnit"));
|
||||
searchVO.setPageSize(propertiesService.getInt("pageSize"));
|
||||
|
||||
/** pageing */
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
|
||||
paginationInfo.setPageSize(searchVO.getPageSize());
|
||||
|
||||
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
List<?> sampleList = egovQustnrQestnManageService.selectQustnrQestnManageList(searchVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
|
||||
int totCnt = egovQustnrQestnManageService.selectQustnrQestnManageListCnt(searchVO);
|
||||
paginationInfo.setTotalRecordCount(totCnt);
|
||||
model.addAttribute("paginationInfo", paginationInfo);
|
||||
|
||||
return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항 목록을 상세조회 조회한다.
|
||||
* @param searchVO
|
||||
* @param qustnrQestnManageVO
|
||||
* @param commandMap
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageDetail"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qqm/EgovQustnrQestnManageDetail.do")
|
||||
public String egovQustnrQestnManageDetail(@ModelAttribute("searchVO") ComDefaultVO searchVO, @ModelAttribute("qustnrQestnManageVO") QustnrQestnManageVO qustnrQestnManageVO,
|
||||
@RequestParam Map<?, ?> commandMap, ModelMap model) throws Exception {
|
||||
|
||||
String sLocationUrl = "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageDetail";
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
|
||||
if(sCmd.equals("del")){
|
||||
|
||||
egovQustnrQestnManageService.deleteQustnrQestnManage(qustnrQestnManageVO);
|
||||
/** 목록으로갈때 검색조건 유지 */
|
||||
// sLocationUrl = "redirect:/_mngr_/qqm/EgovQustnrQestnManageList.do?";
|
||||
// sLocationUrl = sLocationUrl + "searchMode=" + qustnrQestnManageVO.getSearchMode();
|
||||
// sLocationUrl = sLocationUrl + "&qestnrId=" + qustnrQestnManageVO.getQestnrId();
|
||||
// sLocationUrl = sLocationUrl + "&qestnrTmplatId=" +qustnrQestnManageVO.getQestnrTmplatId();
|
||||
return CommUtil.doCompleteUrl(model, "성공", "삭제 되었습니다.", "/_mngr_/qqm/EgovQustnrQestnManageList.do");
|
||||
|
||||
} else {
|
||||
|
||||
//공통코드 질문유형 조회
|
||||
ComDefaultCodeVO voComCode = new ComDefaultCodeVO();
|
||||
voComCode.setCodeId("COM018");
|
||||
List<?> listComCode = cmmUseService.selectCmmCodeDetail(voComCode);
|
||||
model.addAttribute("cmmCode018", listComCode);
|
||||
|
||||
List<?> sampleList = egovQustnrQestnManageService.selectQustnrQestnManageDetail(qustnrQestnManageVO);
|
||||
model.addAttribute("resultList", sampleList);
|
||||
}
|
||||
|
||||
return sLocationUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항를 수정한다.
|
||||
* @param searchVO
|
||||
* @param commandMap
|
||||
* @param qustnrQestnManageVO
|
||||
* @param bindingResult
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageModify"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qqm/EgovQustnrQestnManageModify.do")
|
||||
public String qustnrQestnManageModify(@ModelAttribute("searchVO") ComDefaultVO searchVO, @RequestParam Map<?, ?> commandMap,
|
||||
@ModelAttribute("qustnrQestnManageVO") QustnrQestnManageVO qustnrQestnManageVO, BindingResult bindingResult, ModelMap model) throws Exception {
|
||||
// 0. Spring Security 사용자권한 처리
|
||||
// Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
// if(!isAuthenticated) {
|
||||
// model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
|
||||
// return "egovframework/com/uat/uia/EgovLoginUsr";
|
||||
// }
|
||||
|
||||
//로그인 객체 선언
|
||||
// LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
String sLocationUrl = "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageModify";
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
|
||||
//공통코드 질문유형 조회
|
||||
ComDefaultCodeVO voComCode = new ComDefaultCodeVO();
|
||||
voComCode.setCodeId("COM018");
|
||||
List<?> listComCode = cmmUseService.selectCmmCodeDetail(voComCode);
|
||||
model.addAttribute("cmmCode018", listComCode);
|
||||
|
||||
if(sCmd.equals("save")){
|
||||
//서버 validate 체크
|
||||
beanValidator.validate(qustnrQestnManageVO, bindingResult);
|
||||
if (bindingResult.hasErrors()){
|
||||
//설문제목가져오기
|
||||
String sQestnrId = commandMap.get("qestnrId") == null ? "" : (String)commandMap.get("qestnrId");
|
||||
String sQestnrTmplatId = commandMap.get("qestnrTmplatId") == null ? "" : (String)commandMap.get("qestnrTmplatId");
|
||||
|
||||
LOGGER.info("sQestnrId => {}", sQestnrId);
|
||||
LOGGER.info("sQestnrTmplatId => {}", sQestnrTmplatId);
|
||||
if(!sQestnrId.equals("") && !sQestnrTmplatId.equals("")){
|
||||
|
||||
Map<String, String> mapQustnrManage = new HashMap<String, String>();
|
||||
mapQustnrManage.put("qestnrId", sQestnrId);
|
||||
mapQustnrManage.put("qestnrTmplatId", sQestnrTmplatId);
|
||||
|
||||
model.addAttribute("qestnrInfo", egovQustnrQestnManageService.selectQustnrManageQestnrSj(mapQustnrManage));
|
||||
}
|
||||
|
||||
List<?> resultList = egovQustnrQestnManageService.selectQustnrQestnManageDetail(qustnrQestnManageVO);
|
||||
model.addAttribute("resultList", resultList);
|
||||
return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageModify";
|
||||
}
|
||||
|
||||
//아이디 설정
|
||||
qustnrQestnManageVO.setFrstRegisterId(CommUtil.getMngrMemId());
|
||||
qustnrQestnManageVO.setLastUpdusrId(CommUtil.getMngrMemId());
|
||||
|
||||
egovQustnrQestnManageService.updateQustnrQestnManage(qustnrQestnManageVO);
|
||||
/** 목록으로갈때 검색조건 유지 */
|
||||
// sLocationUrl = "redirect:/_mngr_/qqm/EgovQustnrQestnManageList.do?";
|
||||
// sLocationUrl = sLocationUrl + "searchMode=" + qustnrQestnManageVO.getSearchMode();
|
||||
// sLocationUrl = sLocationUrl + "&qestnrId=" + qustnrQestnManageVO.getQestnrId();
|
||||
// sLocationUrl = sLocationUrl + "&qestnrTmplatId=" +qustnrQestnManageVO.getQestnrTmplatId();
|
||||
return CommUtil.doCompleteUrl(model, "성공", "수정 되었습니다.", "/_mngr_/qqm/EgovQustnrQestnManageDetail.do");
|
||||
|
||||
} else {
|
||||
|
||||
List<?> resultList = egovQustnrQestnManageService.selectQustnrQestnManageDetail(qustnrQestnManageVO);
|
||||
model.addAttribute("resultList", resultList);
|
||||
}
|
||||
|
||||
return sLocationUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문문항를 등록한다.
|
||||
* @param searchVO
|
||||
* @param commandMap
|
||||
* @param qustnrQestnManageVO
|
||||
* @param bindingResult
|
||||
* @param model
|
||||
* @return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageRegist"
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value="/_mngr_/qqm/EgovQustnrQestnManageRegist.do")
|
||||
public String qustnrQestnManageRegist(@ModelAttribute("searchVO") ComDefaultVO searchVO, @RequestParam Map<?, ?> commandMap,
|
||||
@ModelAttribute("qustnrQestnManageVO") QustnrQestnManageVO qustnrQestnManageVO, BindingResult bindingResult, ModelMap model) throws Exception {
|
||||
// 0. Spring Security 사용자권한 처리
|
||||
// Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
// if(!isAuthenticated) {
|
||||
// model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
|
||||
// return "egovframework/com/uat/uia/EgovLoginUsr";
|
||||
// }
|
||||
|
||||
//로그인 객체 선언
|
||||
// LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
|
||||
|
||||
String sLocationUrl = "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageRegist";
|
||||
|
||||
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
|
||||
LOGGER.info("cmd => {}", sCmd);
|
||||
|
||||
//공통코드 질문유형 조회
|
||||
ComDefaultCodeVO voComCode = new ComDefaultCodeVO();
|
||||
voComCode.setCodeId("COM018");
|
||||
List<?> listComCode = cmmUseService.selectCmmCodeDetail(voComCode);
|
||||
model.addAttribute("cmmCode018", listComCode);
|
||||
|
||||
if(sCmd.equals("save")){
|
||||
|
||||
//서버 validate 체크
|
||||
beanValidator.validate(qustnrQestnManageVO, bindingResult);
|
||||
if (bindingResult.hasErrors()){
|
||||
//설문제목가져오기
|
||||
String sQestnrId = commandMap.get("qestnrId") == null ? "" : (String)commandMap.get("qestnrId");
|
||||
String sQestnrTmplatId = commandMap.get("qestnrTmplatId") == null ? "" : (String)commandMap.get("qestnrTmplatId");
|
||||
|
||||
LOGGER.info("sQestnrId => {}", sQestnrId);
|
||||
LOGGER.info("sQestnrTmplatId => {}", sQestnrTmplatId);
|
||||
if(!sQestnrId.equals("") && !sQestnrTmplatId.equals("")){
|
||||
|
||||
Map<String, String> mapQustnrManage = new HashMap<String, String>();
|
||||
mapQustnrManage.put("qestnrId", sQestnrId);
|
||||
mapQustnrManage.put("qestnrTmplatId", sQestnrTmplatId);
|
||||
|
||||
model.addAttribute("qestnrInfo", egovQustnrQestnManageService.selectQustnrManageQestnrSj(mapQustnrManage));
|
||||
}
|
||||
|
||||
return "egovframework/com/uss/olp/qqm/EgovQustnrQestnManageRegist";
|
||||
}
|
||||
|
||||
//아이디 설정
|
||||
qustnrQestnManageVO.setFrstRegisterId(CommUtil.getMngrMemId());
|
||||
qustnrQestnManageVO.setLastUpdusrId(CommUtil.getMngrMemId());
|
||||
/** 목록으로갈때 검색조건 유지 */
|
||||
egovQustnrQestnManageService.insertQustnrQestnManage(qustnrQestnManageVO);
|
||||
// sLocationUrl = "redirect:/_mngr_/qqm/EgovQustnrQestnManageList.do?";
|
||||
// sLocationUrl = sLocationUrl + "searchMode=" + qustnrQestnManageVO.getSearchMode();
|
||||
// sLocationUrl = sLocationUrl + "&qestnrId=" + qustnrQestnManageVO.getQestnrId();
|
||||
// sLocationUrl = sLocationUrl + "&qestnrTmplatId=" +qustnrQestnManageVO.getQestnrTmplatId();
|
||||
return CommUtil.doCompleteUrl(model, "성공", "저장 되었습니다.", "/_mngr_/qqm/EgovQustnrQestnManageList.do");
|
||||
|
||||
} else {
|
||||
|
||||
//설문제목가져오기
|
||||
String sQestnrId = commandMap.get("qestnrId") == null ? "" : (String)commandMap.get("qestnrId");
|
||||
String sQestnrTmplatId = commandMap.get("qestnrTmplatId") == null ? "" : (String)commandMap.get("qestnrTmplatId");
|
||||
|
||||
LOGGER.info("sQestnrId => {}", sQestnrId);
|
||||
LOGGER.info("sQestnrTmplatId => {}", sQestnrTmplatId);
|
||||
|
||||
if(!sQestnrId.equals("") && !sQestnrTmplatId.equals("")){
|
||||
|
||||
Map<String, String> mapQustnrManage = new HashMap<String, String>();
|
||||
mapQustnrManage.put("qestnrId", sQestnrId);
|
||||
mapQustnrManage.put("qestnrTmplatId", sQestnrTmplatId);
|
||||
|
||||
model.addAttribute("qestnrInfo", egovQustnrQestnManageService.selectQustnrManageQestnrSj(mapQustnrManage));
|
||||
}
|
||||
}
|
||||
|
||||
return sLocationUrl;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,193 @@
|
||||
package egovframework.com.uss.olp.qri.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
import egovframework.itgcms.module.link.service.LinkVO;
|
||||
/**
|
||||
* 설문조사 Service Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public interface EgovQustnrRespondInfoService {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 설문템플릿을 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrTmplatManage(Map<?, ?> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 객관식 통계를 조회 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageStatistics1(Map<?, ?> map) throws Exception;
|
||||
/**
|
||||
* 주관식 통계를 조회 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageStatistics2(Map<?, ?> map) throws Exception;
|
||||
/**
|
||||
* 회원정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public Map<?, ?> selectQustnrRespondInfoManageEmplyrinfo(Map<?, ?> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageComtnqestnrinfo(Map<?, ?> map) throws Exception;
|
||||
/**
|
||||
* 설문정보(web)를 조회한다.
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageComtnqestnrinfoWeb() throws Exception;
|
||||
/**
|
||||
* 문항정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageComtnqustnrqesitm(Map<?, ?> map) throws Exception;
|
||||
/**
|
||||
* 기타의견이 있는 문항정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageComtnqustnrqesitmEtc(Map<?, ?> map) throws Exception;
|
||||
/**
|
||||
* 항목정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageComtnqustnriem(Map<?, ?> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 기타의견이 있는 항목정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageComtnqustnriemEtc(Map<?, ?> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 항목결과(기타 답변내용)를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoComtnqustnrrspnsresultEtc(Map<?, ?> map) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문조사(설문등록)를(을) 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageList(ComDefaultVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문조사(설문등록)를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int selectQustnrRespondInfoManageListCnt(ComDefaultVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사) 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoList(ComDefaultVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 상세조회 한다.
|
||||
* @param qustnrRespondInfoVO - 응답자결과(설문조사) 정보 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoDetail(QustnrRespondInfoVO qustnrRespondInfoVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public int selectQustnrRespondInfoListCnt(ComDefaultVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 등록한다.
|
||||
* @param qustnrRespondInfoVO - 응답자결과(설문조사) 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
void insertQustnrRespondInfo(QustnrRespondInfoVO qustnrRespondInfoVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 수정한다.
|
||||
* @param qustnrRespondInfoVO - 응답자결과(설문조사) 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
void updateQustnrRespondInfo(QustnrRespondInfoVO qustnrRespondInfoVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 삭제한다.
|
||||
* @param qustnrRespondInfoVO - 응답자결과(설문조사) 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
void deleteQustnrRespondInfo(QustnrRespondInfoVO qustnrRespondInfoVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 사용자 설문조사(설문등록)를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectWebPollRegistPopup(ComDefaultVO searchVO) throws Exception;
|
||||
|
||||
/**
|
||||
* 설문조사 전체 결과(통계)를 엑셀다운로드한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
|
||||
|
||||
ModelAndView mngrQustnrRespondInfoResultExcelDown(Map<?, ?> map, HttpServletRequest request) throws Exception;
|
||||
}
|
||||
@ -0,0 +1,264 @@
|
||||
package egovframework.com.uss.olp.qri.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
/**
|
||||
* 설문조사 VO Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class QustnrRespondInfoVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 129726904408750568L;
|
||||
|
||||
/** 설문응답ID */
|
||||
private String qestnrQesrspnsId = "";
|
||||
|
||||
/** 설문문항ID */
|
||||
private String qestnrQesitmId = "";
|
||||
|
||||
/** 설문ID */
|
||||
private String qestnrId = "";
|
||||
|
||||
/** 설문템플릿ID */
|
||||
private String qestnrTmplatId = "";
|
||||
|
||||
/** 설문항목ID */
|
||||
private String qustnrIemId = "";
|
||||
|
||||
/** 응답자답변내용 */
|
||||
private String respondAnswerCn = "";
|
||||
|
||||
/** 응답자명 */
|
||||
private String respondNm = "";
|
||||
|
||||
/** 기타답변내용 */
|
||||
private String etcAnswerCn = "";
|
||||
|
||||
/** 기타답변여부 갯수 */
|
||||
private String etcAnswerAtCnt = "";
|
||||
|
||||
/** 최초등록시점 */
|
||||
private String frstRegisterPnttm = "";
|
||||
|
||||
/** 최등등록시점ID */
|
||||
private String frstRegisterId = "";
|
||||
|
||||
/** 최종수정시점 */
|
||||
private String lastUpdusrPnttm = "";
|
||||
|
||||
/** 최종수정시점ID */
|
||||
private String lastUpdusrId = "";
|
||||
|
||||
/**
|
||||
* qestnrQesrspnsId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrQesrspnsId() {
|
||||
return qestnrQesrspnsId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrQesrspnsId attribute 값을 설정한다.
|
||||
* @return qestnrQesrspnsId String
|
||||
*/
|
||||
public void setQestnrQesrspnsId(String qestnrQesrspnsId) {
|
||||
this.qestnrQesrspnsId = qestnrQesrspnsId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrQesitmId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrQesitmId() {
|
||||
return qestnrQesitmId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrQesitmId attribute 값을 설정한다.
|
||||
* @return qestnrQesitmId String
|
||||
*/
|
||||
public void setQestnrQesitmId(String qestnrQesitmId) {
|
||||
this.qestnrQesitmId = qestnrQesitmId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrId() {
|
||||
return qestnrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrId attribute 값을 설정한다.
|
||||
* @return qestnrId String
|
||||
*/
|
||||
public void setQestnrId(String qestnrId) {
|
||||
this.qestnrId = qestnrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrTmplatId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQestnrTmplatId() {
|
||||
return qestnrTmplatId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qestnrTmplatId attribute 값을 설정한다.
|
||||
* @return qestnrTmplatId String
|
||||
*/
|
||||
public void setQestnrTmplatId(String qestnrTmplatId) {
|
||||
this.qestnrTmplatId = qestnrTmplatId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qustnrIemId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getQustnrIemId() {
|
||||
return qustnrIemId;
|
||||
}
|
||||
|
||||
/**
|
||||
* qustnrIemId attribute 값을 설정한다.
|
||||
* @return qustnrIemId String
|
||||
*/
|
||||
public void setQustnrIemId(String qustnrIemId) {
|
||||
this.qustnrIemId = qustnrIemId;
|
||||
}
|
||||
|
||||
/**
|
||||
* respondAnswerCn attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getRespondAnswerCn() {
|
||||
return respondAnswerCn;
|
||||
}
|
||||
|
||||
/**
|
||||
* respondAnswerCn attribute 값을 설정한다.
|
||||
* @return respondAnswerCn String
|
||||
*/
|
||||
public void setRespondAnswerCn(String respondAnswerCn) {
|
||||
this.respondAnswerCn = respondAnswerCn;
|
||||
}
|
||||
|
||||
/**
|
||||
* respondNm attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getRespondNm() {
|
||||
return respondNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* respondNm attribute 값을 설정한다.
|
||||
* @return respondNm String
|
||||
*/
|
||||
public void setRespondNm(String respondNm) {
|
||||
this.respondNm = respondNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* etcAnswerCn attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getEtcAnswerCn() {
|
||||
return etcAnswerCn;
|
||||
}
|
||||
|
||||
/**
|
||||
* etcAnswerCn attribute 값을 설정한다.
|
||||
* @return etcAnswerCn String
|
||||
*/
|
||||
public void setEtcAnswerCn(String etcAnswerCn) {
|
||||
this.etcAnswerCn = etcAnswerCn;
|
||||
}
|
||||
|
||||
public String getEtcAnswerAtCnt() {
|
||||
return etcAnswerAtCnt;
|
||||
}
|
||||
|
||||
public void setEtcAnswerAtCnt(String etcAnswerAtCnt) {
|
||||
this.etcAnswerAtCnt = etcAnswerAtCnt;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterPnttm attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getFrstRegisterPnttm() {
|
||||
return frstRegisterPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterPnttm attribute 값을 설정한다.
|
||||
* @return frstRegisterPnttm String
|
||||
*/
|
||||
public void setFrstRegisterPnttm(String frstRegisterPnttm) {
|
||||
this.frstRegisterPnttm = frstRegisterPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getFrstRegisterId() {
|
||||
return frstRegisterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* frstRegisterId attribute 값을 설정한다.
|
||||
* @return frstRegisterId String
|
||||
*/
|
||||
public void setFrstRegisterId(String frstRegisterId) {
|
||||
this.frstRegisterId = frstRegisterId;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrPnttm attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getLastUpdusrPnttm() {
|
||||
return lastUpdusrPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrPnttm attribute 값을 설정한다.
|
||||
* @return lastUpdusrPnttm String
|
||||
*/
|
||||
public void setLastUpdusrPnttm(String lastUpdusrPnttm) {
|
||||
this.lastUpdusrPnttm = lastUpdusrPnttm;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrId attribute 를 리턴한다.
|
||||
* @return the String
|
||||
*/
|
||||
public String getLastUpdusrId() {
|
||||
return lastUpdusrId;
|
||||
}
|
||||
|
||||
/**
|
||||
* lastUpdusrId attribute 값을 설정한다.
|
||||
* @return lastUpdusrId String
|
||||
*/
|
||||
public void setLastUpdusrId(String lastUpdusrId) {
|
||||
this.lastUpdusrId = lastUpdusrId;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,309 @@
|
||||
package egovframework.com.uss.olp.qri.service.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
import egovframework.com.uss.olp.qri.service.EgovQustnrRespondInfoService;
|
||||
import egovframework.com.uss.olp.qri.service.QustnrRespondInfoVO;
|
||||
import egovframework.itgcms.common.ItgMap;
|
||||
import egovframework.itgcms.module.link.service.LinkVO;
|
||||
import egovframework.itgcms.util.CommUtil;
|
||||
import egovframework.itgcms.util.ExcelDownloadView;
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
/**
|
||||
* 설문조사 ServiceImpl Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Service("egovQustnrRespondInfoService")
|
||||
public class EgovQustnrRespondInfoServiceImpl extends EgovAbstractServiceImpl implements EgovQustnrRespondInfoService{
|
||||
|
||||
//final private Log log = LogFactory.getLog(this.getClass());
|
||||
|
||||
@Resource(name="qustnrRespondInfoDao")
|
||||
private QustnrRespondInfoDao dao;
|
||||
|
||||
@Resource(name="qustnrRespondInfoIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
|
||||
/**
|
||||
* 설문템플릿을 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrTmplatManage(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrTmplatManage(map);
|
||||
}
|
||||
/**
|
||||
* 객관식 통계를 조회 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrRespondInfoManageStatistics1(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrRespondInfoManageStatistics1(map);
|
||||
}
|
||||
/**
|
||||
* 주관식 통계를 조회 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrRespondInfoManageStatistics2(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrRespondInfoManageStatistics2(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public Map<?, ?> selectQustnrRespondInfoManageEmplyrinfo(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrRespondInfoManageEmplyrinfo(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrRespondInfoManageComtnqestnrinfo(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrRespondInfoManageComtnqestnrinfo(map);
|
||||
}
|
||||
/**
|
||||
* 설문정보(web)를 조회한다.
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrRespondInfoManageComtnqestnrinfoWeb() throws Exception{
|
||||
return dao.selectQustnrRespondInfoManageComtnqestnrinfoWeb();
|
||||
}
|
||||
/**
|
||||
* 문항정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrRespondInfoManageComtnqustnrqesitm(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrRespondInfoManageComtnqustnrqesitm(map);
|
||||
}
|
||||
/**
|
||||
* 기타의견이 있는 문항정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrRespondInfoManageComtnqustnrqesitmEtc(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrRespondInfoManageComtnqustnrqesitmEtc(map);
|
||||
}
|
||||
/**
|
||||
* 항목정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrRespondInfoManageComtnqustnriem(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrRespondInfoManageComtnqustnriem(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 기타의견이 있는 항목정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrRespondInfoManageComtnqustnriemEtc(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrRespondInfoManageComtnqustnriemEtc(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 항목결과(기타 답변내용)를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrRespondInfoComtnqustnrrspnsresultEtc(Map<?, ?> map) throws Exception{
|
||||
return dao.selectQustnrRespondInfoComtnqustnrrspnsresultEtc(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문조사(설문등록)를(을) 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrRespondInfoManageList(ComDefaultVO searchVO) throws Exception{
|
||||
return dao.selectQustnrRespondInfoManageList(searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문조사(설문등록)를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public int selectQustnrRespondInfoManageListCnt(ComDefaultVO searchVO) throws Exception{
|
||||
return dao.selectQustnrRespondInfoManageListCnt(searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사) 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrRespondInfoList(ComDefaultVO searchVO) throws Exception{
|
||||
return dao.selectQustnrRespondInfoList(searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 상세조회 한다.
|
||||
* @param QustnrRespondInfo - 회정정보가 담김 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectQustnrRespondInfoDetail(QustnrRespondInfoVO qustnrRespondInfoVO) throws Exception{
|
||||
return dao.selectQustnrRespondInfoDetail(qustnrRespondInfoVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public int selectQustnrRespondInfoListCnt(ComDefaultVO searchVO) throws Exception{
|
||||
return dao.selectQustnrRespondInfoListCnt(searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 등록한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void insertQustnrRespondInfo(QustnrRespondInfoVO qustnrRespondInfoVO) throws Exception {
|
||||
String sMakeId = idgenService.getNextStringId();
|
||||
|
||||
qustnrRespondInfoVO.setQestnrQesrspnsId(sMakeId);
|
||||
|
||||
dao.insertQustnrRespondInfo(qustnrRespondInfoVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 수정한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void updateQustnrRespondInfo(QustnrRespondInfoVO qustnrRespondInfoVO) throws Exception{
|
||||
dao.updateQustnrRespondInfo(qustnrRespondInfoVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 삭제한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public void deleteQustnrRespondInfo(QustnrRespondInfoVO qustnrRespondInfoVO) throws Exception{
|
||||
dao.deleteQustnrRespondInfo(qustnrRespondInfoVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 사용자 설문조사(설문등록)를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<?> selectWebPollRegistPopup(ComDefaultVO searchVO) throws Exception{
|
||||
return dao.selectWebPollRegistPopup(searchVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModelAndView mngrQustnrRespondInfoResultExcelDown(Map<?, ?> map, HttpServletRequest request) throws Exception{
|
||||
|
||||
ModelAndView mav = new ModelAndView(ExcelDownloadView.EXCEL_DOWN);
|
||||
|
||||
Map paramMap = CommUtil.getParameterMap(request);
|
||||
|
||||
// sheet 1
|
||||
//설문정보
|
||||
paramMap.put("Comtnqestnrinfo", dao.selectQustnrRespondInfoManageComtnqestnrinfo(map));
|
||||
//문항정보
|
||||
paramMap.put("Comtnqustnrqesitm", dao.selectQustnrRespondInfoManageComtnqustnrqesitm(map));
|
||||
paramMap.put("dataList", dao.selectQustnrRespondInfoManageComtnqustnrqesitm(map));
|
||||
//항목정보
|
||||
paramMap.put("Comtnqustnriem", dao.selectQustnrRespondInfoManageComtnqustnriem(map));
|
||||
//설문템플릿ID 설정
|
||||
paramMap.put("qestnrTmplatId", map.get("qestnrTmplatId") == null ? "" : (String)map.get("qestnrTmplatId") );
|
||||
//설문지정보ID 설정
|
||||
paramMap.put("qestnrId", map.get("qestnrId") == null ? "" : (String)map.get("qestnrId"));
|
||||
//객관식통계 답안
|
||||
paramMap.put("qestnrStatistic1", dao.selectQustnrRespondInfoManageStatistics1(map));
|
||||
//주관식통계 답안
|
||||
paramMap.put("qestnrStatistic2", dao.selectQustnrRespondInfoManageStatistics2(map));
|
||||
|
||||
// sheet 2
|
||||
//문항정보(기타의견만 포함)
|
||||
paramMap.put("ComtnqustnrqesitmEtc", dao.selectQustnrRespondInfoManageComtnqustnrqesitmEtc(map));
|
||||
//항목정보(기타의견만 포함)
|
||||
paramMap.put("ComtnqustnriemEtc", dao.selectQustnrRespondInfoManageComtnqustnriemEtc(map));
|
||||
//항목결과(기타 답변내용)
|
||||
paramMap.put("ComtnqustnrrspnsresultEtc", dao.selectQustnrRespondInfoComtnqustnrrspnsresultEtc(map));
|
||||
|
||||
//엑셀 템플릿에 넘겨줄 데이타
|
||||
mav.addObject("data", paramMap);
|
||||
|
||||
//다운로드에 사용되어질 엑셀파일 템플릿
|
||||
mav.addObject(ExcelDownloadView.DOWN_EXCEL_TEMPLATE, CommUtil.getExcelTemplateName(request, "mngr"));
|
||||
|
||||
//다운로드시 표시될 파일명 (확장자는 자동으로 xls로 지정된다.)
|
||||
// mav.addObject(ExcelDownloadView.DOWN_FILE_NM, "연계 데이터 통계("+linkVO.getCntOption()+")_"+ CommUtil.getDatePattern("yyyy-MM-dd"));
|
||||
mav.addObject(ExcelDownloadView.DOWN_FILE_NM, "설문 결과");
|
||||
|
||||
return mav;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,221 @@
|
||||
package egovframework.com.uss.olp.qri.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.com.cmm.ComDefaultVO;
|
||||
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
|
||||
import egovframework.com.uss.olp.qri.service.QustnrRespondInfoVO;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
/**
|
||||
* 설문조사 Dao Class 구현
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2009.03.20
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.20 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Repository("qustnrRespondInfoDao")
|
||||
public class QustnrRespondInfoDao extends EgovComAbstractDAO {
|
||||
|
||||
|
||||
/**
|
||||
* 설문템플릿을 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrTmplatManage(Map<?, ?> map) throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrTmplatManages", map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 객관식 통계를 조회 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageStatistics1(Map<?, ?> map) throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrRespondInfoManageStatistics1", map);
|
||||
}
|
||||
/**
|
||||
* 주관식 통계를 조회 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageStatistics2(Map<?, ?> map) throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrRespondInfoManageStatistics2", map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 회원정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public Map<?, ?> selectQustnrRespondInfoManageEmplyrinfo(Map<?, ?> map) throws Exception{
|
||||
return (Map<?, ?>)select("QustnrRespondInfo.selectQustnrRespondInfoManageEmplyrinfo", map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageComtnqestnrinfo(Map<?, ?> map) throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrRespondInfoManageComtnqestnrinfo", map);
|
||||
}
|
||||
/**
|
||||
* 설문정보(web)를 조회한다.
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageComtnqestnrinfoWeb() throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrRespondInfoManageComtnqestnrinfoWeb", "");
|
||||
}
|
||||
/**
|
||||
* 문항정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageComtnqustnrqesitm(Map<?, ?> map) throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrRespondInfoManageComtnqustnrqesitm", map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 기타의견이 있는 문항정보만 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageComtnqustnrqesitmEtc(Map<?, ?> map) throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrRespondInfoManageComtnqustnrqesitmEtc", map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 항목정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageComtnqustnriem(Map<?, ?> map) throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrRespondInfoManageComtnqustnriem", map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 기타의견이 있는 항목정보를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageComtnqustnriemEtc(Map<?, ?> map) throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrRespondInfoManageComtnqustnriemEtc", map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 항목결과(기타 답변내용)를 조회한다.
|
||||
* @param map - 조회할 정보가 담긴 map
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoComtnqustnrrspnsresultEtc(Map<?, ?> map) throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrRespondInfoComtnqustnrrspnsresultEtc", map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문조사(설문등록)를(을) 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoManageList(ComDefaultVO searchVO) throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrRespondInfoManage", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 설문조사(설문등록)를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public int selectQustnrRespondInfoManageListCnt(ComDefaultVO searchVO) throws Exception{
|
||||
return (Integer)select("QustnrRespondInfo.selectQustnrRespondInfoManageCnt", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사) 목록을 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoList(ComDefaultVO searchVO) throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrRespondInfo", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 상세조회 한다.
|
||||
* @param qustnrRespondInfoVO - 응답자결과(설문조사) 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectQustnrRespondInfoDetail(QustnrRespondInfoVO qustnrRespondInfoVO) throws Exception{
|
||||
return list("QustnrRespondInfo.selectQustnrRespondInfoDetail", qustnrRespondInfoVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 목록 전체 건수를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return int
|
||||
* @throws Exception
|
||||
*/
|
||||
public int selectQustnrRespondInfoListCnt(ComDefaultVO searchVO) throws Exception{
|
||||
return (Integer)select("QustnrRespondInfo.selectQustnrRespondInfoCnt", searchVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 등록한다.
|
||||
* @param qqustnrRespondInfoVO - 응답자결과(설문조사) 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public void insertQustnrRespondInfo(QustnrRespondInfoVO qustnrRespondInfoVO) throws Exception{
|
||||
insert("QustnrRespondInfo.insertQustnrRespondInfo", qustnrRespondInfoVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 수정한다.
|
||||
* @param qustnrRespondInfoVO - 응답자결과(설문조사) 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public void updateQustnrRespondInfo(QustnrRespondInfoVO qustnrRespondInfoVO) throws Exception{
|
||||
insert("QustnrRespondInfo.updateQustnrRespondInfo", qustnrRespondInfoVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 응답자결과(설문조사)를(을) 삭제한다.
|
||||
* @param qustnrRespondInfoVO - 응답자결과(설문조사) 정보 담김 VO
|
||||
* @throws Exception
|
||||
*/
|
||||
public void deleteQustnrRespondInfo(QustnrRespondInfoVO qustnrRespondInfoVO) throws Exception{
|
||||
insert("QustnrRespondInfo.deleteQustnrRespondInfo", qustnrRespondInfoVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 사용자 설문조사(설문등록)를(을) 조회한다.
|
||||
* @param searchVO - 조회할 정보가 담긴 VO
|
||||
* @return List
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<?> selectWebPollRegistPopup(ComDefaultVO searchVO) throws Exception{
|
||||
return list("QustnrRespondInfo.selectWebPollRegistPopup", searchVO);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue