최초커밋(일부)

main
이범준 11 months ago
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>
* &lt;&lt; (Modification Information) &gt;&gt;
*
*
* ------- -------- ---------------------------
* 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 [] = {
"&#40;","&#41;",
"&#91;","&#93;",
"&#123;","&#125;",
"&#34;","&#39;",
"&#44;","&#58;",
"&#59;","&#61;",
" ","\t", //" ","\t",
"\r","\n", //"\r","\n",
"&#37;","&#33;",
"&#43;","&#45;"
};
/**
* 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):
*
* & -> &amp; < -> &lt; > -> &gt; " -> &#034; ' -> &#039;
*
* 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("&", "&amp;");
returnValue = returnValue.replaceAll("<", "&lt;");
returnValue = returnValue.replaceAll(">", "&gt;");
returnValue = returnValue.replaceAll("\"", "&#34;");
returnValue = returnValue.replaceAll("\'", "&#39;");
returnValue = returnValue.replaceAll(".", "&#46;");
returnValue = returnValue.replaceAll("%2E", "&#46;");
returnValue = returnValue.replaceAll("%2F", "&#47;");
return returnValue;
}
public static String clearXSSMaximum(String value) {
String returnValue = value;
returnValue = clearXSSMinimum(returnValue);
returnValue = returnValue.replaceAll("%00", null);
returnValue = returnValue.replaceAll("%", "&#37;");
// \\. => .
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>&#160;";
previousPageLabel = "<a class=\"btn prev\" href=\"#\" onclick=\"{0}({1}); return false;\">" +
"<img src='" + strWebDir + "prev.png' border='0' alt='이전페이지'/></a>&#160;";
currentPageLabel = "<strong class='on'>{0}</strong>&#160;";
otherPageLabel = "<a href=\"#\" onclick=\"{0}({1}); return false;\">{2}</a>&#160;";
nextPageLabel = "<a class=\"btn next\" href=\"#\" onclick=\"{0}({1}); return false;\">" +
"<img src='" + strWebDir + "next.png' border='0' alt='다음페이지'/></a>&#160;";
lastPageLabel = "<a class=\"btn nextAll\" href=\"#\" onclick=\"{0}({1}); return false;\">" +
"<img src='" + strWebDir + "nextAll.png' border='0' alt='마지막페이지'/></a>&#160;";
*/
/*
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>&#160;";
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>&#160;";
currentPageLabel = "<strong>{0}</strong>&#160;";
otherPageLabel = "<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \">{2}</a>&#160;";
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>&#160;";
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>&#160;";
*/
}
@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("&lt;");
break;
case '>':
strBuff.append("&gt;");
break;
//case '&':
//strBuff.append("&amp;");
//break;
case '"':
strBuff.append("&quot;");
break;
case '\'':
strBuff.append("&apos;");
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("&lt;");
break;
case '>':
strBuff.append("&gt;");
break;
case '&':
strBuff.append("&amp;");
break;
case '"':
strBuff.append("&quot;");
break;
case '\'':
strBuff.append("&apos;");
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>&copy; 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
* 17TIMESTAMP
*
* @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
* &lt;listener&gt;
* &lt;listener-class&gt;org.springframework.web.context.request.RequestContextListener&lt;/listener-class&gt;
* &lt;/listener&gt;
* </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>&copy; 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&quot;);
* 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);
}
}

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

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save