first commit
This commit is contained in:
commit
0f15c49551
77
.gitignore
vendored
Normal file
77
.gitignore
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
### Eclipse ###
|
||||
|
||||
.metadata
|
||||
bin/
|
||||
deploy/
|
||||
tmp/
|
||||
|
||||
*.tmp
|
||||
*.bak
|
||||
*.swp
|
||||
*~.nib
|
||||
local.properties
|
||||
.settings
|
||||
.loadpath
|
||||
.recommenders
|
||||
|
||||
# External tool builders
|
||||
.externalToolBuilders/
|
||||
|
||||
# Locally stored "Eclipse launch configurations"
|
||||
*.launch
|
||||
|
||||
# PyDev specific (Python IDE for Eclipse)
|
||||
*.pydevproject
|
||||
|
||||
# CDT-specific (C/C++ Development Tooling)
|
||||
.cproject
|
||||
|
||||
# Java annotation processor (APT)
|
||||
.factorypath
|
||||
|
||||
# PDT-specific (PHP Development Tools)
|
||||
.buildpath
|
||||
|
||||
# sbteclipse plugin
|
||||
.target
|
||||
|
||||
# Tern plugin
|
||||
.tern-project
|
||||
|
||||
# TeXlipse plugin
|
||||
.texlipse
|
||||
|
||||
# STS (Spring Tool Suite)
|
||||
.springBeans
|
||||
|
||||
# Code Recommenders
|
||||
.recommenders/
|
||||
|
||||
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||
.cache-main
|
||||
.scala_dependencies
|
||||
.worksheet
|
||||
|
||||
### Eclipse Patch ###
|
||||
# Eclipse Core
|
||||
*.project
|
||||
|
||||
# JDT-specific (Eclipse Java Development Tools)
|
||||
*.classpath
|
||||
|
||||
# End of https://www.gitignore.io/api/eclipse
|
||||
|
||||
# Maven
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
|
||||
# jrebel
|
||||
rebel.xml
|
||||
/fairnet.iml
|
||||
649
pom.xml
Normal file
649
pom.xml
Normal file
@ -0,0 +1,649 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>fairnet</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>1.0.0</version>
|
||||
<name>fairnet</name>
|
||||
<url>http://www.egovframe.go.kr</url>
|
||||
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache Software License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
</license>
|
||||
</licenses>
|
||||
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
|
||||
<spring.maven.artifact.version>4.3.22.RELEASE</spring.maven.artifact.version>
|
||||
<egovframework.rte.version>3.9.0</egovframework.rte.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<webcontent-dir>${project.basedir}\src\main\webapp\WEB-INF\lib</webcontent-dir>
|
||||
</properties>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>maven-public</id>
|
||||
<url>http://nexus.iten.co.kr:9999/repository/maven-public/</url>
|
||||
<releases>
|
||||
<enabled>true</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.3</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.solr</groupId>
|
||||
<artifactId>solr-solrj</artifactId>
|
||||
<version>5.3.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
<version>4.4.6</version>
|
||||
</dependency>
|
||||
|
||||
<!-- pdf 솔루션을 위한 lib -->
|
||||
<dependency>
|
||||
<groupId>com.mashape.unirest</groupId>
|
||||
<artifactId>unirest-java</artifactId>
|
||||
<version>1.4.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>egovframework.rte</groupId>
|
||||
<artifactId>egovframework.rte.fdl.security</artifactId>
|
||||
<version>${egovframework.rte.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>egovframework.rte</groupId>
|
||||
<artifactId>egovframework.rte.fdl.excel</artifactId>
|
||||
<version>${egovframework.rte.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>egovframework.rte</groupId>
|
||||
<artifactId>egovframework.rte.ptl.mvc</artifactId>
|
||||
<version>${egovframework.rte.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>egovframework.rte</groupId>
|
||||
<artifactId>egovframework.rte.fdl.idgnr</artifactId>
|
||||
<version>${egovframework.rte.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>egovframework.rte</groupId>
|
||||
<artifactId>egovframework.rte.fdl.property</artifactId>
|
||||
<version>${egovframework.rte.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jstl</artifactId>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-dbcp</groupId>
|
||||
<artifactId>commons-dbcp</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>taglibs</groupId>
|
||||
<artifactId>standard</artifactId>
|
||||
<version>1.1.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cglib</groupId>
|
||||
<artifactId>cglib</artifactId>
|
||||
<version>3.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.antlr</groupId>
|
||||
<artifactId>antlr</artifactId>
|
||||
<version>3.5</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>oro</groupId>
|
||||
<artifactId>oro</artifactId>
|
||||
<version>2.0.8</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-fileupload</groupId>
|
||||
<artifactId>commons-fileupload</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Cross-Site Scripting -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet.jsp</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<version>2.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.ibm.icu</groupId>
|
||||
<artifactId>icu4j</artifactId>
|
||||
<version>53.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- quartz -->
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz-weblogic</artifactId>
|
||||
<version>2.1.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.quartz-scheduler</groupId>
|
||||
<artifactId>quartz-jboss</artifactId>
|
||||
<version>2.1.7</version>
|
||||
</dependency>
|
||||
|
||||
<!-- user config add -->
|
||||
<!-- json 추가 -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.5.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jackson</groupId>
|
||||
<artifactId>jackson-mapper-asl</artifactId>
|
||||
<version>1.9.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- site mesh -->
|
||||
<dependency>
|
||||
<groupId>opensymphony</groupId>
|
||||
<artifactId>sitemesh</artifactId>
|
||||
<version>2.4.2</version>
|
||||
</dependency>
|
||||
<!--// site mesh -->
|
||||
|
||||
<!-- log4j -->
|
||||
<dependency>
|
||||
<groupId>org.lazyluke</groupId>
|
||||
<artifactId>log4jdbc-remix</artifactId>
|
||||
<version>0.2.7</version>
|
||||
</dependency>
|
||||
|
||||
<!-- log4j 보안취약점으로 인한 업데이트 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-core</artifactId>
|
||||
<version>2.17.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- log4j 보안취약점으로 인한 업데이트 -->
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-api</artifactId>
|
||||
<version>2.17.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- log4j 보안취약점으로 인한 업데이트 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.logging.log4j</groupId>
|
||||
<artifactId>log4j-slf4j-impl</artifactId>
|
||||
<version>2.17.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- ckeditor -->
|
||||
<dependency>
|
||||
<groupId>com.ckeditor</groupId>
|
||||
<artifactId>ckeditor-java-core</artifactId>
|
||||
<version>3.5.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- json-simple -->
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
<artifactId>json-simple</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>nl.captcha</groupId>
|
||||
<artifactId>simplecaptcha</artifactId>
|
||||
<version>1.2.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.jsoup/jsoup -->
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.11.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Email -->
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-email</artifactId>
|
||||
<version>1.3.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>egovframework.com.ems</groupId>
|
||||
<artifactId>sndng-mail</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime -->
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpmime</artifactId>
|
||||
<version>4.5.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Java thumbnailator -->
|
||||
<dependency>
|
||||
<groupId>net.coobird</groupId>
|
||||
<artifactId>thumbnailator</artifactId>
|
||||
<version>[0.4, 0.5)</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>3.16</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>3.16</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 자동완성기능 gson 사용 -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.mail</groupId>
|
||||
<artifactId>mail</artifactId>
|
||||
<version>1.4.7</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>30.0-jre</version>
|
||||
</dependency>
|
||||
|
||||
<!-- crpyto -->
|
||||
<dependency>
|
||||
<groupId>egovframework.rte</groupId>
|
||||
<artifactId>egovframework.rte.fdl.crypto</artifactId>
|
||||
<version>${egovframework.rte.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>taglibs</groupId>
|
||||
<artifactId>taglibs-unstandard</artifactId>
|
||||
<version>20060829</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.taglibs/taglibs-standard-spec -->
|
||||
<dependency>
|
||||
<groupId>org.apache.taglibs</groupId>
|
||||
<artifactId>taglibs-standard-spec</artifactId>
|
||||
<version>1.2.5</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
|
||||
<dependency>
|
||||
<groupId>joda-time</groupId>
|
||||
<artifactId>joda-time</artifactId>
|
||||
<version>2.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
<version>4.3.8.Final</version>
|
||||
</dependency>
|
||||
|
||||
<!-- lombok -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.34</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/jdom/jdom -->
|
||||
<dependency>
|
||||
<groupId>jdom</groupId>
|
||||
<artifactId>jdom</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.oroinc</groupId>
|
||||
<artifactId>NetComponents</artifactId>
|
||||
<version>1.3.8</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/javax.media/jai-core -->
|
||||
<dependency>
|
||||
<groupId>javax.media</groupId>
|
||||
<artifactId>jai-core</artifactId>
|
||||
<version>1.1.3</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.jcraft/jsch -->
|
||||
<dependency>
|
||||
<groupId>com.jcraft</groupId>
|
||||
<artifactId>jsch</artifactId>
|
||||
<version>0.1.44-1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.core -->
|
||||
<dependency>
|
||||
<groupId>fr.opensagres.xdocreport</groupId>
|
||||
<artifactId>org.apache.poi.xwpf.converter.core</artifactId>
|
||||
<version>1.0.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.pdf -->
|
||||
<dependency>
|
||||
<groupId>fr.opensagres.xdocreport</groupId>
|
||||
<artifactId>org.apache.poi.xwpf.converter.pdf</artifactId>
|
||||
<version>1.0.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/fr.opensagres.xdocreport/org.apache.poi.xwpf.converter.xhtml -->
|
||||
<dependency>
|
||||
<groupId>fr.opensagres.xdocreport</groupId>
|
||||
<artifactId>org.apache.poi.xwpf.converter.xhtml</artifactId>
|
||||
<version>1.0.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.apache.pdfbox/pdfbox-app -->
|
||||
<dependency>
|
||||
<groupId>org.apache.pdfbox</groupId>
|
||||
<artifactId>pdfbox-app</artifactId>
|
||||
<version>1.8.1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/commons-dbutils/commons-dbutils -->
|
||||
<dependency>
|
||||
<groupId>commons-dbutils</groupId>
|
||||
<artifactId>commons-dbutils</artifactId>
|
||||
<version>1.6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.4</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-compress</groupId>
|
||||
<artifactId>commons-compress</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>JSON-java</groupId>
|
||||
<artifactId>JSON-java</artifactId>
|
||||
<version>1</version>
|
||||
</dependency>
|
||||
|
||||
<!-- MyBatis -->
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
<version>3.5.6</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.mybatis/mybatis-spring -->
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis-spring</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>4.3.22.RELEASE</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/org.mariadb.jdbc/mariadb-java-client -->
|
||||
<dependency>
|
||||
<groupId>org.mariadb.jdbc</groupId>
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
<version>3.5.3</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
|
||||
<build>
|
||||
<defaultGoal>install</defaultGoal>
|
||||
<directory>${basedir}/target</directory>
|
||||
<finalName>ROOT</finalName>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.tomcat.maven</groupId>
|
||||
<artifactId>tomcat7-maven-plugin</artifactId>
|
||||
<version>2.2</version>
|
||||
<configuration>
|
||||
<port>80</port>
|
||||
<path>/</path>
|
||||
<systemProperties>
|
||||
<JAVA_OPTS>-Xms256m -Xmx768m -XX:MaxPermSize=256m</JAVA_OPTS>
|
||||
</systemProperties>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
<version>3.2.2</version>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>hibernate3-maven-plugin</artifactId>
|
||||
<version>2.1</version>
|
||||
<configuration>
|
||||
<components>
|
||||
<component>
|
||||
<name>hbm2ddl</name>
|
||||
<implementation>annotationconfiguration</implementation>
|
||||
</component>
|
||||
</components>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>2.3.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
<!-- EMMA -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>emma-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-3</version>
|
||||
</plugin>
|
||||
<!-- PMD manven plugin -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
<version>3.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
<plugins>
|
||||
<!-- EMMA -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
<forkMode>once</forkMode>
|
||||
<reportFormat>xml</reportFormat>
|
||||
<excludes>
|
||||
<exclude>**/Abstract*.java</exclude>
|
||||
<exclude>**/*Suite.java</exclude>
|
||||
</excludes>
|
||||
<includes>
|
||||
<include>**/*Test.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>emma-maven-plugin</artifactId>
|
||||
<inherited>true</inherited>
|
||||
</plugin>
|
||||
<!-- JavaDoc -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.9.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<reporting>
|
||||
<outputDirectory>${basedir}/target/site</outputDirectory>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||
<version>2.7</version>
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<id>sunlink</id>
|
||||
<reports>
|
||||
<report>javadoc</report>
|
||||
</reports>
|
||||
<inherited>true</inherited>
|
||||
<configuration>
|
||||
<links>
|
||||
<link>http://docs.oracle.com/javase/6/docs/api/</link>
|
||||
</links>
|
||||
</configuration>
|
||||
</reportSet>
|
||||
</reportSets>
|
||||
</plugin>
|
||||
<!-- JUnit Test Results & EMMA Coverage Reporting -->
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>emma-maven-plugin</artifactId>
|
||||
<inherited>true</inherited>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>surefire-report-maven-plugin</artifactId>
|
||||
<inherited>true</inherited>
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<reports>
|
||||
<report>report-only</report>
|
||||
</reports>
|
||||
</reportSet>
|
||||
</reportSets>
|
||||
</plugin>
|
||||
<!-- Generating JavaDoc Report -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<minmemory>128m</minmemory>
|
||||
<maxmemory>512m</maxmemory>
|
||||
<encoding>${encoding}</encoding>
|
||||
<docencoding>${encoding}</docencoding>
|
||||
<charset>${encoding}</charset>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!-- Generating Java Source in HTML -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jxr-plugin</artifactId>
|
||||
<configuration>
|
||||
<inputEncoding>${encoding}</inputEncoding>
|
||||
<outputEncoding>${encoding}</outputEncoding>
|
||||
<linkJavadoc>true</linkJavadoc>
|
||||
<javadocDir>apidocs</javadocDir>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
<groupId>fairnet</groupId>
|
||||
</project>
|
||||
|
||||
BIN
src/.DS_Store
vendored
Normal file
BIN
src/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
src/main/.DS_Store
vendored
Normal file
BIN
src/main/.DS_Store
vendored
Normal file
Binary file not shown.
107
src/main/java/kcc/com/cmm/AltibaseClobStringTypeHandler.java
Normal file
107
src/main/java/kcc/com/cmm/AltibaseClobStringTypeHandler.java
Normal file
@ -0,0 +1,107 @@
|
||||
package kcc.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 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);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setParameterInternal(PreparedStatement ps, int index, Object value, String jdbcType, LobCreator lobCreator) throws SQLException {
|
||||
lobCreator.setClobAsString(ps, index, (String) value);
|
||||
}
|
||||
|
||||
@Override
|
||||
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) {
|
||||
System.out.println("IOException Occured!!!");
|
||||
} finally {
|
||||
if (rd != null) {
|
||||
try {
|
||||
rd.close();
|
||||
} catch (Exception ignore) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return read_data.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object valueOf(String s) {
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
||||
36
src/main/java/kcc/com/cmm/CmmUtil.java
Normal file
36
src/main/java/kcc/com/cmm/CmmUtil.java
Normal file
@ -0,0 +1,36 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||
import kcc.com.cmm.ComDefaultVO;
|
||||
|
||||
public class CmmUtil {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(CmmUtil.class);
|
||||
|
||||
|
||||
/**
|
||||
* 페이징 객체 생성
|
||||
* @param tmpVO - extends ComDefaultVO
|
||||
* @param paginationInfo
|
||||
* @param searchListCnt - 목록 건수
|
||||
* @param totCnt - 전체 건수
|
||||
*/
|
||||
public static PaginationInfo getPageing(Object tmpVO, int searchListCnt) {
|
||||
PaginationInfo paginationInfo = new PaginationInfo();
|
||||
ComDefaultVO vo = (ComDefaultVO) tmpVO;
|
||||
vo.setPageUnit(searchListCnt);
|
||||
paginationInfo.setCurrentPageNo(vo.getPageIndex());
|
||||
paginationInfo.setRecordCountPerPage(vo.getPageUnit());
|
||||
paginationInfo.setPageSize(vo.getPageSize());
|
||||
vo.setFirstIndex(paginationInfo.getFirstRecordIndex());
|
||||
vo.setLastIndex(paginationInfo.getLastRecordIndex());
|
||||
vo.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
|
||||
|
||||
return paginationInfo;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
185
src/main/java/kcc/com/cmm/ComDefaultCodeVO.java
Normal file
185
src/main/java/kcc/com/cmm/ComDefaultCodeVO.java
Normal file
@ -0,0 +1,185 @@
|
||||
package kcc.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);
|
||||
}
|
||||
}
|
||||
436
src/main/java/kcc/com/cmm/ComDefaultVO.java
Normal file
436
src/main/java/kcc/com/cmm/ComDefaultVO.java
Normal file
@ -0,0 +1,436 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
/**
|
||||
* @Class Name : ComDefaultVO.java
|
||||
* @Description : ComDefaultVO class
|
||||
* @Modification Information
|
||||
* @
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------- -------- ---------------------------
|
||||
* @ 2009.02.01 조재영 최초 생성
|
||||
*
|
||||
* @author 공통서비스 개발팀 조재영
|
||||
* @since 2009.02.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
public class ComDefaultVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6062858939907510631L;
|
||||
|
||||
/** 검색조건 */
|
||||
private String searchCondition = "";
|
||||
|
||||
/** 검색Keyword */
|
||||
private String searchKeyword = "";
|
||||
|
||||
/** 검색Keyword */
|
||||
private String searchEncKeyword = "";
|
||||
|
||||
/** 검색사용여부 */
|
||||
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 = "";
|
||||
|
||||
private String searchYear = "";
|
||||
private String searchMonth2 = "";
|
||||
private String searchQuarter = "";
|
||||
|
||||
/** 엑셀용 */
|
||||
private String excelYn = "";
|
||||
|
||||
private String siteId = "";
|
||||
|
||||
private String siteNm = "";
|
||||
|
||||
private String searchConditionSite;
|
||||
|
||||
private String sortOver = "A"; //재정렬시 차순(A:오름차순 , D:내림차순)
|
||||
|
||||
private String seCd = ""; //게시판 구분 및 게시판ID추가 구분
|
||||
|
||||
private int sort = 0;
|
||||
|
||||
private int beSort = 0; //이전 sort번호
|
||||
|
||||
private int totCnt = 0;
|
||||
|
||||
private String searchSortCnd = ""; // 정렬 항목
|
||||
private String searchSortOrd = ""; // 정렬 구분(오름/내림)
|
||||
|
||||
private String searchNm = ""; //상세검색 이름
|
||||
|
||||
private String tempSortNum ;
|
||||
|
||||
|
||||
private String searchStartDt; //검색시작일
|
||||
|
||||
private String searchEndDt; //검색종료일
|
||||
|
||||
private String searchStatus; //진행상태
|
||||
|
||||
private String searchSelStatus; //셀렉트 진행상태
|
||||
|
||||
private String[] searchStatusArr; //검색상태
|
||||
|
||||
private String searchMonth = "1"; //검색월선택
|
||||
|
||||
private String searchSbmtId ; // 결제자 검색
|
||||
|
||||
public int getBeSort() {
|
||||
return beSort;
|
||||
}
|
||||
|
||||
public void setBeSort(int beSort) {
|
||||
this.beSort = beSort;
|
||||
}
|
||||
|
||||
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 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;
|
||||
}
|
||||
|
||||
public String getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public String getSortOver() {
|
||||
return sortOver;
|
||||
}
|
||||
|
||||
public void setSortOver(String sortOver) {
|
||||
this.sortOver = sortOver;
|
||||
}
|
||||
|
||||
public String getSiteNm() {
|
||||
return siteNm;
|
||||
}
|
||||
|
||||
public void setSiteNm(String siteNm) {
|
||||
this.siteNm = siteNm;
|
||||
}
|
||||
|
||||
public String getSearchConditionSite() {
|
||||
return searchConditionSite;
|
||||
}
|
||||
|
||||
public void setSearchConditionSite(String searchConditionSite) {
|
||||
this.searchConditionSite = searchConditionSite;
|
||||
}
|
||||
|
||||
public String getSeCd() {
|
||||
return seCd;
|
||||
}
|
||||
|
||||
public void setSeCd(String seCd) {
|
||||
this.seCd = seCd;
|
||||
}
|
||||
|
||||
public int getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(int sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public int getTotCnt() {
|
||||
return totCnt;
|
||||
}
|
||||
|
||||
public void setTotCnt(int totCnt) {
|
||||
this.totCnt = totCnt;
|
||||
}
|
||||
|
||||
public String getSearchSortCnd() {
|
||||
return searchSortCnd;
|
||||
}
|
||||
|
||||
public void setSearchSortCnd(String searchSortCnd) {
|
||||
this.searchSortCnd = searchSortCnd;
|
||||
}
|
||||
|
||||
public String getSearchSortOrd() {
|
||||
return searchSortOrd;
|
||||
}
|
||||
|
||||
public void setSearchSortOrd(String searchSortOrd) {
|
||||
this.searchSortOrd = searchSortOrd;
|
||||
}
|
||||
|
||||
public String getTempSortNum() {
|
||||
return tempSortNum;
|
||||
}
|
||||
|
||||
public void setTempSortNum(String tempSortNum) {
|
||||
this.tempSortNum = tempSortNum;
|
||||
}
|
||||
|
||||
public String getSearchNm() {
|
||||
return searchNm;
|
||||
}
|
||||
|
||||
public void setSearchNm(String searchNm) {
|
||||
this.searchNm = searchNm;
|
||||
}
|
||||
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
|
||||
public String getSearchStartDt() {
|
||||
return searchStartDt;
|
||||
}
|
||||
|
||||
public void setSearchStartDt(String searchStartDt) {
|
||||
this.searchStartDt = searchStartDt;
|
||||
}
|
||||
|
||||
public String getSearchEndDt() {
|
||||
return searchEndDt;
|
||||
}
|
||||
|
||||
public void setSearchEndDt(String searchEndDt) {
|
||||
this.searchEndDt = searchEndDt;
|
||||
}
|
||||
|
||||
public String getSearchStatus() {
|
||||
return searchStatus;
|
||||
}
|
||||
|
||||
public void setSearchStatus(String searchStatus) {
|
||||
this.searchStatus = searchStatus;
|
||||
}
|
||||
|
||||
public String getSearchMonth() {
|
||||
return searchMonth;
|
||||
}
|
||||
|
||||
public void setSearchMonth(String searchMonth) {
|
||||
this.searchMonth = searchMonth;
|
||||
}
|
||||
|
||||
public String[] getSearchStatusArr() {
|
||||
String[]returnArr;
|
||||
//int returnSize = this.searchStatusArr.length;
|
||||
int returnSize = 0;
|
||||
try {
|
||||
returnSize = this.searchStatusArr.length;
|
||||
}catch(NullPointerException ex) {
|
||||
System.out.println("NullPointerException");
|
||||
//ex.printStackTrace();
|
||||
}
|
||||
|
||||
/* FIX */
|
||||
if(returnSize > 0){
|
||||
returnArr = new String[returnSize];
|
||||
|
||||
for(int i=0; i < returnSize; i++){
|
||||
returnArr[i] = this.searchStatusArr[i];
|
||||
}
|
||||
|
||||
return returnArr;
|
||||
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
|
||||
//return searchStatusArr;
|
||||
}
|
||||
|
||||
public void setSearchStatusArr(String[] searchStatusArr) {
|
||||
this.searchStatusArr = searchStatusArr;
|
||||
}
|
||||
|
||||
public String getExcelYn() {
|
||||
return excelYn;
|
||||
}
|
||||
|
||||
public void setExcelYn(String excelYn) {
|
||||
this.excelYn = excelYn;
|
||||
}
|
||||
|
||||
public String getSearchEncKeyword() {
|
||||
return searchEncKeyword;
|
||||
}
|
||||
|
||||
public void setSearchEncKeyword(String searchEncKeyword) {
|
||||
this.searchEncKeyword = searchEncKeyword;
|
||||
}
|
||||
|
||||
public String getSearchSelStatus() {
|
||||
return searchSelStatus;
|
||||
}
|
||||
|
||||
public void setSearchSelStatus(String searchSelStatus) {
|
||||
this.searchSelStatus = searchSelStatus;
|
||||
}
|
||||
|
||||
public String getSearchSbmtId() {
|
||||
return searchSbmtId;
|
||||
}
|
||||
|
||||
public void setSearchSbmtId(String searchSbmtId) {
|
||||
this.searchSbmtId = searchSbmtId;
|
||||
}
|
||||
|
||||
public String getSearchYear() {
|
||||
return searchYear;
|
||||
}
|
||||
|
||||
public void setSearchYear(String searchYear) {
|
||||
this.searchYear = searchYear;
|
||||
}
|
||||
|
||||
public String getSearchMonth2() {
|
||||
return searchMonth2;
|
||||
}
|
||||
|
||||
public void setSearchMonth2(String searchMonth2) {
|
||||
this.searchMonth2 = searchMonth2;
|
||||
}
|
||||
|
||||
public String getSearchQuarter() {
|
||||
return searchQuarter;
|
||||
}
|
||||
|
||||
public void setSearchQuarter(String searchQuarter) {
|
||||
this.searchQuarter = searchQuarter;
|
||||
}
|
||||
|
||||
}
|
||||
406
src/main/java/kcc/com/cmm/EgovComCrossSiteHndlr.java
Normal file
406
src/main/java/kcc/com/cmm/EgovComCrossSiteHndlr.java
Normal file
@ -0,0 +1,406 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.JspWriter;
|
||||
import javax.servlet.jsp.PageContext;
|
||||
import javax.servlet.jsp.tagext.BodyTagSupport;
|
||||
|
||||
import org.apache.taglibs.standard.tag.common.core.Util;
|
||||
|
||||
/**
|
||||
* Cross-Site Scripting 체크하여 값을 되돌려 받는 핸들러 JSP TLD, 자바에서 사용가능
|
||||
*
|
||||
* @author 공통서비스 장동한
|
||||
* @since 2010.11.09
|
||||
* @version 1.0
|
||||
* @see <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2010.11.09 장동한 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
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
|
||||
|
||||
private static final long serialVersionUID = -6750233818675360686L;
|
||||
|
||||
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 String m_sDiffChar ="()[]{}\"',:;= \t\r\n%!+-";
|
||||
//private String m_sDiffChar ="()[]{}\"',:;=%!+-";
|
||||
private String m_sArrDiffChar [] = {
|
||||
"(",")",
|
||||
"[","]",
|
||||
"{","}",
|
||||
""","'",
|
||||
",",":",
|
||||
";","=",
|
||||
" ","\t", //" ","\t",
|
||||
"\r","\n", //"\r","\n",
|
||||
"%","!",
|
||||
"+","-"
|
||||
};
|
||||
|
||||
/**
|
||||
* Constructs a new handler. As with TagSupport, subclasses should not
|
||||
* provide other constructors and are expected to call the superclass
|
||||
* constructor.
|
||||
*/
|
||||
public EgovComCrossSiteHndlr() {
|
||||
super();
|
||||
init();
|
||||
}
|
||||
|
||||
// resets local state
|
||||
private void init() {
|
||||
value = def = null;
|
||||
escapeXml = true;
|
||||
needBody = false;
|
||||
}
|
||||
|
||||
// Releases any resources we may have (or inherit)
|
||||
public void release() {
|
||||
super.release();
|
||||
init();
|
||||
}
|
||||
|
||||
// *********************************************************************
|
||||
// Tag logic
|
||||
|
||||
// evaluates 'value' and determines if the body should be evaluted
|
||||
public int doStartTag() throws JspException {
|
||||
|
||||
needBody = false; // reset state related to 'default'
|
||||
this.bodyContent = null; // clean-up body (just in case container is
|
||||
// pooling tag handlers)
|
||||
|
||||
JspWriter out = pageContext.getOut();
|
||||
//System.out.println("EgovComCrossSiteFilter> ============================");
|
||||
try {
|
||||
// print value if available; otherwise, try 'default'
|
||||
if (value != null) {
|
||||
//System.out.println("EgovComCrossSiteFilter> =value");
|
||||
String sWriteEscapedXml = getWriteEscapedXml();
|
||||
//System.out.println("EgovComCrossSiteFilter sWriteEscapedXml>" + sWriteEscapedXml);
|
||||
out.print(sWriteEscapedXml);
|
||||
return SKIP_BODY;
|
||||
} else {
|
||||
// if we don't have a 'default' attribute, just go to the body
|
||||
if (def == null) {
|
||||
needBody = true;
|
||||
return EVAL_BODY_BUFFERED;
|
||||
}
|
||||
|
||||
//System.out.println("EgovComCrossSiteFilter def> ="+def);
|
||||
|
||||
// if we do have 'default', print it
|
||||
if (def != null) {
|
||||
// good 'default'
|
||||
out(pageContext, escapeXml, def);
|
||||
//System.out.println("EgovComCrossSiteFilter> ="+def);
|
||||
}
|
||||
return SKIP_BODY;
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
throw new JspException(ex.toString(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
// prints the body if necessary; reports errors
|
||||
public int doEndTag() throws JspException {
|
||||
try {
|
||||
//System.out.println("EgovComCrossSiteFilter ==== doEndTag");
|
||||
if (!needBody){
|
||||
return EVAL_PAGE; // nothing more to do
|
||||
}
|
||||
|
||||
// trim and print out the body
|
||||
if (bodyContent != null && bodyContent.getString() != null){
|
||||
//String sWriteEscapedXml = getWriteEscapedXml();
|
||||
//out2(pageContext, escapeXml, sWriteEscapedXml.toString());
|
||||
//System.out.println("EgovComCrossSiteFilter> end");
|
||||
//System.out.println("EgovComCrossSiteFilter sWriteEscapedXml > sWriteEscapedXml");
|
||||
out(pageContext, escapeXml, bodyContent.getString().trim());
|
||||
|
||||
}
|
||||
return EVAL_PAGE;
|
||||
} catch (IOException ex) {
|
||||
throw new JspException(ex.toString(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
// *********************************************************************
|
||||
// Public utility methods
|
||||
|
||||
/**
|
||||
* Outputs <tt>text</tt> to <tt>pageContext</tt>'s current JspWriter. If
|
||||
* <tt>escapeXml</tt> is true, performs the following substring replacements
|
||||
* (to facilitate output to XML/HTML pages):
|
||||
*
|
||||
* & -> & < -> < > -> > " -> " ' -> '
|
||||
*
|
||||
* See also Util.escapeXml().
|
||||
*/
|
||||
public static void out(PageContext pageContext, boolean escapeXml,
|
||||
Object obj) throws IOException {
|
||||
JspWriter w = pageContext.getOut();
|
||||
|
||||
if (!escapeXml) {
|
||||
// write chars as is
|
||||
if (obj instanceof Reader) {
|
||||
Reader reader = (Reader) obj;
|
||||
char[] buf = new char[4096];
|
||||
int count;
|
||||
while ((count = reader.read(buf, 0, 4096)) != -1) {
|
||||
w.write(buf, 0, count);
|
||||
}
|
||||
} else {
|
||||
w.write(obj.toString());
|
||||
}
|
||||
} else {
|
||||
// escape XML chars
|
||||
if (obj instanceof Reader) {
|
||||
Reader reader = (Reader) obj;
|
||||
char[] buf = new char[4096];
|
||||
int count;
|
||||
while ((count = reader.read(buf, 0, 4096)) != -1) {
|
||||
writeEscapedXml(buf, count, w);
|
||||
}
|
||||
} else {
|
||||
String text = obj.toString();
|
||||
writeEscapedXml(text.toCharArray(), text.length(), w);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public static void out2(PageContext pageContext, boolean escapeXml,
|
||||
Object obj) throws IOException {
|
||||
JspWriter w = pageContext.getOut();
|
||||
|
||||
w.write(obj.toString());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Optimized to create no extra objects and write directly to the JspWriter
|
||||
* using blocks of escaped and unescaped characters
|
||||
*
|
||||
*/
|
||||
private static void writeEscapedXml(char[] buffer, int length, JspWriter w)
|
||||
throws IOException {
|
||||
int start = 0;
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
char c = buffer[i];
|
||||
if (c <= Util.HIGHEST_SPECIAL) {
|
||||
char[] escaped = Util.specialCharactersRepresentation[c];
|
||||
if (escaped != null) {
|
||||
// add unescaped portion
|
||||
if (start < i) {
|
||||
w.write(buffer, start, i - start);
|
||||
}
|
||||
// add escaped xml
|
||||
w.write(escaped);
|
||||
start = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// add rest of unescaped portion
|
||||
if (start < length) {
|
||||
w.write(buffer, start, length - start);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Optimized to create no extra objects and write directly to the JspWriter
|
||||
* using blocks of escaped and unescaped characters
|
||||
*
|
||||
*/
|
||||
private String getWriteEscapedXml() throws IOException {
|
||||
String sRtn = "";
|
||||
|
||||
Object obj = this.value;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
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;
|
||||
}
|
||||
/*
|
||||
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");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
53
src/main/java/kcc/com/cmm/EgovComExcepHndlr.java
Normal file
53
src/main/java/kcc/com/cmm/EgovComExcepHndlr.java
Normal file
@ -0,0 +1,53 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.exception.handler.ExceptionHandler;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovComExcepHndlr.java
|
||||
* @Description : 공통서비스의 exception 처리 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 13. 이삼섭
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 13.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@ControllerAdvice
|
||||
public class EgovComExcepHndlr implements ExceptionHandler {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovComExcepHndlr.class);
|
||||
|
||||
|
||||
@RequestMapping("/common/error.jsp")
|
||||
@ResponseBody
|
||||
public ResponseEntity<String> notFound() {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.add(HttpHeaders.CONTENT_TYPE, "application/json");
|
||||
|
||||
return new ResponseEntity<>("{\"error\": \"Resource not found\"}", headers, HttpStatus.NOT_FOUND);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 발생된 Exception을 처리한다.
|
||||
*/
|
||||
@Override
|
||||
public void occur(Exception ex, String packageName) {
|
||||
LOGGER.debug("[HANDLER][PACKAGE]::: {}", packageName);
|
||||
LOGGER.debug("[HANDLER][Exception]:::", ex);
|
||||
}
|
||||
}
|
||||
17
src/main/java/kcc/com/cmm/EgovComOthersExcepHndlr.java
Normal file
17
src/main/java/kcc/com/cmm/EgovComOthersExcepHndlr.java
Normal file
@ -0,0 +1,17 @@
|
||||
package kcc.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);
|
||||
}
|
||||
}
|
||||
34
src/main/java/kcc/com/cmm/EgovComTraceHandler.java
Normal file
34
src/main/java/kcc/com/cmm/EgovComTraceHandler.java
Normal file
@ -0,0 +1,34 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.trace.handler.TraceHandler;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovComTraceHandler.java
|
||||
* @Description : 공통서비스의 trace 처리 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2011. 09. 30. JJY
|
||||
*
|
||||
* @author JJY
|
||||
* @since 2011. 9. 30.
|
||||
*
|
||||
*/
|
||||
public class EgovComTraceHandler implements TraceHandler {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovComTraceHandler.class);
|
||||
|
||||
/**
|
||||
* 발생된 메시지를 출력한다.
|
||||
*/
|
||||
@Override
|
||||
public void todo(Class<?> clazz, String message) {
|
||||
LOGGER.debug("[TRACE]CLASS::: {}", clazz.getName());
|
||||
LOGGER.debug("[TRACE]MESSAGE::: {}", message);
|
||||
//이곳에서 후속처리로 필요한 액션을 취할 수 있다.
|
||||
}
|
||||
}
|
||||
55
src/main/java/kcc/com/cmm/EgovMessageSource.java
Normal file
55
src/main/java/kcc/com/cmm/EgovMessageSource.java
Normal file
@ -0,0 +1,55 @@
|
||||
package kcc.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());
|
||||
}
|
||||
|
||||
}
|
||||
175
src/main/java/kcc/com/cmm/EgovMultiPartEmail.java
Normal file
175
src/main/java/kcc/com/cmm/EgovMultiPartEmail.java
Normal file
@ -0,0 +1,175 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.net.MalformedURLException;
|
||||
|
||||
import org.apache.commons.mail.DefaultAuthenticator;
|
||||
import org.apache.commons.mail.Email;
|
||||
import org.apache.commons.mail.EmailAttachment;
|
||||
import org.apache.commons.mail.EmailException;
|
||||
import org.apache.commons.mail.HtmlEmail;
|
||||
import org.apache.commons.mail.MultiPartEmail;
|
||||
import org.apache.commons.mail.SimpleEmail;
|
||||
import org.springframework.mail.MailException;
|
||||
|
||||
/**
|
||||
* 발송메일에 첨부파일용으로 사용되는 VO 클래스
|
||||
* @author 공통서비스 개발팀 이기하
|
||||
* @since 2011.12.06
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ---------- -------- ---------------------------
|
||||
* 2011.12.06 이기하 최초 생성
|
||||
* 2013.05.23 이기하 thread-safe 하게 변경
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public class EgovMultiPartEmail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -4322006921324597283L;
|
||||
private String id;
|
||||
private String password;
|
||||
private int port;
|
||||
private String host;
|
||||
private String emailAddress;
|
||||
private String senderName;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(int port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return host;
|
||||
}
|
||||
|
||||
public void setHost(String host) {
|
||||
this.host = host;
|
||||
}
|
||||
|
||||
public String getEmailAddress() {
|
||||
return emailAddress;
|
||||
}
|
||||
|
||||
public void setEmailAddress(String emailAddress) {
|
||||
this.emailAddress = emailAddress;
|
||||
}
|
||||
|
||||
public String getSenderName() {
|
||||
return senderName;
|
||||
}
|
||||
|
||||
public void setSenderName(String senderName) {
|
||||
this.senderName = senderName;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String send() throws EmailException {
|
||||
MultiPartEmail email = new MultiPartEmail();
|
||||
|
||||
email.setCharset("UTF-8");
|
||||
email.setHostName(this.host);
|
||||
email.setSmtpPort(this.port);
|
||||
email.setStartTLSEnabled(true);
|
||||
email.setAuthenticator(new DefaultAuthenticator(this.id, this.password));
|
||||
email.setSocketConnectionTimeout(60000);
|
||||
email.setSocketTimeout(60000);
|
||||
email.setFrom(this.emailAddress, this.senderName);
|
||||
|
||||
return email.send();
|
||||
}
|
||||
|
||||
// Simple 메일
|
||||
public String send(String addTo, String subject, String msg) throws Exception {
|
||||
SimpleEmail email = new SimpleEmail();
|
||||
|
||||
setEmailInfo(addTo, subject, msg, email);
|
||||
|
||||
return email.send();
|
||||
}
|
||||
|
||||
// HTML 메일
|
||||
public String send(String addTo, String subject, String textMsg, String htmlMsg) throws MailException, MalformedURLException {
|
||||
String result = "";
|
||||
try {
|
||||
HtmlEmail email = new HtmlEmail();
|
||||
|
||||
// 3번째 파라미터 'html' 의미 없음. 단 문자 없으면 error
|
||||
setEmailInfo(addTo, subject, "html", email);
|
||||
email.setHtmlMsg(htmlMsg);
|
||||
|
||||
// HTML 이메일을 지원하지 않는 클라이언트라면 다음 메세지를 뿌려웁니다
|
||||
email.setTextMsg("Your email client does not support HTML messages");
|
||||
// email.setTextMsg(textMsg);
|
||||
|
||||
// 이미지 Sample
|
||||
// 삽입할 이미지와 그 Content Id를 설정합니다. URL 이미지 사용 시 메일전송 지연될 수 있음
|
||||
// URL url = new URL("https://www.google.co.kr/images/branding/googlelogo/2x/googlelogo_color_120x44dp.png");
|
||||
// String cid = email.embed(url, "Apache logo");
|
||||
// // HTML 메세지를 설정합니다
|
||||
// email.setHtmlMsg("<html>The apache logo - <img src=\"cid:"+cid+"\"></html>");
|
||||
|
||||
result = email.send();
|
||||
} catch (EmailException e) {
|
||||
System.out.println("EmailException Occured!!!");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 파일첨부 메일
|
||||
public String send(String addTo, String subject, String msg, EmailAttachment attachment) throws Exception {
|
||||
MultiPartEmail email = new MultiPartEmail();
|
||||
|
||||
setEmailInfo(addTo, subject, msg, email);
|
||||
|
||||
if (attachment != null) {
|
||||
email.attach(attachment);
|
||||
}
|
||||
|
||||
return email.send();
|
||||
}
|
||||
|
||||
private void setEmailInfo(String addTo, String subject, String msg, Email email) throws EmailException {
|
||||
// 테스트 네이버s
|
||||
email.setAuthenticator(new DefaultAuthenticator(this.id, this.password));
|
||||
email.setStartTLSEnabled(true);
|
||||
email.setSSLOnConnect(true);
|
||||
// 테스트 네이버e
|
||||
|
||||
email.setCharset("UTF-8");
|
||||
email.setHostName(this.host);
|
||||
email.setSmtpPort(this.port);
|
||||
email.setSocketConnectionTimeout(60000);
|
||||
email.setSocketTimeout(60000);
|
||||
email.setFrom(this.emailAddress, this.senderName);
|
||||
email.addTo(addTo);
|
||||
email.setSubject(subject);
|
||||
email.setMsg(msg);
|
||||
}
|
||||
}
|
||||
109
src/main/java/kcc/com/cmm/EgovWebUtil.java
Normal file
109
src/main/java/kcc/com/cmm/EgovWebUtil.java
Normal file
@ -0,0 +1,109 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 교차접속 스크립트 공격 취약성 방지(파라미터 문자열 교체)
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2011.10.10 한성곤 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
public class EgovWebUtil {
|
||||
public static String clearXSSMinimum(String value) {
|
||||
if (value == null || value.trim().equals("")) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String returnValue = value;
|
||||
|
||||
returnValue = returnValue.replaceAll("&", "&");
|
||||
returnValue = returnValue.replaceAll("<", "<");
|
||||
returnValue = returnValue.replaceAll(">", ">");
|
||||
returnValue = returnValue.replaceAll("\"", """);
|
||||
returnValue = returnValue.replaceAll("\'", "'");
|
||||
returnValue = returnValue.replaceAll("[.]", ".");
|
||||
returnValue = returnValue.replaceAll("%2E", ".");
|
||||
returnValue = returnValue.replaceAll("%2F", "/");
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public static String clearXSSMaximum(String value) {
|
||||
String returnValue = value;
|
||||
returnValue = clearXSSMinimum(returnValue);
|
||||
|
||||
returnValue = returnValue.replaceAll("%00", null);
|
||||
|
||||
returnValue = returnValue.replaceAll("%", "%");
|
||||
|
||||
// \\. => .
|
||||
|
||||
returnValue = returnValue.replaceAll("\\.\\./", ""); // ../
|
||||
returnValue = returnValue.replaceAll("\\.\\.\\\\", ""); // ..\
|
||||
returnValue = returnValue.replaceAll("\\./", ""); // ./
|
||||
returnValue = returnValue.replaceAll("%2F", "");
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public static String filePathBlackList(String value) {
|
||||
String returnValue = value;
|
||||
if (returnValue == null || returnValue.trim().equals("")) {
|
||||
return "";
|
||||
}
|
||||
|
||||
returnValue = returnValue.replaceAll("\\.\\./", ""); // ../
|
||||
returnValue = returnValue.replaceAll("\\.\\.\\\\", ""); // ..\
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 행안부 보안취약점 점검 조치 방안.
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static String filePathReplaceAll(String value) {
|
||||
String returnValue = value;
|
||||
if (returnValue == null || returnValue.trim().equals("")) {
|
||||
return "";
|
||||
}
|
||||
|
||||
returnValue = returnValue.replaceAll("/", "");
|
||||
returnValue = returnValue.replaceAll("\\", "");
|
||||
returnValue = returnValue.replaceAll("\\.\\.", ""); // ..
|
||||
returnValue = returnValue.replaceAll("&", "");
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
public static String filePathWhiteList(String value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static boolean isIPAddress(String str) {
|
||||
Pattern ipPattern = Pattern.compile("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}");
|
||||
|
||||
return ipPattern.matcher(str).matches();
|
||||
}
|
||||
|
||||
public static String removeCRLF(String parameter) {
|
||||
return parameter.replaceAll("\r", "").replaceAll("\n", "");
|
||||
}
|
||||
|
||||
public static String removeSQLInjectionRisk(String parameter) {
|
||||
return parameter.replaceAll("\\p{Space}", "").replaceAll("\\*", "").replaceAll("%", "").replaceAll(";", "").replaceAll("-", "").replaceAll("\\+", "").replaceAll(",", "");
|
||||
}
|
||||
|
||||
public static String removeOSCmdRisk(String parameter) {
|
||||
return parameter.replaceAll("\\p{Space}", "").replaceAll("\\*", "").replaceAll("|", "").replaceAll(";", "");
|
||||
}
|
||||
|
||||
}
|
||||
63
src/main/java/kcc/com/cmm/ImagePaginationRenderer.java
Normal file
63
src/main/java/kcc/com/cmm/ImagePaginationRenderer.java
Normal file
@ -0,0 +1,63 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.AbstractPaginationRenderer;
|
||||
/**
|
||||
* 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;
|
||||
|
||||
public ImagePaginationRenderer() {
|
||||
// no-op
|
||||
}
|
||||
|
||||
public void initVariables(){
|
||||
/*firstPageLabel = "<li> </li><li><a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/egovframework/com/cmm/mod/icon/icon_prevend.gif\" alt=\"처음\" border=\"0\"/></a></li>";
|
||||
previousPageLabel = "<li><a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/egovframework/com/cmm/mod/icon/icon_prev.gif\" alt=\"이전\" border=\"0\"/></a></li>";
|
||||
currentPageLabel = "<li><strong>{0}</strong></li>";
|
||||
otherPageLabel = "<li><a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \">{2}</a></li>";
|
||||
nextPageLabel = "<li> <a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/egovframework/com/cmm/mod/icon/icon_next.gif\" alt=\"다음\" border=\"0\"/></a></li>";
|
||||
lastPageLabel = "<li><a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/egovframework/com/cmm/mod/icon/icon_nextend.gif\" alt=\"마지막\" border=\"0\"/></a></li>";*/
|
||||
|
||||
/*firstPageLabel = "<li><input type='button' class='pageFirst' onclick=\"{0}({1});return false;\"></li>";
|
||||
previousPageLabel = "<li><input type='button' class='pageBefore' onclick=\"{0}({1});return false;\"></li>";
|
||||
currentPageLabel = "<li><strong style='font-weight:bold;'>{0}</strong></li>";
|
||||
otherPageLabel = "<li onclick=\"{0}({1});return false;\" style='cursor:pointer'>{2}</li>";
|
||||
nextPageLabel = "<li><input type='button' class='pageNext' onclick=\"{0}({1});return false;\"></li>";
|
||||
lastPageLabel = "<li><input type='button' class='pageLast' onclick=\"{0}({1});return false;\"></li>";*/
|
||||
|
||||
firstPageLabel = "<button class='btn_page_first' title='첫 페이지 이동' onclick=\"{0}({1});return false;\"><i></i></button>";
|
||||
previousPageLabel = "<button class='btn_page_prev' title='이전 페이지 이동' onclick=\"{0}({1});return false;\"><i></i></button>";
|
||||
currentPageLabel = "<button class='on' title=\"현재 {0}페이지\" onclick='return false;' readonly='readonly'>{0}</button>";
|
||||
otherPageLabel = "<button title=\"{1} 페이지 이동\" onclick=\"{0}({1});return false;\">{2}</button>";
|
||||
nextPageLabel = "<button class='btn_page_next' title='다음 페이지 이동' onclick=\"{0}({1});return false;\"><i></i></button>";
|
||||
lastPageLabel = "<button class='btn_page_last' title='마지막 페이지 이동' onclick=\"{0}({1});return false;\"><i></i></button>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void setServletContext(ServletContext servletContext) {
|
||||
this.servletContext = servletContext;
|
||||
initVariables();
|
||||
}
|
||||
|
||||
}
|
||||
47
src/main/java/kcc/com/cmm/ImagePaginationRendererWeb.java
Normal file
47
src/main/java/kcc/com/cmm/ImagePaginationRendererWeb.java
Normal file
@ -0,0 +1,47 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.springframework.web.context.ServletContextAware;
|
||||
|
||||
import egovframework.rte.ptl.mvc.tags.ui.pagination.AbstractPaginationRenderer;
|
||||
/**
|
||||
* ImagePaginationRenderer.java 클래스
|
||||
*
|
||||
* @author 서준식
|
||||
* @since 2011. 9. 16.
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------------- ----------------------
|
||||
* 2011. 9. 16. 서준식 이미지 경로에 ContextPath추가
|
||||
* </pre>
|
||||
*/
|
||||
public class ImagePaginationRendererWeb extends AbstractPaginationRenderer implements ServletContextAware{
|
||||
|
||||
private ServletContext servletContext;
|
||||
|
||||
public ImagePaginationRendererWeb() {
|
||||
// no-op
|
||||
}
|
||||
|
||||
public void initVariables(){
|
||||
firstPageLabel = "<li class='page_first_li'><a href=\"#\" class=\"btn only_icon btn_40 btn_page_first\" title=\"첫 페이지 이동\" onclick=\"{0}({1});return false;\"><i class=\"icon page_first\"></i></a></li>";
|
||||
previousPageLabel = "<li class='page_prev_li'><a href=\"#\" class=\"btn only_icon btn_40 btn_page_prev\" title=\"이전 페이지 이동\" onclick=\"{0}({1});return false;\"><i class=\"icon page_prev\"></i></a></li>";
|
||||
currentPageLabel = "<li><a href=\"#\" class=\"btn btn_40 active\" title=\"{0} 페이지 이동\" onclick=\\\"return false;\\\" readonly>{0}</a></li>";
|
||||
otherPageLabel = "<li><a href=\"#\" class=\"btn btn_40\" title=\"{1} 페이지 이동\" onclick=\"{0}({1});return false;\">{2}</a></li>";
|
||||
nextPageLabel = "<li class='page_next_li'><a href=\"#\" class=\"btn only_icon btn_40 btn_page_next\" title=\"다음 페이지 이동\" onclick=\"{0}({1});return false;\"><i class=\"icon page_next\"></i></a></li>";
|
||||
lastPageLabel = "<li class='page_last_li'><a href=\"#\" class=\"btn only_icon btn_40 btn_page_last\" title=\"마지막 페이지 이동\" onclick=\"{0}({1});return false;\"><i class=\"icon page_last\"></i></a></li>";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setServletContext(ServletContext servletContext) {
|
||||
this.servletContext = servletContext;
|
||||
initVariables();
|
||||
}
|
||||
|
||||
}
|
||||
106
src/main/java/kcc/com/cmm/JsonResult.java
Normal file
106
src/main/java/kcc/com/cmm/JsonResult.java
Normal file
@ -0,0 +1,106 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 공용 JSON 리턴 모델
|
||||
* @author wimy
|
||||
*
|
||||
*/
|
||||
public class JsonResult implements Serializable{
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -6362971805582357050L;
|
||||
|
||||
private boolean success;
|
||||
|
||||
private String code;
|
||||
|
||||
private String message;
|
||||
|
||||
private Object data;
|
||||
|
||||
private String redirectUrl = "";
|
||||
|
||||
/**
|
||||
* json 성공 여부
|
||||
* @return
|
||||
*/
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
/**
|
||||
* json 성공 여부
|
||||
* @param success
|
||||
*/
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
/**
|
||||
* 코드
|
||||
* @return
|
||||
*/
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 코드
|
||||
* @param code
|
||||
*/
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지
|
||||
* @return
|
||||
*/
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지
|
||||
* @param message
|
||||
*/
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
/**
|
||||
* JSON 데이터
|
||||
* @return
|
||||
*/
|
||||
public Object getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* JSON 데이터
|
||||
* @param data
|
||||
*/
|
||||
public void setData(Object data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 리다이렉트 URL
|
||||
* @return
|
||||
*/
|
||||
public String getRedirectUrl() {
|
||||
return redirectUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 리다이렉트 URL
|
||||
* @param redirectUrl
|
||||
*/
|
||||
public void setRedirectUrl(String redirectUrl) {
|
||||
this.redirectUrl = redirectUrl;
|
||||
}
|
||||
|
||||
}
|
||||
600
src/main/java/kcc/com/cmm/LoginVO.java
Normal file
600
src/main/java/kcc/com/cmm/LoginVO.java
Normal file
@ -0,0 +1,600 @@
|
||||
package kcc.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 password2;
|
||||
/** 비밀번호 힌트 */
|
||||
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;
|
||||
|
||||
private String siteId;
|
||||
|
||||
private String siteNm;
|
||||
|
||||
private String authority;
|
||||
|
||||
/** 로그인 후 리턴 url */
|
||||
private String beforeUrl;
|
||||
/** 회원탈퇴 사유 */
|
||||
private String message;
|
||||
|
||||
private int passMiss;
|
||||
|
||||
/** 등록안된 사용자도 검색(값이 있으면 모두 조회) */
|
||||
private String statusAll;
|
||||
private String emplyrSttusCode; //상태코드
|
||||
|
||||
|
||||
private int snsIdCnt = 0;
|
||||
private String snsSite;
|
||||
private String snsId; // SNS 회원정보 ID
|
||||
private String snsEmail;
|
||||
|
||||
|
||||
private String tel;
|
||||
private String orgnztNo;
|
||||
private String orgnztPosi ;
|
||||
private String emplNo ;
|
||||
private String userWork ;
|
||||
|
||||
|
||||
/*회원 아이디*/
|
||||
private String membId;
|
||||
/*회원 이름*/
|
||||
private String membName;
|
||||
/*회원 시퀀스*/
|
||||
private String membSeq;
|
||||
/*회원 Ci*/
|
||||
private String membCi;
|
||||
/*회원 이메일*/
|
||||
private String membEmail;
|
||||
/*회원 휴대폰번호*/
|
||||
private String membCelnum;
|
||||
/*회원 생년월일 형식 : YYYY-MM-DD*/
|
||||
private String membBirth;
|
||||
/*회원 SMS 수신 여부 Y:수신, N:미수신*/
|
||||
private String membSmsRecpYn;
|
||||
/*회원 이메일 수신 여부 Y:수신, N:미수신*/
|
||||
private String membEmailRecpYn;
|
||||
/*회원 성별 코드*/
|
||||
private String sexCode;
|
||||
/*분쟁조정 회원 구분 코드 010000 : 분쟁조정 회원 구분 코드*/
|
||||
private String dispsettMembDivisCode;
|
||||
/*법인번호 형식 : 000000-0000000*/
|
||||
private String corpnum;
|
||||
/*사업자 등록번호 형식 : 000-00-00000*/
|
||||
private String buisnRegnum;
|
||||
/*회사 명*/
|
||||
private String compTitle;
|
||||
|
||||
private String isSelect;
|
||||
/* 관리자 로그인 유형 001 : IP제어, 002 : OTP */
|
||||
private String loginTypeCd;
|
||||
|
||||
private String certNum = "";
|
||||
|
||||
/*20221012 대시보드를 위해 직급 코드 추가*/
|
||||
private String ofcpsNm;
|
||||
|
||||
private String phone;
|
||||
|
||||
/*분쟁조정 회원테이블 정보*/
|
||||
private String memberIdx;
|
||||
private String memberAddress1;
|
||||
private String memberAddress2;
|
||||
private String memberCode;
|
||||
private String memberContactDate;
|
||||
private String memberEmail1;
|
||||
private String memberEmail2;
|
||||
private String memberId;
|
||||
private String memberIp;
|
||||
private String memberDept;
|
||||
private String memberPosition;
|
||||
private String memberTel;
|
||||
private String memberPhone;
|
||||
private String memberItemA1; //추가항목
|
||||
private String memberOldPw;
|
||||
private String memberOldPwChk;
|
||||
private String memberModDate;
|
||||
private String memberName;
|
||||
private String memberPost;
|
||||
private String memberPw;
|
||||
private String memberGrant;
|
||||
private String enableDept;
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getIhidNum() {
|
||||
return ihidNum;
|
||||
}
|
||||
public void setIhidNum(String ihidNum) {
|
||||
this.ihidNum = ihidNum;
|
||||
}
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
public String getPassword2() {
|
||||
return password2;
|
||||
}
|
||||
public void setPassword2(String password2) {
|
||||
this.password2 = password2;
|
||||
}
|
||||
public String getPasswordHint() {
|
||||
return passwordHint;
|
||||
}
|
||||
public void setPasswordHint(String passwordHint) {
|
||||
this.passwordHint = passwordHint;
|
||||
}
|
||||
public String getPasswordCnsr() {
|
||||
return passwordCnsr;
|
||||
}
|
||||
public void setPasswordCnsr(String passwordCnsr) {
|
||||
this.passwordCnsr = passwordCnsr;
|
||||
}
|
||||
public String getUserSe() {
|
||||
return userSe;
|
||||
}
|
||||
public void setUserSe(String userSe) {
|
||||
this.userSe = userSe;
|
||||
}
|
||||
public String getOrgnztId() {
|
||||
return orgnztId;
|
||||
}
|
||||
public void setOrgnztId(String orgnztId) {
|
||||
this.orgnztId = orgnztId;
|
||||
}
|
||||
public String getOrgnztNm() {
|
||||
return orgnztNm;
|
||||
}
|
||||
public void setOrgnztNm(String orgnztNm) {
|
||||
this.orgnztNm = orgnztNm;
|
||||
}
|
||||
public String getUniqId() {
|
||||
return uniqId;
|
||||
}
|
||||
public void setUniqId(String uniqId) {
|
||||
this.uniqId = uniqId;
|
||||
}
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
public String getDn() {
|
||||
return dn;
|
||||
}
|
||||
public void setDn(String dn) {
|
||||
this.dn = dn;
|
||||
}
|
||||
public String getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
public void setSiteId(String siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
public String getSiteNm() {
|
||||
return siteNm;
|
||||
}
|
||||
public void setSiteNm(String siteNm) {
|
||||
this.siteNm = siteNm;
|
||||
}
|
||||
public String getAuthority() {
|
||||
return authority;
|
||||
}
|
||||
public void setAuthority(String authority) {
|
||||
this.authority = authority;
|
||||
}
|
||||
public String getBeforeUrl() {
|
||||
return beforeUrl;
|
||||
}
|
||||
public void setBeforeUrl(String beforeUrl) {
|
||||
this.beforeUrl = beforeUrl;
|
||||
}
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
public int getPassMiss() {
|
||||
return passMiss;
|
||||
}
|
||||
public void setPassMiss(int passMiss) {
|
||||
this.passMiss = passMiss;
|
||||
}
|
||||
public String getStatusAll() {
|
||||
return statusAll;
|
||||
}
|
||||
public void setStatusAll(String statusAll) {
|
||||
this.statusAll = statusAll;
|
||||
}
|
||||
public String getEmplyrSttusCode() {
|
||||
return emplyrSttusCode;
|
||||
}
|
||||
public void setEmplyrSttusCode(String emplyrSttusCode) {
|
||||
this.emplyrSttusCode = emplyrSttusCode;
|
||||
}
|
||||
public int getSnsIdCnt() {
|
||||
return snsIdCnt;
|
||||
}
|
||||
public void setSnsIdCnt(int snsIdCnt) {
|
||||
this.snsIdCnt = snsIdCnt;
|
||||
}
|
||||
public String getSnsSite() {
|
||||
return snsSite;
|
||||
}
|
||||
public void setSnsSite(String snsSite) {
|
||||
this.snsSite = snsSite;
|
||||
}
|
||||
public String getSnsId() {
|
||||
return snsId;
|
||||
}
|
||||
public void setSnsId(String snsId) {
|
||||
this.snsId = snsId;
|
||||
}
|
||||
public String getSnsEmail() {
|
||||
return snsEmail;
|
||||
}
|
||||
public void setSnsEmail(String snsEmail) {
|
||||
this.snsEmail = snsEmail;
|
||||
}
|
||||
public String getTel() {
|
||||
return tel;
|
||||
}
|
||||
public void setTel(String tel) {
|
||||
this.tel = tel;
|
||||
}
|
||||
public String getOrgnztNo() {
|
||||
return orgnztNo;
|
||||
}
|
||||
public void setOrgnztNo(String orgnztNo) {
|
||||
this.orgnztNo = orgnztNo;
|
||||
}
|
||||
public String getOrgnztPosi() {
|
||||
return orgnztPosi;
|
||||
}
|
||||
public void setOrgnztPosi(String orgnztPosi) {
|
||||
this.orgnztPosi = orgnztPosi;
|
||||
}
|
||||
public String getEmplNo() {
|
||||
return emplNo;
|
||||
}
|
||||
public void setEmplNo(String emplNo) {
|
||||
this.emplNo = emplNo;
|
||||
}
|
||||
public String getUserWork() {
|
||||
return userWork;
|
||||
}
|
||||
public void setUserWork(String userWork) {
|
||||
this.userWork = userWork;
|
||||
}
|
||||
public static long getSerialversionuid() {
|
||||
return serialVersionUID;
|
||||
}
|
||||
public String getMembSeq() {
|
||||
return membSeq;
|
||||
}
|
||||
public void setMembSeq(String membSeq) {
|
||||
this.membSeq = membSeq;
|
||||
}
|
||||
public String getMembId() {
|
||||
return membId;
|
||||
}
|
||||
public void setMembId(String membId) {
|
||||
this.membId = membId;
|
||||
}
|
||||
public String getMembName() {
|
||||
return membName;
|
||||
}
|
||||
public void setMembName(String membName) {
|
||||
this.membName = membName;
|
||||
}
|
||||
public String getMembCi() {
|
||||
return membCi;
|
||||
}
|
||||
public void setMembCi(String membCi) {
|
||||
this.membCi = membCi;
|
||||
}
|
||||
public String getMembEmail() {
|
||||
return membEmail;
|
||||
}
|
||||
public void setMembEmail(String membEmail) {
|
||||
this.membEmail = membEmail;
|
||||
}
|
||||
public String getMembCelnum() {
|
||||
return membCelnum;
|
||||
}
|
||||
public void setMembCelnum(String membCelnum) {
|
||||
this.membCelnum = membCelnum;
|
||||
}
|
||||
public String getMembBirth() {
|
||||
return membBirth;
|
||||
}
|
||||
public void setMembBirth(String membBirth) {
|
||||
this.membBirth = membBirth;
|
||||
}
|
||||
public String getMembSmsRecpYn() {
|
||||
return membSmsRecpYn;
|
||||
}
|
||||
public void setMembSmsRecpYn(String membSmsRecpYn) {
|
||||
this.membSmsRecpYn = membSmsRecpYn;
|
||||
}
|
||||
public String getMembEmailRecpYn() {
|
||||
return membEmailRecpYn;
|
||||
}
|
||||
public void setMembEmailRecpYn(String membEmailRecpYn) {
|
||||
this.membEmailRecpYn = membEmailRecpYn;
|
||||
}
|
||||
public String getSexCode() {
|
||||
return sexCode;
|
||||
}
|
||||
public void setSexCode(String sexCode) {
|
||||
this.sexCode = sexCode;
|
||||
}
|
||||
public String getDispsettMembDivisCode() {
|
||||
return dispsettMembDivisCode;
|
||||
}
|
||||
public void setDispsettMembDivisCode(String dispsettMembDivisCode) {
|
||||
this.dispsettMembDivisCode = dispsettMembDivisCode;
|
||||
}
|
||||
public String getCorpnum() {
|
||||
return corpnum;
|
||||
}
|
||||
public void setCorpnum(String corpnum) {
|
||||
this.corpnum = corpnum;
|
||||
}
|
||||
public String getBuisnRegnum() {
|
||||
return buisnRegnum;
|
||||
}
|
||||
public void setBuisnRegnum(String buisnRegnum) {
|
||||
this.buisnRegnum = buisnRegnum;
|
||||
}
|
||||
public String getCompTitle() {
|
||||
return compTitle;
|
||||
}
|
||||
public void setCompTitle(String compTitle) {
|
||||
this.compTitle = compTitle;
|
||||
}
|
||||
public String getIsSelect() {
|
||||
return isSelect;
|
||||
}
|
||||
public void setIsSelect(String isSelect) {
|
||||
this.isSelect = isSelect;
|
||||
}
|
||||
|
||||
public String getOfcpsNm() {
|
||||
return ofcpsNm;
|
||||
}
|
||||
public void setOfcpsNm(String ofcpsNm) {
|
||||
this.ofcpsNm = ofcpsNm;
|
||||
}
|
||||
|
||||
public String getLoginTypeCd() {
|
||||
return loginTypeCd;
|
||||
}
|
||||
public void setLoginTypeCd(String loginTypeCd) {
|
||||
this.loginTypeCd = loginTypeCd;
|
||||
}
|
||||
public String getCertNum() {
|
||||
return certNum;
|
||||
}
|
||||
public void setCertNum(String certNum) {
|
||||
this.certNum = certNum;
|
||||
}
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
public String getMemberIdx() {
|
||||
return memberIdx;
|
||||
}
|
||||
public void setMemberIdx(String memberIdx) {
|
||||
this.memberIdx = memberIdx;
|
||||
}
|
||||
public String getMemberAddress1() {
|
||||
return memberAddress1;
|
||||
}
|
||||
public void setMemberAddress1(String memberAddress1) {
|
||||
this.memberAddress1 = memberAddress1;
|
||||
}
|
||||
public String getMemberAddress2() {
|
||||
return memberAddress2;
|
||||
}
|
||||
public void setMemberAddress2(String memberAddress2) {
|
||||
this.memberAddress2 = memberAddress2;
|
||||
}
|
||||
public String getMemberCode() {
|
||||
return memberCode;
|
||||
}
|
||||
public void setMemberCode(String memberCode) {
|
||||
this.memberCode = memberCode;
|
||||
}
|
||||
public String getMemberContactDate() {
|
||||
return memberContactDate;
|
||||
}
|
||||
public void setMemberContactDate(String memberContactDate) {
|
||||
this.memberContactDate = memberContactDate;
|
||||
}
|
||||
public String getMemberEmail1() {
|
||||
return memberEmail1;
|
||||
}
|
||||
public void setMemberEmail1(String memberEmail1) {
|
||||
this.memberEmail1 = memberEmail1;
|
||||
}
|
||||
public String getMemberEmail2() {
|
||||
return memberEmail2;
|
||||
}
|
||||
public void setMemberEmail2(String memberEmail2) {
|
||||
this.memberEmail2 = memberEmail2;
|
||||
}
|
||||
public String getMemberId() {
|
||||
return memberId;
|
||||
}
|
||||
public void setMemberId(String memberId) {
|
||||
this.memberId = memberId;
|
||||
}
|
||||
public String getMemberIp() {
|
||||
return memberIp;
|
||||
}
|
||||
public void setMemberIp(String memberIp) {
|
||||
this.memberIp = memberIp;
|
||||
}
|
||||
public String getMemberDept() {
|
||||
return memberDept;
|
||||
}
|
||||
public void setMemberDept(String memberDept) {
|
||||
this.memberDept = memberDept;
|
||||
}
|
||||
public String getMemberPosition() {
|
||||
return memberPosition;
|
||||
}
|
||||
public void setMemberPosition(String memberPosition) {
|
||||
this.memberPosition = memberPosition;
|
||||
}
|
||||
public String getMemberTel() {
|
||||
return memberTel;
|
||||
}
|
||||
public void setMemberTel(String memberTel) {
|
||||
this.memberTel = memberTel;
|
||||
}
|
||||
public String getMemberPhone() {
|
||||
return memberPhone;
|
||||
}
|
||||
public void setMemberPhone(String memberPhone) {
|
||||
this.memberPhone = memberPhone;
|
||||
}
|
||||
public String getMemberItemA1() {
|
||||
return memberItemA1;
|
||||
}
|
||||
public void setMemberItemA1(String memberItemA1) {
|
||||
this.memberItemA1 = memberItemA1;
|
||||
}
|
||||
public String getMemberOldPw() {
|
||||
return memberOldPw;
|
||||
}
|
||||
public void setMemberOldPw(String memberOldPw) {
|
||||
this.memberOldPw = memberOldPw;
|
||||
}
|
||||
public String getMemberOldPwChk() {
|
||||
return memberOldPwChk;
|
||||
}
|
||||
public void setMemberOldPwChk(String memberOldPwChk) {
|
||||
this.memberOldPwChk = memberOldPwChk;
|
||||
}
|
||||
public String getMemberModDate() {
|
||||
return memberModDate;
|
||||
}
|
||||
public void setMemberModDate(String memberModDate) {
|
||||
this.memberModDate = memberModDate;
|
||||
}
|
||||
public String getMemberName() {
|
||||
return memberName;
|
||||
}
|
||||
public void setMemberName(String memberName) {
|
||||
this.memberName = memberName;
|
||||
}
|
||||
public String getMemberPost() {
|
||||
return memberPost;
|
||||
}
|
||||
public void setMemberPost(String memberPost) {
|
||||
this.memberPost = memberPost;
|
||||
}
|
||||
public String getMemberPw() {
|
||||
return memberPw;
|
||||
}
|
||||
public void setMemberPw(String memberPw) {
|
||||
this.memberPw = memberPw;
|
||||
}
|
||||
public String getMemberGrant() {
|
||||
return memberGrant;
|
||||
}
|
||||
public void setMemberGrant(String memberGrant) {
|
||||
this.memberGrant = memberGrant;
|
||||
}
|
||||
public String getEnableDept() {
|
||||
return enableDept;
|
||||
}
|
||||
public void setEnableDept(String enableDept) {
|
||||
this.enableDept = enableDept;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
39
src/main/java/kcc/com/cmm/ReadVO.java
Normal file
39
src/main/java/kcc/com/cmm/ReadVO.java
Normal file
@ -0,0 +1,39 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ReadVO implements Serializable {
|
||||
|
||||
private String menuNo = ""; //메뉴 번호
|
||||
|
||||
private String readId = ""; //읽음처리 ID
|
||||
|
||||
private String loginId = "";//로그인 ID
|
||||
|
||||
public String getMenuNo() {
|
||||
return menuNo;
|
||||
}
|
||||
|
||||
public void setMenuNo(String menuNo) {
|
||||
this.menuNo = menuNo;
|
||||
}
|
||||
|
||||
public String getReadId() {
|
||||
return readId;
|
||||
}
|
||||
|
||||
public void setReadId(String readId) {
|
||||
this.readId = readId;
|
||||
}
|
||||
|
||||
public String getLoginId() {
|
||||
return loginId;
|
||||
}
|
||||
|
||||
public void setLoginId(String loginId) {
|
||||
this.loginId = loginId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
121
src/main/java/kcc/com/cmm/SessionVO.java
Normal file
121
src/main/java/kcc/com/cmm/SessionVO.java
Normal file
@ -0,0 +1,121 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 세션 VO 클래스
|
||||
* @author 공통서비스 개발팀 박지욱
|
||||
* @since 2009.03.06
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.06 박지욱 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class SessionVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -2848741427493626376L;
|
||||
|
||||
/** 아이디 */
|
||||
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;
|
||||
}
|
||||
}
|
||||
149
src/main/java/kcc/com/cmm/UserVO.java
Normal file
149
src/main/java/kcc/com/cmm/UserVO.java
Normal file
@ -0,0 +1,149 @@
|
||||
package kcc.com.cmm;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Class Name : UserVO.java
|
||||
* @Description : Login VO class
|
||||
* @Modification Information
|
||||
* @
|
||||
* @ 수정일 수정자 수정내용
|
||||
* @ ------- -------- ---------------------------
|
||||
* @ 2018.09.27 ITN 최초 생성
|
||||
*
|
||||
* @author ITN
|
||||
* @since 2018.09.27
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
public class UserVO implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 이름 */
|
||||
private String name;
|
||||
/** 이메일주소 */
|
||||
private String email;
|
||||
/** 사용자구분 */
|
||||
private String userSe;
|
||||
/** 고유아이디 */
|
||||
private String uniqId;
|
||||
/** 로그인 후 이동할 페이지 */
|
||||
private String url;
|
||||
/** 사용자 IP정보 */
|
||||
private String ip;
|
||||
/** GPKI인증 DN */
|
||||
private String dn;
|
||||
/** 핸드폰인증 DN */
|
||||
private String mblDn;
|
||||
|
||||
private String authority;
|
||||
/**
|
||||
* @return the name
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
/**
|
||||
* @param name the name to set
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
/**
|
||||
* @return the email
|
||||
*/
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
/**
|
||||
* @param email the email to set
|
||||
*/
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
/**
|
||||
* @return the userSe
|
||||
*/
|
||||
public String getUserSe() {
|
||||
return userSe;
|
||||
}
|
||||
/**
|
||||
* @param userSe the userSe to set
|
||||
*/
|
||||
public void setUserSe(String userSe) {
|
||||
this.userSe = userSe;
|
||||
}
|
||||
/**
|
||||
* @return the uniqId
|
||||
*/
|
||||
public String getUniqId() {
|
||||
return uniqId;
|
||||
}
|
||||
/**
|
||||
* @param uniqId the uniqId to set
|
||||
*/
|
||||
public void setUniqId(String uniqId) {
|
||||
this.uniqId = uniqId;
|
||||
}
|
||||
/**
|
||||
* @return the url
|
||||
*/
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
/**
|
||||
* @param url the url to set
|
||||
*/
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
/**
|
||||
* @return the ip
|
||||
*/
|
||||
public String getIp() {
|
||||
return ip;
|
||||
}
|
||||
/**
|
||||
* @param ip the ip to set
|
||||
*/
|
||||
public void setIp(String ip) {
|
||||
this.ip = ip;
|
||||
}
|
||||
/**
|
||||
* @return the dn
|
||||
*/
|
||||
public String getDn() {
|
||||
return dn;
|
||||
}
|
||||
/**
|
||||
* @param dn the dn to set
|
||||
*/
|
||||
public void setDn(String dn) {
|
||||
this.dn = dn;
|
||||
}
|
||||
/**
|
||||
* @return the mblDn
|
||||
*/
|
||||
public String getMblDn() {
|
||||
return mblDn;
|
||||
}
|
||||
/**
|
||||
* @param mblDn the mblDn to set
|
||||
*/
|
||||
public void setMblDn(String mblDn) {
|
||||
this.mblDn = mblDn;
|
||||
}
|
||||
public String getAuthority() {
|
||||
return authority;
|
||||
}
|
||||
public void setAuthority(String authority) {
|
||||
this.authority = authority;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
113
src/main/java/kcc/com/cmm/aspect/LoggerAspect.java
Normal file
113
src/main/java/kcc/com/cmm/aspect/LoggerAspect.java
Normal file
@ -0,0 +1,113 @@
|
||||
package kcc.com.cmm.aspect;
|
||||
|
||||
import java.util.Enumeration;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.json.simple.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import kcc.com.cmm.util.IpUtil;
|
||||
|
||||
@Component
|
||||
public class LoggerAspect {
|
||||
private static final Logger log = LoggerFactory.getLogger(LoggerAspect.class);
|
||||
|
||||
|
||||
public Object methodLogger(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
|
||||
StringBuffer logBuffer = new StringBuffer();
|
||||
List<Object> logList = Lists.newArrayList();
|
||||
Object result = null;
|
||||
try {
|
||||
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); // request 정보를 가져온다.
|
||||
|
||||
|
||||
|
||||
String controllerName = proceedingJoinPoint.getSignature().getDeclaringType().getSimpleName();
|
||||
String methodName = proceedingJoinPoint.getSignature().getName();
|
||||
logBuffer.append("\n┌ [●●●●●●●●●●●● 요청정보 ●●●●●●●●●●]\n");
|
||||
logBuffer.append("│ [Method] URL : [{}] {}\n");
|
||||
logList.add(request.getMethod());
|
||||
logList.add(request.getRequestURI());
|
||||
|
||||
logBuffer.append("│ Request IP : {}\n");
|
||||
logList.add(IpUtil.getClientIP(request));
|
||||
|
||||
logBuffer.append("│ Request Browser : {}\n");
|
||||
logList.add(IpUtil.getBrowser(request));
|
||||
|
||||
logBuffer.append("│ Controller : [{}] - [{}] \n");
|
||||
logList.add(controllerName);
|
||||
logList.add(methodName);
|
||||
|
||||
/*logBuffer.append("│ 요청Param : {}\n");
|
||||
logList.add(getParams(request));*/
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
|
||||
|
||||
result = proceedingJoinPoint.proceed();
|
||||
|
||||
long end = System.currentTimeMillis();
|
||||
logBuffer.append("│ Time : [{}] sec\n");
|
||||
logList.add( (double)(end - start)/1000d );
|
||||
|
||||
if( result instanceof ModelAndView ) {
|
||||
logBuffer.append("│ Result : {}\n");
|
||||
logList.add(result);
|
||||
}else if( result instanceof String ) {
|
||||
logBuffer.append("│ View : {}\n");
|
||||
logList.add(result);
|
||||
} else {
|
||||
logBuffer.append("│ Result : {}\n");
|
||||
logList.add(result);
|
||||
}
|
||||
|
||||
proceedingJoinPoint.getArgs();
|
||||
|
||||
logBuffer.append("└ [●●●●●●●●●●●●●●●●●●●●●●●●●●●●]");
|
||||
if(result!=null && result.toString().indexOf("web/com")<0
|
||||
&& result.toString().indexOf("main/inc")<0
|
||||
) { // heder, footer, navi 로그는 찍지 않음.
|
||||
log.info(logBuffer.toString(), logList.toArray());
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
logBuffer.append("└ [●●●●●●●●●●●●●●●●●●●●●●●●●●●●]");
|
||||
log.info(logBuffer.toString(), logList.toArray());
|
||||
|
||||
System.out.println("Throwable Log ::: "+ throwable.toString());
|
||||
throw throwable;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* request 에 담긴 정보를 JSONObject 형태로 반환한다.
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private static JSONObject getParams(HttpServletRequest request) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
Enumeration<String> params = request.getParameterNames();
|
||||
while (params.hasMoreElements()) {
|
||||
String param = params.nextElement();
|
||||
String replaceParam = param.replaceAll("\\.", "-");
|
||||
jsonObject.put(replaceParam, request.getParameter(param));
|
||||
}
|
||||
return jsonObject;
|
||||
}
|
||||
}
|
||||
40
src/main/java/kcc/com/cmm/captcha/AudioCaptCha.java
Normal file
40
src/main/java/kcc/com/cmm/captcha/AudioCaptCha.java
Normal file
@ -0,0 +1,40 @@
|
||||
package kcc.com.cmm.captcha;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import nl.captcha.Captcha;
|
||||
import nl.captcha.audio.AudioCaptcha;
|
||||
import nl.captcha.audio.producer.VoiceProducer;
|
||||
import nl.captcha.servlet.CaptchaServletUtil;
|
||||
|
||||
public class AudioCaptCha {
|
||||
public void getAudioCaptCha(HttpServletRequest req, HttpServletResponse resp, String answer) throws IOException
|
||||
{
|
||||
HttpSession session = req.getSession();
|
||||
Captcha captcha = (Captcha) session.getAttribute(Captcha.NAME);
|
||||
String getAnswer = answer;
|
||||
AudioCaptcha audiocaptcha = null;
|
||||
if ( getAnswer == null || "".equals(getAnswer) ) getAnswer = captcha.getAnswer();
|
||||
|
||||
String lan = req.getParameter("lan");
|
||||
if( lan != null && "kor".equals(lan)) {
|
||||
VoiceProducer vProd = new SetKorVoiceProducer(); //한글 음성을 생성해주는 객체 생성
|
||||
audiocaptcha = new AudioCaptcha.Builder()
|
||||
.addAnswer(new SetTextProducer(getAnswer))
|
||||
.addVoice(vProd) //한글음성생성기를 AudioCaptcha에 적용
|
||||
.addNoise()
|
||||
.build();
|
||||
} else {
|
||||
audiocaptcha = new AudioCaptcha.Builder()
|
||||
.addAnswer(new SetTextProducer(getAnswer))
|
||||
.addNoise()
|
||||
.build();
|
||||
}
|
||||
|
||||
String agent = req.getParameter("agent"); //브라우저마다 응답을 달리해야할경우 이용.
|
||||
CaptchaServletUtil.writeAudio(resp, audiocaptcha.getChallenge());
|
||||
}
|
||||
}
|
||||
66
src/main/java/kcc/com/cmm/captcha/CaptCha.java
Normal file
66
src/main/java/kcc/com/cmm/captcha/CaptCha.java
Normal file
@ -0,0 +1,66 @@
|
||||
package kcc.com.cmm.captcha;
|
||||
|
||||
import static nl.captcha.Captcha.NAME;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import nl.captcha.Captcha;
|
||||
import nl.captcha.backgrounds.GradiatedBackgroundProducer;
|
||||
import nl.captcha.gimpy.DropShadowGimpyRenderer;
|
||||
import nl.captcha.servlet.CaptchaServletUtil;
|
||||
import nl.captcha.text.producer.NumbersAnswerProducer;
|
||||
import nl.captcha.text.renderer.DefaultWordRenderer;
|
||||
|
||||
public class CaptCha {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static int _width = 150; //이미지 가로크기
|
||||
private static int _height = 50; //이미지 높이
|
||||
private static int _fontsize = 44; //폰트크기
|
||||
|
||||
public CaptCha() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void getCaptCha(HttpServletRequest req, HttpServletResponse resp)
|
||||
throws IOException {
|
||||
try {
|
||||
|
||||
// 폰트 설정 =========================================================
|
||||
List<Font> fontList = new ArrayList<Font>();
|
||||
fontList.add(new Font("", Font.HANGING_BASELINE, 40));//
|
||||
fontList.add(new Font("Courier", Font.ITALIC, 40));
|
||||
fontList.add(new Font("", Font.PLAIN, 40));
|
||||
|
||||
List<Color> colorList = new ArrayList<Color>();
|
||||
// colorList.add(Color.green);
|
||||
// colorList.add(Color.pink);
|
||||
// colorList.add(Color.gray);
|
||||
colorList.add(Color.black);
|
||||
// colorList.add(Color.blue);
|
||||
// 폰트 설정 =========================================================
|
||||
|
||||
Captcha captcha = new Captcha.Builder( _width, _height)
|
||||
// .addText(wordRenderer)
|
||||
.addText(new NumbersAnswerProducer(6), //6자리 숫자로 된 문자를 추가
|
||||
new DefaultWordRenderer(colorList, fontList)) //글자 꾸미기(색상, 폰트)
|
||||
.gimp(new DropShadowGimpyRenderer()).gimp()
|
||||
// BlockGimpyRenderer,FishEyeGimpyRenderer,RippleGimpyRenderer,ShearGimpyRenderer,StretchGimpyRenderer
|
||||
.addNoise().addNoise().addBorder()
|
||||
.addBackground(new GradiatedBackgroundProducer())
|
||||
// FlatColorBackgroundProducer,SquigglesBackgroundProducer,TransparentBackgroundProducer
|
||||
.build();
|
||||
|
||||
req.getSession().setAttribute(NAME, captcha);
|
||||
CaptchaServletUtil.writeImage(resp, captcha.getImage());
|
||||
} catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
59
src/main/java/kcc/com/cmm/captcha/CaptchaUtil.java
Normal file
59
src/main/java/kcc/com/cmm/captcha/CaptchaUtil.java
Normal file
@ -0,0 +1,59 @@
|
||||
package kcc.com.cmm.captcha;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import nl.captcha.Captcha;
|
||||
import nl.captcha.audio.AudioCaptcha;
|
||||
import nl.captcha.audio.producer.VoiceProducer;
|
||||
import nl.captcha.backgrounds.GradiatedBackgroundProducer;
|
||||
import nl.captcha.servlet.CaptchaServletUtil;
|
||||
import nl.captcha.text.producer.NumbersAnswerProducer;
|
||||
|
||||
public class CaptchaUtil {
|
||||
public CaptchaUtil() {
|
||||
|
||||
}
|
||||
public void captchaImg(HttpServletRequest request, HttpServletResponse response){
|
||||
Captcha captcha = new Captcha.Builder(200, 60)
|
||||
.addText(new NumbersAnswerProducer(6))
|
||||
.addNoise().addNoise().addNoise()
|
||||
.addBackground(new GradiatedBackgroundProducer())
|
||||
.addBorder()
|
||||
.build();
|
||||
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setDateHeader("Expires", 0);
|
||||
response.setHeader("Pragma", "no-cache");
|
||||
response.setDateHeader("Max-Age", 0);
|
||||
response.setContentType("image/png");
|
||||
|
||||
CaptchaServletUtil.writeImage(response, captcha.getImage());;
|
||||
request.getSession().setAttribute("captcha", captcha.getAnswer());
|
||||
}
|
||||
|
||||
public void captchaAudio(HttpServletRequest request, HttpServletResponse response){
|
||||
String getAnswer = (String) request.getSession().getAttribute("captcha");
|
||||
VoiceProducer vProd = new SetKorVoiceProducer(); //한글 음성을 생성해주는 객체 생성
|
||||
|
||||
/* AudioCaptcha ac = new AudioCaptcha.Builder()
|
||||
.addAnswer(new SetTextProducer(getAnswer))
|
||||
.addVoice()
|
||||
.addNoise()
|
||||
.build();*/
|
||||
|
||||
AudioCaptcha ac = new AudioCaptcha.Builder()
|
||||
.addAnswer(new SetTextProducer(getAnswer))
|
||||
.addVoice(vProd)
|
||||
.addNoise()
|
||||
.build() ;
|
||||
|
||||
response.setHeader("Cache-Control", "no-cache");
|
||||
response.setDateHeader("Expires", 0);
|
||||
response.setHeader("Pragma", "no-cache");
|
||||
response.setDateHeader("Max-Age", 0);
|
||||
|
||||
CaptchaServletUtil.writeAudio(response, ac.getChallenge());;
|
||||
request.getSession().setAttribute("captcha", ac.getAnswer());
|
||||
}
|
||||
}
|
||||
50
src/main/java/kcc/com/cmm/captcha/SetKorVoiceProducer.java
Normal file
50
src/main/java/kcc/com/cmm/captcha/SetKorVoiceProducer.java
Normal file
@ -0,0 +1,50 @@
|
||||
package kcc.com.cmm.captcha;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import nl.captcha.audio.Sample;
|
||||
import nl.captcha.audio.producer.VoiceProducer;
|
||||
import nl.captcha.util.FileUtil;
|
||||
|
||||
public class SetKorVoiceProducer implements VoiceProducer
|
||||
{
|
||||
private static final Map<Integer, String> DEFAULT_VOICES_MAP;
|
||||
|
||||
static {
|
||||
DEFAULT_VOICES_MAP = new HashMap<Integer, String>();
|
||||
StringBuilder sb;
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
sb = new StringBuilder("/sounds/ko/numbers/");
|
||||
sb.append(i);
|
||||
sb.append(".wav");
|
||||
DEFAULT_VOICES_MAP.put(i, sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
private final Map<Integer, String> _voices;
|
||||
|
||||
public SetKorVoiceProducer() {
|
||||
this(DEFAULT_VOICES_MAP);
|
||||
}
|
||||
|
||||
|
||||
public SetKorVoiceProducer(Map<Integer, String> voices) {
|
||||
_voices = voices;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sample getVocalization(char num) {
|
||||
try {
|
||||
Integer.parseInt(num + "");
|
||||
} catch (NumberFormatException e) {
|
||||
throw new IllegalArgumentException("Expected <num> to be a number, got '" + num + "' instead.",e);
|
||||
}
|
||||
|
||||
int idx = Integer.parseInt(num + "");
|
||||
String filename = _voices.get(idx);
|
||||
return FileUtil.readSample(filename);
|
||||
}
|
||||
|
||||
}
|
||||
19
src/main/java/kcc/com/cmm/captcha/SetTextProducer.java
Normal file
19
src/main/java/kcc/com/cmm/captcha/SetTextProducer.java
Normal file
@ -0,0 +1,19 @@
|
||||
package kcc.com.cmm.captcha;
|
||||
|
||||
/**
|
||||
* 전달받은 문자열을 그대로 오디오캡차가 이용할수있도록 생성한 클래스
|
||||
*/
|
||||
import nl.captcha.text.producer.TextProducer;
|
||||
|
||||
public class SetTextProducer implements TextProducer {
|
||||
private final String _getAnswer;
|
||||
public SetTextProducer(String getAnswer){
|
||||
_getAnswer = getAnswer;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText() {
|
||||
return _getAnswer;
|
||||
}
|
||||
}
|
||||
80
src/main/java/kcc/com/cmm/exception/BaseException.java
Normal file
80
src/main/java/kcc/com/cmm/exception/BaseException.java
Normal file
@ -0,0 +1,80 @@
|
||||
package kcc.com.cmm.exception;
|
||||
|
||||
public class BaseException extends RuntimeException {
|
||||
|
||||
private static final long serialVersionUID = 3500875284669187163L;
|
||||
|
||||
private BaseModelCode baseModelCode;
|
||||
private Object [] params;
|
||||
|
||||
|
||||
public BaseException() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public BaseException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
|
||||
public BaseException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
|
||||
public BaseException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
|
||||
public BaseException(BaseModelCode baseModelCode, Object ... params) {
|
||||
this.baseModelCode = baseModelCode;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
|
||||
public BaseException(BaseModelCode baseModelCode, Object param) {
|
||||
this(baseModelCode, new Object[] {param});
|
||||
}
|
||||
|
||||
public BaseException(BaseModelCode baseModelCode) {
|
||||
this(baseModelCode, new Object[] {null});
|
||||
}
|
||||
|
||||
|
||||
public BaseModelCode getBaseModelCode() {
|
||||
return baseModelCode;
|
||||
}
|
||||
|
||||
|
||||
public Object[] getParams() {
|
||||
Object[]returnArr;
|
||||
//int returnSize = this.schSeqArr.length;
|
||||
int returnSize = 0;
|
||||
try {
|
||||
returnSize = this.params.length;
|
||||
}catch(NullPointerException ex) {
|
||||
System.out.println("NullPointerException");
|
||||
//ex.printStackTrace();
|
||||
}
|
||||
|
||||
/* FIX */
|
||||
if(returnSize > 0){
|
||||
returnArr = new String[returnSize];
|
||||
|
||||
for(int i=0; i < returnSize; i++){
|
||||
returnArr[i] = this.params[i];
|
||||
}
|
||||
|
||||
return returnArr;
|
||||
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
|
||||
//return params;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
67
src/main/java/kcc/com/cmm/exception/BaseModelCode.java
Normal file
67
src/main/java/kcc/com/cmm/exception/BaseModelCode.java
Normal file
@ -0,0 +1,67 @@
|
||||
package kcc.com.cmm.exception;
|
||||
|
||||
public enum BaseModelCode {
|
||||
|
||||
MC200("200", "성공"),
|
||||
MC400("400", "요청 정보가 올바르지 않습니다."),
|
||||
MC401("401", "사용 권한이 없습니다. 로그인 후 이용해주세요. "),
|
||||
MC404("404", "요청된 URL을 찾을 수 없습니다."),
|
||||
MC490("490", "첨부파일 용량({0})이 최대 허용량({1})을 초과하였습니다."),
|
||||
MC491("491", "첨부파일 용량이 최대 허용량({0})을 초과하였습니다."),
|
||||
MC492("492", "지원하지 않는 Http Method 입니다."),
|
||||
MC500("500", "시스템 오류가 발생했습니다."),
|
||||
|
||||
MC600("600", "[{0}] 필수 입니다."),
|
||||
MC610("610", "[{0}] 숫자만 가능합니다."),
|
||||
MC611("611", "[{0}] 최소 {1}이상만 가능합니다."),
|
||||
MC612("612", "[{0}] 최대 {1}이하만 가능합니다."),
|
||||
MC613("613", "[{0}] {1} ~ {2}만 가능합니다."),
|
||||
MC630("630", "[{0}] 최소 {1}자리 이상만 가능합니다."),
|
||||
MC631("631", "[{0}] 최대 {1}자리 이하만 가능합니다."),
|
||||
MC632("632", "[{0}] {1} ~ {2}자리만 가능합니다."),
|
||||
MC633("633", "[{0}] 최소 {1} byte 이상만 가능합니다."),
|
||||
MC634("634", "[{0}] 최대 {1} byte 이하만 가능합니다."),
|
||||
MC635("635", "[{0}] {1} ~ {2} byte만 가능합니다."),
|
||||
MC640("640", "[{0}] 날짜({1})만 가능합니다."),
|
||||
MC650("650", "[{0}] 패턴이 일치하지 않습니다."),
|
||||
MC651("651", "[{0}] 패턴({1})이 일치하지 않습니다."),
|
||||
|
||||
MC800("800", "{0} 오류\n{1}"), // 신보 연동 오류
|
||||
|
||||
MC1010("1010", "인증서 서명 검증이 실패하였습니다.\n\n{0}\n\n같은 문제가 계속해서 발생하면 위 메시지를 기록하신 후 고객상담센터({1})로 연락주시기 바랍니다."),
|
||||
MC1011("1011", "인증서가 유효하지 않습니다.\n\n{0}"),
|
||||
MC1012("1012", "신원확인이 실패하였습니다.\n\n공인인증서 발급에 사용된 사업자등록번호와 귀사의 사업자등록번호가 일치하지 않습니다.\n\n회원정보의 사업자번호가 올바로 등록되어 있는지 확인하시기 바랍니다.\n\n궁금하신 점이 있으시면 고객상담센터({0})로 연락주시기 바랍니다."),
|
||||
MC1013("1013", "암호화 검증에 실패하였습니다."),
|
||||
|
||||
|
||||
MC1110("1110", "서명값 Base64 Decode 결과 실패\n\n[{0}] {1}"),
|
||||
MC1111("1111", "전자서명 검증 결과 실패\n\n[{0}] {1}"),
|
||||
MC1112("1112", "인증서 추출 실패\n\n[{0}] {1}"),
|
||||
MC1113("1113", "인증서 검증 실패\n\n[{0}] {1}"),
|
||||
MC1114("1114", "신원확인이 실패하였습니다. 공인인증서 발급에 사용된 사업자등록번호와 귀사의 사업자등록번호가 일치하지 않습니다.\n\n회원정보의 사업자번호가 올바로 등록되어 있는지 확인하시기 바랍니다.\n\n[{0}] {1}"),
|
||||
|
||||
|
||||
|
||||
|
||||
MC2001("2001", "Excel 파일 생성 중 오류가 발생했습니다."),
|
||||
MC2002("2002", "Excel Export 최대 건수({0})를 초과하였습니다."),
|
||||
MC2003("2003", "파일 다운로드 중 오류가 발생했습니다."),
|
||||
;
|
||||
private String code;
|
||||
private String msg;
|
||||
BaseModelCode(String code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
/**
|
||||
* 코드
|
||||
* @return
|
||||
*/
|
||||
public String code() {
|
||||
return code;
|
||||
}
|
||||
public String msg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
}
|
||||
46
src/main/java/kcc/com/cmm/filter/HTMLTagFilter.java
Normal file
46
src/main/java/kcc/com/cmm/filter/HTMLTagFilter.java
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright 2008-2009 MOPAS(Ministry of Public Administration and Security).
|
||||
*
|
||||
* 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 kcc.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 Public Administration and Security).
|
||||
*
|
||||
* 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 kcc.com.cmm.filter;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
|
||||
public class HTMLTagFilterRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
public HTMLTagFilterRequestWrapper(HttpServletRequest request) {
|
||||
super(request);
|
||||
}
|
||||
|
||||
public String[] getParameterValues(String parameter) {
|
||||
|
||||
String[] values = super.getParameterValues(parameter);
|
||||
|
||||
if(values==null){
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < values.length; i++) {
|
||||
if (values[i] != null) {
|
||||
StringBuffer strBuff = new StringBuffer();
|
||||
for (int j = 0; j < values[i].length(); j++) {
|
||||
char c = values[i].charAt(j);
|
||||
switch (c) {
|
||||
case '<':
|
||||
strBuff.append("<");
|
||||
break;
|
||||
case '>':
|
||||
strBuff.append(">");
|
||||
break;
|
||||
//case '&':
|
||||
//strBuff.append("&");
|
||||
//break;
|
||||
case '"':
|
||||
strBuff.append(""");
|
||||
break;
|
||||
case '\'':
|
||||
strBuff.append("'");
|
||||
break;
|
||||
default:
|
||||
strBuff.append(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
values[i] = strBuff.toString();
|
||||
} else {
|
||||
values[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
public String getParameter(String parameter) {
|
||||
|
||||
String value = super.getParameter(parameter);
|
||||
|
||||
if(value==null){
|
||||
return null;
|
||||
}
|
||||
|
||||
StringBuffer strBuff = new StringBuffer();
|
||||
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
char c = value.charAt(i);
|
||||
switch (c) {
|
||||
case '<':
|
||||
strBuff.append("<");
|
||||
break;
|
||||
case '>':
|
||||
strBuff.append(">");
|
||||
break;
|
||||
case '&':
|
||||
strBuff.append("&");
|
||||
break;
|
||||
case '"':
|
||||
strBuff.append(""");
|
||||
break;
|
||||
case '\'':
|
||||
strBuff.append("'");
|
||||
break;
|
||||
default:
|
||||
strBuff.append(c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
value = strBuff.toString();
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
48
src/main/java/kcc/com/cmm/filter/XssFilter.java
Normal file
48
src/main/java/kcc/com/cmm/filter/XssFilter.java
Normal file
@ -0,0 +1,48 @@
|
||||
/*
|
||||
* Copyright 2008-2009 MOPAS(Ministry of Public Administration and Security).
|
||||
*
|
||||
* 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 kcc.com.cmm.filter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.Filter;
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.FilterConfig;
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class XssFilter implements Filter{
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private FilterConfig config;
|
||||
|
||||
public void doFilter(ServletRequest request, ServletResponse response,
|
||||
FilterChain chain) throws IOException, ServletException {
|
||||
ServletContext context = config.getServletContext();
|
||||
chain.doFilter(new XssFilterRequestWrapper((HttpServletRequest)request), response);
|
||||
//chain.doFilter(new XssFilterRequestWrapper((HttpServletRequest)request , response , context ), response);
|
||||
}
|
||||
|
||||
public void init(FilterConfig config) throws ServletException {
|
||||
this.config = config;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
this.config = null;
|
||||
}
|
||||
}
|
||||
149
src/main/java/kcc/com/cmm/filter/XssFilterRequestWrapper.java
Normal file
149
src/main/java/kcc/com/cmm/filter/XssFilterRequestWrapper.java
Normal file
@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright 2008-2009 MOPAS(Ministry of Public Administration and Security).
|
||||
*
|
||||
* 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 kcc.com.cmm.filter;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletRequestWrapper;
|
||||
|
||||
public class XssFilterRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
ServletContext context ;
|
||||
HttpServletRequest request ;
|
||||
ServletResponse response;
|
||||
|
||||
public XssFilterRequestWrapper(HttpServletRequest request) {
|
||||
super(request);
|
||||
}
|
||||
|
||||
public XssFilterRequestWrapper(HttpServletRequest request, ServletContext context) {
|
||||
super(request);
|
||||
this.context = context ;
|
||||
this.request = request;
|
||||
}
|
||||
|
||||
public XssFilterRequestWrapper(HttpServletRequest request, ServletResponse response, ServletContext context) {
|
||||
super(request);
|
||||
this.context = context ;
|
||||
this.request = request;
|
||||
this.response = response ;
|
||||
}
|
||||
|
||||
public String[] getParameterValues(String parameter) {
|
||||
|
||||
String[] values = super.getParameterValues(parameter);
|
||||
|
||||
if(values==null){
|
||||
return null;
|
||||
}
|
||||
|
||||
int count = values.length;
|
||||
String[] encodedValues = new String[count];
|
||||
for (int i = 0; i < count; i++) {
|
||||
encodedValues[i] = cleanXSS(values[i]);
|
||||
}
|
||||
return encodedValues;
|
||||
}
|
||||
|
||||
public String getParameter(String parameter) {
|
||||
String value = super.getParameter(parameter);
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
return cleanXSS(value);
|
||||
}
|
||||
|
||||
public String getHeader(String name) {
|
||||
String value = super.getHeader(name);
|
||||
if (value == null)
|
||||
return null;
|
||||
return cleanXSS(value);
|
||||
|
||||
}
|
||||
|
||||
private String cleanXSS(String test_str) {
|
||||
// 특수 구문 필터링 (데이터베이스가 Oracle 인 경우)
|
||||
|
||||
String test_str_low= test_str.toLowerCase();
|
||||
if(test_str_low.contains("union")||
|
||||
test_str_low.contains("select") ||
|
||||
test_str_low.contains("insert") ||
|
||||
test_str_low.contains("drop") ||
|
||||
test_str_low.contains("update") ||
|
||||
test_str_low.contains("delete") ||
|
||||
test_str_low.contains("join") ||
|
||||
test_str_low.contains("from") ||
|
||||
test_str_low.contains("where") ||
|
||||
test_str_low.contains("substr") ||
|
||||
test_str_low.contains("user_tables")||
|
||||
test_str_low.contains("script")||
|
||||
test_str_low.contains("<")||
|
||||
test_str_low.contains(">")||
|
||||
test_str_low.contains("alert")||
|
||||
test_str_low.contains("javascript")||
|
||||
test_str_low.contains("=")||
|
||||
test_str_low.contains("!")||
|
||||
test_str_low.contains("or")||
|
||||
test_str_low.contains("user_tables")||
|
||||
test_str_low.contains("\\(")||
|
||||
test_str_low.contains("\\)")||
|
||||
test_str_low.contains("user_tables")||
|
||||
test_str_low.contains("<") ||
|
||||
test_str_low.contains("\"") ||
|
||||
test_str_low.contains("%") ||
|
||||
test_str_low.contains("()") ||
|
||||
test_str_low.contains("+") ||
|
||||
test_str_low.contains("%") ||
|
||||
test_str_low.contains(">")
|
||||
)
|
||||
{
|
||||
|
||||
try {
|
||||
context.getRequestDispatcher("/blank.do").forward(request, response);
|
||||
} catch (ServletException e) {
|
||||
System.out.println("ServletException Occured!!!");
|
||||
} catch (IOException e) {
|
||||
System.out.println("IOException Occured!!!");
|
||||
}
|
||||
|
||||
test_str = test_str_low;
|
||||
test_str = test_str.replaceAll("union", "q-union");
|
||||
test_str = test_str.replaceAll("select", "q-select");
|
||||
test_str = test_str.replaceAll("insert", "q-insert");
|
||||
test_str = test_str.replaceAll("drop", "q-drop");
|
||||
test_str = test_str.replaceAll("update", "q-update");
|
||||
test_str = test_str.replaceAll("delete", "q-delete");
|
||||
test_str = test_str.replaceAll("and", "q-and");
|
||||
test_str = test_str.replaceAll("or", "q-or");
|
||||
test_str = test_str.replaceAll("join", "q-join");
|
||||
test_str = test_str.replaceAll("substr", "q-substr");
|
||||
test_str = test_str.replaceAll("from", "q-from");
|
||||
test_str = test_str.replaceAll("where", "q-where");
|
||||
test_str = test_str.replaceAll("declare", "q-declare");
|
||||
test_str = test_str.replaceAll("openrowset", "q-openrowset");
|
||||
test_str = test_str.replaceAll("user_tables","q-user_tables");
|
||||
test_str = test_str.replaceAll("user_tab_columns","q-user_tab_columns");
|
||||
test_str = test_str.replaceAll("table_name","q-table_name");
|
||||
test_str = test_str.replaceAll("column_name","q-column_name");
|
||||
test_str = test_str.replaceAll("row_num","q-row_num");
|
||||
}
|
||||
return test_str ;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package kcc.com.cmm.interceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.springframework.web.servlet.FlashMap;
|
||||
import org.springframework.web.servlet.FlashMapManager;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
import org.springframework.web.servlet.support.RequestContextUtils;
|
||||
import org.springmodules.validation.commons.MessageUtils;
|
||||
|
||||
import kcc.com.cmm.LoginVO;
|
||||
|
||||
public class InterceptorHandler extends HandlerInterceptorAdapter{
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
|
||||
|
||||
///kccadr/adjPgrMgr/** URL 패턴 접근 시 LoginVO가 없을경우 로그인화면으로 이동_220425_이준호
|
||||
HttpSession session = request.getSession();
|
||||
LoginVO loginVO = (LoginVO) session.getAttribute("LoginVO");
|
||||
/*SsoLoginVO ssoLoginVO = (SsoLoginVO) session.getAttribute("SSOLoginVO");*/
|
||||
|
||||
if(loginVO == null) {
|
||||
|
||||
FlashMap flashMap = new FlashMap();
|
||||
flashMap.put("message", "로그인 시간이 만료되어 로그인 페이지로 이동합니다.");
|
||||
FlashMapManager flashMapManager = RequestContextUtils.getFlashMapManager(request);
|
||||
flashMapManager.saveOutputFlashMap(flashMap, request, response);
|
||||
|
||||
request.getSession().invalidate();
|
||||
|
||||
response.sendRedirect(request.getContextPath() + "/cmm/main/mainPage.do");
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* view 화면으로 데이터가 넘어가기 이전에 실행
|
||||
* modelAndView 값을 체크할 수 있음
|
||||
* */
|
||||
@Override
|
||||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
|
||||
super.postHandle(request, response, handler, modelAndView);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* view에서 모든 처리를 완료한 후에 실행
|
||||
* */
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
|
||||
super.afterCompletion(request, response, handler, ex);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package kcc.com.cmm.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface AdrCourtFileMngService {
|
||||
|
||||
// public AdrCourtFileVO selectCourtFileInfs(AdrCourtFileVO adrCourtFileVO) throws Exception;
|
||||
|
||||
public void insertCourtFileInf(AdrCourtFileVO adrCourtFileVO) throws Exception;
|
||||
|
||||
}
|
||||
72
src/main/java/kcc/com/cmm/service/AdrCourtFileVO.java
Normal file
72
src/main/java/kcc/com/cmm/service/AdrCourtFileVO.java
Normal file
@ -0,0 +1,72 @@
|
||||
package kcc.com.cmm.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class AdrCourtFileVO implements Serializable {
|
||||
|
||||
private String crtAtchFileId;
|
||||
private String crtSeq;
|
||||
private String crtSn;
|
||||
private String crtAtchFileTy;
|
||||
private String frstRegistPnttm;
|
||||
private String frstRegisterId;
|
||||
private String lastUpdtPnttm;
|
||||
private String lastUpdusrId;
|
||||
|
||||
|
||||
public String getCrtAtchFileId() {
|
||||
return crtAtchFileId;
|
||||
}
|
||||
public void setCrtAtchFileId(String crtAtchFileId) {
|
||||
this.crtAtchFileId = crtAtchFileId;
|
||||
}
|
||||
public String getCrtSeq() {
|
||||
return crtSeq;
|
||||
}
|
||||
public void setCrtSeq(String crtSeq) {
|
||||
this.crtSeq = crtSeq;
|
||||
}
|
||||
public String getCrtSn() {
|
||||
return crtSn;
|
||||
}
|
||||
public void setCrtSn(String crtSn) {
|
||||
this.crtSn = crtSn;
|
||||
}
|
||||
public String getCrtAtchFileTy() {
|
||||
return crtAtchFileTy;
|
||||
}
|
||||
public void setCrtAtchFileTy(String crtAtchFileTy) {
|
||||
this.crtAtchFileTy = crtAtchFileTy;
|
||||
}
|
||||
public String getFrstRegistPnttm() {
|
||||
return frstRegistPnttm;
|
||||
}
|
||||
public void setFrstRegistPnttm(String frstRegistPnttm) {
|
||||
this.frstRegistPnttm = frstRegistPnttm;
|
||||
}
|
||||
public String getFrstRegisterId() {
|
||||
return frstRegisterId;
|
||||
}
|
||||
public void setFrstRegisterId(String frstRegisterId) {
|
||||
this.frstRegisterId = frstRegisterId;
|
||||
}
|
||||
public String getLastUpdtPnttm() {
|
||||
return lastUpdtPnttm;
|
||||
}
|
||||
public void setLastUpdtPnttm(String lastUpdtPnttm) {
|
||||
this.lastUpdtPnttm = lastUpdtPnttm;
|
||||
}
|
||||
public String getLastUpdusrId() {
|
||||
return lastUpdusrId;
|
||||
}
|
||||
public void setLastUpdusrId(String lastUpdusrId) {
|
||||
this.lastUpdusrId = lastUpdusrId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
241
src/main/java/kcc/com/cmm/service/CmmnDetailCode.java
Normal file
241
src/main/java/kcc/com/cmm/service/CmmnDetailCode.java
Normal file
@ -0,0 +1,241 @@
|
||||
package kcc.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 = -6508801327314181679L;
|
||||
|
||||
/*
|
||||
* 코드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
|
||||
*/
|
||||
|
||||
private String clCode = "";
|
||||
private String searchSortCnd = ""; // 정렬 항목
|
||||
private String searchSortOrd = ""; // 정렬 구분(오름/내림)
|
||||
|
||||
private String tempCodeId = "";
|
||||
private String sortNo = "";
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public String getClCode() {
|
||||
return clCode;
|
||||
}
|
||||
|
||||
public void setClCode(String clCode) {
|
||||
this.clCode = clCode;
|
||||
}
|
||||
|
||||
public String getSearchSortCnd() {
|
||||
return searchSortCnd;
|
||||
}
|
||||
|
||||
public void setSearchSortCnd(String searchSortCnd) {
|
||||
this.searchSortCnd = searchSortCnd;
|
||||
}
|
||||
|
||||
public String getSearchSortOrd() {
|
||||
return searchSortOrd;
|
||||
}
|
||||
|
||||
public void setSearchSortOrd(String searchSortOrd) {
|
||||
this.searchSortOrd = searchSortOrd;
|
||||
}
|
||||
|
||||
public String getTempCodeId() {
|
||||
return tempCodeId;
|
||||
}
|
||||
|
||||
public void setTempCodeId(String tempCodeId) {
|
||||
this.tempCodeId = tempCodeId;
|
||||
}
|
||||
|
||||
public String getSortNo() {
|
||||
return sortNo;
|
||||
}
|
||||
|
||||
public void setSortNo(String sortNo) {
|
||||
this.sortNo = sortNo;
|
||||
}
|
||||
|
||||
}
|
||||
77
src/main/java/kcc/com/cmm/service/EgovCmmUseService.java
Normal file
77
src/main/java/kcc/com/cmm/service/EgovCmmUseService.java
Normal file
@ -0,0 +1,77 @@
|
||||
package kcc.com.cmm.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import kcc.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;
|
||||
|
||||
/**
|
||||
* 공통코드를 조회한다.(by String codeId)
|
||||
*
|
||||
* @param String codeId
|
||||
* @return List(코드)
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<CmmnDetailCode> selectCmmCodeDetail(String codeId) 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;
|
||||
|
||||
public void updateSatis(SatisVO satisVO) throws Exception;
|
||||
|
||||
public SatisVO selectSatis() throws Exception;
|
||||
}
|
||||
126
src/main/java/kcc/com/cmm/service/EgovFileMngService.java
Normal file
126
src/main/java/kcc/com/cmm/service/EgovFileMngService.java
Normal file
@ -0,0 +1,126 @@
|
||||
package kcc.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;
|
||||
|
||||
/**
|
||||
* 이미지 파일에 대한 목록을 업데이트하다.
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public void updateFileInfo(List<FileVO> _result) throws Exception;
|
||||
|
||||
public void deleteFmsFileInf(FileVO fileVO) throws Exception;
|
||||
}
|
||||
498
src/main/java/kcc/com/cmm/service/EgovFileMngUtil.java
Normal file
498
src/main/java/kcc/com/cmm/service/EgovFileMngUtil.java
Normal file
@ -0,0 +1,498 @@
|
||||
package kcc.com.cmm.service;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
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.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
import kcc.let.utl.fcc.service.EgovStringUtil;
|
||||
import net.coobird.thumbnailator.Thumbnails;
|
||||
import net.coobird.thumbnailator.name.Rename;
|
||||
//import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovFileMngUtil.java
|
||||
* @Description : 메시지 처리 관련 유틸리티
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.02.13 이삼섭 최초 생성
|
||||
* 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 02. 13
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@Component("EgovFileMngUtil")
|
||||
public class EgovFileMngUtil {
|
||||
|
||||
public static final int BUFF_SIZE = 2048;
|
||||
|
||||
@Resource(name = "propertiesService")
|
||||
protected EgovPropertyService propertyService;
|
||||
|
||||
@Resource(name = "egovFileIdGnrService")
|
||||
private EgovIdGnrService idgenService;
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovFileMngUtil.class);
|
||||
|
||||
/**
|
||||
* 첨부파일에 대한 목록 정보를 취득한다.
|
||||
*
|
||||
* @param files
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public List<FileVO> parseFileInf(Map<String, MultipartFile> files, String KeyStr, int fileKeyParam, String atchFileId, String storePath, String isThumbFile) throws Exception {
|
||||
int fileKey = fileKeyParam;
|
||||
|
||||
String storePathString = "";
|
||||
String atchFileIdString = "";
|
||||
|
||||
if ("".equals(storePath) || storePath == null) {
|
||||
storePathString = propertyService.getString("Globals.fileStorePath");
|
||||
} else {
|
||||
storePathString = propertyService.getString(storePath);
|
||||
}
|
||||
|
||||
if ("".equals(atchFileId) || atchFileId == null) {
|
||||
atchFileIdString = idgenService.getNextStringId();
|
||||
} else {
|
||||
atchFileIdString = atchFileId;
|
||||
}
|
||||
|
||||
File saveFolder = new File(storePathString);
|
||||
|
||||
if (!saveFolder.exists() || saveFolder.isFile()) {
|
||||
saveFolder.mkdirs();
|
||||
}
|
||||
|
||||
|
||||
// Iterator<Entry<String, MultipartFile>> itr = files.entrySet().iterator();
|
||||
|
||||
List<MultipartFile> tmp = new ArrayList<MultipartFile>(files.values());
|
||||
ListIterator<MultipartFile> itr = tmp.listIterator(tmp.size());
|
||||
|
||||
|
||||
MultipartFile file;
|
||||
String filePath = "";
|
||||
List<FileVO> result = new ArrayList<FileVO>();
|
||||
FileVO fvo;
|
||||
|
||||
while (itr.hasPrevious()) {
|
||||
// Entry<String, MultipartFile> entry = itr.next();
|
||||
// file = entry.getValue();
|
||||
|
||||
file = itr.previous();
|
||||
|
||||
|
||||
String orginFileName = file.getOriginalFilename();
|
||||
|
||||
//--------------------------------------
|
||||
// 원 파일명이 없는 경우 처리
|
||||
// (첨부가 되지 않은 input file type)
|
||||
//--------------------------------------
|
||||
if ("".equals(orginFileName)) {
|
||||
continue;
|
||||
}
|
||||
////------------------------------------
|
||||
|
||||
int index = orginFileName.lastIndexOf(".");
|
||||
String fileExt = orginFileName.substring(index + 1);
|
||||
String newName = KeyStr + EgovStringUtil.getTimeStamp() + fileKey;
|
||||
long _size = file.getSize();
|
||||
|
||||
if (!"".equals(orginFileName)) {
|
||||
filePath = storePathString + File.separator + newName;
|
||||
file.transferTo(new File(filePath));
|
||||
}
|
||||
|
||||
String thumbName = "";
|
||||
if(("thumbFile").equals(isThumbFile)) {
|
||||
// file inputstream 으로 섬네일 생성후 저장
|
||||
// BufferedImage originalImage = ImageIO.read(new File("original.png"));
|
||||
BufferedImage originalImage = ImageIO.read(file.getInputStream());
|
||||
// BufferedImage thumbnail = Thumbnails.of(originalImage).scale(0.25).asBufferedImage(); // 해상도
|
||||
BufferedImage thumbnail = Thumbnails.of(originalImage).size(360, 260).asBufferedImage(); // 사이즈
|
||||
|
||||
thumbName = newName + "_THUMB";
|
||||
String thumFilePath = storePathString + File.separator + thumbName;
|
||||
File thumbFile = new File(thumFilePath);
|
||||
ImageIO.write(thumbnail, fileExt, thumbFile);
|
||||
|
||||
// 서버 파일로 섬네일 저장
|
||||
// File destinationDir = new File(filePath);
|
||||
// Thumbnails.of(filePath).size(200, 200).toFiles(saveFolder, Rename.PREFIX_DOT_THUMBNAIL); // 이미지 확장자 파일 필요
|
||||
}
|
||||
|
||||
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));
|
||||
fvo.setThumbFileNm(thumbName);
|
||||
|
||||
// writeFile(file, newName, storePathString);
|
||||
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;
|
||||
String stordFilePathReal = (stordFilePath==null?"":stordFilePath).replaceAll("..","");
|
||||
try {
|
||||
stream = file.getInputStream();
|
||||
File cFile = new File(stordFilePathReal);
|
||||
|
||||
if (!cFile.isDirectory()) {
|
||||
boolean _flag = cFile.mkdir();
|
||||
if (!_flag) {
|
||||
throw new IOException("Directory creation Failed ");
|
||||
}
|
||||
}
|
||||
|
||||
bos = new FileOutputStream(stordFilePathReal + 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);
|
||||
}
|
||||
} catch (FileNotFoundException fnfe) {
|
||||
LOGGER.debug("fnfe: {}", fnfe);
|
||||
} catch (IOException ioe) {
|
||||
LOGGER.debug("ioe: {}", ioe);
|
||||
} catch (Exception e) {
|
||||
LOGGER.debug("e: {}", e);
|
||||
} finally {
|
||||
if (bos != null) {
|
||||
try {
|
||||
bos.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
if (stream != null) {
|
||||
try {
|
||||
stream.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 서버의 파일을 다운로드한다.
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
public static void downFile(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
|
||||
String downFileName = EgovStringUtil.isNullToString(request.getAttribute("downFile")).replaceAll("..","");
|
||||
String orgFileName = EgovStringUtil.isNullToString(request.getAttribute("orgFileName")).replaceAll("..","");
|
||||
|
||||
/*if ((String)request.getAttribute("downFile") == null) {
|
||||
downFileName = "";
|
||||
} else {
|
||||
downFileName = EgovStringUtil.isNullToString(request.getAttribute("downFile"));
|
||||
}*/
|
||||
|
||||
/*if ((String)request.getAttribute("orgFileName") == null) {
|
||||
orgFileName = "";
|
||||
} else {
|
||||
orgFileName = (String)request.getAttribute("orginFile");
|
||||
}*/
|
||||
|
||||
File file = new File(downFileName);
|
||||
|
||||
if (!file.exists()) {
|
||||
throw new FileNotFoundException(downFileName);
|
||||
}
|
||||
|
||||
if (!file.isFile()) {
|
||||
throw new FileNotFoundException(downFileName);
|
||||
}
|
||||
|
||||
byte[] b = new byte[BUFF_SIZE]; //buffer size 2K.
|
||||
String fName = (new String(orgFileName.getBytes(), "UTF-8")).replaceAll("\r\n","");
|
||||
response.setContentType("application/x-msdownload");
|
||||
response.setHeader("Content-Disposition:", "attachment; filename=" + fName);
|
||||
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(b)) != -1) {
|
||||
outs.write(b, 0, read);
|
||||
}
|
||||
} finally {
|
||||
if (outs != null) {
|
||||
try {
|
||||
outs.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
if (fin != null) {
|
||||
try {
|
||||
fin.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 첨부로 등록된 파일을 서버에 업로드한다.
|
||||
*
|
||||
* @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 = EgovStringUtil.getTimeStamp() + "." + fileExt;
|
||||
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;
|
||||
newName = EgovStringUtil.isNullToString(newName).replaceAll("..", "");
|
||||
stordFilePath = EgovStringUtil.isNullToString(stordFilePath).replaceAll("..", "");
|
||||
try {
|
||||
stream = file.getInputStream();
|
||||
File cFile = new File(stordFilePath);
|
||||
|
||||
if (!cFile.isDirectory())
|
||||
cFile.mkdir();
|
||||
|
||||
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);
|
||||
}
|
||||
} catch (FileNotFoundException fnfe) {
|
||||
LOGGER.debug("fnfe: {}",fnfe);
|
||||
} catch (IOException ioe) {
|
||||
LOGGER.debug("ioe: {}", ioe);
|
||||
} catch (Exception e) {
|
||||
LOGGER.debug("e: {}", e);
|
||||
} finally {
|
||||
if (bos != null) {
|
||||
try {
|
||||
bos.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
if (stream != null) {
|
||||
try {
|
||||
stream.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 서버 파일에 대하여 다운로드를 처리한다.
|
||||
*
|
||||
* @param response
|
||||
* @param streFileNm
|
||||
* : 파일저장 경로가 포함된 형태
|
||||
* @param orignFileNm
|
||||
* @throws Exception
|
||||
*/
|
||||
public void downFile(HttpServletResponse response, String streFileNm, String orignFileNm) throws Exception {
|
||||
// String downFileName = EgovStringUtil.isNullToString(request.getAttribute("downFile")).replaceAll("..","");
|
||||
// String orgFileName = EgovStringUtil.isNullToString(request.getAttribute("orgFileName")).replaceAll("..","");
|
||||
String downFileName = EgovStringUtil.isNullToString(streFileNm).replaceAll("..","");
|
||||
String orgFileName = EgovStringUtil.isNullToString(orignFileNm).replaceAll("..","");
|
||||
|
||||
File file = new File(downFileName);
|
||||
//log.debug(this.getClass().getName()+" downFile downFileName "+downFileName);
|
||||
//log.debug(this.getClass().getName()+" downFile orgFileName "+orgFileName);
|
||||
|
||||
if (!file.exists()) {
|
||||
throw new FileNotFoundException(downFileName);
|
||||
}
|
||||
|
||||
if (!file.isFile()) {
|
||||
throw new FileNotFoundException(downFileName);
|
||||
}
|
||||
|
||||
//byte[] b = new byte[BUFF_SIZE]; //buffer size 2K.
|
||||
int fSize = (int)file.length();
|
||||
if (fSize > 0) {
|
||||
BufferedInputStream in = null;
|
||||
|
||||
try {
|
||||
in = new BufferedInputStream(new FileInputStream(file));
|
||||
|
||||
String mimetype = "text/html"; //"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 {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (Exception ignore) {
|
||||
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
response.getOutputStream().flush();
|
||||
response.getOutputStream().close();
|
||||
}
|
||||
|
||||
/*
|
||||
String uploadPath = propertiesService.getString("fileDir");
|
||||
|
||||
File uFile = new File(uploadPath, requestedFile);
|
||||
int fSize = (int) uFile.length();
|
||||
|
||||
if (fSize > 0) {
|
||||
BufferedInputStream in = new BufferedInputStream(new FileInputStream(uFile));
|
||||
|
||||
String mimetype = "text/html";
|
||||
|
||||
response.setBufferSize(fSize);
|
||||
response.setContentType(mimetype);
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\""
|
||||
+ requestedFile + "\"");
|
||||
response.setContentLength(fSize);
|
||||
|
||||
FileCopyUtils.copy(in, response.getOutputStream());
|
||||
in.close();
|
||||
response.getOutputStream().flush();
|
||||
response.getOutputStream().close();
|
||||
} else {
|
||||
response.setContentType("text/html");
|
||||
PrintWriter printwriter = response.getWriter();
|
||||
printwriter.println("<html>");
|
||||
printwriter.println("<br><br><br><h2>Could not get file name:<br>" + requestedFile + "</h2>");
|
||||
printwriter.println("<br><br><br><center><h3><a href='javascript: history.go(-1)'>Back</a></h3></center>");
|
||||
printwriter.println("<br><br><br>© webAccess");
|
||||
printwriter.println("</html>");
|
||||
printwriter.flush();
|
||||
printwriter.close();
|
||||
}
|
||||
//*/
|
||||
|
||||
|
||||
/*
|
||||
response.setContentType("application/x-msdownload");
|
||||
response.setHeader("Content-Disposition:", "attachment; filename=" + new String(orgFileName.getBytes(),"UTF-8" ));
|
||||
response.setHeader("Content-Transfer-Encoding","binary");
|
||||
response.setHeader("Pragma","no-cache");
|
||||
response.setHeader("Expires","0");
|
||||
|
||||
BufferedInputStream fin = new BufferedInputStream(new FileInputStream(file));
|
||||
BufferedOutputStream outs = new BufferedOutputStream(response.getOutputStream());
|
||||
int read = 0;
|
||||
|
||||
while ((read = fin.read(b)) != -1) {
|
||||
outs.write(b,0,read);
|
||||
}
|
||||
log.debug(this.getClass().getName()+" BufferedOutputStream Write Complete!!! ");
|
||||
|
||||
outs.close();
|
||||
fin.close();
|
||||
//*/
|
||||
}
|
||||
}
|
||||
252
src/main/java/kcc/com/cmm/service/EgovProperties.java
Normal file
252
src/main/java/kcc/com/cmm/service/EgovProperties.java
Normal file
@ -0,0 +1,252 @@
|
||||
package kcc.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 org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import kcc.com.cmm.EgovWebUtil;
|
||||
import kcc.com.cmm.util.EgovResourceCloseHelper;
|
||||
//import java.io.FileNotFoundException;
|
||||
//import java.io.IOException;
|
||||
//import java.util.Properties;
|
||||
/**
|
||||
* Class Name : EgovProperties.java
|
||||
* Description : properties값들을 파일로부터 읽어와 Globals클래스의 정적변수로 로드시켜주는 클래스로
|
||||
* 문자열 정보 기준으로 사용할 전역변수를 시스템 재시작으로 반영할 수 있도록 한다.
|
||||
* Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.01.19 박지욱 최초 생성
|
||||
* 2011.07.20 서준식 Globals파일의 상대경로를 읽은 메서드 추가
|
||||
* 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성
|
||||
*
|
||||
* @author 공통 서비스 개발팀 박지욱
|
||||
* @since 2009. 01. 19
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
|
||||
public class EgovProperties{
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovProperties.class);
|
||||
|
||||
//프로퍼티값 로드시 에러발생하면 반환되는 에러문자열
|
||||
public static final String ERR_CODE =" EXCEPTION OCCURRED";
|
||||
public static final String ERR_CODE_FNFE =" EXCEPTION(FNFE) OCCURRED";
|
||||
public static final String ERR_CODE_IOE =" EXCEPTION(IOE) OCCURRED";
|
||||
|
||||
//파일구분자
|
||||
static final char FILE_SEPARATOR = File.separatorChar;
|
||||
|
||||
//프로퍼티 파일의 물리적 위치
|
||||
//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 RELATIVE_PATH_PREFIX = EgovProperties.class.getResource("").getPath().substring(0, EgovProperties.class.getResource("").getPath().lastIndexOf("com")).replaceAll("/classes/kcc/", "/classes/egovframework/");
|
||||
|
||||
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 = ERR_CODE;
|
||||
value="99";
|
||||
debug(GLOBALS_PROPERTIES_FILE + " : " + keyName);
|
||||
FileInputStream fis = null;
|
||||
try{
|
||||
Properties props = new Properties();
|
||||
fis = new FileInputStream(GLOBALS_PROPERTIES_FILE);
|
||||
props.load(new java.io.BufferedInputStream(fis));
|
||||
value = props.getProperty(keyName).trim();
|
||||
value = RELATIVE_PATH_PREFIX + "egovProps" + System.getProperty("file.separator") + value;
|
||||
}catch(FileNotFoundException fne){
|
||||
debug(fne);
|
||||
}catch(IOException ioe){
|
||||
debug(ioe);
|
||||
}catch(Exception e){
|
||||
debug(e);
|
||||
}finally{
|
||||
try {
|
||||
if (fis != null) fis.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
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{
|
||||
java.util.Properties props = new java.util.Properties();
|
||||
fis = new FileInputStream(fileName);
|
||||
props.load(new java.io.BufferedInputStream(fis));
|
||||
fis.close();
|
||||
|
||||
String value = props.getProperty(key);
|
||||
value = RELATIVE_PATH_PREFIX + "egovProps" + System.getProperty("file.separator") + value;
|
||||
return value;
|
||||
}catch(java.io.FileNotFoundException fne){
|
||||
return ERR_CODE_FNFE;
|
||||
}catch(java.io.IOException ioe){
|
||||
return ERR_CODE_IOE;
|
||||
}finally{
|
||||
try {
|
||||
if (fis != null) fis.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* 주어진 파일에서 인자로 주어진 문자열을 Key값으로 하는 프로퍼티 값을 반환한다
|
||||
* @param fileName String
|
||||
* @param key String
|
||||
* @return String
|
||||
|
||||
public static String getProperty(String fileName, String key){
|
||||
FileInputStream fis = null;
|
||||
try{
|
||||
java.util.Properties props = new java.util.Properties();
|
||||
fis = new FileInputStream(fileName);
|
||||
props.load(new java.io.BufferedInputStream(fis));
|
||||
fis.close();
|
||||
|
||||
String value = props.getProperty(key);
|
||||
return value;
|
||||
}catch(java.io.FileNotFoundException fne){
|
||||
return ERR_CODE_FNFE;
|
||||
}catch(java.io.IOException ioe){
|
||||
return ERR_CODE_IOE;
|
||||
}finally{
|
||||
try {
|
||||
if (fis != null) fis.close();
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* 주어진 프로파일의 내용을 파싱하여 (key-value) 형태의 구조체 배열을 반환한다.
|
||||
* @param property String
|
||||
* @return ArrayList
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
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_SEPARATOR).replace('/', FILE_SEPARATOR);
|
||||
FileInputStream fis = null;
|
||||
try
|
||||
{
|
||||
|
||||
File srcFile = new File(src);
|
||||
if (srcFile.exists()) {
|
||||
|
||||
java.util.Properties props = new java.util.Properties();
|
||||
fis = new FileInputStream(src);
|
||||
props.load(new java.io.BufferedInputStream(fis));
|
||||
fis.close();
|
||||
|
||||
int i = 0;
|
||||
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 (Exception ex){
|
||||
debug("EX:"+ex);
|
||||
} finally {
|
||||
try {
|
||||
if (fis != null) fis.close();
|
||||
} catch (Exception ex) {
|
||||
debug("EX:"+ex);//ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return keyList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 시스템 로그를 출력한다.
|
||||
* @param obj Object
|
||||
*/
|
||||
private static void debug(Object obj) {
|
||||
if (obj instanceof java.lang.Exception) {
|
||||
//((Exception)obj).printStackTrace();
|
||||
//System.out.println("DEBUG: " + obj); // 2011.10.10 보안점검 후속조치
|
||||
LOGGER.debug("IGNORED: {}", ((Exception)obj).getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
package kcc.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();
|
||||
|
||||
}
|
||||
292
src/main/java/kcc/com/cmm/service/FileVO.java
Normal file
292
src/main/java/kcc/com/cmm/service/FileVO.java
Normal file
@ -0,0 +1,292 @@
|
||||
package kcc.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 fileSize = "";
|
||||
|
||||
/**
|
||||
* 파일저장경로
|
||||
*/
|
||||
public String fileStreCours = "";
|
||||
/**
|
||||
* 원파일명
|
||||
*/
|
||||
public String orignlFileNm = "";
|
||||
/**
|
||||
* 저장파일명
|
||||
*/
|
||||
public String streFileNm = "";
|
||||
|
||||
/**
|
||||
* 섬네일 이미지 파일명
|
||||
*/
|
||||
public String thumbFileNm = "";
|
||||
|
||||
/**
|
||||
* atchFileId attribute를 리턴한다.
|
||||
*
|
||||
* @return the atchFileId
|
||||
*/
|
||||
|
||||
public String maxFileNum = "";
|
||||
|
||||
public String menuName = ""; //파일 업로드시 매뉴 분할
|
||||
|
||||
public String getMaxFileNum() {
|
||||
return maxFileNum;
|
||||
}
|
||||
|
||||
public void setMaxFileNum(String maxFileNum) {
|
||||
this.maxFileNum = maxFileNum;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the thumbFileNm
|
||||
*/
|
||||
public String getThumbFileNm() {
|
||||
return thumbFileNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param thumbFileNm the thumbFileNm to set
|
||||
*/
|
||||
public void setThumbFileNm(String thumbFileNm) {
|
||||
this.thumbFileNm = thumbFileNm;
|
||||
}
|
||||
|
||||
/**
|
||||
* toString 메소드를 대치한다.
|
||||
*/
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
}
|
||||
|
||||
public String getMenuName() {
|
||||
return menuName;
|
||||
}
|
||||
|
||||
public void setMenuName(String menuName) {
|
||||
this.menuName = menuName;
|
||||
}
|
||||
|
||||
public String getFileSize() {
|
||||
return fileSize;
|
||||
}
|
||||
|
||||
public void setFileSize(String fileSize) {
|
||||
this.fileSize = fileSize;
|
||||
}
|
||||
}
|
||||
30
src/main/java/kcc/com/cmm/service/Globals.java
Normal file
30
src/main/java/kcc/com/cmm/service/Globals.java
Normal file
@ -0,0 +1,30 @@
|
||||
package kcc.com.cmm.service;
|
||||
|
||||
/**
|
||||
* Class Name : Globals.java
|
||||
* Description : 시스템 구동 시 프로퍼티를 통해 사용될 전역변수를 정의한다.
|
||||
* Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.01.19 박지욱 최초 생성
|
||||
*
|
||||
* @author 공통 서비스 개발팀 박지욱
|
||||
* @since 2009. 01. 19
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
|
||||
public class Globals {
|
||||
//파일 업로드 원 파일명
|
||||
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";
|
||||
}
|
||||
10
src/main/java/kcc/com/cmm/service/ReadService.java
Normal file
10
src/main/java/kcc/com/cmm/service/ReadService.java
Normal file
@ -0,0 +1,10 @@
|
||||
package kcc.com.cmm.service;
|
||||
|
||||
import kcc.com.cmm.ReadVO;
|
||||
|
||||
public interface ReadService {
|
||||
|
||||
public ReadVO selectReadYn(ReadVO readVO) throws Exception;
|
||||
|
||||
public void insertReadYn(ReadVO readVO) throws Exception;
|
||||
}
|
||||
27
src/main/java/kcc/com/cmm/service/SatisVO.java
Normal file
27
src/main/java/kcc/com/cmm/service/SatisVO.java
Normal file
@ -0,0 +1,27 @@
|
||||
package kcc.com.cmm.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public class SatisVO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String openYn;
|
||||
private String lastUpdtPnttm;
|
||||
private String lastUpdtId;
|
||||
|
||||
|
||||
}
|
||||
20
src/main/java/kcc/com/cmm/service/SequenceUtilService.java
Normal file
20
src/main/java/kcc/com/cmm/service/SequenceUtilService.java
Normal file
@ -0,0 +1,20 @@
|
||||
package kcc.com.cmm.service;
|
||||
|
||||
/**
|
||||
* SequenceUtil을 위한 서비스
|
||||
* @author yu
|
||||
* @since 2021.10.08
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2021.10.08 yu 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
public interface SequenceUtilService {
|
||||
// 일련번호(시퀀스) 조회
|
||||
public String getSeqNextVal(String seqId) throws Exception;
|
||||
}
|
||||
83
src/main/java/kcc/com/cmm/service/impl/CmmUseDAO.java
Normal file
83
src/main/java/kcc/com/cmm/service/impl/CmmUseDAO.java
Normal file
@ -0,0 +1,83 @@
|
||||
package kcc.com.cmm.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import kcc.com.cmm.ComDefaultCodeVO;
|
||||
import kcc.com.cmm.service.CmmnDetailCode;
|
||||
import kcc.com.cmm.service.SatisVO;
|
||||
|
||||
/**
|
||||
* @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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 조건에 따른 공통코드를 불러온다.
|
||||
*
|
||||
* @param vo
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public CmmnDetailCode selectCmmCodeDetailValue(ComDefaultCodeVO vo) throws Exception {
|
||||
return (CmmnDetailCode) select("CmmUseDAO.selectCmmCodeDetailValue", vo);
|
||||
}
|
||||
|
||||
public SatisVO selectSatis() throws Exception {
|
||||
return (SatisVO) select ("cmmUseDAO.selectSatis");
|
||||
}
|
||||
|
||||
public void updateSatis(SatisVO satisVO) throws Exception {
|
||||
update("cmmUseDAO.updateSatis", satisVO);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,121 @@
|
||||
package kcc.com.cmm.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import kcc.com.cmm.ComDefaultCodeVO;
|
||||
import kcc.com.cmm.service.CmmnDetailCode;
|
||||
import kcc.com.cmm.service.EgovCmmUseService;
|
||||
import kcc.com.cmm.service.SatisVO;
|
||||
|
||||
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
|
||||
*/
|
||||
@Override
|
||||
public List<CmmnDetailCode> selectCmmCodeDetail(ComDefaultCodeVO vo) throws Exception {
|
||||
return cmmUseDAO.selectCmmCodeDetail(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 공통코드를 조회한다.(by String codeId)
|
||||
*
|
||||
* @param String codeId
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<CmmnDetailCode> selectCmmCodeDetail(String codeId) throws Exception {
|
||||
ComDefaultCodeVO comDefaultCodeVO = new ComDefaultCodeVO();
|
||||
comDefaultCodeVO.setCodeId(codeId);
|
||||
return cmmUseDAO.selectCmmCodeDetail(comDefaultCodeVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* ComDefaultCodeVO의 리스트를 받아서 여러개의 코드 리스트를 맵에 담아서 리턴한다.
|
||||
*
|
||||
* @param voList
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("rawtypes")
|
||||
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
|
||||
*/
|
||||
@Override
|
||||
public List<CmmnDetailCode> selectOgrnztIdDetail(ComDefaultCodeVO vo) throws Exception {
|
||||
return cmmUseDAO.selectOgrnztIdDetail(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 그룹정보를 코드형태로 리턴한다.
|
||||
*
|
||||
* @param 조회조건정보 vo
|
||||
* @return 그룹정보 List
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<CmmnDetailCode> selectGroupIdDetail(ComDefaultCodeVO vo) throws Exception {
|
||||
return cmmUseDAO.selectGroupIdDetail(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSatis(SatisVO satisVO) throws Exception {
|
||||
cmmUseDAO.updateSatis(satisVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SatisVO selectSatis() throws Exception {
|
||||
return cmmUseDAO.selectSatis();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package kcc.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 {
|
||||
|
||||
@Override
|
||||
@Resource(name = "egov.sqlMapClient")
|
||||
public void setSuperSqlMapClient(SqlMapClient sqlMapClient) {
|
||||
super.setSuperSqlMapClient(sqlMapClient);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,189 @@
|
||||
package kcc.com.cmm.service.impl;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import kcc.com.cmm.service.EgovFileMngService;
|
||||
import kcc.com.cmm.service.FileVO;
|
||||
|
||||
/**
|
||||
* @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 kcc.com.cmm.service.EgovFileMngService#deleteFileInfs(java.util.List)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void deleteFileInfs(List fvoList) throws Exception {
|
||||
fileMngDAO.deleteFileInfs(fvoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 하나의 파일에 대한 정보(속성 및 상세)를 등록한다.
|
||||
*
|
||||
* @see kcc.com.cmm.service.EgovFileMngService#insertFileInf(kcc.com.cmm.service.FileVO)
|
||||
*/
|
||||
@Override
|
||||
public String insertFileInf(FileVO fvo) throws Exception {
|
||||
String atchFileId = fvo.getAtchFileId();
|
||||
|
||||
fileMngDAO.insertFileInf(fvo);
|
||||
|
||||
return atchFileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 여러 개의 파일에 대한 정보(속성 및 상세)를 등록한다.
|
||||
*
|
||||
* @see kcc.com.cmm.service.EgovFileMngService#insertFileInfs(java.util.List)
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public String insertFileInfs(List fvoList) throws Exception {
|
||||
String atchFileId = "";
|
||||
|
||||
if (fvoList.size() != 0) {
|
||||
atchFileId = fileMngDAO.insertFileInfs(fvoList);
|
||||
}
|
||||
if (atchFileId == "") {
|
||||
atchFileId = null;
|
||||
}
|
||||
return atchFileId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일에 대한 목록을 조회한다.
|
||||
*
|
||||
* @see kcc.com.cmm.service.EgovFileMngService#selectFileInfs(kcc.com.cmm.service.FileVO)
|
||||
*/
|
||||
@Override
|
||||
public List<FileVO> selectFileInfs(FileVO fvo) throws Exception {
|
||||
return fileMngDAO.selectFileInfs(fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 여러 개의 파일에 대한 정보(속성 및 상세)를 수정한다.
|
||||
*
|
||||
* @see kcc.com.cmm.service.EgovFileMngService#updateFileInfs(java.util.List)
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public void updateFileInfs(List fvoList) throws Exception {
|
||||
//Delete & Insert
|
||||
fileMngDAO.updateFileInfs(fvoList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 하나의 파일을 삭제한다.
|
||||
*
|
||||
* @see kcc.com.cmm.service.EgovFileMngService#deleteFileInf(kcc.com.cmm.service.FileVO)
|
||||
*/
|
||||
@Override
|
||||
public void deleteFileInf(FileVO fvo) throws Exception {
|
||||
fileMngDAO.deleteFileInf(fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일에 대한 상세정보를 조회한다.
|
||||
*
|
||||
* @see kcc.com.cmm.service.EgovFileMngService#selectFileInf(kcc.com.cmm.service.FileVO)
|
||||
*/
|
||||
@Override
|
||||
public FileVO selectFileInf(FileVO fvo) throws Exception {
|
||||
return fileMngDAO.selectFileInf(fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일 구분자에 대한 최대값을 구한다.
|
||||
*
|
||||
* @see kcc.com.cmm.service.EgovFileMngService#getMaxFileSN(kcc.com.cmm.service.FileVO)
|
||||
*/
|
||||
@Override
|
||||
public int getMaxFileSN(FileVO fvo) throws Exception {
|
||||
return fileMngDAO.getMaxFileSN(fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 전체 파일을 삭제한다.
|
||||
*
|
||||
* @see kcc.com.cmm.service.EgovFileMngService#deleteAllFileInf(kcc.com.cmm.service.FileVO)
|
||||
*/
|
||||
@Override
|
||||
public void deleteAllFileInf(FileVO fvo) throws Exception {
|
||||
fileMngDAO.deleteAllFileInf(fvo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일명 검색에 대한 목록을 조회한다.
|
||||
*
|
||||
* @see kcc.com.cmm.service.EgovFileMngService#selectFileListByFileNm(kcc.com.cmm.service.FileVO)
|
||||
*/
|
||||
@Override
|
||||
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 kcc.com.cmm.service.EgovFileMngService#selectImageFileList(kcc.com.cmm.service.FileVO)
|
||||
*/
|
||||
@Override
|
||||
public List<FileVO> selectImageFileList(FileVO vo) throws Exception {
|
||||
return fileMngDAO.selectImageFileList(vo);
|
||||
}
|
||||
|
||||
/*단일 파일업데이트*/
|
||||
@Override
|
||||
public void updateFileInfo(List fvoList) throws Exception {
|
||||
//Delete & Update
|
||||
fileMngDAO.updateFileInfo(fvoList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteFmsFileInf(FileVO fileVO) throws Exception {
|
||||
FileVO returnFileVO = new FileVO();
|
||||
returnFileVO = fileMngDAO.selectFileInf(fileVO);
|
||||
if(returnFileVO !=null) {
|
||||
File delFile = new File(returnFileVO.getFileStreCours()+returnFileVO.getStreFileNm());
|
||||
delFile.delete(); //실제파일 deletePerFile 삭제
|
||||
}
|
||||
//lettnfiledetail pk 인 lettnfile 는 삭제 안함
|
||||
fileMngDAO.deleteFileInf(fileVO); //DB삭제
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package kcc.com.cmm.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import kcc.com.cmm.LoginVO;
|
||||
import kcc.com.cmm.service.EgovUserDetailsService;
|
||||
|
||||
/**
|
||||
*
|
||||
* @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;
|
||||
|
||||
}
|
||||
|
||||
@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() {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
package kcc.com.cmm.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import kcc.com.cmm.service.EgovUserDetailsService;
|
||||
|
||||
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 {
|
||||
|
||||
@Override
|
||||
public Object getAuthenticatedUser() {
|
||||
|
||||
return RequestContextHolder.getRequestAttributes().getAttribute("loginVO", RequestAttributes.SCOPE_SESSION);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getAuthorities() {
|
||||
|
||||
// 권한 설정을 리턴한다.
|
||||
List<String> listAuth = new ArrayList<String>();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
192
src/main/java/kcc/com/cmm/service/impl/FileManageDAO.java
Normal file
192
src/main/java/kcc/com/cmm/service/impl/FileManageDAO.java
Normal file
@ -0,0 +1,192 @@
|
||||
package kcc.com.cmm.service.impl;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import kcc.com.cmm.service.FileVO;
|
||||
|
||||
/**
|
||||
* @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);
|
||||
}
|
||||
|
||||
/*단일파일 수정*/
|
||||
public void updateFileInfo(List fvoList) throws Exception{
|
||||
FileVO vo;
|
||||
Iterator<?> iter = fvoList.iterator();
|
||||
while (iter.hasNext()) {
|
||||
vo = (FileVO) iter.next();
|
||||
update("FileManageDAO.updateFileInfo", vo);
|
||||
}
|
||||
}
|
||||
}
|
||||
18
src/main/java/kcc/com/cmm/service/impl/ReadDAO.java
Normal file
18
src/main/java/kcc/com/cmm/service/impl/ReadDAO.java
Normal file
@ -0,0 +1,18 @@
|
||||
package kcc.com.cmm.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
|
||||
import kcc.com.cmm.ReadVO;
|
||||
|
||||
@Repository("readDAO")
|
||||
public class ReadDAO extends EgovAbstractDAO {
|
||||
|
||||
public ReadVO selectReadYn(ReadVO readVO) {
|
||||
return (ReadVO)select("readDAO.selectReadYn", readVO);
|
||||
}
|
||||
|
||||
public void insertReadYn(ReadVO readVO) {
|
||||
insert("readDAO.insertReadYn", readVO);
|
||||
}
|
||||
}
|
||||
26
src/main/java/kcc/com/cmm/service/impl/ReadServiceImpl.java
Normal file
26
src/main/java/kcc/com/cmm/service/impl/ReadServiceImpl.java
Normal file
@ -0,0 +1,26 @@
|
||||
package kcc.com.cmm.service.impl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import kcc.com.cmm.ReadVO;
|
||||
import kcc.com.cmm.service.ReadService;
|
||||
|
||||
@Service("readService")
|
||||
public class ReadServiceImpl implements ReadService {
|
||||
|
||||
@Resource(name = "readDAO")
|
||||
private ReadDAO readDAO;
|
||||
|
||||
@Override
|
||||
public ReadVO selectReadYn(ReadVO readVO) throws Exception {
|
||||
return readDAO.selectReadYn(readVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertReadYn(ReadVO readVO) throws Exception {
|
||||
readDAO.insertReadYn(readVO);
|
||||
}
|
||||
|
||||
}
|
||||
35
src/main/java/kcc/com/cmm/service/impl/SequenceUtilDAO.java
Normal file
35
src/main/java/kcc/com/cmm/service/impl/SequenceUtilDAO.java
Normal file
@ -0,0 +1,35 @@
|
||||
package kcc.com.cmm.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
|
||||
/**
|
||||
* SequenceUtil을 위한 데이터 접근 클래스
|
||||
* @author yu
|
||||
* @since 2021.10.08
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2021.10.08 yu 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@Repository("SequenceUtilDAO")
|
||||
public class SequenceUtilDAO extends EgovAbstractDAO {
|
||||
|
||||
// 시퀀스 정보 조회
|
||||
public EgovMap selectSeqMng(EgovMap paramMap) throws Exception {
|
||||
return (EgovMap) select("SequenceUtilDAO.selectSeqMng", paramMap);
|
||||
}
|
||||
|
||||
// 시퀀스관리 seqNo 저장
|
||||
public void updateSeqMng(EgovMap paramMap) throws Exception {
|
||||
update("SequenceUtilDAO.updateSeqMng", paramMap);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,140 @@
|
||||
package kcc.com.cmm.service.impl;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.commons.collections4.MapUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import egovframework.rte.psl.dataaccess.util.EgovMap;
|
||||
import kcc.com.cmm.exception.BaseException;
|
||||
import kcc.com.cmm.service.SequenceUtilService;
|
||||
import kcc.com.cmm.util.DateUtil;
|
||||
import kcc.com.cmm.util.SequenceUtil;
|
||||
import kcc.com.cmm.util.StringUtil2;
|
||||
|
||||
/**
|
||||
* SequenceUtil을 위한 서비스 구현 클래스
|
||||
* @author yu
|
||||
* @since 2021.10.08
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2021.10.08 yu 최초 생성
|
||||
* </pre>
|
||||
*/
|
||||
@Service("SequenceUtilService")
|
||||
public class SequenceUtilServiceImpl extends EgovAbstractServiceImpl implements SequenceUtilService {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(SequenceUtilServiceImpl.class);
|
||||
|
||||
@Resource(name = "SequenceUtilDAO")
|
||||
private SequenceUtilDAO sequenceUtilDAO;
|
||||
|
||||
// 일련번호(시퀀스) 조회
|
||||
@SuppressWarnings("unchecked")
|
||||
public String getSeqNextVal(String seqId) throws Exception {
|
||||
|
||||
EgovMap paramMap = new EgovMap();
|
||||
paramMap.put("seqId", seqId);
|
||||
paramMap.put("isAdrNo", SequenceUtil.SEQ_ADR_NO);
|
||||
EgovMap seqMngMap = sequenceUtilDAO.selectSeqMng(paramMap);
|
||||
|
||||
if (seqMngMap == null) {
|
||||
throw new BaseException(StringUtil2.msgFormat("시퀀스관리에 [{0}]정보가 존재하지 않습니다.", seqId)) ;
|
||||
}
|
||||
|
||||
int seqNo = MapUtils.getIntValue(seqMngMap, "seqNo");
|
||||
int initSeqNo = MapUtils.getIntValue(seqMngMap, "initSeqNo");
|
||||
if (initSeqNo > 0) {
|
||||
if (seqNo < initSeqNo) {
|
||||
seqNo = initSeqNo;
|
||||
}
|
||||
}
|
||||
int seqSize = MapUtils.getIntValue(seqMngMap, "seqSize");
|
||||
String seqLpad = (String) seqMngMap.get("seqLpad");
|
||||
String seqPrefix = (String) seqMngMap.get("seqPrefix");
|
||||
String seqPrefixDtFmt = (String) seqMngMap.get("seqPrefixDtFmt");
|
||||
String initDailyYn = (String) seqMngMap.get("initDailyYn");
|
||||
|
||||
if("Y".equals(initDailyYn)) {
|
||||
LocalDate today = getLocalDate(seqMngMap.get("todayFmt"), null);
|
||||
LocalDate modDate = getLocalDate(seqMngMap.get("modDateFmt"), null);
|
||||
|
||||
if(SequenceUtil.SEQ_ADR_NO.equals(seqId)) { // 조정번호시 년도 넘어가는지만 체크
|
||||
if(today.getYear() != modDate.getYear()) {
|
||||
seqNo = initSeqNo;
|
||||
}
|
||||
} else {
|
||||
if(today.compareTo(modDate) != 0) {
|
||||
seqNo = initSeqNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
seqNo++;
|
||||
|
||||
if(seqSize > 0) {
|
||||
if(StringUtil2.toString(seqNo).length() > seqSize) {
|
||||
throw new BaseException(StringUtil2.msgFormat("seqNo({0})가 seqSize({1})를 초과하였습니다.", seqNo, seqSize));
|
||||
}
|
||||
}
|
||||
|
||||
seqMngMap.put("seqNo", seqNo);
|
||||
seqMngMap.put("modLgnId", null);
|
||||
sequenceUtilDAO.updateSeqMng(seqMngMap);
|
||||
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
|
||||
if(SequenceUtil.SEQ_ADR_NO.equals(seqId)) { // 조정번호시 날짜프리픽스+문자프리픽스 순으로
|
||||
if(StringUtil2.isNotEmpty(seqPrefixDtFmt)) {
|
||||
buffer.append(seqPrefixDtFmt);
|
||||
}
|
||||
if(StringUtil2.isNotEmpty(seqPrefix)) {
|
||||
buffer.append(seqPrefix);
|
||||
}
|
||||
} else { // 문자프리픽스 + 날짜프리픽스
|
||||
if(StringUtil2.isNotEmpty(seqPrefix)) {
|
||||
buffer.append(seqPrefix);
|
||||
}
|
||||
if(StringUtil2.isNotEmpty(seqPrefixDtFmt)) {
|
||||
buffer.append(seqPrefixDtFmt);
|
||||
}
|
||||
}
|
||||
|
||||
if(seqSize > 0 && StringUtil2.isNotEmpty(seqLpad)) {
|
||||
buffer.append(StringUtil2.lpad(StringUtil2.toString(seqNo), seqSize, seqLpad));
|
||||
} else {
|
||||
buffer.append(seqNo);
|
||||
}
|
||||
|
||||
String nextVal = buffer.toString();
|
||||
LOGGER.debug("[{}] 채번 : {}", seqId, nextVal);
|
||||
return nextVal;
|
||||
}
|
||||
|
||||
public LocalDate getLocalDate(Object obj, String pattern) {
|
||||
Object value = obj;
|
||||
if(value == null) {
|
||||
return null;
|
||||
}
|
||||
if(value instanceof Date) {
|
||||
return DateUtil.toLocalDate((Date)value);
|
||||
} else if(value instanceof Timestamp) {
|
||||
return DateUtil.toLocalDate((Timestamp)value);
|
||||
} else if(value instanceof String) {
|
||||
return DateUtil.parseLocalDate((String)value, pattern);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package kcc.com.cmm.spring.config;
|
||||
|
||||
import org.springframework.beans.factory.config.PropertiesFactoryBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
|
||||
|
||||
@Configuration
|
||||
public class SpringCoreConfig {
|
||||
|
||||
@Bean
|
||||
public PropertiesFactoryBean config() {
|
||||
PropertiesFactoryBean propBean = new PropertiesFactoryBean();
|
||||
ClassPathResource config = new ClassPathResource("/egovframework/egovProps/globals_local.properties");
|
||||
propBean.setLocation(config);
|
||||
return propBean;
|
||||
}
|
||||
|
||||
}
|
||||
75
src/main/java/kcc/com/cmm/spring/data/CoreConstant.java
Normal file
75
src/main/java/kcc/com/cmm/spring/data/CoreConstant.java
Normal file
@ -0,0 +1,75 @@
|
||||
package kcc.com.cmm.spring.data;
|
||||
|
||||
public class CoreConstant {
|
||||
|
||||
|
||||
/* Charset */
|
||||
public static final String CHARSET_UTF8 = "UTF-8";
|
||||
public static final String CHARSET_EUCKR = "EUC-KR";
|
||||
|
||||
|
||||
/* Request key */
|
||||
public static final String REQUEST_PARAM_BOX = "paramBox";
|
||||
public static final String REQUEST_PARAM_ORG_BOX = "paramOrgBox";
|
||||
public static final String REQUEST_MENU_ID = "menuId";
|
||||
public static final String REQUEST_MENU_BOX = "menuBox";
|
||||
public static final String REQUEST_MENU_BOX_JSON = "menuBoxJson";
|
||||
// public static final String REQUEST_QUICK_MENU_LIST_JSON = "quickMenuListJson";
|
||||
public static final String REQUEST_QUICK_MENU_ADD = "quickMenuAdd";
|
||||
|
||||
|
||||
/* ParamBox key */
|
||||
public static final String PARAM_PAGINATE_NAME = "paginate";
|
||||
public static final String PARAM_PAGINATE_PAGE = "pg";
|
||||
public static final String PARAM_PAGINATE_RECORD_SIZE = "paginateRecordSize";
|
||||
public static final String PARAM_PAGINATE_PAGE_SIZE = "paginatePageSize";
|
||||
|
||||
|
||||
/* ParamBox property key */
|
||||
public static final String PARAM_PROP_PARAM_BOX = "PARAM_PROP_PARAM_BOX";
|
||||
public static final String PARAM_PROP_PARAM_FILE_BOX = "PARAM_PROP_PARAM_FILE_BOX";
|
||||
public static final String PARAM_PROP_MODEL_BOX = "PARAM_PROP_MODEL_BOX";
|
||||
public static final String PARAM_PROP_TRANS_LOG_BOX = "PARAM_PROP_TRANS_LOG_BOX";
|
||||
public static final String PARAM_PROP_XML_IN_DATA = "PARAM_PROP_XML_IN_DATA";
|
||||
public static final String PARAM_PROP_XML_IN_CLASS = "PARAM_PROP_XML_IN_CLASS";
|
||||
public static final String PARAM_PROP_XML_OUT_CLASS = "PARAM_PROP_XML_OUT_CLASS";
|
||||
public static final String PARAM_PROP_CONTENT_TYPE_CHARSET = "PARAM_PROP_CONTENT_TYPE_CHARSET";
|
||||
|
||||
|
||||
/* ModelBox key */
|
||||
public static final String MODEL_DOWNLOAD_FILE = "MODEL_DOWNLOAD_FILE";
|
||||
public static final String MODEL_DOWNLOAD_FILE_NAME = "MODEL_DOWNLOAD_FILE_NAME";
|
||||
|
||||
|
||||
/* Layout key */
|
||||
public static final String LAYOUT_BLANK = "blank";
|
||||
public static final String LAYOUT_SINGLE = "single";
|
||||
public static final String LAYOUT_SUPPORT = "support";
|
||||
|
||||
|
||||
/* Spring profile */
|
||||
public static final String PROFILE_LOCAL = "local";
|
||||
public static final String PROFILE_DEV = "dev";
|
||||
public static final String PROFILE_PROD = "prod";
|
||||
|
||||
|
||||
/* Menu role */
|
||||
public static final String MENU_ROLE_R = "R";
|
||||
public static final String MENU_ROLE_W = "W";
|
||||
|
||||
|
||||
/* File */
|
||||
public static final String FILE_DOWNLOAD_TYPE = "downloadType";
|
||||
public static final String FILE_JWT_FILE_NAME = "fileName";
|
||||
public static final String FILE_JWT_FILE_PATH = "filePath";
|
||||
public static final String FILE_JWT_FILE_TYPE = "fileType";
|
||||
public static final String FILE_JWT_SESSION_ID = "sessionId";
|
||||
public static final String FILE_HEADER_TOKEN = "X-File-Token";
|
||||
public static final String FILE_HEADER_URL = "X-File-Url";
|
||||
|
||||
public static final String FILE_JWT_FILE_TYPE_EXCEL = "excel";
|
||||
public static final String FILE_JWT_FILE_TYPE_FILE = "file";
|
||||
|
||||
|
||||
|
||||
}
|
||||
56
src/main/java/kcc/com/cmm/spring/data/util/ConfigUtil.java
Normal file
56
src/main/java/kcc/com/cmm/spring/data/util/ConfigUtil.java
Normal file
@ -0,0 +1,56 @@
|
||||
package kcc.com.cmm.spring.data.util;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ConfigUtil {
|
||||
|
||||
private static Properties config;
|
||||
|
||||
|
||||
@Resource(name="config")
|
||||
private void setConfig(Properties config) {
|
||||
ConfigUtil.config = config;
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T get(String key) {
|
||||
return (T)config.getProperty(key);
|
||||
}
|
||||
|
||||
|
||||
public static String getString(String key) {
|
||||
return config.getProperty(key);
|
||||
}
|
||||
|
||||
|
||||
public static String getString(String key, String defaultValue) {
|
||||
String value = config.getProperty(key);
|
||||
if(value == null) {
|
||||
value = defaultValue;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
public static int getInt(String key) {
|
||||
return NumberUtils.toInt(config.getProperty(key));
|
||||
}
|
||||
|
||||
|
||||
public static int getInt(String key, int defaultValue) {
|
||||
Object value = config.getProperty(key);
|
||||
if(value == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
return NumberUtils.toInt(String.valueOf(value));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
140
src/main/java/kcc/com/cmm/spring/data/util/ExcelUtil.java
Normal file
140
src/main/java/kcc/com/cmm/spring/data/util/ExcelUtil.java
Normal file
@ -0,0 +1,140 @@
|
||||
package kcc.com.cmm.spring.data.util;
|
||||
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.util.HSSFColor;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellStyle;
|
||||
import org.apache.poi.ss.usermodel.Font;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.xssf.streaming.SXSSFSheet;
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class ExcelUtil {
|
||||
private static final Logger log = LoggerFactory.getLogger(ExcelUtil.class);
|
||||
|
||||
/**
|
||||
* 엑셀 파일을 방출합니다.
|
||||
*
|
||||
* @param voList 엑셀에 넣고 싶은 vo 리스트 형태로 넣습니다.
|
||||
* @param header 엑셀 해더
|
||||
* @param order 헤더에 해당하는 내용의 vo 필드 이름을 작성합니다. 예를 들어 String userName; 필드의 1번째 해더이름을 "사용자 이름" 으로 정했으면
|
||||
* 순서를 맞추어 1번째 order 배열에 "UserName" 이라는 글짜를 입력해줍니다(*주의:첫 문자는 대문자, 낙타체). 첫번째 컬럼에는 "줄번호"가
|
||||
* 들어가는데, 이것에 대한 내용은 order에 값을 입력하지 않습니다.
|
||||
* @param width 컬럼 너비를 설정합니다. length가 해더의 length와 일치할 필요는 없습니다.
|
||||
* @param title
|
||||
* @throws Exception
|
||||
* @return SXSSFSheet
|
||||
*
|
||||
* 특징 : 해더보다 내용의 컬럼수가 많을 때 해당 줄의 컬럼은 cut, 해더 이름이 vo와 다르게 되면 해당 컬럼 출력 안됨 require : 날짜 포멧은
|
||||
* 지원하지 않습니다.
|
||||
*
|
||||
*
|
||||
* ***********************************************************************************************
|
||||
* EX String title = "게시판 리스트"; int[] width = {1500, 1500, 1500, 3000, 30000, 3000 };
|
||||
* String[] header = {"번호", "게시판번호", "작성자", "제목", "내용", "작성일" }; String[] order = { "Seq",
|
||||
* "UserId", "Title", "Content", "RegDt" }; => 첫번째 "번호"에 대한 order 이름이 비어있습니다.
|
||||
*
|
||||
* ***********************************************************************************************
|
||||
*/
|
||||
// public static SXSSFWorkbook makeSimpleFruitExcelWorkbook(List<Object> voList, String[] header, String[] order, int[] width, String title) throws Exception {
|
||||
// // 시트 생성
|
||||
// SXSSFWorkbook workbook = new SXSSFWorkbook();
|
||||
// SXSSFSheet sheet = workbook.createSheet(title);
|
||||
//
|
||||
// for (int i = 0; i < width.length; i++) {
|
||||
//// sheet.setColumnWidth(0, width[width.length - (i + 1)]);
|
||||
// sheet.setColumnWidth(i, width[i]);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
// int r = 2;// 줄부터 찍기
|
||||
//
|
||||
// Font font = workbook.createFont();
|
||||
// font.setBoldweight(font.BOLDWEIGHT_BOLD);
|
||||
//
|
||||
// CellStyle styleTh = workbook.createCellStyle(); // 표 Th
|
||||
// styleTh.setBorderBottom(CellStyle.BORDER_THIN); //테두리 두껍게
|
||||
// styleTh.setBorderLeft(CellStyle.BORDER_THIN);
|
||||
// styleTh.setBorderRight(CellStyle.BORDER_THIN);
|
||||
// styleTh.setBorderTop(CellStyle.BORDER_THIN);
|
||||
// styleTh.setAlignment(CellStyle.ALIGN_CENTER); // 정렬
|
||||
// styleTh.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index);
|
||||
// styleTh.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
|
||||
// styleTh.setFont(font);
|
||||
//
|
||||
// CellStyle styleTd = workbook.createCellStyle(); // 표 Td
|
||||
// styleTd.setBorderBottom(CellStyle.BORDER_THIN); //테두리 두껍게
|
||||
// styleTd.setBorderBottom(CellStyle.BORDER_THIN); //테두리 두껍게
|
||||
// styleTd.setBorderLeft(CellStyle.BORDER_THIN);
|
||||
// styleTd.setBorderRight(CellStyle.BORDER_THIN);
|
||||
// styleTd.setBorderTop(CellStyle.BORDER_THIN);
|
||||
// styleTd.setAlignment(CellStyle.ALIGN_CENTER); // 정렬
|
||||
// styleTd.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
|
||||
// styleTd.setWrapText(true); // 자동 줄바꿈
|
||||
//
|
||||
//
|
||||
// // 헤더 행 생
|
||||
// Row headerRow = sheet.createRow(r);
|
||||
// // 해더 값 채움 (우측 방향으로)
|
||||
// Cell headerCell = null;
|
||||
// for (int i = 0; i < header.length; i++) {
|
||||
// headerCell = headerRow.createCell(i);
|
||||
// headerCell.setCellValue(header[i]);
|
||||
// headerCell.setCellStyle(styleTh);
|
||||
// }
|
||||
//
|
||||
// // 내용 행 및 셀 생성
|
||||
// Row bodyRow = null;
|
||||
// Cell bodyCell = null;
|
||||
//
|
||||
//
|
||||
// bodyRow = sheet.createRow(0);
|
||||
// bodyCell = bodyRow.createCell(0);
|
||||
// bodyCell.setCellValue(title);// 읽어온 데이터 표시
|
||||
//
|
||||
//
|
||||
// int c = 0;// 컬럼
|
||||
// for (Object vo : voList) {
|
||||
// bodyRow = sheet.createRow(r + 1);
|
||||
// bodyCell = bodyRow.createCell(0);
|
||||
// //bodyCell.setCellValue(r + 1); // 첫 컬럼은 줄 번호
|
||||
//
|
||||
// PropertyDescriptor pd; // 클래스의 필드 메소드를 찾아줌. 이름을 기존에 vo.setUserId() 란 메소드를 통해서만 호출이 가능 했다면, PropertyDescriptor는 이름만으로 메소드
|
||||
// // 호출이 가능함. 클래스가 변경 되어도 동일한 작동으로 getter&setter 호출이 가능하도록 도와줌
|
||||
// Method[] methods = vo.getClass().getDeclaredMethods(); // 메소드들 호출함
|
||||
// // 배열로 준 이름 과 같으면 해당 열 데이터 쓰기
|
||||
//
|
||||
// for (int i = 0; i < order.length; i++) {
|
||||
// for (Method method : methods) { // vo 내부 메소드 반복
|
||||
//
|
||||
// if (method.getName().equals("get" + (order[i] == null ? "" : order[i]))) { // vo메소드 이름과 order의 이름 비교
|
||||
// // getter 호출 준비
|
||||
// String getMethodName = method.getName().substring(3); // getter의 이름 가져옴
|
||||
// pd = new PropertyDescriptor(getMethodName, vo.getClass());
|
||||
//
|
||||
// // vo의 데이터 세팅
|
||||
// String cellData = (pd.getReadMethod().invoke(vo) != null ? pd.getReadMethod().invoke(vo) : "").toString();
|
||||
////log.debug("CellData {}", cellData);
|
||||
// bodyCell = bodyRow.createCell(c++); // 데이터 순서
|
||||
// bodyCell.setCellValue(cellData);// 읽어온 데이터 표시
|
||||
// bodyCell.setCellStyle(styleTd);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// c = 0;
|
||||
// r++;
|
||||
// }
|
||||
//
|
||||
// return workbook;
|
||||
// }
|
||||
|
||||
}
|
||||
58
src/main/java/kcc/com/cmm/spring/data/util/ProfileUtil.java
Normal file
58
src/main/java/kcc/com/cmm/spring/data/util/ProfileUtil.java
Normal file
@ -0,0 +1,58 @@
|
||||
package kcc.com.cmm.spring.data.util;
|
||||
|
||||
import java.util.Arrays;
|
||||
import javax.annotation.PostConstruct;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.stereotype.Service;
|
||||
import kcc.com.cmm.spring.data.CoreConstant;
|
||||
|
||||
@Service
|
||||
public class ProfileUtil {
|
||||
|
||||
private static Environment environment;
|
||||
|
||||
private static boolean isLocal = false;
|
||||
private static boolean isDev = false;
|
||||
private static boolean isProd = false;
|
||||
|
||||
@Autowired
|
||||
public void setEnvironment(Environment environment) {
|
||||
ProfileUtil.environment = environment;
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
String[] profiles = environment.getActiveProfiles();
|
||||
for (int i = 0, s = profiles.length; i < s; i++) {
|
||||
if (CoreConstant.PROFILE_DEV.equalsIgnoreCase(profiles[i])) {
|
||||
ProfileUtil.isDev = true;
|
||||
} else if (CoreConstant.PROFILE_PROD.equalsIgnoreCase(profiles[i])) {
|
||||
ProfileUtil.isProd = true;
|
||||
} else if (CoreConstant.PROFILE_LOCAL.equalsIgnoreCase(profiles[i])) {
|
||||
ProfileUtil.isLocal = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isProfile(final String profile) {
|
||||
String[] profiles = environment.getActiveProfiles();
|
||||
if (Arrays.stream(profiles).anyMatch(env -> env.equalsIgnoreCase(profile))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isLocal() {
|
||||
return ProfileUtil.isLocal;
|
||||
}
|
||||
|
||||
public static boolean isDev() {
|
||||
return ProfileUtil.isDev;
|
||||
}
|
||||
|
||||
public static boolean isProd() {
|
||||
return ProfileUtil.isProd;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package kcc.com.cmm.spring.interceptor;
|
||||
|
||||
import java.util.Properties;
|
||||
import org.apache.ibatis.cache.CacheKey;
|
||||
import org.apache.ibatis.executor.Executor;
|
||||
import org.apache.ibatis.mapping.BoundSql;
|
||||
import org.apache.ibatis.mapping.MappedStatement;
|
||||
import org.apache.ibatis.plugin.Interceptor;
|
||||
import org.apache.ibatis.plugin.Intercepts;
|
||||
import org.apache.ibatis.plugin.Invocation;
|
||||
import org.apache.ibatis.plugin.Plugin;
|
||||
import org.apache.ibatis.plugin.Signature;
|
||||
import org.apache.ibatis.session.ResultHandler;
|
||||
import org.apache.ibatis.session.RowBounds;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@Intercepts({
|
||||
@Signature(type = Executor.class, method = "update", args = {MappedStatement.class, Object.class}),
|
||||
@Signature(type = Executor.class, method = "query", args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class, CacheKey.class, BoundSql.class}),
|
||||
@Signature(type = Executor.class, method = "query", args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class})
|
||||
})
|
||||
public class MybatisLoggingInterceptor implements Interceptor {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(MybatisLoggingInterceptor.class);
|
||||
|
||||
@Override
|
||||
public Object intercept(Invocation invocation) throws Throwable {
|
||||
Object[] args = invocation.getArgs();
|
||||
MappedStatement mappedStatement = (MappedStatement)args[0];
|
||||
log.debug("\nSQL ID :\n\n\t\t {}\n\n", mappedStatement.getId());
|
||||
|
||||
return invocation.proceed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object plugin(Object target) {
|
||||
return Plugin.wrap(target, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProperties(Properties properties) {
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package kcc.com.cmm.spring.interceptor;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||
|
||||
public class PresentationInterceptor extends HandlerInterceptorAdapter {
|
||||
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(PresentationInterceptor.class);
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
return super.preHandle(request, response, handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
|
||||
log.info("################# postHandle:"+modelAndView.getViewName());
|
||||
log.info("-------------->uri{}",request.getRequestURI());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
92
src/main/java/kcc/com/cmm/spring/view/ExcelDownloadView.java
Normal file
92
src/main/java/kcc/com/cmm/spring/view/ExcelDownloadView.java
Normal file
@ -0,0 +1,92 @@
|
||||
package kcc.com.cmm.spring.view;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||
import org.springframework.web.servlet.view.AbstractView;
|
||||
|
||||
public class ExcelDownloadView extends AbstractView{
|
||||
@Override
|
||||
protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response)
|
||||
throws Exception {
|
||||
|
||||
Locale locale = (Locale) model.get("locale");
|
||||
String workbookName = (String) model.get("workbookName");
|
||||
|
||||
// 겹치는 파일 이름 중복을 피하기 위해 시간을 이용해서 파일 이름에 추가
|
||||
Date date = new Date();
|
||||
SimpleDateFormat dayformat = new SimpleDateFormat("yyyyMMdd", locale);
|
||||
SimpleDateFormat hourformat = new SimpleDateFormat("HHmmss", locale);
|
||||
String day = dayformat.format(date);
|
||||
String hour = hourformat.format(date);
|
||||
String fileName = workbookName + "_" + day + "_" + hour + ".xlsx";
|
||||
|
||||
// 여기서부터는 각 브라우저에 따른 파일이름 인코딩작업
|
||||
String browser = request.getHeader("User-Agent");
|
||||
if (browser.indexOf("MSIE") > -1) {
|
||||
fileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20");
|
||||
} else if (browser.indexOf("Trident") > -1) { // IE11
|
||||
fileName = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20");
|
||||
} else if (browser.indexOf("Firefox") > -1) {
|
||||
fileName = "\"" + new String(fileName.getBytes("UTF-8"), "8859_1") + "\"";
|
||||
} else if (browser.indexOf("Opera") > -1) {
|
||||
fileName = "\"" + new String(fileName.getBytes("UTF-8"), "8859_1") + "\"";
|
||||
} else if (browser.indexOf("Chrome") > -1) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
fileName = sb.toString();
|
||||
} else if (browser.indexOf("Safari") > -1){
|
||||
fileName = "\"" + new String(fileName.getBytes("UTF-8"), "8859_1")+ "\"";
|
||||
} else {
|
||||
fileName = "\"" + new String(fileName.getBytes("UTF-8"), "8859_1")+ "\"";
|
||||
}
|
||||
|
||||
response.setContentType("application/download;charset=utf-8");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\";");
|
||||
response.setHeader("Content-Transfer-Encoding", "binary");
|
||||
|
||||
OutputStream os = null;
|
||||
SXSSFWorkbook workbook = null;
|
||||
|
||||
try {
|
||||
workbook = (SXSSFWorkbook) model.get("workbook");
|
||||
os = response.getOutputStream();
|
||||
|
||||
// 파일생성
|
||||
workbook.write(os);
|
||||
}catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
} finally {
|
||||
if(workbook != null) {
|
||||
try {
|
||||
workbook.close();
|
||||
} catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
}
|
||||
|
||||
if(os != null) {
|
||||
try {
|
||||
os.close();
|
||||
} catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
65
src/main/java/kcc/com/cmm/taglibs/CodeTag.java
Normal file
65
src/main/java/kcc/com/cmm/taglibs/CodeTag.java
Normal file
@ -0,0 +1,65 @@
|
||||
package kcc.com.cmm.taglibs;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.JspWriter;
|
||||
import javax.servlet.jsp.tagext.SimpleTagSupport;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import kcc.com.cmm.ComDefaultCodeVO;
|
||||
import kcc.com.cmm.service.CmmnDetailCode;
|
||||
import kcc.com.cmm.service.impl.CmmUseDAO;
|
||||
import kcc.com.cmm.util.StringUtil;
|
||||
|
||||
@Service
|
||||
public class CodeTag extends SimpleTagSupport {
|
||||
private static final Logger log = LoggerFactory.getLogger(CodeTag.class);
|
||||
|
||||
private static CmmUseDAO cmmUseDAO;
|
||||
|
||||
@Autowired
|
||||
private void setCmmUseDAO(CmmUseDAO cmmUseDAO) {
|
||||
CodeTag.cmmUseDAO = cmmUseDAO;
|
||||
}
|
||||
|
||||
private String codeId = null;
|
||||
|
||||
private String code;
|
||||
|
||||
|
||||
public void setCodeId(String codeId) {
|
||||
this.codeId = codeId;
|
||||
}
|
||||
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void doTag() throws JspException, IOException {
|
||||
JspWriter out = getJspContext().getOut();
|
||||
ComDefaultCodeVO vo = new ComDefaultCodeVO();
|
||||
vo.setCodeId(codeId);
|
||||
vo.setCode(code);
|
||||
|
||||
try {
|
||||
if (!"".equals(codeId)) {
|
||||
CmmnDetailCode cmmnDetailCode= cmmUseDAO.selectCmmCodeDetailValue(vo);
|
||||
out.print(StringUtil.escapeXml(cmmnDetailCode.getCodeNm()));
|
||||
} else {
|
||||
out.print("");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("TagCode Exception Error");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
88
src/main/java/kcc/com/cmm/taglibs/DoubleSubmitTag.java
Normal file
88
src/main/java/kcc/com/cmm/taglibs/DoubleSubmitTag.java
Normal file
@ -0,0 +1,88 @@
|
||||
package kcc.com.cmm.taglibs;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
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;
|
||||
|
||||
import kcc.com.cmm.util.EgovDoubleSubmitHelper;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
}
|
||||
48
src/main/java/kcc/com/cmm/taglibs/FormatTag.java
Normal file
48
src/main/java/kcc/com/cmm/taglibs/FormatTag.java
Normal file
@ -0,0 +1,48 @@
|
||||
package kcc.com.cmm.taglibs;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.JspWriter;
|
||||
import javax.servlet.jsp.tagext.SimpleTagSupport;
|
||||
|
||||
public class FormatTag extends SimpleTagSupport {
|
||||
|
||||
private String value;
|
||||
private String pattern;
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getPattern() {
|
||||
return pattern;
|
||||
}
|
||||
|
||||
public void setPattern(String pattern) {
|
||||
this.pattern = pattern;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doTag() throws JspException, IOException {
|
||||
JspWriter out = getJspContext().getOut();
|
||||
StringBuffer tag = new StringBuffer();
|
||||
for (int i = 0, j = 0; value != null && !value.equals("") && i < pattern.length(); i++) {
|
||||
if (pattern.charAt(i) == '#') {
|
||||
tag.append(value.charAt(j));
|
||||
j++;
|
||||
} else if (pattern.charAt(i) == '*') {
|
||||
tag.append(pattern.charAt(i));
|
||||
j++;
|
||||
} else {
|
||||
tag.append(pattern.charAt(i));
|
||||
}
|
||||
}
|
||||
|
||||
out.print(tag.toString());
|
||||
}
|
||||
|
||||
}
|
||||
32
src/main/java/kcc/com/cmm/taglibs/ProfileConditionTag.java
Normal file
32
src/main/java/kcc/com/cmm/taglibs/ProfileConditionTag.java
Normal file
@ -0,0 +1,32 @@
|
||||
package kcc.com.cmm.taglibs;
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.web.servlet.tags.RequestContextAwareTag;
|
||||
|
||||
public class ProfileConditionTag extends RequestContextAwareTag {
|
||||
|
||||
private String profile;
|
||||
|
||||
@Override
|
||||
protected int doStartTagInternal() throws Exception {
|
||||
final Environment environment = this.getRequestContext().getWebApplicationContext().getEnvironment();
|
||||
if (environment != null) {
|
||||
final String[] profiles = environment.getActiveProfiles();
|
||||
|
||||
for(String prof : profile.split(",")) {
|
||||
if (ArrayUtils.contains(profiles, prof)) {
|
||||
return EVAL_BODY_INCLUDE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return SKIP_BODY;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return profile;
|
||||
}
|
||||
|
||||
public void setValue(String profile) {
|
||||
this.profile = profile;
|
||||
}
|
||||
}
|
||||
212
src/main/java/kcc/com/cmm/taglibs/RadioTag.java
Normal file
212
src/main/java/kcc/com/cmm/taglibs/RadioTag.java
Normal file
@ -0,0 +1,212 @@
|
||||
package kcc.com.cmm.taglibs;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.JspWriter;
|
||||
import javax.servlet.jsp.tagext.SimpleTagSupport;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import kcc.com.cmm.ComDefaultCodeVO;
|
||||
import kcc.com.cmm.service.CmmnDetailCode;
|
||||
import kcc.com.cmm.service.impl.CmmUseDAO;
|
||||
import kcc.com.cmm.util.StringUtil;
|
||||
|
||||
@Service
|
||||
public class RadioTag extends SimpleTagSupport {
|
||||
private static final Logger log = LoggerFactory.getLogger(RadioTag.class);
|
||||
|
||||
private static CmmUseDAO cmmUseDAO;
|
||||
|
||||
@Autowired
|
||||
private void setCmmUseDAO(CmmUseDAO cmmUseDAO) {
|
||||
RadioTag.cmmUseDAO = cmmUseDAO;
|
||||
}
|
||||
|
||||
private String codeId = null;
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
private String script;
|
||||
|
||||
private String css = null;
|
||||
|
||||
private String styleClass = "";
|
||||
|
||||
private Set<String> includeSet = null;
|
||||
|
||||
private String selectedValue = null;
|
||||
|
||||
private String defaultValue = null;
|
||||
|
||||
private String defaultText = null;
|
||||
|
||||
private String onChange = "";
|
||||
|
||||
private String disabled = "";
|
||||
|
||||
private String spanYn = "";
|
||||
|
||||
public void setSelectedValue(String selectedValue) {
|
||||
this.selectedValue = selectedValue;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setScript(String script) {
|
||||
this.script = script;
|
||||
}
|
||||
|
||||
public void setCss(String css) {
|
||||
this.css = css;
|
||||
}
|
||||
|
||||
public void setIncludeSet(Set<String> includeSet) {
|
||||
this.includeSet = includeSet;
|
||||
}
|
||||
|
||||
public void setDefaultValue(String defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public void setDefaultText(String defaultText) {
|
||||
this.defaultText = defaultText;
|
||||
}
|
||||
|
||||
public void setCodeId(String codeId) {
|
||||
this.codeId = codeId;
|
||||
}
|
||||
|
||||
public void setOnChange(String onChange) {
|
||||
this.onChange = onChange;
|
||||
}
|
||||
|
||||
public void setStyleClass(String styleClass) {
|
||||
this.styleClass = styleClass;
|
||||
}
|
||||
|
||||
public void setDisabled(String disabled) {
|
||||
this.disabled = disabled;
|
||||
}
|
||||
|
||||
public void setSpanYn(String spanYn) {
|
||||
this.spanYn = spanYn;
|
||||
}
|
||||
|
||||
public void setIncludes(String includes) {
|
||||
if (!StringUtil.isEmpty(StringUtil.trim(includes))) {
|
||||
StringTokenizer includeTokens = new StringTokenizer(includes, ",");
|
||||
String includeToken;
|
||||
|
||||
includeSet = new HashSet<String>();
|
||||
while (includeTokens.hasMoreTokens()) {
|
||||
includeToken = includeTokens.nextToken();
|
||||
if (!StringUtil.isEmpty(StringUtil.trim(includeToken))) {
|
||||
includeSet.add(includeToken);
|
||||
}
|
||||
}
|
||||
if (includeSet.isEmpty()) {
|
||||
includeSet = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doTag() throws JspException, IOException {
|
||||
|
||||
String spanStart = "";
|
||||
String spanEnd = "";
|
||||
|
||||
if ("Y".equals(spanYn)) {
|
||||
spanStart = "<span>";
|
||||
spanEnd = "</span>";
|
||||
}
|
||||
|
||||
JspWriter out = getJspContext().getOut();
|
||||
|
||||
StringBuffer tag = new StringBuffer("");
|
||||
int i=0;
|
||||
|
||||
id = id+i++;
|
||||
if (defaultText != null) {
|
||||
tag.append("\n\t\t"+spanStart +"<input type=\"radio\" id=\"" + id + "\" name=\"" + name + "\" value=\"" + defaultValue + "\" checked=\"checked\"");
|
||||
if (css != null) {
|
||||
tag.append(" " + css + " ");
|
||||
}
|
||||
if (script != null) {
|
||||
tag.append(" " + script + " ");
|
||||
}
|
||||
|
||||
if (!onChange.equals("")) {
|
||||
tag.append(" onChange=\"" + onChange + "\"");
|
||||
}
|
||||
|
||||
if (!disabled.equals("")) {
|
||||
tag.append(" disabled=\"" + "disabled" + "\"");
|
||||
}
|
||||
|
||||
tag.append("> <label class=\""+styleClass+"\" for=\""+ id +"\">"+defaultText+"</label>"+spanEnd);
|
||||
|
||||
}
|
||||
|
||||
ComDefaultCodeVO vo = new ComDefaultCodeVO();
|
||||
vo.setCodeId(codeId);
|
||||
|
||||
List<CmmnDetailCode> codeList;
|
||||
try {
|
||||
|
||||
codeList = cmmUseDAO.selectCmmCodeDetail(vo);
|
||||
if (codeList != null) {
|
||||
for (CmmnDetailCode code : codeList) {
|
||||
if (includeSet == null || includeSet.contains(code.getCode())) {
|
||||
id = id+i++;
|
||||
tag.append("\n\t\t"+spanStart +"<input type=\"radio\" id=\"" + id + "\" name=\"" + name + "\" value=\"" + StringUtil.escapeXml(code.getCode()) + "\"");
|
||||
if (css != null) {
|
||||
tag.append(" " + css + " ");
|
||||
}
|
||||
if (script != null) {
|
||||
tag.append(" " + script + " ");
|
||||
}
|
||||
|
||||
if (!onChange.equals("")) {
|
||||
tag.append(" onChange=\"" + onChange + "\"");
|
||||
}
|
||||
|
||||
if (code.getCode().equals(selectedValue)) {
|
||||
tag.append(" checked=\"checked\" ");
|
||||
}
|
||||
|
||||
if (!disabled.equals("")) {
|
||||
tag.append(" disabled=\"" + "disabled" + "\"");
|
||||
}
|
||||
|
||||
tag.append("> <label class=\""+styleClass+"\" for=\""+ id +"\">"+StringUtil.escapeXml(code.getCodeNm())+"</label>"+spanEnd);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
|
||||
out.print(tag.toString());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
267
src/main/java/kcc/com/cmm/taglibs/SelectTag.java
Normal file
267
src/main/java/kcc/com/cmm/taglibs/SelectTag.java
Normal file
@ -0,0 +1,267 @@
|
||||
package kcc.com.cmm.taglibs;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import javax.servlet.jsp.JspException;
|
||||
import javax.servlet.jsp.JspWriter;
|
||||
import javax.servlet.jsp.tagext.SimpleTagSupport;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import kcc.com.cmm.ComDefaultCodeVO;
|
||||
import kcc.com.cmm.service.CmmnDetailCode;
|
||||
import kcc.com.cmm.service.impl.CmmUseDAO;
|
||||
import kcc.com.cmm.util.StringUtil;
|
||||
|
||||
@Service
|
||||
public class SelectTag extends SimpleTagSupport {
|
||||
private static final Logger log = LoggerFactory.getLogger(SelectTag.class);
|
||||
|
||||
|
||||
private static CmmUseDAO cmmUseDAO;
|
||||
|
||||
@Autowired
|
||||
private void setCmmUseDAO(CmmUseDAO cmmUseDAO) {
|
||||
SelectTag.cmmUseDAO = cmmUseDAO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private String codeId = null;
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String script;
|
||||
|
||||
private String css;
|
||||
|
||||
private String styleClass = "";
|
||||
|
||||
private Set<String> includeSet = null;
|
||||
|
||||
private Set<String> skipCdSet = null;
|
||||
|
||||
private List<String> betweenCdList = null;
|
||||
|
||||
private String selectedValue = null;
|
||||
|
||||
private String defaultValue = null;
|
||||
|
||||
private String defaultText = null;
|
||||
|
||||
private String onChange = "";
|
||||
|
||||
public void setSelectedValue(String selectedValue) {
|
||||
this.selectedValue = selectedValue;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setScript(String script) {
|
||||
this.script = script;
|
||||
}
|
||||
|
||||
public void setCss(String css) {
|
||||
this.css = css;
|
||||
}
|
||||
|
||||
public void setIncludeSet(Set<String> includeSet) {
|
||||
this.includeSet = includeSet;
|
||||
}
|
||||
|
||||
public void setDefaultValue(String defaultValue) {
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public void setDefaultText(String defaultText) {
|
||||
this.defaultText = defaultText;
|
||||
}
|
||||
|
||||
public void setCodeId(String codeId) {
|
||||
this.codeId = codeId;
|
||||
}
|
||||
|
||||
public void setSkipCdSet(Set<String> skipCdSet) {
|
||||
this.skipCdSet = skipCdSet;
|
||||
}
|
||||
|
||||
public void setBetweenCdList(List<String> betweenCdList) {
|
||||
this.betweenCdList = betweenCdList;
|
||||
}
|
||||
|
||||
public void setIncludes(String includes) {
|
||||
if (!StringUtil.isEmpty(StringUtil.trim(includes))) {
|
||||
StringTokenizer includeTokens = new StringTokenizer(includes, ",");
|
||||
String includeToken;
|
||||
|
||||
includeSet = new HashSet<String>();
|
||||
while (includeTokens.hasMoreTokens()) {
|
||||
includeToken = includeTokens.nextToken();
|
||||
if (!StringUtil.isEmpty(StringUtil.trim(includeToken))) {
|
||||
includeSet.add(includeToken);
|
||||
}
|
||||
}
|
||||
if (includeSet.isEmpty()) {
|
||||
includeSet = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setSkipCd(String skipCd) {
|
||||
if (!StringUtil.isEmpty(StringUtil.trim(skipCd))) {
|
||||
StringTokenizer skipTokens = new StringTokenizer(skipCd, ",");
|
||||
String skipCdToken;
|
||||
|
||||
skipCdSet = new HashSet<String>();
|
||||
while (skipTokens.hasMoreTokens()) {
|
||||
skipCdToken = skipTokens.nextToken();
|
||||
if (!StringUtil.isEmpty(StringUtil.trim(skipCdToken))) {
|
||||
skipCdSet.add(skipCdToken);
|
||||
}
|
||||
}
|
||||
if (skipCdSet.isEmpty()) {
|
||||
skipCdSet = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setBetween(String between) {
|
||||
StringTokenizer betweenTokens = new StringTokenizer(between, ",");
|
||||
String betweenToken;
|
||||
betweenCdList = new ArrayList<>();
|
||||
while (betweenTokens.hasMoreTokens()) {
|
||||
betweenToken = betweenTokens.nextToken();
|
||||
if (!StringUtil.isEmpty(StringUtil.trim(betweenToken))) {
|
||||
betweenCdList.add(betweenToken);
|
||||
}
|
||||
}
|
||||
if (CollectionUtils.isEmpty(betweenCdList)) {
|
||||
betweenCdList = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void setStyleClass(String styleClass) {
|
||||
this.styleClass = styleClass;
|
||||
}
|
||||
|
||||
public void setOnChange(String onChange) {
|
||||
this.onChange = onChange;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doTag() throws JspException, IOException {
|
||||
JspWriter out = getJspContext().getOut();
|
||||
|
||||
StringBuffer tag = new StringBuffer("\n\t<select name=\"" + name + "\" ");
|
||||
|
||||
if (id != null) {
|
||||
tag.append("id=\"" + id + "\" ");
|
||||
}
|
||||
|
||||
if (css != null) {
|
||||
tag.append(" " + css + " ");
|
||||
}
|
||||
|
||||
if (styleClass != null) {
|
||||
tag.append(" class=\"" + styleClass + "\" ");
|
||||
}
|
||||
|
||||
if (script != null) {
|
||||
tag.append(" " + script + " ");
|
||||
}
|
||||
|
||||
if (!onChange.equals("")) {
|
||||
tag.append(" onChange=\"" + onChange + "\"");
|
||||
}
|
||||
|
||||
tag.append(">");
|
||||
|
||||
if (defaultText != null) {
|
||||
tag.append("\n\t\t<option value=\"" + defaultValue + "\">" + defaultText + "</option>");
|
||||
}
|
||||
|
||||
ComDefaultCodeVO vo = new ComDefaultCodeVO();
|
||||
vo.setCodeId(codeId);
|
||||
|
||||
List<CmmnDetailCode> codeList;
|
||||
try {
|
||||
|
||||
codeList = cmmUseDAO.selectCmmCodeDetail(vo);
|
||||
if (codeList != null) {
|
||||
for (CmmnDetailCode code : codeList) {
|
||||
String cd = code.getCode();
|
||||
// System.out.println("cd : "+ cd);
|
||||
boolean flag = true;
|
||||
// 포함하는코드가 존재한다면..
|
||||
if(CollectionUtils.isNotEmpty(includeSet)){
|
||||
if(!includeSet.contains(cd)){
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 제외하는 코드가 존재한다면..
|
||||
if(CollectionUtils.isNotEmpty(skipCdSet) && skipCdSet.contains(cd)){
|
||||
continue;
|
||||
}
|
||||
// 범위지정을 했다면..
|
||||
if(CollectionUtils.isNotEmpty(betweenCdList) && this.getBetweenFlag(betweenCdList, cd)){
|
||||
continue;
|
||||
}
|
||||
|
||||
if(flag){
|
||||
String trimmedSelectedValue = (selectedValue != null) ? selectedValue.trim() : null;
|
||||
// if (code.getCode().equals(selectedValue.trim()) {
|
||||
if (code.getCode().equals(trimmedSelectedValue)) {
|
||||
tag.append("\n\t\t<option value=\"" + StringUtil.escapeXml(code.getCode()) + "\" selected=\"selected\" >" + StringUtil.escapeXml(code.getCodeNm()) + "</option>");
|
||||
} else {
|
||||
tag.append("\n\t\t<option value=\"" + StringUtil.escapeXml(code.getCode()) + "\">" + StringUtil.escapeXml(code.getCodeNm()) + "</option>");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tag.append("\n\t </select>");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
|
||||
// System.out.println("tag.toString() :: \n" + tag.toString());
|
||||
out.print(tag.toString());
|
||||
|
||||
}
|
||||
|
||||
public boolean getBetweenFlag(List<String> between, String code){
|
||||
boolean flag = false;
|
||||
if(CollectionUtils.isNotEmpty(between) && between.size() == 2){
|
||||
try{
|
||||
int startNum = Integer.parseInt(between.get(0));
|
||||
int endNum = Integer.parseInt(between.get(1));
|
||||
int codeNum = Integer.parseInt(code);
|
||||
if(codeNum >= startNum && codeNum <= endNum){
|
||||
flag = true;
|
||||
}
|
||||
}catch (NumberFormatException e){
|
||||
flag = false;
|
||||
System.out.println("NumberFormatException Occured!!!");
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
}
|
||||
375
src/main/java/kcc/com/cmm/util/Criteria.java
Normal file
375
src/main/java/kcc/com/cmm/util/Criteria.java
Normal file
@ -0,0 +1,375 @@
|
||||
package kcc.com.cmm.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
|
||||
/**
|
||||
* 프로그램 파일명 : Criteria.java
|
||||
*
|
||||
* 프로그램 설명 : 검색용 객체
|
||||
*
|
||||
* 작 성 자 : jeong hoon hee
|
||||
*
|
||||
* 작 성 일 : 2013. 12. 02.
|
||||
*
|
||||
* Copyright(c) 2013 DAEYOON Co. Ltd. All rights reserved.
|
||||
*/
|
||||
public class Criteria implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 검색용 맵 객체
|
||||
*/
|
||||
private Map<String, Object> condition = new HashMap<String, Object>();
|
||||
|
||||
/**
|
||||
* getParams() 메소드에서 append 할지여부의 condition맵
|
||||
*/
|
||||
private Map<String, Boolean> paramViewMap = new HashMap<String, Boolean>();
|
||||
|
||||
/**
|
||||
* 정렬용 리스트 객체
|
||||
*/
|
||||
private List<Order> orderList = new ArrayList<Order>();
|
||||
|
||||
/** 검색조건 */
|
||||
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;
|
||||
|
||||
/** 검색KeywordFrom */
|
||||
private String searchKeywordFrom = "";
|
||||
|
||||
/** 검색KeywordTo */
|
||||
private String searchKeywordTo = "";
|
||||
|
||||
/** 메뉴번호 */
|
||||
private Integer menuNo;
|
||||
|
||||
/**
|
||||
* 기본생성자
|
||||
*/
|
||||
public Criteria() {
|
||||
}
|
||||
|
||||
/**
|
||||
* request객체에서 넘어오는 검색파라미터를 셋팅한다. (* condition 맵처리)
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Criteria(HttpServletRequest request) {
|
||||
|
||||
Set<String> set = request.getParameterMap().keySet();
|
||||
Iterator<String> iter = set.iterator();
|
||||
while (iter.hasNext()) {
|
||||
String key = iter.next();
|
||||
if (key.equals("pageUnit")) {
|
||||
try {
|
||||
pageUnit = Integer.parseInt(request.getParameter(key));
|
||||
|
||||
this.condition.put("pageUnit", pageUnit);
|
||||
this.paramViewMap.put("pageUnit", true);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
} else if (key.equals("pageSize")) {
|
||||
try {
|
||||
pageSize = Integer.parseInt(request.getParameter(key));
|
||||
|
||||
this.condition.put("pageSize", pageSize);
|
||||
this.paramViewMap.put("pageSize", true);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
} else if (key.equals("pageIndex")) {
|
||||
try {
|
||||
pageIndex = Integer.parseInt(request.getParameter(key));
|
||||
|
||||
this.condition.put("pageIndex", pageIndex);
|
||||
this.paramViewMap.put("pageIndex", true);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
} else if (key.equals("searchCondition")) {
|
||||
try {
|
||||
searchCondition = request.getParameter(key);
|
||||
|
||||
this.condition.put("searchCondition", searchCondition);
|
||||
this.paramViewMap.put("searchCondition", true);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
} else if (key.equals("searchKeyword")) {
|
||||
try {
|
||||
searchKeyword = request.getParameter(key);
|
||||
|
||||
this.condition.put("searchKeyword", searchKeyword);
|
||||
this.paramViewMap.put("searchKeyword", true);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
} else if (key.equals("menuNo")) {
|
||||
try {
|
||||
menuNo = Integer.parseInt(request.getParameter(key));
|
||||
|
||||
this.condition.put("menuNo", menuNo);
|
||||
this.paramViewMap.put("menuNo", true);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
} else if (key.startsWith("condition.")) {
|
||||
String conditionKey = StringUtils.substringAfter(key, "condition.");
|
||||
String conditionValue = request.getParameter(key);
|
||||
if (StringUtils.isNotEmpty(conditionValue)) {
|
||||
this.condition.put(conditionKey, conditionValue);
|
||||
this.paramViewMap.put(conditionKey, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Object> getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public void setCondition(Map<String, Object> condition) {
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
public Object remove(Object key) {
|
||||
return this.condition.remove(key);
|
||||
}
|
||||
|
||||
public Object get(String key) {
|
||||
return this.condition.get(key);
|
||||
}
|
||||
|
||||
public Object put(String key, Object value) {
|
||||
this.paramViewMap.put(key, true);
|
||||
return this.condition.put(key, value);
|
||||
}
|
||||
|
||||
public Object put(String key, Object value, boolean append) {
|
||||
this.paramViewMap.put(key, append);
|
||||
return this.condition.put(key, value);
|
||||
}
|
||||
|
||||
public List<Order> getOrderList() {
|
||||
return orderList;
|
||||
}
|
||||
|
||||
public void setOrderList(List<Order> orderList) {
|
||||
this.orderList = orderList;
|
||||
}
|
||||
|
||||
public void addOrder(Order order) {
|
||||
this.orderList.add(order);
|
||||
}
|
||||
|
||||
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 Integer getMenuNo() {
|
||||
return menuNo;
|
||||
}
|
||||
|
||||
public void setMenuNo(Integer menuNo) {
|
||||
this.menuNo = menuNo;
|
||||
}
|
||||
|
||||
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;
|
||||
condition.put("pageIndex", pageIndex);
|
||||
}
|
||||
|
||||
public int getPageUnit() {
|
||||
return pageUnit;
|
||||
}
|
||||
|
||||
public void setPageUnit(int pageUnit) {
|
||||
this.pageUnit = pageUnit;
|
||||
condition.put("pageUnit", pageUnit);
|
||||
}
|
||||
|
||||
public int getPageSize() {
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(int pageSize) {
|
||||
this.pageSize = pageSize;
|
||||
condition.put("pageSize", pageSize);
|
||||
}
|
||||
|
||||
public int getFirstIndex() {
|
||||
return firstIndex;
|
||||
}
|
||||
|
||||
public void setFirstIndex(int firstIndex) {
|
||||
this.firstIndex = firstIndex;
|
||||
condition.put("firstIndex", firstIndex);
|
||||
}
|
||||
|
||||
public int getLastIndex() {
|
||||
return lastIndex;
|
||||
}
|
||||
|
||||
public void setLastIndex(int lastIndex) {
|
||||
this.lastIndex = lastIndex;
|
||||
condition.put("lastIndex", lastIndex);
|
||||
}
|
||||
|
||||
public int getRecordCountPerPage() {
|
||||
return recordCountPerPage;
|
||||
}
|
||||
|
||||
public void setRecordCountPerPage(int recordCountPerPage) {
|
||||
this.recordCountPerPage = recordCountPerPage;
|
||||
condition.put("recordCountPerPage", recordCountPerPage);
|
||||
}
|
||||
|
||||
public String getSearchKeywordFrom() {
|
||||
return searchKeywordFrom;
|
||||
}
|
||||
|
||||
public void setSearchKeywordFrom(String searchKeywordFrom) {
|
||||
this.searchKeywordFrom = searchKeywordFrom;
|
||||
}
|
||||
|
||||
public String getSearchKeywordTo() {
|
||||
return searchKeywordTo;
|
||||
}
|
||||
|
||||
public void setSearchKeywordTo(String searchKeywordTo) {
|
||||
this.searchKeywordTo = searchKeywordTo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 검색파라미터 문자열을 리턴한다.
|
||||
* @return
|
||||
*/
|
||||
public String getParams() {
|
||||
return getParams(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 검색파라미터 문자열을 리턴한다.
|
||||
* @param appendPageIndex-pageindex를 붙힐지말지여부
|
||||
* @return
|
||||
*/
|
||||
public String getParams(boolean appendPageIndex) {
|
||||
StringBuffer parameterString = new StringBuffer();
|
||||
if (appendPageIndex) {
|
||||
parameterString.append("pageIndex=");
|
||||
parameterString.append(this.pageIndex);
|
||||
parameterString.append("&");
|
||||
}
|
||||
parameterString.append("pageUnit=");
|
||||
parameterString.append(this.pageUnit);
|
||||
parameterString.append("&pageSize=");
|
||||
parameterString.append(this.pageSize);
|
||||
parameterString.append("&searchCondition=");
|
||||
parameterString.append(StringUtils.defaultString(this.searchCondition));
|
||||
parameterString.append("&searchKeyword=");
|
||||
try {
|
||||
parameterString.append(URLEncoder.encode(StringUtils.defaultString(this.searchKeyword), "UTF-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
parameterString.append("&menuNo=");
|
||||
parameterString.append((this.menuNo != null) ? this.menuNo : "");
|
||||
if (this.condition.size() > 0) {
|
||||
Set<String> set = this.condition.keySet();
|
||||
Iterator<String> iter = set.iterator();
|
||||
while (iter.hasNext()) {
|
||||
String key = iter.next();
|
||||
Object value = this.condition.get(key);
|
||||
Boolean append = this.paramViewMap.get(key)!=null?this.paramViewMap.get(key):true;
|
||||
if (append) {
|
||||
parameterString.append("&condition.");
|
||||
parameterString.append(key);
|
||||
parameterString.append("=");
|
||||
if (value instanceof String) {
|
||||
if (StringUtils.isNotEmpty((String) value)) {
|
||||
try {
|
||||
parameterString.append(URLEncoder.encode((String) value, "UTF-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
parameterString.append(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return parameterString.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
}
|
||||
|
||||
}
|
||||
239
src/main/java/kcc/com/cmm/util/DateUtil.java
Normal file
239
src/main/java/kcc/com/cmm/util/DateUtil.java
Normal file
@ -0,0 +1,239 @@
|
||||
package kcc.com.cmm.util;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
|
||||
public final class DateUtil {
|
||||
|
||||
public static final String BASE_PATTERN = "yyyyMMddHHmmssSSS";
|
||||
public static final int BASE_PATTERN_LEN = BASE_PATTERN.length();
|
||||
private static final String[] PATTERN_CACHE = new String[BASE_PATTERN_LEN + 1];
|
||||
static {
|
||||
PATTERN_CACHE[BASE_PATTERN_LEN] = BASE_PATTERN;
|
||||
PATTERN_CACHE[14] = BASE_PATTERN.substring(0, 14);
|
||||
PATTERN_CACHE[12] = BASE_PATTERN.substring(0, 12);
|
||||
PATTERN_CACHE[10] = BASE_PATTERN.substring(0, 10);
|
||||
PATTERN_CACHE[8] = BASE_PATTERN.substring(0, 8);
|
||||
PATTERN_CACHE[6] = BASE_PATTERN.substring(0, 6);
|
||||
PATTERN_CACHE[4] = BASE_PATTERN.substring(0, 4);
|
||||
PATTERN_CACHE[0] = "";
|
||||
}
|
||||
public static final String DATE_PATTERN = PATTERN_CACHE[8];
|
||||
public static final String DATETIME_PATTERN = PATTERN_CACHE[14];
|
||||
|
||||
|
||||
public static LocalDateTime now() {
|
||||
return LocalDateTime.now();
|
||||
}
|
||||
|
||||
|
||||
public static Date toDate(LocalDate ld) {
|
||||
Date date = null;
|
||||
if(ld != null) {
|
||||
Instant instant = ld.atStartOfDay(ZoneId.systemDefault()).toInstant();
|
||||
date = Date.from(instant);
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
public static Date toDate(LocalDateTime ldt) {
|
||||
Date date = null;
|
||||
if(ldt != null) {
|
||||
Instant instant = ldt.atZone(ZoneId.systemDefault()).toInstant();
|
||||
date = Date.from(instant);
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
public static LocalDate toLocalDate(Date date) {
|
||||
LocalDate ld = null;
|
||||
if(date != null) {
|
||||
ld = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
}
|
||||
return ld;
|
||||
}
|
||||
|
||||
|
||||
public static LocalDateTime toLocalDateTime(Date date) {
|
||||
LocalDateTime ldt = null;
|
||||
if(date != null) {
|
||||
ldt = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
|
||||
}
|
||||
return ldt;
|
||||
}
|
||||
|
||||
|
||||
public static Date parse(String source, String pattern) {
|
||||
Date date = null;
|
||||
if(source == null) {
|
||||
return date;
|
||||
}
|
||||
int sourceLen = source.length();
|
||||
if(sourceLen < 1) {
|
||||
return date;
|
||||
}
|
||||
if(sourceLen > 8) {
|
||||
LocalDateTime ldt = DateUtil.parseLocalDateTime(source, pattern);
|
||||
date = DateUtil.toDate(ldt);
|
||||
} else {
|
||||
LocalDate ld = DateUtil.parseLocalDate(source, pattern);
|
||||
date = DateUtil.toDate(ld);
|
||||
}
|
||||
return date;
|
||||
}
|
||||
|
||||
|
||||
public static Date parse(String source) {
|
||||
return DateUtil.parse(source, null);
|
||||
}
|
||||
|
||||
|
||||
public static LocalDate parseLocalDate(String source, String pattern) {
|
||||
LocalDate ld = null;
|
||||
if(source == null) {
|
||||
return ld;
|
||||
}
|
||||
int sourceLen = source.length();
|
||||
if(sourceLen < 1) {
|
||||
return ld;
|
||||
}
|
||||
if(StringUtil.isEmpty(pattern)) {
|
||||
pattern = PATTERN_CACHE[sourceLen];
|
||||
if(StringUtil.isEmpty(pattern)) {
|
||||
return ld;
|
||||
}
|
||||
}
|
||||
ld = LocalDate.parse(source, DateTimeFormatter.ofPattern(pattern));
|
||||
return ld;
|
||||
}
|
||||
|
||||
|
||||
public static LocalDate parseLocalDate(String source) {
|
||||
return DateUtil.parseLocalDate(source, null);
|
||||
}
|
||||
|
||||
|
||||
public static LocalDateTime parseLocalDateTime(String source, String pattern) {
|
||||
LocalDateTime ldt = null;
|
||||
if(source == null) {
|
||||
return ldt;
|
||||
}
|
||||
int sourceLen = source.length();
|
||||
if(sourceLen < 1) {
|
||||
return ldt;
|
||||
}
|
||||
if(StringUtil.isEmpty(pattern)) {
|
||||
pattern = PATTERN_CACHE[sourceLen];
|
||||
if(StringUtil.isEmpty(pattern)) {
|
||||
return ldt;
|
||||
}
|
||||
}
|
||||
ldt = LocalDateTime.parse(source, DateTimeFormatter.ofPattern(PATTERN_CACHE[sourceLen]));
|
||||
return ldt;
|
||||
}
|
||||
|
||||
|
||||
public static LocalDateTime parseLocalDateTime(String source) {
|
||||
return DateUtil.parseLocalDateTime(source, null);
|
||||
}
|
||||
|
||||
public static String format(Date date, String pattern) {
|
||||
if (date == null)
|
||||
return null;
|
||||
|
||||
return getInnerDateFormat(pattern).format(date);
|
||||
}
|
||||
|
||||
private static SimpleDateFormat getInnerDateFormat(String pattern) {
|
||||
SimpleDateFormat f = cache.get(pattern);
|
||||
if (f == null)
|
||||
f = createDateformat(pattern);
|
||||
|
||||
return f;
|
||||
}
|
||||
|
||||
private static final Locale __DEFAULT_LOCALE = Locale.ENGLISH;
|
||||
|
||||
private static HashMap<String, SimpleDateFormat> cache = new HashMap<String, SimpleDateFormat>();
|
||||
|
||||
|
||||
private synchronized static SimpleDateFormat createDateformat(String pattern) {
|
||||
SimpleDateFormat f = cache.get(pattern);
|
||||
if (f == null) {
|
||||
f = new SimpleDateFormat(pattern, __DEFAULT_LOCALE);
|
||||
cache.put(pattern, f);
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
||||
//날짜 계산 더해주기
|
||||
/*
|
||||
* //year 년 전 cal.add(Calendar.YEAR, -year);
|
||||
* //month 월 전 cal.add(Calendar.MONTH, -month);
|
||||
* //month 일 전 cal.add(Calendar.DATE, -day);
|
||||
*
|
||||
* */
|
||||
public static String AddDate(String strDate, int year, int month, int day) throws Exception {
|
||||
SimpleDateFormat dtFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Calendar cal = Calendar.getInstance();
|
||||
Date dt = dtFormat.parse(strDate); cal.setTime(dt);
|
||||
cal.add(Calendar.YEAR, year);
|
||||
cal.add(Calendar.MONTH, month);
|
||||
cal.add(Calendar.DATE, day);
|
||||
return dtFormat.format(cal.getTime());
|
||||
|
||||
}
|
||||
|
||||
public static String setDiffYear(String searchYear) {
|
||||
|
||||
int yearChar = Integer.parseInt(searchYear);
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(new Date());
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
cal.add(Calendar.YEAR, -yearChar);
|
||||
|
||||
return df.format(cal.getTime());
|
||||
}
|
||||
|
||||
public static String setDiffMonth(String searchMonth) {
|
||||
|
||||
int yearChar = Integer.parseInt(searchMonth);
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.setTime(new Date());
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
cal.add(Calendar.MONTH, -yearChar);
|
||||
|
||||
return df.format(cal.getTime());
|
||||
}
|
||||
|
||||
/**
|
||||
* @methodName : setLastDayOfMonth
|
||||
* @author : 이호영
|
||||
* @date : 2022.11.23
|
||||
* @description : 해당 년 월의 마지막 날짜 구함
|
||||
* @param year
|
||||
* @param month
|
||||
* @return
|
||||
*/
|
||||
public static int setLastDayOfMonth(String year, String month) {
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.set(Integer.parseInt(year), Integer.parseInt(month)-1, 1);
|
||||
|
||||
return cal.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
}
|
||||
|
||||
}
|
||||
83
src/main/java/kcc/com/cmm/util/EgovBasicLogger.java
Normal file
83
src/main/java/kcc/com/cmm/util/EgovBasicLogger.java
Normal file
@ -0,0 +1,83 @@
|
||||
package kcc.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);
|
||||
}
|
||||
}
|
||||
118
src/main/java/kcc/com/cmm/util/EgovDoubleSubmitHelper.java
Normal file
118
src/main/java/kcc/com/cmm/util/EgovDoubleSubmitHelper.java
Normal file
@ -0,0 +1,118 @@
|
||||
package kcc.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;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
return false;
|
||||
//throw new RuntimeException("Double Submit Preventer TagLig isn't set. Check JSP.");
|
||||
}
|
||||
|
||||
String parameter = request.getParameter(EgovDoubleSubmitHelper.PARAMETER_NAME);
|
||||
|
||||
// check parameter
|
||||
if (parameter == null) {
|
||||
return false;
|
||||
//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;
|
||||
}
|
||||
|
||||
public static boolean checkAndSaveToken(String tokenKey , MultipartHttpServletRequest multiRequest) {
|
||||
|
||||
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);
|
||||
String parameter = multiRequest.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;
|
||||
}
|
||||
}
|
||||
126
src/main/java/kcc/com/cmm/util/EgovResourceCloseHelper.java
Normal file
126
src/main/java/kcc/com/cmm/util/EgovResourceCloseHelper.java
Normal file
@ -0,0 +1,126 @@
|
||||
package kcc.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!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
149
src/main/java/kcc/com/cmm/util/IpUtil.java
Normal file
149
src/main/java/kcc/com/cmm/util/IpUtil.java
Normal file
@ -0,0 +1,149 @@
|
||||
/*
|
||||
* Copyright 2008-2009 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.
|
||||
*/
|
||||
package kcc.com.cmm.util;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.URLEncoder;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class IpUtil {
|
||||
public static String getClientIP(HttpServletRequest request) {
|
||||
String userip = request.getHeader("X-Forwarded-For"); // 아이피 가져오기 아파치 아래에 웹로직이 있을경우
|
||||
|
||||
if ( userip == null || "".equals(userip) ) { // 아이피 가져오기 , 바로 웹로직이 있을경우
|
||||
userip = request.getRemoteAddr();
|
||||
}
|
||||
|
||||
if ( userip == null || "".equals(userip) ) {
|
||||
return "";
|
||||
}
|
||||
|
||||
String[] userips = userip.split(",");
|
||||
return userips[0];
|
||||
}
|
||||
|
||||
public static String getBrowser(HttpServletRequest request) {
|
||||
String header = request.getHeader("User-Agent");
|
||||
|
||||
//System.out.println("header:"+header);
|
||||
|
||||
if (header.indexOf("MSIE") > -1 || header.indexOf("rv:11.0") > -1) {
|
||||
return "MSIE";
|
||||
}else if (header.indexOf("Opera") > -1 || header.indexOf("OPR") > -1) {
|
||||
return "Opera";
|
||||
}else if (header.indexOf("Chrome") > -1) {
|
||||
return "Chrome";
|
||||
}else if (header.indexOf("Firefox") > -1) {
|
||||
return "Firefox";
|
||||
}
|
||||
return "Firefox";
|
||||
}
|
||||
|
||||
public static String getStr(HttpServletRequest request,String str) throws UnsupportedEncodingException {
|
||||
String header = request.getHeader("User-Agent");
|
||||
|
||||
String browser;
|
||||
|
||||
if (header.indexOf("MSIE") > -1 || header.indexOf("rv:11.0") > -1) {
|
||||
browser = "MSIE";
|
||||
} else if (header.indexOf("Chrome") > -1) {
|
||||
browser = "Chrome";
|
||||
} else if (header.indexOf("Opera") > -1) {
|
||||
browser = "Opera";
|
||||
} else {
|
||||
browser = "Firefox";
|
||||
}
|
||||
|
||||
if (browser.equals("MSIE")) {
|
||||
str = URLEncoder.encode(str, "UTF-8")
|
||||
.replaceAll("\\+", "%20");
|
||||
} else if (browser.equals("Firefox")) {
|
||||
str = new String(str.getBytes("UTF-8"), "8859_1");
|
||||
} else if (browser.equals("Opera")) {
|
||||
str = new String(str.getBytes("UTF-8"), "8859_1");
|
||||
} else if (browser.equals("Chrome")) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
for (int i = 0; i < str.length(); i++) {
|
||||
char c = str.charAt(i);
|
||||
if (c > '~') {
|
||||
sb.append(URLEncoder.encode("" + c, "UTF-8"));
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
str = sb.toString();
|
||||
} else {
|
||||
str = "Not supported browser";
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
public static String getOzServerName(String serverNm) {
|
||||
|
||||
String ozServerNm = "";
|
||||
|
||||
if(serverNm.contains("localhost") || serverNm.contains("119.193.215.98") || serverNm.contains("iten.co.kr") || serverNm.contains("192.168.0.176") || serverNm.contains("ljhtest")) {//로컬 및 개발서버 요청시 서버 경로 처리
|
||||
|
||||
ozServerNm = "http://119.193.215.98:8086";
|
||||
// ozServerNm = "http://192.168.0.176:8091";
|
||||
|
||||
}else if(serverNm.contains("192.168.39.144")) {//저작위 업무시스템망에서 오즈 요청시 오즈 서버 경로 처리
|
||||
|
||||
ozServerNm = "http://192.168.39.145:8080";
|
||||
|
||||
}
|
||||
|
||||
return ozServerNm;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static String getClientIPv4(HttpServletRequest request) {
|
||||
String userip = request.getHeader("X-Forwarded-For"); // 아파치 아래에 웹로직이 있을경우 아이피 가져오기
|
||||
|
||||
if (userip == null || "".equals(userip)) { // 아이피 가져오기 , 바로 웹로직이 있을경우
|
||||
userip = request.getRemoteAddr();
|
||||
}
|
||||
|
||||
if (userip == null || "".equals(userip)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
// 여러 IP가 있을 경우 첫 번째 IP 사용
|
||||
String[] userips = userip.split(",");
|
||||
userip = userips[0].trim();
|
||||
|
||||
// IPv6 주소인 경우 IPv4로 변환 시도
|
||||
try {
|
||||
InetAddress inetAddress = InetAddress.getByName(userip);
|
||||
if (inetAddress instanceof java.net.Inet6Address) {
|
||||
byte[] ipv4Bytes = new byte[4];
|
||||
System.arraycopy(inetAddress.getAddress(), 12, ipv4Bytes, 0, 4);
|
||||
InetAddress ipv4Address = InetAddress.getByAddress(ipv4Bytes);
|
||||
return ipv4Address.getHostAddress();
|
||||
}
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace(); // 예외 발생 시 로그 출력
|
||||
}
|
||||
|
||||
// IPv4 주소라면 그대로 반환
|
||||
return userip;
|
||||
}
|
||||
}
|
||||
60
src/main/java/kcc/com/cmm/util/Order.java
Normal file
60
src/main/java/kcc/com/cmm/util/Order.java
Normal file
@ -0,0 +1,60 @@
|
||||
package kcc.com.cmm.util;
|
||||
|
||||
|
||||
/**
|
||||
* 프로그램 파일명 : Order.java
|
||||
*
|
||||
* 프로그램 설명 : 쿼리에서 정렬방법을 정의하는 클래스
|
||||
*
|
||||
* 작 성 자 : jeong hoon hee
|
||||
*
|
||||
* 작 성 일 : 2013. 6. 7.
|
||||
*
|
||||
* Copyright(c) 2013 DAEYOON Co. Ltd. All rights reserved.
|
||||
*/
|
||||
public class Order {
|
||||
|
||||
private String columnName;
|
||||
private String orderType;
|
||||
|
||||
public Order() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
public Order(String columnName, String orderType) {
|
||||
super();
|
||||
this.columnName = columnName;
|
||||
this.orderType = orderType;
|
||||
}
|
||||
|
||||
public static Order asc(String columnName) {
|
||||
Order order = new Order();
|
||||
order.setColumnName(columnName);
|
||||
order.setOrderType("ASC");
|
||||
return order;
|
||||
}
|
||||
|
||||
public static Order desc(String columnName) {
|
||||
Order order = new Order();
|
||||
order.setColumnName(columnName);
|
||||
order.setOrderType("DESC");
|
||||
return order;
|
||||
}
|
||||
|
||||
public String getColumnName() {
|
||||
return columnName;
|
||||
}
|
||||
|
||||
public void setColumnName(String columnName) {
|
||||
this.columnName = columnName;
|
||||
}
|
||||
|
||||
public String getOrderType() {
|
||||
return orderType;
|
||||
}
|
||||
|
||||
public void setOrderType(String orderType) {
|
||||
this.orderType = orderType;
|
||||
}
|
||||
}
|
||||
142
src/main/java/kcc/com/cmm/util/RedirectUrlMaker.java
Normal file
142
src/main/java/kcc/com/cmm/util/RedirectUrlMaker.java
Normal file
@ -0,0 +1,142 @@
|
||||
package kcc.com.cmm.util;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
/**
|
||||
* 프로그램 파일명 : RedirectUrlMaker.java
|
||||
*
|
||||
* 프로그램 설명 : 리다이렉트URL를 생성해주는 유틸클래스
|
||||
*
|
||||
* 작 성 자 : jeong hoon hee
|
||||
*
|
||||
* 작 성 일 : 2013. 5. 15.
|
||||
*
|
||||
* Copyright(c) 2013 DAEYOON Co. Ltd. All rights reserved.
|
||||
*/
|
||||
public class RedirectUrlMaker {
|
||||
|
||||
/**
|
||||
* 요청매핑URL
|
||||
*/
|
||||
private String requestMappingUrl;
|
||||
|
||||
/**
|
||||
* 검색파라미터객체
|
||||
*/
|
||||
private Criteria criteria;
|
||||
|
||||
/**
|
||||
* 추가파라미터맵
|
||||
*/
|
||||
private Map<String, Object> paramMap = null;
|
||||
|
||||
/**
|
||||
* 생성자1
|
||||
*
|
||||
* @param requestMappingUrl : 요청매핑URL (예: "/board/list.do")
|
||||
* @param criteria : 검색파라미터객체
|
||||
*/
|
||||
public RedirectUrlMaker(String requestMappingUrl, Criteria criteria) {
|
||||
this.requestMappingUrl = requestMappingUrl;
|
||||
this.criteria = criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* 생성자2
|
||||
* @param requestMappingUrl
|
||||
*/
|
||||
public RedirectUrlMaker(String requestMappingUrl) {
|
||||
this.requestMappingUrl = requestMappingUrl;
|
||||
}
|
||||
|
||||
public Object appendParam(String key, Object value) {
|
||||
if (this.paramMap == null) {
|
||||
this.paramMap = new HashMap<String, Object>();
|
||||
}
|
||||
return this.paramMap.put(key, value);
|
||||
}
|
||||
|
||||
public Object getParam(String key) {
|
||||
if (this.paramMap == null) {
|
||||
return null;
|
||||
}
|
||||
return this.paramMap.get(key);
|
||||
}
|
||||
|
||||
public Map<String, Object> getParamMap() {
|
||||
return paramMap;
|
||||
}
|
||||
|
||||
public void setParamMap(Map<String, Object> paramMap) {
|
||||
this.paramMap = paramMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 리다이렉트URL를 생성하여 리턴한다.
|
||||
*
|
||||
* @return
|
||||
* @throws UnsupportedEncodingException
|
||||
*/
|
||||
public String getRedirectUrl() {
|
||||
StringBuffer redirectUrl = new StringBuffer("redirect:");
|
||||
|
||||
if (StringUtils.isNotEmpty(this.requestMappingUrl)) {
|
||||
if (this.requestMappingUrl.startsWith("/") == false) {
|
||||
this.requestMappingUrl = "/" + this.requestMappingUrl;
|
||||
}
|
||||
if (this.requestMappingUrl.endsWith("?")) {
|
||||
this.requestMappingUrl = this.requestMappingUrl.substring(0, this.requestMappingUrl.length()-1);
|
||||
}
|
||||
}
|
||||
|
||||
redirectUrl.append(this.requestMappingUrl);
|
||||
|
||||
if (this.criteria != null) {
|
||||
if (redirectUrl.toString().indexOf("?") == -1) {
|
||||
redirectUrl.append("?");
|
||||
} else {
|
||||
redirectUrl.append("&");
|
||||
}
|
||||
redirectUrl.append(this.criteria.getParams());
|
||||
}
|
||||
|
||||
if (this.paramMap != null) {
|
||||
if (this.paramMap.size() > 0) {
|
||||
Set<String> set = this.paramMap.keySet();
|
||||
Iterator<String> iter = set.iterator();
|
||||
while (iter.hasNext()) {
|
||||
String key = iter.next();
|
||||
Object value = this.paramMap.get(key);
|
||||
redirectUrl.append("&");
|
||||
redirectUrl.append(key);
|
||||
redirectUrl.append("=");
|
||||
if (value instanceof String) {
|
||||
if (StringUtils.isNotEmpty((String) value)) {
|
||||
try {
|
||||
redirectUrl.append(URLEncoder.encode((String) value, "UTF-8"));
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
redirectUrl.append(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return redirectUrl.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getRedirectUrl();
|
||||
}
|
||||
|
||||
}
|
||||
41
src/main/java/kcc/com/cmm/util/SequenceUtil.java
Normal file
41
src/main/java/kcc/com/cmm/util/SequenceUtil.java
Normal file
@ -0,0 +1,41 @@
|
||||
package kcc.com.cmm.util;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import kcc.com.cmm.service.SequenceUtilService;
|
||||
|
||||
@Service
|
||||
public class SequenceUtil {
|
||||
|
||||
private static SequenceUtilService sequenceUtilService;
|
||||
|
||||
public static final String SEQ_ID_TR_SEQ_NO = "TR_SEQ_NO"; // 전문일련번호
|
||||
public static final String SEQ_ID_ECRS_TR_SEQ_NO = "ECRS_TR_SEQ_NO"; // 전문일련번호-이크로스
|
||||
public static final String SEQ_ID_PAY_NO_SEQ_NO = "PAY_NO_SEQ_NO"; // 지급번호
|
||||
public static final String SEQ_ID_ACCOUNT_NO_SEQ_NO = "ACCOUNT_NO_SEQ_NO"; // 계좌조회 번호
|
||||
|
||||
public static final String SEQ_ADR_NO = "SEQ_ADR_NO"; // 조정사건 번호
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private void setSequenceService(SequenceUtilService sequenceUtilService) {
|
||||
SequenceUtil.sequenceUtilService = sequenceUtilService;
|
||||
}
|
||||
|
||||
|
||||
public static String getNextVal(String seqId) {
|
||||
String seq = "";
|
||||
try {
|
||||
seq = sequenceUtilService.getSeqNextVal(seqId);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
return seq;
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.out.println("hi seq:" + getNextVal("SEQ_ADR_NO"));
|
||||
}
|
||||
}
|
||||
0
src/main/java/kcc/com/cmm/util/Snippet.java
Normal file
0
src/main/java/kcc/com/cmm/util/Snippet.java
Normal file
26
src/main/java/kcc/com/cmm/util/StreamDocsUtil.java
Normal file
26
src/main/java/kcc/com/cmm/util/StreamDocsUtil.java
Normal file
@ -0,0 +1,26 @@
|
||||
package kcc.com.cmm.util;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import com.mashape.unirest.http.HttpResponse;
|
||||
import com.mashape.unirest.http.Unirest;
|
||||
import com.mashape.unirest.http.exceptions.UnirestException;
|
||||
import java.net.URL;
|
||||
|
||||
|
||||
public class StreamDocsUtil {
|
||||
|
||||
|
||||
public static HttpResponse<String> regPdfDoc(String filePath, String requestUrl) throws UnirestException {
|
||||
|
||||
HttpResponse<String> response=Unirest.post(requestUrl)
|
||||
.field("pdf", new File(filePath))
|
||||
.field("save", false)
|
||||
.asString();
|
||||
// System.out.println(response.getStatus());
|
||||
// System.out.println(response.getBody());
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
517
src/main/java/kcc/com/cmm/util/StringUtil.java
Normal file
517
src/main/java/kcc/com/cmm/util/StringUtil.java
Normal file
@ -0,0 +1,517 @@
|
||||
/*
|
||||
* Copyright 2008-2009 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.
|
||||
*/
|
||||
package kcc.com.cmm.util;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
import java.security.SecureRandom;
|
||||
import java.sql.Clob;
|
||||
import java.sql.SQLException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import kcc.let.utl.sim.service.EgovFileScrty;
|
||||
|
||||
public class StringUtil {
|
||||
|
||||
private static final int HIGHEST_SPECIAL = '>'; // for escaping html code. by hessie; since 2007/10/01.
|
||||
private static final int LOWEST_SPECIAL = '\"'; // for escaping html code. by hessie; since 2007/10/01.
|
||||
private static final int HIGHEST_BR = '\r'; // for escaping html code. by hessie; since 2007/10/01.
|
||||
private static final int LOWEST_BR = '\n'; // for escaping html code. by hessie; since 2007/10/01.
|
||||
private static final int HIGHEST_JS_SPECIAL = '\\'; // for escaping js literal code. by hessie; since 2007/10/01
|
||||
private static char[][] specialCharactersRepresentation = new char[HIGHEST_SPECIAL + 1][];
|
||||
private static char[][] specialCharactersRepresentationWithNbsp = new char[HIGHEST_SPECIAL + 1][];
|
||||
|
||||
|
||||
|
||||
public final static char[] byteCodes;
|
||||
|
||||
static {
|
||||
byteCodes = new char[] { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||
}
|
||||
|
||||
public static String bytesToOrgString(byte[] bytes) {
|
||||
int len = bytes.length;
|
||||
char[] chars = new char[len * 2];
|
||||
|
||||
for (int i = 0; i < len; ++i) {
|
||||
chars[i * 2] = byteCodes[(bytes[i] & 0XF0) >> 4];
|
||||
chars[i * 2 + 1] = byteCodes[(bytes[i] & 0X0F)];
|
||||
}
|
||||
return new String(chars);
|
||||
}
|
||||
|
||||
/**
|
||||
* 글자 특정 사이즈로 잘라내기
|
||||
*
|
||||
* @param str
|
||||
* @param size
|
||||
* @return String
|
||||
*/
|
||||
public String cutString(String str, int size) {
|
||||
String returnStr = null;
|
||||
if (str.length() > size) {
|
||||
returnStr = str.substring(0, size) + "...";
|
||||
}
|
||||
else {
|
||||
returnStr = str;
|
||||
}
|
||||
return returnStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 글자 특정 사이즈로 잘라내기
|
||||
*
|
||||
* @param str
|
||||
* @param size
|
||||
* @param tail
|
||||
* @return String
|
||||
*/
|
||||
public String cutString(String str, int size, boolean tail) {
|
||||
String returnStr = null;
|
||||
String tails = "";
|
||||
|
||||
if (tail == true) {
|
||||
tails = "...";
|
||||
}
|
||||
|
||||
if (str.length() > size) {
|
||||
returnStr = str.substring(0, size) + tails;
|
||||
}
|
||||
else {
|
||||
returnStr = str;
|
||||
}
|
||||
return returnStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 글자 특정 사이즈로 <br/> 분이기
|
||||
*
|
||||
* @param str
|
||||
* @param size
|
||||
* @return String
|
||||
*/
|
||||
public String brString(String str, int size) {
|
||||
String returnStr = "";
|
||||
int j = 0;
|
||||
for(int i = 0; i < str.length(); i++)
|
||||
{
|
||||
if(j >= size)
|
||||
{
|
||||
returnStr += "<br/>";
|
||||
j = 0;
|
||||
}
|
||||
returnStr += str.charAt(i);
|
||||
j++;
|
||||
}
|
||||
return returnStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* \r\n을 <br/> 태그로 변환처리
|
||||
*
|
||||
* @param str
|
||||
* @return String
|
||||
*/
|
||||
public String nl2br(String str) {
|
||||
String returnStr = null;
|
||||
returnStr = str.replaceAll("\r\n", "<br/>");
|
||||
return returnStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* \r\n을 삭제
|
||||
*
|
||||
* @param str
|
||||
* @return String
|
||||
*/
|
||||
public String nl2Null(String str) {
|
||||
String returnStr = null;
|
||||
returnStr = str.replaceAll("\r\n", "");
|
||||
return returnStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* \n을 <br/> 태그로 변환처리
|
||||
*
|
||||
* @param str
|
||||
* @return String
|
||||
*/
|
||||
public String nl2br2(String str) {
|
||||
String returnStr = null;
|
||||
returnStr = str.replaceAll("\n", "<br/>");
|
||||
return returnStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 특수문자를 변환합니다
|
||||
*
|
||||
* @param str
|
||||
* @return String
|
||||
*/
|
||||
public String middot(String str) {
|
||||
str = str.replaceAll("·", "·");
|
||||
str = str.replaceAll("“", "“");
|
||||
str = str.replaceAll("”", "”");
|
||||
str = str.replaceAll("→", "→");
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* html 태그를 제거합니다
|
||||
*
|
||||
* @param str
|
||||
* @return String
|
||||
*/
|
||||
public static String stripTag(String str) {
|
||||
str = str.replaceAll("\\<.*?\\>", "");
|
||||
str = str.replaceAll(" ", "");
|
||||
str = str.replaceAll("<span>","");
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* clob 스트링 출력
|
||||
*
|
||||
* @param str
|
||||
* @param size
|
||||
* @return String
|
||||
* @throws IOException
|
||||
*/
|
||||
public String getClob(Clob str) throws IOException {
|
||||
try {
|
||||
|
||||
Reader reader = str.getCharacterStream();
|
||||
|
||||
StringBuffer out = new StringBuffer();
|
||||
char[] buff = new char[1024];
|
||||
int nchars = 0;
|
||||
|
||||
// 스트링 버퍼에 append 시킨후
|
||||
while ((nchars = reader.read(buff)) > 0) {
|
||||
out.append(buff, 0, nchars);
|
||||
}
|
||||
|
||||
return out.toString();
|
||||
} catch (SQLException e) {
|
||||
System.out.println("clob에러");
|
||||
return "clob에러";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 글자 널값이면 대체하기
|
||||
*
|
||||
* @param str
|
||||
* @param size
|
||||
* @return String
|
||||
*/
|
||||
public String nvl(String str, String str_r) {
|
||||
String returnStr = str;
|
||||
if (str == null) {
|
||||
if (str_r == null) {
|
||||
str_r = "";
|
||||
}
|
||||
returnStr = str_r;
|
||||
} else if (str.length() == 0) {
|
||||
if (str_r == null) {
|
||||
str_r = "";
|
||||
}
|
||||
returnStr = str_r;
|
||||
}
|
||||
|
||||
return returnStr;
|
||||
}
|
||||
|
||||
/**
|
||||
* https 검색
|
||||
*
|
||||
* @param str
|
||||
* @param size
|
||||
* @return String
|
||||
*/
|
||||
public boolean httpsFind(String str) {
|
||||
|
||||
if(str.matches("https://.*"))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 휴대폰번호 대시('-') 추가
|
||||
* 대시 유무 상관없음
|
||||
* 유효성 맞지 않을시 변환안됨.
|
||||
*/
|
||||
public String addDash(String str) {
|
||||
String regExp = "(^01[016789]{1}|070)([0-9]{3}|[0-9]{4})([0-9]{4})$";
|
||||
String chgf = "$1-$2-$3";
|
||||
return str.replaceFirst(regExp, chgf);
|
||||
}
|
||||
|
||||
public boolean checkReg(String reg, String str) {
|
||||
return Pattern.matches(reg, str);
|
||||
}
|
||||
|
||||
public static boolean checkRegKor(String str) {
|
||||
return Pattern.matches("[가-힣]+", str);
|
||||
}
|
||||
|
||||
public boolean checkRegNum(String str) {
|
||||
return Pattern.matches("[0-9]+", str);
|
||||
}
|
||||
|
||||
public boolean checkRegEng(String str) {
|
||||
return Pattern.matches("[a-zA-z]+", str);
|
||||
}
|
||||
public boolean checkRegEngUp(String str) {
|
||||
return Pattern.matches("[A-z]+", str);
|
||||
}
|
||||
public boolean checkRegEngLo(String str) {
|
||||
return Pattern.matches("[a-z]+", str);
|
||||
}
|
||||
|
||||
public static boolean checkRegKorEngNum(String str) {
|
||||
return Pattern.matches("[가-힣A-za-z0-9]+", str);
|
||||
}
|
||||
|
||||
/**
|
||||
* 새 우편번호 변환
|
||||
*/
|
||||
public String getPost(int area, int num) {
|
||||
String[][] newPosts = {
|
||||
{""}
|
||||
,{"05050","11787","13636","26475","25517","07988","05048"}
|
||||
,{"14041","14442","10449","14067","16704","21313"}
|
||||
,{"46700","44248","51708","52628"}
|
||||
,{"32840","32840","28684","31158","32839"}
|
||||
,{"62278","55316","57987","58457"}
|
||||
,{"41504","36709","37653"}
|
||||
};
|
||||
return newPosts[area][num];
|
||||
}
|
||||
|
||||
public String nl2br() {
|
||||
String returnStr = null;
|
||||
return returnStr;
|
||||
}
|
||||
|
||||
public static boolean isEmpty(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
public static boolean isNotEmpty(String value) {
|
||||
return !isEmpty(value);
|
||||
}
|
||||
|
||||
public static String trim(String value) {
|
||||
if(value == null) {
|
||||
return null;
|
||||
}
|
||||
return value.trim();
|
||||
}
|
||||
|
||||
public static String getOnlyNum(String value) {
|
||||
if(value == null) {
|
||||
return null;
|
||||
}
|
||||
return value.replaceAll("[^0-9]","");
|
||||
}
|
||||
|
||||
public static String escapeXml(Object o) {
|
||||
if (o == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
StringWriter writer = new StringWriter();
|
||||
try {
|
||||
writeXmlText(writer, o.toString(), true);
|
||||
} catch (java.io.IOException e) { // this exception cannot be catched.
|
||||
System.out.println("escapeXml IOException Error");
|
||||
}
|
||||
|
||||
return writer.toString();
|
||||
}
|
||||
public static void writeXmlText(Writer writer, String text) throws java.io.IOException {
|
||||
writeXmlText(writer, text, true, false, false);
|
||||
}
|
||||
|
||||
public static void writeXmlText(Writer writer, String text, boolean escapeXml) throws java.io.IOException {
|
||||
writeXmlText(writer, text, escapeXml, false, false);
|
||||
}
|
||||
|
||||
public static void writeXmlText(Writer writer, String text, boolean escapeXml, boolean applyBr) throws java.io.IOException {
|
||||
writeXmlText(writer, text, escapeXml, applyBr, false);
|
||||
}
|
||||
|
||||
public static void writeXmlText(Writer writer, String text, boolean escapeXml, boolean applyBr, boolean escapeNbsp) throws java.io.IOException {
|
||||
if (text == null) {
|
||||
// do nothing.
|
||||
} else if (!escapeXml && !applyBr) {
|
||||
writer.write(text);
|
||||
} else {
|
||||
writeXmlText(writer, text.toCharArray(), text.length(), escapeXml, applyBr, escapeNbsp);
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeXmlText(Writer writer, char[] buffer, int length, boolean escapeXml, boolean applyBr, boolean escapeNbsp) throws java.io.IOException {
|
||||
int highest = HIGHEST_SPECIAL;
|
||||
int lowest = LOWEST_SPECIAL;
|
||||
int start = 0;
|
||||
int i = 0;
|
||||
char[][] representation = (escapeNbsp ? specialCharactersRepresentationWithNbsp : specialCharactersRepresentation);
|
||||
|
||||
if (applyBr) {
|
||||
lowest = LOWEST_BR;
|
||||
if (!escapeXml) {
|
||||
highest = HIGHEST_BR;
|
||||
}
|
||||
} else {
|
||||
if (!escapeXml) {
|
||||
i = length;
|
||||
}
|
||||
}
|
||||
|
||||
for (; i < length; i++) {
|
||||
char c = buffer[i];
|
||||
if (c <= highest && c >= lowest) {
|
||||
char[] escaped = representation[c];
|
||||
if (escaped != null) {
|
||||
// add unescaped portion
|
||||
if (start < i) {
|
||||
writer.write(buffer, start, i - start);
|
||||
}
|
||||
// add escaped xml
|
||||
writer.write(escaped);
|
||||
start = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// add rest of unescaped portion
|
||||
if (start < length) {
|
||||
writer.write(buffer, start, length - start);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
try {
|
||||
System.out.print(EgovFileScrty.encryptPassword("1", "kcctest"));
|
||||
} catch (Exception e) {
|
||||
System.out.println("Main Exception Error");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 파라미터를 String 타입으로 가져옵니다.<br>
|
||||
* - null일 경우 빈 문자열을 가져옵니다.<br>
|
||||
* Get String(if object is null, return empty string).
|
||||
* @param Object
|
||||
* @return String
|
||||
*/
|
||||
public static String getString(Object obj) {
|
||||
if (obj == null)
|
||||
return "";
|
||||
else
|
||||
return String.valueOf(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* 오늘 날짜를 형식에 맞는 문자열로 가져옵니다.
|
||||
*
|
||||
* @param format
|
||||
* @return
|
||||
*/
|
||||
public static String getDateToString(String format) {
|
||||
Date date = new Date();
|
||||
return getDateToString(date, format);
|
||||
}
|
||||
|
||||
/**
|
||||
* 날짜 객체를 형식에 맞는 문자열로 가져옵니다.
|
||||
*
|
||||
* @param date
|
||||
* @param format
|
||||
* @return
|
||||
*/
|
||||
public static String getDateToString(Date date, String format) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(format);
|
||||
return sdf.format(date);
|
||||
}
|
||||
|
||||
|
||||
public static String getRandomKey(int len) {
|
||||
SecureRandom random = new SecureRandom();
|
||||
String tmp1 = Math.abs(random.nextInt()) + "";
|
||||
String tmp2 = Math.abs(random.nextInt()) + "";
|
||||
|
||||
//String key = (long) (Math.random() * Math.pow(len, len))+"";
|
||||
String key = (tmp1 + tmp2).substring(0, 10);
|
||||
|
||||
if(key.length()!=len) {
|
||||
return getRandomKey(len);
|
||||
}
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
public static String getRandomKey(int len, HashMap<String, String> keyMap) {
|
||||
|
||||
SecureRandom random = new SecureRandom();
|
||||
String tmp1 = Math.abs(random.nextInt()) + "";
|
||||
String tmp2 = Math.abs(random.nextInt()) + "";
|
||||
|
||||
//String key = (long) (Math.random() * Math.pow(len, len))+"";
|
||||
String key = (tmp1 + tmp2).substring(0, 10);
|
||||
|
||||
if(key.length()!=len) {
|
||||
return getRandomKey(len, keyMap);
|
||||
}
|
||||
|
||||
if(keyMap.containsKey(key)) {
|
||||
return getRandomKey(len, keyMap);
|
||||
}
|
||||
keyMap.put(key, key);
|
||||
return key;
|
||||
}
|
||||
|
||||
//오즈리포트 직인 이미지 처리를 위한 주소 변환 함수
|
||||
public static String getUrlString(String url) {
|
||||
|
||||
String repUrl = "";
|
||||
|
||||
if(url.contains("hosts_")) { //운영서버 업무시스템 주소셋팅
|
||||
|
||||
repUrl = url.replaceAll("hosts_real", "https://adr.copyright.or.kr");
|
||||
//repUrl = url.replaceAll("hosts_real", "http://192.168.39.144");
|
||||
|
||||
}else{ //개발서버 시스템 주소 셋팅
|
||||
|
||||
repUrl = url.replaceAll("host_dev", "http://119.193.215.98:8081");
|
||||
|
||||
}
|
||||
|
||||
repUrl = repUrl.replaceAll("&url&", "/uss/ion/pwm/getImage.do?atchFileId=");
|
||||
|
||||
return repUrl;
|
||||
}
|
||||
}
|
||||
598
src/main/java/kcc/com/cmm/util/StringUtil2.java
Normal file
598
src/main/java/kcc/com/cmm/util/StringUtil2.java
Normal file
@ -0,0 +1,598 @@
|
||||
package kcc.com.cmm.util;
|
||||
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.google.common.base.CaseFormat;
|
||||
|
||||
import kcc.com.cmm.exception.BaseException;
|
||||
|
||||
|
||||
public final class StringUtil2 {
|
||||
private static final int HIGHEST_SPECIAL = '>'; // for escaping html code. by hessie; since 2007/10/01.
|
||||
private static final int LOWEST_SPECIAL = '\"'; // for escaping html code. by hessie; since 2007/10/01.
|
||||
private static final int HIGHEST_BR = '\r'; // for escaping html code. by hessie; since 2007/10/01.
|
||||
private static final int LOWEST_BR = '\n'; // for escaping html code. by hessie; since 2007/10/01.
|
||||
private static final int HIGHEST_JS_SPECIAL = '\\'; // for escaping js literal code. by hessie; since 2007/10/01
|
||||
private static char[][] specialCharactersRepresentation = new char[HIGHEST_SPECIAL + 1][];
|
||||
private static char[][] specialCharactersRepresentationWithNbsp = new char[HIGHEST_SPECIAL + 1][];
|
||||
|
||||
public static final String CHARSET_UTF8 = "UTF-8";
|
||||
public static final String CHARSET_EUCKR = "EUC-KR";
|
||||
|
||||
public static String toString(Object o) {
|
||||
if (o == null) {
|
||||
return null;
|
||||
}
|
||||
return o.toString();
|
||||
}
|
||||
|
||||
public static String toString(Object o, String defaultValue) {
|
||||
if (o == null) {
|
||||
return defaultValue;
|
||||
}
|
||||
return o.toString();
|
||||
}
|
||||
|
||||
public static boolean isEmpty(String value) {
|
||||
return (value == null || value.length() == 0);
|
||||
}
|
||||
|
||||
public static boolean isNotEmpty(String value) {
|
||||
return !isEmpty(value);
|
||||
}
|
||||
|
||||
public static String trim(String value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
return value.trim();
|
||||
}
|
||||
|
||||
public static String lpad(String value, int len, String pad) {
|
||||
if (value == null) {
|
||||
value = "";
|
||||
}
|
||||
return StringUtils.leftPad(value, len, pad);
|
||||
}
|
||||
|
||||
public static String rpad(String value, int len, String pad) {
|
||||
if (value == null) {
|
||||
value = "";
|
||||
}
|
||||
return StringUtils.rightPad(value, len, pad);
|
||||
}
|
||||
|
||||
public static String rpadb(String value, int len, String pad) {
|
||||
if (value == null) {
|
||||
value = "";
|
||||
}
|
||||
int preLen = value.getBytes().length;
|
||||
|
||||
return StringUtils.rightPad(value, len - preLen + value.length(), pad);
|
||||
}
|
||||
|
||||
public static String rpadb(String value, int len, String pad, String encoding) throws Exception {
|
||||
if (value == null) {
|
||||
value = "";
|
||||
}
|
||||
int preLen = value.getBytes(encoding).length;
|
||||
|
||||
return StringUtils.rightPad(value, len - preLen + value.length(), pad);
|
||||
}
|
||||
|
||||
public static String camelLower(String name) {
|
||||
return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name);
|
||||
}
|
||||
|
||||
public static String camelUpper(String name) {
|
||||
return CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지 Format
|
||||
*
|
||||
* @param msg
|
||||
* - "{0}는 {1}자리입니다."
|
||||
* @param params
|
||||
* - new Object[]{"ID", 8}
|
||||
* @return
|
||||
*/
|
||||
public static String msgFormat(String msg, Object... params) {
|
||||
String formatMsg = null;
|
||||
if (StringUtil2.isNotEmpty(msg)) {
|
||||
if (params != null && params.length > 0) {
|
||||
formatMsg = MessageFormat.format(msg, params);
|
||||
} else {
|
||||
formatMsg = msg;
|
||||
}
|
||||
}
|
||||
return formatMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 메시지 Parse
|
||||
*
|
||||
* @param pattern
|
||||
* - "{0}는 {1}자리입니다."
|
||||
* @param msg
|
||||
* - "ID는 8자리입니다."
|
||||
* @return new Object[]{"ID", 8}
|
||||
*/
|
||||
public static Object[] msgParse(String pattern, String msg) {
|
||||
Object[] params = null;
|
||||
if (StringUtil2.isEmpty(pattern)) {
|
||||
return params;
|
||||
}
|
||||
if (StringUtil2.isEmpty(msg)) {
|
||||
return params;
|
||||
}
|
||||
try {
|
||||
MessageFormat formatter = new MessageFormat(pattern);
|
||||
params = formatter.parse(msg);
|
||||
} catch (ParseException e) {
|
||||
throw new BaseException("ParseException Error");
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
public static String formatPhone(String value, boolean crypt) {
|
||||
String format = null;
|
||||
if (value == null) {
|
||||
return format;
|
||||
}
|
||||
format = value.replaceAll(" ", "");
|
||||
int formatLen = format.length();
|
||||
if (formatLen < 1) {
|
||||
return format;
|
||||
}
|
||||
if (formatLen == 8) {
|
||||
if (crypt) {
|
||||
format = format.replaceAll("^(\\d{4})(\\d{2})(\\d{2})$", "$1-**$3");
|
||||
} else {
|
||||
format = format.replaceAll("^(\\d{4})(\\d{4})$", "$1-$2");
|
||||
}
|
||||
} else if (formatLen >= 9 && formatLen <= 12) {
|
||||
if (crypt) {
|
||||
format = format.replaceAll("^(02.{0}|01.{1}|050.{1}|[0-9]{3})([0-9]+)([0-9]{4})$", "$1-****-$3");
|
||||
} else {
|
||||
format = format.replaceAll("^(02.{0}|01.{1}|050.{1}|[0-9]{3})([0-9]+)([0-9]{4})$", "$1-$2-$3");
|
||||
}
|
||||
} else {
|
||||
if (crypt) {
|
||||
format = format.replaceAll("^(\\d+)(\\d{2})$", "$1**");
|
||||
} else {
|
||||
// nothing..
|
||||
}
|
||||
}
|
||||
return format;
|
||||
}
|
||||
|
||||
public static String formatPhone(String value) {
|
||||
return StringUtil2.formatPhone(value, false);
|
||||
}
|
||||
|
||||
public static String formatJdNo(String value) {
|
||||
String format = null;
|
||||
if (StringUtil2.isEmpty(value)) {
|
||||
return format;
|
||||
}
|
||||
format = value.replaceAll("^(\\d{2})(\\d{4})(\\d{1})(\\d{5})(\\d{2})$", "$1-$2-$3-$4-$5");
|
||||
return format;
|
||||
}
|
||||
|
||||
public static String formatBalNo(String value) {
|
||||
String format = null;
|
||||
if (StringUtil2.isEmpty(value)) {
|
||||
return format;
|
||||
}
|
||||
format = value.replaceAll(" ", "");
|
||||
int formatLen = format.length();
|
||||
|
||||
if (formatLen == 11) {
|
||||
format = value.replaceAll("^(\\S{1})(\\S{1})(\\S{6})(\\S{3})$", "$1-$2-$3-$4");
|
||||
} else if (formatLen == 14) {
|
||||
format = value.replaceAll("^(\\S{1})(\\S{1})(\\S{6})(\\S{3})(\\S{3})$", "$1-$2-$3-$4-$5");
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
/**
|
||||
* 사업자등록번호
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static String formatBizNo(String value) {
|
||||
String format = null;
|
||||
if (StringUtil2.isEmpty(value)) {
|
||||
return format;
|
||||
}
|
||||
format = value.replaceAll("^(\\d{3})(\\d{2})(\\d{5})$", "$1-$2-$3");
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 사업자등록번호
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static String formatBirthNo(String value) {
|
||||
String format = null;
|
||||
if (StringUtil2.isEmpty(value)) {
|
||||
return format;
|
||||
}
|
||||
format = value.replaceAll("^(\\d{2})(\\d{2})(\\d{2})(\\d{1})$", "$1.$2.$3.$4");
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 법인번호
|
||||
*
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public static String formatBizIdNo(String value) {
|
||||
String format = null;
|
||||
if (StringUtil2.isEmpty(value)) {
|
||||
return format;
|
||||
}
|
||||
format = value.replaceAll("^(\\d{6})(\\d{7})$", "$1-$2");
|
||||
|
||||
return format;
|
||||
}
|
||||
|
||||
public static String formatAmount(String value, String pattern) {
|
||||
String format = null;
|
||||
if (StringUtil2.isNotEmpty(value)) {
|
||||
Double number = Double.parseDouble(value);
|
||||
DecimalFormat formatter = new DecimalFormat(pattern);
|
||||
format = formatter.format(number);
|
||||
}
|
||||
return format;
|
||||
}
|
||||
|
||||
public static String formatAmount(Object value, String pattern) {
|
||||
return StringUtil2.formatAmount(String.valueOf(value), pattern);
|
||||
}
|
||||
|
||||
public static String formatAmount(String value) {
|
||||
return StringUtil2.formatAmount(value, "#,###");
|
||||
}
|
||||
|
||||
public static String formatAmount(Object value) {
|
||||
return StringUtil2.formatAmount(String.valueOf(value));
|
||||
}
|
||||
|
||||
public static String formatFileSize(long fileSize) {
|
||||
if (fileSize <= 0) {
|
||||
return "0";
|
||||
}
|
||||
final String[] units = new String[] { "B", "kB", "MB", "GB", "TB" };
|
||||
int digitGroups = (int) (Math.log10(fileSize) / Math.log10(1024));
|
||||
return new DecimalFormat("#,##0.#").format(fileSize / Math.pow(1024, digitGroups)) + " " + units[digitGroups];
|
||||
}
|
||||
|
||||
/**
|
||||
* 문자열을 Byte로 (한글 중간에 안 짤리게) 자름
|
||||
*
|
||||
* @param str
|
||||
* @param len
|
||||
* @param encoding
|
||||
* @return
|
||||
*/
|
||||
public static String subByte(String str, int len, String encoding) {
|
||||
try {
|
||||
if (StringUtil2.isEmpty(str)) {
|
||||
return str;
|
||||
}
|
||||
byte[] strBytes = str.getBytes(encoding);
|
||||
int strLength = strBytes.length;
|
||||
int minusByteNum = 0;
|
||||
int offset = 0;
|
||||
int hangulByteNum = encoding.equals(CHARSET_UTF8) ? 3 : 2;
|
||||
if (strLength > len) {
|
||||
minusByteNum = 0;
|
||||
offset = len;
|
||||
for (int j = 0; j < offset; j++) {
|
||||
if ((strBytes[j] & 0x80) != 0) {
|
||||
minusByteNum++;
|
||||
}
|
||||
}
|
||||
if (minusByteNum % hangulByteNum != 0) {
|
||||
offset -= minusByteNum % hangulByteNum;
|
||||
}
|
||||
return new String(strBytes, 0, offset, encoding);
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new BaseException("Exception Occured");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 문자열을 Byte로 (한글 중간에 안 짤리게) 자름 - from-to
|
||||
*
|
||||
* @param str
|
||||
* @param len
|
||||
* @param encoding
|
||||
* @return
|
||||
*/
|
||||
public static String subByte(String str, int from, int len, String encoding) {
|
||||
try {
|
||||
if (StringUtil2.isEmpty(str)) {
|
||||
return str;
|
||||
}
|
||||
byte[] strBytes = str.getBytes(encoding);
|
||||
int strLength = strBytes.length;
|
||||
int minusByteNum = 0;
|
||||
int offset = 0;
|
||||
int hangulByteNum = encoding.equals(CHARSET_UTF8) ? 3 : 2;
|
||||
if (strLength > len) {
|
||||
minusByteNum = 0;
|
||||
offset = len;
|
||||
for (int j = 0; j < offset; j++) {
|
||||
if ((strBytes[j] & 0x80) != 0) {
|
||||
minusByteNum++;
|
||||
}
|
||||
}
|
||||
if (minusByteNum % hangulByteNum != 0) {
|
||||
offset -= minusByteNum % hangulByteNum;
|
||||
}
|
||||
return new String(strBytes, from, offset, encoding);
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new BaseException("Exception Occured");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 문자열을 Byte로 (한글 중간에 안 짤리게) 자름 (UTF-8)
|
||||
*
|
||||
* @param str
|
||||
* @param len
|
||||
* @return
|
||||
*/
|
||||
public static String subByte(String str, int len) {
|
||||
return StringUtil2.subByte(str, len, CHARSET_UTF8);
|
||||
}
|
||||
|
||||
/**
|
||||
* 문자열을 Byte로 (한글 중간에 안 짤리게) 자름 (EUC-KR)
|
||||
*
|
||||
* @param str
|
||||
* @param len
|
||||
* @return
|
||||
*/
|
||||
public static String subByteEucKr(String str, int len) {
|
||||
return StringUtil2.subByte(str, len, CHARSET_EUCKR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 숫자만 추출.
|
||||
*
|
||||
* @param 추출문자
|
||||
* @return
|
||||
*/
|
||||
public static String getOnlyNumber(String text) {
|
||||
Matcher m = Pattern.compile("[^0-9]").matcher(text);
|
||||
return m.replaceAll("");
|
||||
}
|
||||
|
||||
/**
|
||||
* 비밀번호 유효성 체크
|
||||
*
|
||||
* @param 비밀번호
|
||||
* @return
|
||||
*/
|
||||
public static String isEnablePassword(String passwd) {
|
||||
String returnValue = "";
|
||||
|
||||
Pattern p = Pattern.compile("^(?=.*[A-Za-z])(?=.*\\d)(?=.*[$@$!%*#?&])[A-Za-z\\d$@$!%*#?&]{8,12}$");
|
||||
Matcher m = p.matcher(passwd);
|
||||
|
||||
Pattern p2 = Pattern.compile("(\\w)\\1\\1");
|
||||
Matcher m2 = p2.matcher(passwd);
|
||||
|
||||
if (!m.find()) { // 정규식 이용한 패턴 체크
|
||||
returnValue = "비밀번호는 영문,숫자,특수문자(!@$%^&* 만 허용)를\n조합하여 8~12자로 구성하세요.";
|
||||
} else if (m2.find()) { // 동일 문자 4번 입력 시 패턴 체크
|
||||
returnValue = "비밀번호에 동일문자를 3번 이상 사용할 수 없습니다.";
|
||||
} else if (continueNumberCheck(passwd)) { // 비밀번호 연속 숫자 4자리 체크
|
||||
returnValue = "비밀번호에 연속된 문자를 3자 이상 사용 할 수 없습니다.";
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 연속된 숫자 체크
|
||||
*
|
||||
* @param numberCheck
|
||||
* @return
|
||||
*/
|
||||
public static boolean continueNumberCheck(String numberCheck) {
|
||||
int o = 0;
|
||||
int d = 0;
|
||||
int p = 0;
|
||||
int n = 0;
|
||||
int limit = 3;
|
||||
|
||||
for (int i = 0; i < numberCheck.length(); i++) {
|
||||
char tempVal = numberCheck.charAt(i);
|
||||
if (i > 0 && (p = o - tempVal) > -2 && p < 2 && (n = p == d ? n + 1 : 0) > limit - 3)
|
||||
return true;
|
||||
d = p;
|
||||
o = tempVal;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 문자열에 대해 XML/HTML PCDATA에 적합한 이스케이프 문자 변환 처리를 수행한 결과 문자열을 반환한다. 변환되는 문자는 아래와 같다.
|
||||
*
|
||||
* <pre>
|
||||
* & -> &
|
||||
* < -> <
|
||||
* > -> >
|
||||
* " -> "
|
||||
* ' -> '
|
||||
* </pre>
|
||||
*/
|
||||
public static String escapeXml(Object o) {
|
||||
if (o == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
StringWriter writer = new StringWriter();
|
||||
try {
|
||||
writeXmlText(writer, o.toString(), true);
|
||||
} catch (java.io.IOException e) { // this exception cannot be catched.
|
||||
System.out.println("escapeXml IOException Error");
|
||||
}
|
||||
|
||||
return writer.toString();
|
||||
}
|
||||
|
||||
public static void writeXmlText(Writer writer, String text) throws java.io.IOException {
|
||||
writeXmlText(writer, text, true, false, false);
|
||||
}
|
||||
|
||||
public static void writeXmlText(Writer writer, String text, boolean escapeXml) throws java.io.IOException {
|
||||
writeXmlText(writer, text, escapeXml, false, false);
|
||||
}
|
||||
|
||||
public static void writeXmlText(Writer writer, String text, boolean escapeXml, boolean applyBr) throws java.io.IOException {
|
||||
writeXmlText(writer, text, escapeXml, applyBr, false);
|
||||
}
|
||||
|
||||
public static void writeXmlText(Writer writer, String text, boolean escapeXml, boolean applyBr, boolean escapeNbsp) throws java.io.IOException {
|
||||
if (text == null) {
|
||||
// do nothing.
|
||||
} else if (!escapeXml && !applyBr) {
|
||||
writer.write(text);
|
||||
} else {
|
||||
writeXmlText(writer, text.toCharArray(), text.length(), escapeXml, applyBr, escapeNbsp);
|
||||
}
|
||||
}
|
||||
|
||||
public static void writeXmlText(Writer writer, char[] buffer, int length, boolean escapeXml, boolean applyBr, boolean escapeNbsp) throws java.io.IOException {
|
||||
int highest = HIGHEST_SPECIAL;
|
||||
int lowest = LOWEST_SPECIAL;
|
||||
int start = 0;
|
||||
int i = 0;
|
||||
char[][] representation = (escapeNbsp ? specialCharactersRepresentationWithNbsp : specialCharactersRepresentation);
|
||||
|
||||
if (applyBr) {
|
||||
lowest = LOWEST_BR;
|
||||
if (!escapeXml) {
|
||||
highest = HIGHEST_BR;
|
||||
}
|
||||
} else {
|
||||
if (!escapeXml) {
|
||||
i = length;
|
||||
}
|
||||
}
|
||||
|
||||
for (; i < length; i++) {
|
||||
char c = buffer[i];
|
||||
if (c <= highest && c >= lowest) {
|
||||
char[] escaped = representation[c];
|
||||
if (escaped != null) {
|
||||
// add unescaped portion
|
||||
if (start < i) {
|
||||
writer.write(buffer, start, i - start);
|
||||
}
|
||||
// add escaped xml
|
||||
writer.write(escaped);
|
||||
start = i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// add rest of unescaped portion
|
||||
if (start < length) {
|
||||
writer.write(buffer, start, length - start);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 문자열이 빈 문자열("")인지 확인하여, 빈 문자열("")이 아니면 주어진 문자열을 그대로 반환하고, 빈 문자열("")이면 <tt>defaultValue</tt>를 반환한다.
|
||||
*
|
||||
* @param value
|
||||
* @param defaultValue
|
||||
* @return String
|
||||
*/
|
||||
public static String nvl(String value, String defaultValue) {
|
||||
return coalesce(value, defaultValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 주어진 문자열이 <tt>null</tt>인지 확인하여, <tt>null</tt>이 아니면 주어진 문자열을 그대로 반환하고, <tt>null</tt>이면 빈 문자열("")을 반환한다.
|
||||
*
|
||||
* @param value
|
||||
* @return String
|
||||
*/
|
||||
public static String nvl(String value) {
|
||||
return coalesce(value, "");
|
||||
}
|
||||
|
||||
private static String coalesce(String value, String defaultValue) {
|
||||
if (isEmpty(value)) {
|
||||
return defaultValue;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
// 단문 장문 byte 체크
|
||||
String smsTxt = "[한국저작권위원회] 신청하신 분쟁조정 접수내역에 보완이 필요합니다.\r\n"
|
||||
+ "[한국저작권위원회 adr.copyright.or.kr 마이페이지]에서 확인해주시기 바랍니다.";
|
||||
String smsTxt2 = "[한한한한한한한국저작권위원회] 신청하신 분쟁조정 접수내역에 보완이 필요합니다.\r\n"
|
||||
+ "[해주시기 바랍랍니니다.";
|
||||
int bytes = smsTxt2.getBytes("euc-kr").length;
|
||||
System.out.println("1 bytes: " + bytes);
|
||||
|
||||
String reqStr = "K0422G111202007085000020030012ECREDI 202007081543010000 1(심)다인우 60781395901801110774847K201202000493 003IT금융개발부 90000001000000002020070720210706";
|
||||
int bdyLength = 250;
|
||||
int fieldLength = 10;
|
||||
|
||||
}
|
||||
|
||||
public static String extractLogMethodNm(
|
||||
String p_url
|
||||
) throws Exception{
|
||||
if(p_url.contains(";JSESSIONID")) {
|
||||
p_url = p_url.substring(0, p_url.indexOf(";JSESSIONID"));
|
||||
}else if (p_url.contains(";jsessionid")){
|
||||
p_url = p_url.substring(0, p_url.indexOf(";jsessionid"));
|
||||
}
|
||||
String[] s_arr = p_url.split("/");
|
||||
|
||||
if (s_arr.length>=3) {
|
||||
return s_arr[s_arr.length-3]+"/"+s_arr[s_arr.length-2]+"/"+s_arr[s_arr.length-1];
|
||||
}
|
||||
|
||||
return p_url;
|
||||
}
|
||||
|
||||
}
|
||||
97
src/main/java/kcc/com/cmm/util/TokenUtil.java
Normal file
97
src/main/java/kcc/com/cmm/util/TokenUtil.java
Normal file
@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Copyright 2008-2009 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.
|
||||
*/
|
||||
package kcc.com.cmm.util;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import egovframework.rte.fdl.idgnr.impl.Base64;
|
||||
|
||||
public class TokenUtil {
|
||||
|
||||
private static final String TOKEN_KEY = "TOKEN_KEY";
|
||||
private static final Logger logger = Logger.getLogger(TokenUtil.class.getName());
|
||||
|
||||
/**
|
||||
* 로직처리를 위해 세션과 request에 Token 생성
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
public static void saveToken(HttpServletRequest request) {
|
||||
HttpSession session = request.getSession(true);
|
||||
long systemTime = System.currentTimeMillis();
|
||||
byte[] time = new Long(systemTime).toString().getBytes();
|
||||
byte[] id = session.getId().getBytes();
|
||||
|
||||
try {
|
||||
MessageDigest SHA = MessageDigest.getInstance("SHA-256");
|
||||
SHA.update(id);
|
||||
SHA.update(time);
|
||||
|
||||
String token = Base64.encode(SHA.digest());
|
||||
request.setAttribute(TOKEN_KEY, token);
|
||||
session.setAttribute(TOKEN_KEY, token);
|
||||
|
||||
logger.error("#########################################################################");
|
||||
logger.error("# Generate Token Key Value = " + token + " #");
|
||||
logger.error("#########################################################################");
|
||||
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
System.out.println("NoSuchAlgorithmException Occured!!!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 로직처리 이후 중복방지를 위해 세션의 Token 초기화
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
public static void resetToken(HttpServletRequest request) {
|
||||
HttpSession session = request.getSession(true);
|
||||
|
||||
try {
|
||||
session.removeAttribute(TOKEN_KEY);
|
||||
} catch (Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 세션과 request의 Token이 동일한지 비교
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public static boolean isTokenValid(HttpServletRequest request) {
|
||||
HttpSession session = request.getSession(true);
|
||||
String requestToken = request.getParameter(TOKEN_KEY);
|
||||
String sessionToken = (String) session.getAttribute(TOKEN_KEY);
|
||||
|
||||
if (requestToken == null || sessionToken == null) {
|
||||
logger.error("# null #");
|
||||
return false;
|
||||
} else {
|
||||
logger.error("# notnull #");
|
||||
return requestToken.equals(sessionToken);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
65
src/main/java/kcc/com/cmm/util/WebUtil.java
Normal file
65
src/main/java/kcc/com/cmm/util/WebUtil.java
Normal file
@ -0,0 +1,65 @@
|
||||
package kcc.com.cmm.util;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class WebUtil {
|
||||
|
||||
|
||||
/**
|
||||
* MD5
|
||||
* @return
|
||||
*/
|
||||
public String convertToHex(byte[] data ){
|
||||
StringBuffer buf = new StringBuffer();
|
||||
|
||||
for( int i=0; i< data.length; i++){
|
||||
int halfbyte = (data[i] >>> 4 ) & 0x0F;
|
||||
int two_halfs =0;
|
||||
|
||||
do{
|
||||
if((0 <= halfbyte) && (halfbyte <= 9))
|
||||
buf.append((char)('0' + halfbyte));
|
||||
else
|
||||
buf.append((char)('a' + ( halfbyte - 10)));
|
||||
halfbyte =data[i] & 0x0F;
|
||||
|
||||
}while(two_halfs++ < 1);
|
||||
}
|
||||
|
||||
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
//private static String MD5(String text ) throws NoSuchAlgorithmException, UnsupportedEncodingExecption {
|
||||
public String MD5(String text ) throws NoSuchAlgorithmException, UnsupportedEncodingException {
|
||||
MessageDigest md;
|
||||
//md = MessageDigest.getInstance("MD5");
|
||||
try {
|
||||
// 2021.11.24 보안점검 후속조치 암호화 알고리즘 변경(MD5 -> SHA-256)
|
||||
//md = MessageDigest.getInstance("MD5");
|
||||
md = MessageDigest.getInstance("SHA-256");
|
||||
} catch (NoSuchAlgorithmException nsae) {
|
||||
//throw new InternalError("MD5 not supported");
|
||||
throw new InternalError("SHA-256 not supported");
|
||||
}
|
||||
|
||||
byte[] md5hash=new byte[32];
|
||||
md.update(text.getBytes("iso-8859-1"),0,text.length());
|
||||
md5hash=md.digest();
|
||||
return convertToHex(md5hash);
|
||||
}
|
||||
|
||||
public boolean isMobile(HttpServletRequest request){
|
||||
String userAgent = request.getHeader("user-agent");
|
||||
boolean mobile1 = userAgent.matches(".*(iPhone|iPod|Android|Windows CE|BlackBerry|Symbian|Windows Phone|webOS|Opera Mini|Opera Mobi|POLARIS|IEMobile|lgtelecom|nokia|SonyEricsson).*");
|
||||
boolean mobile2 = userAgent.matches(".*(LG|SAMSUNG|Samsung).*");
|
||||
if(mobile1 || mobile2) { return true; }
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
22
src/main/java/kcc/com/cmm/web/EgovBindingInitializer.java
Normal file
22
src/main/java/kcc/com/cmm/web/EgovBindingInitializer.java
Normal file
@ -0,0 +1,22 @@
|
||||
package kcc.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 {
|
||||
|
||||
@Override
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
125
src/main/java/kcc/com/cmm/web/EgovComUtlController.java
Normal file
125
src/main/java/kcc/com/cmm/web/EgovComUtlController.java
Normal file
@ -0,0 +1,125 @@
|
||||
package kcc.com.cmm.web;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import egovframework.rte.fdl.property.EgovPropertyService;
|
||||
import kcc.com.cmm.util.RedirectUrlMaker;
|
||||
|
||||
/**
|
||||
* 공통유틸리티성 작업을 위한 Controller 클래스
|
||||
* @author 공통 서비스 개발팀 JJY
|
||||
* @since 2009.03.02
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.03.02 JJY 최초 생성
|
||||
* 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Controller
|
||||
public class EgovComUtlController {
|
||||
|
||||
/** EgovPropertyService */
|
||||
@Resource(name = "propertiesService")
|
||||
protected EgovPropertyService propertiesService;
|
||||
|
||||
/**
|
||||
* JSP 호출작업만 처리하는 공통 함수
|
||||
*/
|
||||
@RequestMapping(value = "/EgovPageLink.do")
|
||||
public String moveToPage(@RequestParam("link") String linkPage, HttpSession session,
|
||||
@RequestParam(value = "baseMenuNo", required = false) String baseMenuNo,
|
||||
@RequestParam(value = "baseMenuNm", required = false) String baseMenuNm,
|
||||
Model model , HttpServletRequest request ) {
|
||||
String link = linkPage;
|
||||
// service 사용하여 리턴할 결과값 처리하는 부분은 생략하고 단순 페이지 링크만 처리함
|
||||
if (linkPage == null || linkPage.equals("")) {
|
||||
link = "cmm/egovError";
|
||||
} else {
|
||||
if (link.indexOf(",") > -1) {
|
||||
link = link.substring(0, link.indexOf(","));
|
||||
}
|
||||
}
|
||||
// 선택된 메뉴정보를 세션으로 등록한다.
|
||||
if (baseMenuNo != null && !baseMenuNo.equals("") && !baseMenuNo.equals("null")) {
|
||||
session.setAttribute("baseMenuNo", baseMenuNo);
|
||||
}else if(null != request.getAttribute("baseMenuNo")){
|
||||
session.setAttribute("baseMenuNo", (String)request.getAttribute("baseMenuNo"));
|
||||
}
|
||||
// 선택된 메뉴정보를 상단 이름을 세션으로 등록한다.
|
||||
if (baseMenuNm != null && !baseMenuNm.equals("") && !baseMenuNm.equals("null")) {
|
||||
session.setAttribute("baseMenuNm", baseMenuNm);
|
||||
}else if(null != request.getAttribute("baseMenuNm")){
|
||||
session.setAttribute("baseMenuNm", (String)request.getAttribute("baseMenuNm"));
|
||||
}
|
||||
|
||||
if(request.getRequestURI().contains("/WEB-INF/jsp/main/EgovMainView.jsp")){//메인페이지일 경우, 상단 버튼 색상 default로, 이름을
|
||||
session.setAttribute("baseMenuNo", null);
|
||||
session.setAttribute("baseMenuNm", "사이트관리");
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
||||
/**
|
||||
* JSP 호출작업만 처리하는 공통 함수
|
||||
*/
|
||||
@RequestMapping(value = "/EgovPageLink.action")
|
||||
public String moveToPage_action(@RequestParam("link") String linkPage) {
|
||||
String link = linkPage;
|
||||
// service 사용하여 리턴할 결과값 처리하는 부분은 생략하고 단순 페이지 링크만 처리함
|
||||
if (linkPage == null || linkPage.equals("")) {
|
||||
link = "cmm/egovError";
|
||||
}
|
||||
return link;
|
||||
}
|
||||
|
||||
/**
|
||||
* validation rule dynamic java script
|
||||
*/
|
||||
@RequestMapping("/validator.do")
|
||||
public String validate() {
|
||||
return "cmm/validator";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 상단 링크시 파라미터 삭제 후 페이지 호출
|
||||
*/
|
||||
@RequestMapping(value = "/EgovTopPageLink.do")
|
||||
public String EgovTopPageLink(@RequestParam(value = "link", required = false) String linkPage , @RequestParam(value = "baseMenuNo", required = false) String baseMenuNo ,
|
||||
ModelMap model, RedirectAttributes redirectAttributes, HttpServletRequest req, HttpSession session)
|
||||
throws Exception{
|
||||
String link = linkPage;
|
||||
// service 사용하여 리턴할 결과값 처리하는 부분은 생략하고 단순 페이지 링크만 처리함
|
||||
if (linkPage == null || linkPage.equals("")) {
|
||||
link = "cmm/egovError";
|
||||
}
|
||||
|
||||
//linkPage = linkPage+"?baseMenuNo=" + baseMenuNo ;
|
||||
redirectAttributes.addFlashAttribute("baseMenuNo", baseMenuNo); //파라미터숨기기
|
||||
req.setAttribute("baseMenuNo", baseMenuNo);
|
||||
if(req.getAttribute("baseMenuNo") != null) {
|
||||
session.setAttribute("baseMenuNo", (String)req.getAttribute("baseMenuNo"));
|
||||
}
|
||||
|
||||
RedirectUrlMaker redirectUrlMaker = new RedirectUrlMaker(link);
|
||||
return redirectUrlMaker.getRedirectUrl();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
473
src/main/java/kcc/com/cmm/web/EgovFileDownloadController.java
Normal file
473
src/main/java/kcc/com/cmm/web/EgovFileDownloadController.java
Normal file
@ -0,0 +1,473 @@
|
||||
package kcc.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 javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import kcc.com.cmm.service.EgovFileMngService;
|
||||
import kcc.com.cmm.service.FileVO;
|
||||
|
||||
/**
|
||||
* 파일 다운로드를 위한 컨트롤러 클래스
|
||||
* @author 공통서비스개발팀 이삼섭
|
||||
* @since 2009.06.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.3.25 이삼섭 최초 생성
|
||||
*
|
||||
* Copyright (C) 2009 by MOPAS All right reserved.
|
||||
* </pre>
|
||||
*/
|
||||
@Controller
|
||||
public class EgovFileDownloadController {
|
||||
|
||||
@Resource(name = "EgovFileMngService")
|
||||
private EgovFileMngService fileService;
|
||||
|
||||
@Value("#{globalSettings['Globals.pdf.makepath.out']}")
|
||||
private String pdfMakepathOut; //c:/usr/local/tomcat/file/sht/out
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovFileDownloadController.class);
|
||||
|
||||
@Value("#{globalSettings['pdf.filePath']}")
|
||||
private String pdfFilePath;
|
||||
|
||||
/**
|
||||
* 브라우저 구분 얻기.
|
||||
*
|
||||
* @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 RuntimeException("Not supported browser");
|
||||
throw new IOException("Not supported browser");
|
||||
}
|
||||
|
||||
// response.setHeader("Content-Disposition", dispositionPrefix + encodedFilename); // 파일명에 콤마 포함시 오류
|
||||
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);
|
||||
if(fvo == null){
|
||||
response.setContentType("application/x-msdownload");
|
||||
PrintWriter printwriter = response.getWriter();
|
||||
printwriter.println("<html>");
|
||||
printwriter.println("<br><br><br><h2>Could not get file name:<br></h2>");
|
||||
printwriter.println("<br><br><br><center><h3><a href='javascript: history.go(-1)'>Back</a></h3></center>");
|
||||
printwriter.println("<br><br><br>© webAccess");
|
||||
printwriter.println("</html>");
|
||||
printwriter.flush();
|
||||
printwriter.close();
|
||||
return ;
|
||||
}
|
||||
|
||||
File uFile = new File(fvo.getFileStreCours(), fvo.getStreFileNm());
|
||||
long fSize = uFile.length();
|
||||
|
||||
if (fSize > 0) {
|
||||
String mimetype = "application/x-msdownload";
|
||||
|
||||
response.setContentType(mimetype);
|
||||
setDisposition(fvo.getOrignlFileNm(), request, response);
|
||||
//response.setContentLength(fSize);
|
||||
|
||||
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 (Exception ex) {
|
||||
LOGGER.debug("IGNORED: {}", ex.getMessage());
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
if (out != null) {
|
||||
try {
|
||||
out.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
response.setContentType("application/x-msdownload");
|
||||
|
||||
PrintWriter printwriter = response.getWriter();
|
||||
printwriter.println("<html>");
|
||||
printwriter.println("<br><br><br><h2>Could not get file name:<br>" + fvo.getOrignlFileNm() + "</h2>");
|
||||
printwriter.println("<br><br><br><center><h3><a href='javascript: history.go(-1)'>Back</a></h3></center>");
|
||||
printwriter.println("<br><br><br>© webAccess");
|
||||
printwriter.println("</html>");
|
||||
printwriter.flush();
|
||||
printwriter.close();
|
||||
}
|
||||
/*}*/
|
||||
}
|
||||
|
||||
/**
|
||||
* 다이렉트 경로 파일 다운로드를 제공한다.
|
||||
*
|
||||
* @param commandMap
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/cmm/fms/FileDownD.do")
|
||||
public void cvplFileDownloadD(
|
||||
@RequestParam Map<String, Object> commandMap
|
||||
, HttpServletRequest request
|
||||
, HttpServletResponse response
|
||||
) throws Exception {
|
||||
|
||||
String s_path = (String) commandMap.get("path");
|
||||
String s_file = (String) commandMap.get("file");
|
||||
|
||||
File uFile = new File(pdfMakepathOut + "/" + s_path, s_file);
|
||||
|
||||
String mimetype = "application/x-msdownload";
|
||||
|
||||
response.setContentType(mimetype);
|
||||
setDisposition(s_file, request, response);
|
||||
//response.setContentLength(fSize);
|
||||
|
||||
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 (Exception ex) {
|
||||
LOGGER.debug("IGNORED: {}", ex.getMessage());
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
if (out != null) {
|
||||
try {
|
||||
out.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 첨부파일로 등록된 PDF파일을 미리보기 한다.
|
||||
*
|
||||
* @param commandMap
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/cmm/fms/pdfView.do")
|
||||
public void pdfView(@RequestParam Map<String, Object> commandMap, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
String atchFileId = (String) commandMap.get("atchFileId");
|
||||
String fileSn = (String) commandMap.get("fileSn");
|
||||
FileVO fileVO = new FileVO();
|
||||
fileVO.setAtchFileId(atchFileId);
|
||||
fileVO.setFileSn(fileSn);
|
||||
FileVO fvo = fileService.selectFileInf(fileVO);
|
||||
if(fvo == null){
|
||||
response.setContentType("application/x-msdownload");
|
||||
PrintWriter printwriter = response.getWriter();
|
||||
printwriter.println("<html>");
|
||||
printwriter.println("<br><br><br><h2>Could not get file name:<br></h2>");
|
||||
printwriter.println("<br><br><br><center><h3><a href='javascript: history.go(-1)'>Back</a></h3></center>");
|
||||
printwriter.println("<br><br><br>© webAccess");
|
||||
printwriter.println("</html>");
|
||||
printwriter.flush();
|
||||
printwriter.close();
|
||||
return ;
|
||||
}
|
||||
|
||||
FileInputStream fis = null;
|
||||
BufferedOutputStream bos = null;
|
||||
try{
|
||||
/* String pdfFileName = "C:/upload/TEST.pdf";
|
||||
File pdfFile = new File(pdfFileName);*/
|
||||
|
||||
File pdfFile = new File(fvo.getFileStreCours(), fvo.getStreFileNm());
|
||||
|
||||
//클라이언트 브라우져에서 바로 보는 방법(헤더 변경)
|
||||
response.setContentType("application/pdf");
|
||||
//★ 이 구문이 있으면 [다운로드], 이 구문이 없다면 바로 target 지정된 곳에 view 해줍니다.
|
||||
//response.addHeader("Content-Disposition", "attachment; filename="+pdfFile.getName()+".pdf");
|
||||
//파일 읽고 쓰는 건 일반적인 Write방식이랑 동일합니다. 다만 reponse 출력 스트림 객체에 write.
|
||||
fis = new FileInputStream(pdfFile);
|
||||
int size = fis.available(); //지정 파일에서 읽을 수 있는 바이트 수를 반환
|
||||
byte[] buf = new byte[size]; //버퍼설정
|
||||
int readCount = fis.read(buf);
|
||||
response.flushBuffer();
|
||||
bos = new BufferedOutputStream(response.getOutputStream());
|
||||
bos.write(buf, 0, readCount);
|
||||
bos.flush();
|
||||
} catch(Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
} finally {
|
||||
try{
|
||||
if (fis != null) fis.close(); //close는 꼭! 반드시!
|
||||
if (bos != null) bos.close();
|
||||
} catch (IOException e) {
|
||||
System.out.println("IOException Occured!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 첨부파일로 등록된 PDF파일을 미리보기 한다.
|
||||
*
|
||||
* @param commandMap
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/cmm/fms/attachFilePreview.do")
|
||||
public void contentPreview(@RequestParam Map<String, Object> commandMap, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
String atchFileId = (String) commandMap.get("atchFileId");
|
||||
String atchFileType = (String) commandMap.get("atchFileType");
|
||||
String fileSn = (String) commandMap.get("fileSn");
|
||||
FileVO fileVO = new FileVO();
|
||||
fileVO.setAtchFileId(atchFileId);
|
||||
fileVO.setFileSn(fileSn);
|
||||
FileVO fvo = fileService.selectFileInf(fileVO);
|
||||
if(fvo == null){
|
||||
response.setContentType("application/x-msdownload");
|
||||
PrintWriter printwriter = response.getWriter();
|
||||
printwriter.println("<html>");
|
||||
printwriter.println("<br><br><br><h2>Could not get file name:<br></h2>");
|
||||
printwriter.println("<br><br><br><center><h3><a href='javascript: history.go(-1)'>Back</a></h3></center>");
|
||||
printwriter.println("<br><br><br>© webAccess");
|
||||
printwriter.println("</html>");
|
||||
printwriter.flush();
|
||||
printwriter.close();
|
||||
return ;
|
||||
}
|
||||
|
||||
FileInputStream fis = null;
|
||||
BufferedOutputStream bos = null;
|
||||
try{
|
||||
/* String pdfFileName = "C:/upload/TEST.pdf";
|
||||
File pdfFile = new File(pdfFileName);*/
|
||||
File attachFile = new File(fvo.getFileStreCours(), fvo.getStreFileNm());
|
||||
|
||||
/*text/html
|
||||
audio/mpeg
|
||||
image/bmp
|
||||
image/jpeg
|
||||
application/pdf
|
||||
application/java
|
||||
application/jar
|
||||
application/x-zip
|
||||
application/msword
|
||||
application/msaccess
|
||||
application/vnd.ms-excel
|
||||
application/vnd.ms-powerpoint
|
||||
application/octet-stream*/
|
||||
|
||||
if(atchFileType.equalsIgnoreCase("pdf")){
|
||||
atchFileType = "application/pdf" ;
|
||||
}else if(atchFileType.equalsIgnoreCase("xls")) {
|
||||
atchFileType = "application/vnd.ms-excel" ;
|
||||
}else if(atchFileType.equalsIgnoreCase("word")) {
|
||||
atchFileType = "application/msword" ;
|
||||
}else if(atchFileType.equalsIgnoreCase("ppt")) {
|
||||
atchFileType = "application/vnd.ms-powerpoint" ;
|
||||
}else if(atchFileType.equalsIgnoreCase("jpg")) {
|
||||
atchFileType = "image/jpeg" ;
|
||||
}else if(atchFileType.equalsIgnoreCase("gif")) {
|
||||
atchFileType = "image/gif" ;
|
||||
}else if(atchFileType.equalsIgnoreCase("png")) {
|
||||
atchFileType = "image/png" ;
|
||||
}else if(atchFileType.equalsIgnoreCase("bmp")) {
|
||||
atchFileType = "image/bmp" ;
|
||||
}
|
||||
//클라이언트 브라우져에서 바로 보는 방법(헤더 변경)
|
||||
//response.setContentType("application/pdf");
|
||||
response.setContentType(atchFileType);
|
||||
//★ 이 구문이 있으면 [다운로드], 이 구문이 없다면 바로 target 지정된 곳에 view 해줍니다.
|
||||
//response.addHeader("Content-Disposition", "attachment; filename="+pdfFile.getName()+".pdf");
|
||||
//파일 읽고 쓰는 건 일반적인 Write방식이랑 동일합니다. 다만 reponse 출력 스트림 객체에 write.
|
||||
fis = new FileInputStream(attachFile);
|
||||
int size = fis.available(); //지정 파일에서 읽을 수 있는 바이트 수를 반환
|
||||
byte[] buf = new byte[size]; //버퍼설정
|
||||
int readCount = fis.read(buf);
|
||||
response.flushBuffer();
|
||||
bos = new BufferedOutputStream(response.getOutputStream());
|
||||
bos.write(buf, 0, readCount);
|
||||
bos.flush();
|
||||
} catch(Exception e) {
|
||||
System.out.println("Exception Occured!!!");
|
||||
} finally {
|
||||
try{
|
||||
if (fis != null) fis.close(); //close는 꼭! 반드시!
|
||||
if (bos != null) bos.close();
|
||||
} catch (IOException e) {
|
||||
System.out.println("IOException Occured!!!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* pdf 변환 다이렉트 경로 파일 다운로드를 제공한다.
|
||||
*
|
||||
* @param commandMap
|
||||
* @param response
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping(value = "/cmm/fms/FileDownPdf.do")
|
||||
public void FileDownPdf(
|
||||
@RequestParam Map<String, Object> commandMap
|
||||
, HttpServletRequest request
|
||||
, HttpServletResponse response
|
||||
) throws Exception {
|
||||
|
||||
String s_path = (String) commandMap.get("path");
|
||||
String s_file = (String) commandMap.get("file");
|
||||
|
||||
File uFile = new File(pdfFilePath + "/resultFile/", s_file);
|
||||
|
||||
String mimetype = "application/x-msdownload";
|
||||
|
||||
response.setContentType(mimetype);
|
||||
setDisposition(s_file, request, response);
|
||||
//response.setContentLength(fSize);
|
||||
|
||||
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 (Exception ex) {
|
||||
LOGGER.debug("IGNORED: {}", ex.getMessage());
|
||||
} finally {
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
if (out != null) {
|
||||
try {
|
||||
out.close();
|
||||
} catch (Exception ignore) {
|
||||
LOGGER.debug("IGNORED: {}", ignore.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
293
src/main/java/kcc/com/cmm/web/EgovFileMngController.java
Normal file
293
src/main/java/kcc/com/cmm/web/EgovFileMngController.java
Normal file
@ -0,0 +1,293 @@
|
||||
package kcc.com.cmm.web;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
|
||||
import kcc.com.cmm.service.EgovFileMngService;
|
||||
import kcc.com.cmm.service.FileVO;
|
||||
|
||||
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.03.25 이삼섭 최초 생성
|
||||
* 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성
|
||||
*
|
||||
* </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 "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, 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);
|
||||
if(commandMap.get("img_view") !=null){
|
||||
model.addAttribute("img_view", (String)commandMap.get("img_view"));
|
||||
}
|
||||
if(commandMap.get("img_view_w") !=null){
|
||||
model.addAttribute("img_view_w", (String)commandMap.get("img_view_w"));
|
||||
}
|
||||
if(commandMap.get("img_view_h") !=null){
|
||||
model.addAttribute("img_view_h", (String)commandMap.get("img_view_h"));
|
||||
}
|
||||
|
||||
model.addAttribute("commandMap", commandMap);
|
||||
return "cmm/fms/EgovFileList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 첨부파일에 대한 삭제를 처리한다.
|
||||
*
|
||||
* @param fileVO
|
||||
* @param returnUrl
|
||||
* @param sessionVO
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/cmm/fms/deleteFileInfs1.do")
|
||||
public String deleteFileInf1(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam("returnUrl") String returnUrl, HttpServletRequest request, ModelMap model)
|
||||
throws Exception {
|
||||
|
||||
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
|
||||
if (isAuthenticated) {
|
||||
fileService.deleteFileInf(fileVO);
|
||||
}
|
||||
|
||||
return "blank";
|
||||
|
||||
//--------------------------------------------
|
||||
// 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;
|
||||
}*/
|
||||
////------------------------------------------
|
||||
}
|
||||
|
||||
@RequestMapping("/cmm/fms/deleteFileInfs.do")
|
||||
public String deleteFileInf(@ModelAttribute("searchVO") FileVO fileVO , HttpServletRequest request, ModelMap model )
|
||||
throws Exception {
|
||||
|
||||
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
|
||||
// 휴대폰 인증 유무 확인 필요
|
||||
boolean authYn = true;
|
||||
boolean delete = false;
|
||||
if (isAuthenticated || authYn) {
|
||||
FileVO delFileVO =fileService.selectFileInf(fileVO) ; //실제파일삭제
|
||||
if(delFileVO !=null){
|
||||
String fileStreCours = delFileVO.getFileStreCours();
|
||||
String streFileNm = delFileVO.getStreFileNm();
|
||||
File delFile = new File(fileStreCours+streFileNm);
|
||||
delete = delFile.delete();
|
||||
}
|
||||
fileService.deleteFileInf(fileVO);
|
||||
}
|
||||
return "blank";
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시판 첨부파일에 대한 목록을 조회한다.
|
||||
*
|
||||
* @param fileVO
|
||||
* @param commandMap
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/cmm/fms/selectBBSFileInfs.do")
|
||||
public String selectBBSFileInfs(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
|
||||
String atchFileId = (String) commandMap.get("param_atchFileId");
|
||||
String pdfView = (String) commandMap.get("pdf_view"); //'Y' 이면 pdf 직접 보여주기
|
||||
|
||||
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);
|
||||
if("Y".equals(pdfView)){
|
||||
model.addAttribute("pdfView", pdfView);
|
||||
}
|
||||
|
||||
return "cmm/fms/EgovBBSFileList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시판 첨부파일 변경을 위한 수정페이지로 이동한다.
|
||||
*
|
||||
* @param fileVO
|
||||
* @param commandMap
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/cmm/fms/selectBBSFileInfsForUpdate.do")
|
||||
public String selectBBSFileInfsForUpdate(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
|
||||
|
||||
String atchFileId = (String) commandMap.get("param_atchFileId");
|
||||
boolean isImgView = (boolean) (commandMap.get("isImgView") != null ?
|
||||
Boolean.parseBoolean((String)commandMap.get("isImgView")) : false);
|
||||
|
||||
fileVO.setAtchFileId(atchFileId);
|
||||
|
||||
List<FileVO> result = fileService.selectFileInfs(fileVO);
|
||||
|
||||
model.addAttribute("fileList", result);
|
||||
model.addAttribute("updateFlag", "Y");
|
||||
model.addAttribute("isImgView", isImgView);
|
||||
model.addAttribute("fileListCnt", result.size());
|
||||
model.addAttribute("atchFileId", atchFileId);
|
||||
|
||||
return "cmm/fms/EgovBBSFileList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 게시판 첨부파일에 대한 삭제를 처리한다.
|
||||
*
|
||||
* @param fileVO
|
||||
* @param returnUrl
|
||||
* @param request
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/cmm/fms/deleteBBSFileInfs.do")
|
||||
public String deleteBBSFileInfs(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam("returnUrl") String returnUrl, HttpServletRequest request, ModelMap model)
|
||||
throws Exception {
|
||||
|
||||
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
|
||||
|
||||
if (isAuthenticated) {
|
||||
fileService.deleteFileInf(fileVO);
|
||||
}
|
||||
|
||||
return "blank";
|
||||
}
|
||||
|
||||
/**
|
||||
* 이미지 첨부파일에 대한 목록을 조회한다.
|
||||
*
|
||||
* @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, ModelMap model) throws Exception {
|
||||
|
||||
String atchFileId = (String) commandMap.get("atchFileId");
|
||||
|
||||
fileVO.setAtchFileId(atchFileId);
|
||||
List<FileVO> result = fileService.selectImageFileList(fileVO);
|
||||
|
||||
model.addAttribute("fileList", result);
|
||||
|
||||
return "cmm/fms/EgovImgFileList";
|
||||
}
|
||||
|
||||
/**
|
||||
* (사용자)이미지 첨부파일에 대한 목록을 조회한다.
|
||||
*
|
||||
* @param fileVO
|
||||
* @param atchFileId
|
||||
* @param sessionVO
|
||||
* @param model
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/cmm/fms/selectImageFileInfsWeb.do")
|
||||
public String selectImageFileInfsWeb(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam Map<String, Object> commandMap, ModelMap model) throws Exception {
|
||||
|
||||
String atchFileId = (String) commandMap.get("atchFileId");
|
||||
|
||||
fileVO.setAtchFileId(atchFileId);
|
||||
List<FileVO> result = fileService.selectImageFileList(fileVO);
|
||||
|
||||
model.addAttribute("fileList", result);
|
||||
|
||||
return "cmm/fms/EgovImgFileListWeb";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
155
src/main/java/kcc/com/cmm/web/EgovImageProcessController.java
Normal file
155
src/main/java/kcc/com/cmm/web/EgovImageProcessController.java
Normal file
@ -0,0 +1,155 @@
|
||||
package kcc.com.cmm.web;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.util.Map;
|
||||
|
||||
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;
|
||||
|
||||
import kcc.com.cmm.SessionVO;
|
||||
import kcc.com.cmm.service.EgovFileMngService;
|
||||
import kcc.com.cmm.service.FileVO;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovImageProcessController.java
|
||||
* @Description :
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 4. 2. 이삼섭
|
||||
* 2011.08.31. JJY 경량환경 템플릿 커스터마이징버전 생성
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
@SuppressWarnings("resource")
|
||||
@RequestMapping("/cmm/fms/getImage.do")
|
||||
public void getImageInf(SessionVO sessionVO, ModelMap model, @RequestParam Map<String, Object> commandMap, HttpServletResponse response) throws Exception {
|
||||
|
||||
String atchFileId = (String) commandMap.get("atchFileId");
|
||||
String fileSn = (String) commandMap.get("fileSn");
|
||||
String isThumbFile = (String) commandMap.get("isThumbFile");
|
||||
|
||||
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 fileNm = fvo.getStreFileNm();
|
||||
// 섬네일 이미지 경우
|
||||
if (isThumbFile != null && ("thumbFile").equals(isThumbFile) && fvo.getThumbFileNm() != null) {
|
||||
fileNm = fvo.getThumbFileNm();
|
||||
}
|
||||
|
||||
File file = new File(fvo.getFileStreCours(), fileNm);
|
||||
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
new FileInputStream(file);
|
||||
}catch(Exception e) {}
|
||||
|
||||
BufferedInputStream in = null;
|
||||
ByteArrayOutputStream bStream = null;
|
||||
try {
|
||||
fis = new FileInputStream(file);
|
||||
in = new BufferedInputStream(fis);
|
||||
bStream = new ByteArrayOutputStream();
|
||||
int imgByte;
|
||||
/*while ((imgByte = in.read()) != -1) {
|
||||
bStream.write(imgByte);
|
||||
}*/
|
||||
|
||||
byte[] outputByte=new byte[104096];
|
||||
while ((imgByte =in.read(outputByte, 0, 4096 )) > 0 ) {
|
||||
bStream.write(outputByte,0,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();
|
||||
|
||||
} catch (Exception e) {
|
||||
LOGGER.debug("{}", e);
|
||||
} finally {
|
||||
if (bStream != null) {
|
||||
try {
|
||||
bStream.close();
|
||||
} catch (Exception est) {
|
||||
LOGGER.debug("IGNORED: {}", est.getMessage());
|
||||
}
|
||||
}
|
||||
if (in != null) {
|
||||
try {
|
||||
in.close();
|
||||
} catch (Exception ei) {
|
||||
LOGGER.debug("IGNORED: {}", ei.getMessage());
|
||||
}
|
||||
}
|
||||
if (fis != null) {
|
||||
try {
|
||||
fis.close();
|
||||
} catch (Exception efis) {
|
||||
LOGGER.debug("IGNORED: {}", efis.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
125
src/main/java/kcc/com/cmm/web/EgovMultipartResolver.java
Normal file
125
src/main/java/kcc/com/cmm/web/EgovMultipartResolver.java
Normal file
@ -0,0 +1,125 @@
|
||||
package kcc.com.cmm.web;
|
||||
|
||||
/*
|
||||
* Copyright 2001-2006 The Apache Software Foundation.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the ";License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS"; BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
|
||||
import org.apache.commons.fileupload.FileItem;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.multipart.MultipartException;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
||||
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
||||
|
||||
/**
|
||||
* 실행환경의 파일업로드 처리를 위한 기능 클래스
|
||||
* @author 공통서비스개발팀 이삼섭
|
||||
* @since 2009.06.01
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* << 개정이력(Modification Information) >>
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2009.3.25 이삼섭 최초 생성
|
||||
* 2011.06.11 서준식 스프링 3.0 업그레이드 API변경으로인한 수정
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
public class EgovMultipartResolver extends CommonsMultipartResolver {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EgovMultipartResolver.class);
|
||||
|
||||
public EgovMultipartResolver() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 첨부파일 처리를 위한 multipart resolver를 생성한다.
|
||||
*
|
||||
* @param servletContext
|
||||
*/
|
||||
public EgovMultipartResolver(ServletContext servletContext) {
|
||||
super(servletContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* multipart에 대한 parsing을 처리한다.
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
protected MultipartParsingResult parseFileItems(List fileItems, String encoding) {
|
||||
|
||||
MultiValueMap<String, MultipartFile> multipartFiles = new LinkedMultiValueMap<String, MultipartFile>();
|
||||
Map<String, String[]> multipartParameters = new HashMap<String, String[]>();
|
||||
|
||||
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 = multipartParameters.get(fileItem.getFieldName());
|
||||
if (curParam == null) {
|
||||
multipartParameters.put(fileItem.getFieldName(), new String[] { value });
|
||||
} else {
|
||||
String[] newParam = StringUtils.addStringToArray(curParam, value);
|
||||
multipartParameters.put(fileItem.getFieldName(), newParam);
|
||||
}
|
||||
} else {
|
||||
|
||||
if (fileItem.getSize() > 0) {
|
||||
CommonsMultipartFile file = new CommonsMultipartFile(fileItem);
|
||||
|
||||
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
|
||||
fileList.add(file);
|
||||
|
||||
if (multipartFiles.put(fileItem.getName(), fileList) != null) {
|
||||
throw new MultipartException("Multiple files for field name [" + file.getName() + "] found - not supported by MultipartResolver");
|
||||
}
|
||||
LOGGER.debug("Found multipart file [" + file.getName() + "] of size " + file.getSize() + " bytes with original filename [" + file.getOriginalFilename()
|
||||
+ "], stored " + file.getStorageDescription());
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return new MultipartParsingResult(multipartFiles, multipartParameters, null);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package kcc.com.sym.log.ulg.service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovUserLogScheduling.java
|
||||
* @Description : 사용로그 요약을 위한 스케쥴링 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 11. 이삼섭 최초생성
|
||||
* 2011. 7. 01. 이기하 패키지 분리(sym.log -> sym.log.ulg)
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 11.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@Service("egovUserLogScheduling")
|
||||
public class EgovUserLogScheduling extends EgovAbstractServiceImpl {
|
||||
|
||||
@Resource(name="EgovUserLogService")
|
||||
private EgovUserLogService userLogService;
|
||||
|
||||
/**
|
||||
* 사용자 로그정보를 생성한다.
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public void userLogInsert() throws Exception {
|
||||
//userLogService.logInsertUserLog();
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package kcc.com.sym.log.ulg.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovUserLogService.java
|
||||
* @Description : 사용로그 관리를 위한 서비스 인터페이스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 11. 이삼섭 최초생성
|
||||
* 2011. 7. 01. 이기하 패키지 분리(sym.log -> sym.log.ulg)
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 11.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
public interface EgovUserLogService {
|
||||
|
||||
/**
|
||||
* 사용자 로그정보를 생성한다.
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
public void logInsertUserLog() throws Exception;
|
||||
|
||||
/**
|
||||
* 사용자로그 상세정보를 조회한다.
|
||||
*
|
||||
* @param userLog
|
||||
* @return userLog
|
||||
* @throws Exception
|
||||
*/
|
||||
public UserLog selectUserLog(UserLog userLog) throws Exception;
|
||||
|
||||
/**
|
||||
* 사용자 로그정보 목록을 조회한다.
|
||||
*
|
||||
* @param UserLog
|
||||
*/
|
||||
public Map<?, ?> selectUserLogInf(UserLog userLog) throws Exception;
|
||||
|
||||
}
|
||||
422
src/main/java/kcc/com/sym/log/ulg/service/UserLog.java
Normal file
422
src/main/java/kcc/com/sym/log/ulg/service/UserLog.java
Normal file
@ -0,0 +1,422 @@
|
||||
package kcc.com.sym.log.ulg.service;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
|
||||
/**
|
||||
* @Class Name : UserLog.java
|
||||
* @Description : 사용자 로그 관리를 위한 VO 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 11. 이삼섭 최초생성
|
||||
* 2011. 7. 01. 이기하 패키지 분리(sym.log -> sym.log.ulg)
|
||||
* 2011.09.14 서준식 화면에 검색일자를 표시하기위한 멤버변수 추가.
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 11.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
public class UserLog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -3030641254553776910L;
|
||||
/**
|
||||
* 발생일자
|
||||
*/
|
||||
private String occrrncDe = "";
|
||||
/**
|
||||
* 요청자아이디
|
||||
*/
|
||||
private String rqesterId = "";
|
||||
|
||||
private String requstId = "";
|
||||
private String rqesterIp = "";
|
||||
private String insttCode = "";
|
||||
private String trgetMenuNm = "";
|
||||
private String svcNm = "";
|
||||
private String processSeCode = "";
|
||||
private String processCo = "";
|
||||
private String processTime = "";
|
||||
private String rspnsCode = "";
|
||||
private String errorSe = "";
|
||||
private String errorCode = "";
|
||||
private String rqesterNm = "";
|
||||
private String jobSeCode = "";
|
||||
|
||||
/**
|
||||
* 요청자 이름
|
||||
*/
|
||||
private String rqsterNm = "";
|
||||
/**
|
||||
* 메서드명
|
||||
*/
|
||||
private String methodNm = "";
|
||||
/**
|
||||
* 서비스명
|
||||
*/
|
||||
private String srvcNm = "";
|
||||
/**
|
||||
* 생성횟수
|
||||
*/
|
||||
private String creatCo = "";
|
||||
/**
|
||||
* 수정횟수
|
||||
*/
|
||||
private String updtCo = "";
|
||||
/**
|
||||
* 조회횟수
|
||||
*/
|
||||
private String rdCnt = "";
|
||||
/**
|
||||
* 삭제횟수
|
||||
*/
|
||||
private String deleteCo = "";
|
||||
/**
|
||||
* 출력횟수
|
||||
*/
|
||||
private String outptCo = "";
|
||||
/**
|
||||
* 에러횟수
|
||||
*/
|
||||
private String errorCo = "";
|
||||
/**
|
||||
* 검색시작일
|
||||
*/
|
||||
private String searchBgnDe = "";
|
||||
/**
|
||||
* 검색조건
|
||||
*/
|
||||
private String searchCnd = "";
|
||||
/**
|
||||
* 검색종료일
|
||||
*/
|
||||
private String searchEndDe = "";
|
||||
/**
|
||||
* 검색단어
|
||||
*/
|
||||
private String searchWrd = "";
|
||||
/**
|
||||
* 정렬순서(DESC,ASC)
|
||||
*/
|
||||
private String sortOrdr = "";
|
||||
|
||||
/** 검색사용여부 */
|
||||
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;
|
||||
|
||||
/** rowNo */
|
||||
private int rowNo = 0;
|
||||
|
||||
/**
|
||||
* 검색시작일_화면용
|
||||
*/
|
||||
private String searchBgnDeView = "";//2011.09.14
|
||||
|
||||
/**
|
||||
* 검색종료일_화면용
|
||||
*/
|
||||
private String searchEndDeView = "";//2011.09.14
|
||||
|
||||
public String getSearchEndDeView() {
|
||||
return searchEndDeView;
|
||||
}
|
||||
public void setSearchEndDeView(String searchEndDeView) {
|
||||
this.searchEndDeView = searchEndDeView;
|
||||
}
|
||||
public String getSearchBgnDeView() {
|
||||
return searchBgnDeView;
|
||||
}
|
||||
public void setSearchBgnDeView(String searchBgnDeView) {
|
||||
this.searchBgnDeView = searchBgnDeView;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return ToStringBuilder.reflectionToString(this);
|
||||
}
|
||||
|
||||
public String getOccrrncDe() {
|
||||
return occrrncDe;
|
||||
}
|
||||
|
||||
public void setOccrrncDe(String occrrncDe) {
|
||||
this.occrrncDe = occrrncDe;
|
||||
}
|
||||
|
||||
public String getRqesterId() {
|
||||
return rqesterId;
|
||||
}
|
||||
|
||||
public void setRqesterId(String rqesterId) {
|
||||
this.rqesterId = rqesterId;
|
||||
}
|
||||
|
||||
public String getRqsterNm() {
|
||||
return rqsterNm;
|
||||
}
|
||||
|
||||
public void setRqsterNm(String rqsterNm) {
|
||||
this.rqsterNm = rqsterNm;
|
||||
}
|
||||
|
||||
public String getMethodNm() {
|
||||
return methodNm;
|
||||
}
|
||||
|
||||
public void setMethodNm(String methodNm) {
|
||||
this.methodNm = methodNm;
|
||||
}
|
||||
|
||||
public String getSrvcNm() {
|
||||
return srvcNm;
|
||||
}
|
||||
|
||||
public void setSrvcNm(String srvcNm) {
|
||||
this.srvcNm = srvcNm;
|
||||
}
|
||||
|
||||
public String getCreatCo() {
|
||||
return creatCo;
|
||||
}
|
||||
|
||||
public void setCreatCo(String creatCo) {
|
||||
this.creatCo = creatCo;
|
||||
}
|
||||
|
||||
public String getUpdtCo() {
|
||||
return updtCo;
|
||||
}
|
||||
|
||||
public void setUpdtCo(String updtCo) {
|
||||
this.updtCo = updtCo;
|
||||
}
|
||||
|
||||
public String getRdCnt() {
|
||||
return rdCnt;
|
||||
}
|
||||
|
||||
public void setRdCnt(String rdCnt) {
|
||||
this.rdCnt = rdCnt;
|
||||
}
|
||||
|
||||
public String getDeleteCo() {
|
||||
return deleteCo;
|
||||
}
|
||||
|
||||
public void setDeleteCo(String deleteCo) {
|
||||
this.deleteCo = deleteCo;
|
||||
}
|
||||
|
||||
public String getOutptCo() {
|
||||
return outptCo;
|
||||
}
|
||||
|
||||
public void setOutptCo(String outptCo) {
|
||||
this.outptCo = outptCo;
|
||||
}
|
||||
|
||||
public String getErrorCo() {
|
||||
return errorCo;
|
||||
}
|
||||
|
||||
public void setErrorCo(String errorCo) {
|
||||
this.errorCo = errorCo;
|
||||
}
|
||||
|
||||
public String getSearchBgnDe() {
|
||||
return searchBgnDe;
|
||||
}
|
||||
|
||||
public void setSearchBgnDe(String searchBgnDe) {
|
||||
this.searchBgnDe = searchBgnDe;
|
||||
}
|
||||
|
||||
public String getSearchCnd() {
|
||||
return searchCnd;
|
||||
}
|
||||
|
||||
public void setSearchCnd(String searchCnd) {
|
||||
this.searchCnd = searchCnd;
|
||||
}
|
||||
|
||||
public String getSearchEndDe() {
|
||||
return searchEndDe;
|
||||
}
|
||||
|
||||
public void setSearchEndDe(String searchEndDe) {
|
||||
this.searchEndDe = searchEndDe;
|
||||
}
|
||||
|
||||
public String getSearchWrd() {
|
||||
return searchWrd;
|
||||
}
|
||||
|
||||
public void setSearchWrd(String searchWrd) {
|
||||
this.searchWrd = searchWrd;
|
||||
}
|
||||
|
||||
public String getSortOrdr() {
|
||||
return sortOrdr;
|
||||
}
|
||||
|
||||
public void setSortOrdr(String sortOrdr) {
|
||||
this.sortOrdr = sortOrdr;
|
||||
}
|
||||
|
||||
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 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 int getRowNo() {
|
||||
return rowNo;
|
||||
}
|
||||
|
||||
public void setRowNo(int rowNo) {
|
||||
this.rowNo = rowNo;
|
||||
}
|
||||
public String getRequstId() {
|
||||
return requstId;
|
||||
}
|
||||
public void setRequstId(String requstId) {
|
||||
this.requstId = requstId;
|
||||
}
|
||||
public String getRqesterIp() {
|
||||
return rqesterIp;
|
||||
}
|
||||
public void setRqesterIp(String rqesterIp) {
|
||||
this.rqesterIp = rqesterIp;
|
||||
}
|
||||
public String getInsttCode() {
|
||||
return insttCode;
|
||||
}
|
||||
public void setInsttCode(String insttCode) {
|
||||
this.insttCode = insttCode;
|
||||
}
|
||||
public String getTrgetMenuNm() {
|
||||
return trgetMenuNm;
|
||||
}
|
||||
public void setTrgetMenuNm(String trgetMenuNm) {
|
||||
this.trgetMenuNm = trgetMenuNm;
|
||||
}
|
||||
public String getSvcNm() {
|
||||
return svcNm;
|
||||
}
|
||||
public void setSvcNm(String svcNm) {
|
||||
this.svcNm = svcNm;
|
||||
}
|
||||
public String getProcessSeCode() {
|
||||
return processSeCode;
|
||||
}
|
||||
public void setProcessSeCode(String processSeCode) {
|
||||
this.processSeCode = processSeCode;
|
||||
}
|
||||
public String getProcessCo() {
|
||||
return processCo;
|
||||
}
|
||||
public void setProcessCo(String processCo) {
|
||||
this.processCo = processCo;
|
||||
}
|
||||
public String getProcessTime() {
|
||||
return processTime;
|
||||
}
|
||||
public void setProcessTime(String processTime) {
|
||||
this.processTime = processTime;
|
||||
}
|
||||
public String getRspnsCode() {
|
||||
return rspnsCode;
|
||||
}
|
||||
public void setRspnsCode(String rspnsCode) {
|
||||
this.rspnsCode = rspnsCode;
|
||||
}
|
||||
public String getErrorSe() {
|
||||
return errorSe;
|
||||
}
|
||||
public void setErrorSe(String errorSe) {
|
||||
this.errorSe = errorSe;
|
||||
}
|
||||
public String getErrorCode() {
|
||||
return errorCode;
|
||||
}
|
||||
public void setErrorCode(String errorCode) {
|
||||
this.errorCode = errorCode;
|
||||
}
|
||||
public String getRqesterNm() {
|
||||
return rqesterNm;
|
||||
}
|
||||
public void setRqesterNm(String rqesterNm) {
|
||||
this.rqesterNm = rqesterNm;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,79 @@
|
||||
package kcc.com.sym.log.ulg.service.impl;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import egovframework.rte.fdl.cmmn.EgovAbstractServiceImpl;
|
||||
import kcc.com.sym.log.ulg.service.EgovUserLogService;
|
||||
import kcc.com.sym.log.ulg.service.UserLog;
|
||||
|
||||
/**
|
||||
* @Class Name : EgovUserLogServiceImpl.java
|
||||
* @Description : 사용로그 관리를 위한 서비스 구현 클래스
|
||||
* @Modification Information
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- ------- -------------------
|
||||
* 2009. 3. 11. 이삼섭 최초생성
|
||||
* 2011. 7. 01. 이기하 패키지 분리(sym.log -> sym.log.ulg)
|
||||
*
|
||||
* @author 공통 서비스 개발팀 이삼섭
|
||||
* @since 2009. 3. 11.
|
||||
* @version
|
||||
* @see
|
||||
*
|
||||
*/
|
||||
@Service("EgovUserLogService")
|
||||
public class EgovUserLogServiceImpl extends EgovAbstractServiceImpl implements
|
||||
EgovUserLogService {
|
||||
|
||||
@Resource(name="userLogDAO")
|
||||
private UserLogDAO userLogDAO;
|
||||
|
||||
/**
|
||||
* 사용자 로그정보를 생성한다.
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
@Override
|
||||
public void logInsertUserLog() throws Exception {
|
||||
|
||||
userLogDAO.logInsertUserLog();
|
||||
}
|
||||
|
||||
/**
|
||||
* 사용자 로그정보 상제정보를 조회한다.
|
||||
*
|
||||
* @param userLog
|
||||
* @return userLog
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public UserLog selectUserLog(UserLog userLog) throws Exception{
|
||||
|
||||
return userLogDAO.selectUserLog(userLog);
|
||||
}
|
||||
|
||||
/**
|
||||
* 사용자 로그정보 목록을 조회한다.
|
||||
*
|
||||
* @param UserLog
|
||||
*/
|
||||
@Override
|
||||
public Map<?, ?> selectUserLogInf(UserLog userLog) throws Exception {
|
||||
List<?> _result = userLogDAO.selectUserLogInf(userLog);
|
||||
int _cnt = userLogDAO.selectUserLogInfCnt(userLog);
|
||||
|
||||
Map<String, Object> _map = new HashMap<String, Object>();
|
||||
_map.put("resultList", _result);
|
||||
_map.put("resultCnt", Integer.toString(_cnt));
|
||||
|
||||
return _map;
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user