build: merge with master

main
thkim 2024-05-02 11:04:31 +09:00
parent 3ada2309a5
commit 1c9f3405f9
6960 changed files with 2228519 additions and 109 deletions

View File

@ -13,10 +13,6 @@
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<<<<<<< HEAD
=======
<attribute name="test" value="true"/>
>>>>>>> a5c72c4540b2e04c7465cfc0f3e8dc86290a3ee1
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -38,18 +34,10 @@
<classpathentry kind="lib" path="src/main/webapp/WEB-INF/lib/javaproj-1.0.6.jar"/>
<classpathentry kind="lib" path="src/main/webapp/WEB-INF/lib/xdoclet-1.2.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.5"/>
<<<<<<< HEAD
<classpathentry kind="lib" path="src/main/webapp/WEB-INF/lib/ClipReport4.0-1.0.0.301.jar"/>
<classpathentry kind="lib" path="src/main/webapp/WEB-INF/lib/jxl.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
=======
<classpathentry kind="lib" path="/Users/kimtheho/git/dbnt/geoinfo/geoinfo_eGov_work/src/main/webapp/WEB-INF/lib/ClipReport4.0-1.0.0.301.jar"/>
<classpathentry kind="lib" path="/Users/kimtheho/git/dbnt/geoinfo/geoinfo_eGov_work/src/main/webapp/WEB-INF/lib/jxl.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="module" value="true"/>
>>>>>>> a5c72c4540b2e04c7465cfc0f3e8dc86290a3ee1
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>

96
.gitignore vendored
View File

@ -1,4 +1,3 @@
<<<<<<< HEAD
/target
/src/main/webapp/**/**.jar
/src/main/webapp/**/**.class
@ -42,98 +41,3 @@ out/
### VS Code ###
.vscode/
.vs/
=======
.idea/
/target
.metadata
bin/
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
# CDT- autotools
.autotools
# 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/
# Annotation Processing
.apt_generated/
.apt_generated_test/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
# Uncomment this line if you wish to ignore the project description file.
# Typically, this file would be tracked if it contains build/dependency configurations:
#.project
.svn
=======
# ---> Java
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
logs/
.classpath
>>>>>>> a5c72c4540b2e04c7465cfc0f3e8dc86290a3ee1

View File

@ -1,3 +1,2 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/test/java=UTF-8

BIN
doc/Untitled Project.IAB Normal file

Binary file not shown.

BIN
doc/Untitled Project.IAD Normal file

Binary file not shown.

BIN
doc/Untitled Project.IMB Normal file

Binary file not shown.

BIN
doc/Untitled Project.IMD Normal file

Binary file not shown.

BIN
doc/Untitled Project.PFI Normal file

Binary file not shown.

BIN
doc/Untitled Project.PO Normal file

Binary file not shown.

BIN
doc/Untitled Project.PR Normal file

Binary file not shown.

BIN
doc/Untitled Project.PRI Normal file

Binary file not shown.

BIN
doc/Untitled Project.PS Normal file

Binary file not shown.

View File

@ -0,0 +1,5 @@
---- selectApproveLogCnt Matches (4 in 4 files) ----
DownloadAppMapper.java (d:\egov_geoinfo\egovframedev-3.5.1-64bit\workspace\geoinfo_admin\src\main\java\geoinfo\admins\chlog\service): public EgovMap selectApproveLogCnt(String userId) throws Exception;
DownloadAppServiceImpl.java (d:\egov_geoinfo\egovframedev-3.5.1-64bit\workspace\geoinfo_admin\src\main\java\geoinfo\admins\chlog\service\impl): EgovMap map = masterMapper.selectApproveLogCnt((String)params.get("userid"));
DownloadApp_SQL.xml (d:\egov_geoinfo\egovframedev-3.5.1-64bit\workspace\geoinfo_admin\src\main\resources\geoinfo\sqlmap\mappers\admins\chlog): <select id="selectApproveLogCnt" parameterType="String" resultType="egovMap">
DownloadApp_SQL.xml (d:\egov_geoinfo\egovframedev-3.5.1-64bit\workspace\geoinfo_admin\target\classes\geoinfo\sqlmap\mappers\admins\chlog): <select id="selectApproveLogCnt" parameterType="String" resultType="egovMap">

BIN
doc/Untitled Project.WK3 Normal file

Binary file not shown.

9
doc/eGov.ucd Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<editmodel:ClassDiagramEditModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:editmodel="editmodel.xmi" xmlns:options="options.xmi" id="geoinfo.com" metadata="uml2-1.0" tag="10" key="32303037303533312D31302067656F696E666F5F65476F76">
<diagramOptions xsi:type="options:ClassDiagramOptions" properties="wireOptions=1;Product=eUML2" autoName="false"/>
<boardSetting snapToGeometry="true" gridEnabled="true" gridSpacing="15,15" gridOrigin="0,0" rulerUnit="pixel" gridVisibility="false">
<leftRuler/>
<topRuler/>
</boardSetting>
<classDiagramPreferences xsi:type="editmodel:UMLClassDiagramPreference" showPopupBars="true" showConnectionHandles="true" attributeSorter="Natural" methodSorter="Natural" showClassStereotype="true" showPackageStereotype="true" showDependencyStereotype="true" showInterfaceStereotype="true" innerClassSorter="Natural" showPublicAttributes="true" showPackageAttributes="true" showStaticAttributes="true" showPublicMethods="true" showPackageMethods="true" showStaticMethods="true" showPublicInnerClasses="true" showPackageInnerClasses="true" showStaticInnerClasses="true" packageIndication="3" showAttributeProperty="true"/>
</editmodel:ClassDiagramEditModel>

9
doc/geoinfo.com.ucd Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<editmodel:ClassDiagramEditModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:editmodel="editmodel.xmi" xmlns:options="options.xmi" id="geoinfo.com" metadata="uml2-1.0" tag="10" key="32303037303533312D31302067656F696E666F5F65476F76">
<diagramOptions xsi:type="options:ClassDiagramOptions" properties="wireOptions=1;Product=eUML2" autoName="false"/>
<boardSetting snapToGeometry="true" gridEnabled="true" gridSpacing="15,15" gridOrigin="0,0" rulerUnit="pixel" gridVisibility="false">
<leftRuler/>
<topRuler/>
</boardSetting>
<classDiagramPreferences xsi:type="editmodel:UMLClassDiagramPreference" showPopupBars="true" showConnectionHandles="true" attributeSorter="Natural" methodSorter="Natural" showClassStereotype="true" showPackageStereotype="true" showDependencyStereotype="true" showInterfaceStereotype="true" innerClassSorter="Natural" showPublicAttributes="true" showPackageAttributes="true" showStaticAttributes="true" showPublicMethods="true" showPackageMethods="true" showStaticMethods="true" showPublicInnerClasses="true" showPackageInnerClasses="true" showStaticInnerClasses="true" packageIndication="3" showAttributeProperty="true"/>
</editmodel:ClassDiagramEditModel>

6
doc/javadoc.xml Normal file

File diff suppressed because one or more lines are too long

499
pom.xml Normal file
View File

@ -0,0 +1,499 @@
<?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>
<groupId>ictway.com.git.geoinfo</groupId>
<artifactId>geoinfo</artifactId>
<packaging>war</packaging>
<version>1.0.0</version>
<name>geoinfo</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.7</java-version>
<org.springframework-version>3.2.4.RELEASE</org.springframework-version>
<org.aspectj-version>1.7.3</org.aspectj-version>
<org.slf4j-version>1.6.6</org.slf4j-version>
<org.apache.tiles.version>3.0.3</org.apache.tiles.version>
<spring.maven.artifact.version>4.0.9.RELEASE</spring.maven.artifact.version>
<egovframework.rte.version>3.5.0</egovframework.rte.version>
</properties>
<repositories>
<repository>
<id>mesir-repo</id>
<url>http://mesir.googlecode.com/svn/trunk/mavenrepo</url>
</repository>
<repository>
<id>mvn2</id>
<url>http://repo1.maven.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>egovframe</id>
<url>http://www.egovframe.go.kr/maven/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>oracle</id>
<name>ORACLE JDBC Repository</name>
<url>http://mesir.googlecode.com/svn/trunk/mavenrepo</url>
</repository>
</repositories>
<dependencies>
<!-- SMS -->
<dependency>
<groupId>org.apache.ws.xmlrpc</groupId>
<artifactId>xmlrpc</artifactId>
<version>2.0.1</version>
</dependency>
<!-- Spring -->
<!-- 표준프레임워크 실행환경 -->
<dependency>
<groupId>egovframework.rte</groupId>
<artifactId>egovframework.rte.ptl.mvc</artifactId>
<version>${egovframework.rte.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>egovframework.rte</groupId>
<artifactId>egovframework.rte.psl.dataaccess</artifactId>
<version>2.7.0</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>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${org.springframework-version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework-version}</version>
</dependency>
<!-- AOP Alliance -->
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<!-- MyBatis -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.0</version>
</dependency>
<!-- DBCP -->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-dbcp</artifactId>
<scope>provided</scope>
<version>7.0.53</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<!-- MySql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.31</version>
</dependency>
<!-- Oracle -->
<!-- <dependency>
<groupId>ojdbc</groupId>
<artifactId>ojdbc14</artifactId>
<version>14</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/ojdbc14-10.2.0.4.0.jar</systemPath>
</dependency> -->
<!-- PostgreSQL 9.1-901 -->
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.1-901.jdbc4</version>
</dependency>
<!-- AspectJ -->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${org.aspectj-version}</version>
</dependency>
<!-- Web -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
<version>2.5</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<scope>provided</scope>
<version>2.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<version>1.0</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${org.slf4j-version}</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.3alpha-8</version>
</dependency>
<dependency>
<groupId>org.lazyluke</groupId>
<artifactId>log4jdbc-remix</artifactId>
<version>0.2.7</version>
</dependency>
<!-- MappingJacksonJsonView -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
</dependency>
<!-- MultipartHttpServletRequset -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
<!-- Apache Codec -->
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency>
<!-- EgovProperty -->
<dependency>
<groupId>egovframework.rte</groupId>
<artifactId>egovframework.rte.fdl.property</artifactId>
<version>2.7.0</version>
</dependency>
<!-- Log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
<exclusions>
<exclusion>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
</exclusion>
<exclusion>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- @Inject -->
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
</dependency>
<!-- Tiles -->
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-jsp</artifactId>
<version>${org.apache.tiles.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tiles</groupId>
<artifactId>tiles-core</artifactId>
<version>${org.apache.tiles.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports -->
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>5.1.0</version>
</dependency>
<dependency>
<groupId>com.jfinal</groupId>
<artifactId>cos</artifactId>
<version>26Dec2008</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jdom/jdom -->
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>2.0.2</version>
</dependency>
<!-- lucy -->
<dependency>
<groupId>com.navercorp.lucy</groupId>
<artifactId>lucy-xss-servlet</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-websocket</artifactId>
<version>4.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.12</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
<directory>${basedir}/target</directory>
<finalName>geoinfo_eGov</finalName>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalProjectnatures>
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
</additionalProjectnatures>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
</additionalBuildcommands>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
<encoding>UTF-8</encoding>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<configuration>
<mainClass>org.test.int1.Main</mainClass>
</configuration>
</plugin>
<!-- JavaDoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.5</version>
</plugin>
</plugins>
</build>
</project>

19
sonar-project.properties Normal file
View File

@ -0,0 +1,19 @@
# must be unique in a given SonarQube instance
sonar.projectKey=geoinfo
# --- optional properties ---
sonar.host.url=http://localhost:9000
# defaults to project key
#sonar.projectName=My project
# defaults to 'not provided'
#sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Defaults to .
#sonar.sources=.
sonar.sources=src/main/java,src/main/webapp
sonar.exclusions=**/kendo-ui/**/*, **/ClipReport4/**/*, **/G-PIN/**/*, **/IPIN/**/*
sonar.java.binaries=target/classes
sonar.scm.exclusions.disabled=true
# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=euc-kr
sonar.login=sqp_ab637361cfede0396764c018ea44c4f6773f858a

View File

@ -0,0 +1,49 @@
package egovframework.com.cmm;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
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
*
*/
public class EgovComExcepHndlr implements ExceptionHandler {
protected Log log = LogFactory.getLog(this.getClass());
/*
@Resource(name = "otherSSLMailSender")
private SimpleSSLMail mailSender;
*/
/**
* Exception .
*/
public void occur(Exception ex, String packageName) {
//log.debug(" EgovServiceExceptionHandler run...............");
try {
log.error(packageName, ex);
} catch (NumberFormatException e) {
log.debug("error", e);
log.fatal(packageName, ex);// 2011.10.10 보안점검 후속조치
} catch (IndexOutOfBoundsException e) {
log.debug("error", e);
log.fatal(packageName, ex);// 2011.10.10 보안점검 후속조치
} catch (Exception e) {
log.debug("error", e);
log.fatal(packageName, ex);// 2011.10.10 보안점검 후속조치
}
}
}

View File

@ -0,0 +1,16 @@
package egovframework.com.cmm;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import egovframework.rte.fdl.cmmn.exception.handler.ExceptionHandler;
public class EgovComOthersExcepHndlr implements ExceptionHandler {
protected Log log = LogFactory.getLog(this.getClass());
public void occur(Exception exception, String packageName) {
//log.debug(" EgovServiceExceptionHandler run...............");
log.error(packageName, exception);
}
}

View File

@ -0,0 +1,34 @@
package egovframework.com.cmm;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import egovframework.rte.fdl.cmmn.trace.handler.TraceHandler;
/**
* @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);
//이곳에서 후속처리로 필요한 액션을 취할 수 있다.
}
}

View File

@ -0,0 +1,62 @@
package egovframework.com.cmm;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;
/**
* EgovComUtil
*
* @author
* @since 2011.09.15
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- ------------- ----------------------
* 2011.09.15
* </pre>
*/
@Service("egovUtil")
public class EgovComponentChecker implements ApplicationContextAware{
public static ApplicationContext context;
public void setApplicationContext(ApplicationContext context)
throws BeansException {
this.context = context;
}
/**
* Spring MVC ()
*
*/
public static boolean hasComponent(String componentName){
try{
Object component = context.getBean(componentName);
if(component == null){
return false;
}else{
return true;
}
}catch(NoSuchBeanDefinitionException ex){// 해당 컴포넌트를 찾을 수없을 경우 false반환
return false;
}
}
}

View File

@ -0,0 +1,55 @@
package egovframework.com.cmm;
import java.util.Locale;
import org.springframework.context.MessageSource;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
/**
* MessageSource ReloadableResourceBundleMessageSource
* @author
* @since 2009.06.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.03.11
*
* </pre>
*/
public class EgovMessageSource extends ReloadableResourceBundleMessageSource implements MessageSource {
private ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource;
/**
* getReloadableResourceBundleMessageSource()
* @param reloadableResourceBundleMessageSource - resource MessageSource
* @return ReloadableResourceBundleMessageSource
*/
public void setReloadableResourceBundleMessageSource(ReloadableResourceBundleMessageSource reloadableResourceBundleMessageSource) {
this.reloadableResourceBundleMessageSource = reloadableResourceBundleMessageSource;
}
/**
* getReloadableResourceBundleMessageSource()
* @return ReloadableResourceBundleMessageSource
*/
public ReloadableResourceBundleMessageSource getReloadableResourceBundleMessageSource() {
return reloadableResourceBundleMessageSource;
}
/**
*
* @param code -
* @return String
*/
public String getMessage(String code) {
return getReloadableResourceBundleMessageSource().getMessage(code, null, Locale.getDefault());
}
}

View File

@ -0,0 +1,142 @@
package egovframework.com.cmm;
import java.util.regex.Pattern;
/**
* ( )
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2011.10.10
*
* </pre>
*/
public class EgovWebUtil {
public static String clearXSSMinimum(String value) {
if (value == null || value.trim().equals("")) {
return "";
}
String returnValue = value;
returnValue = returnValue.replaceAll("&", "&amp;");
returnValue = returnValue.replaceAll("<", "&lt;");
returnValue = returnValue.replaceAll(">", "&gt;");
returnValue = returnValue.replaceAll("\"", "&#34;");
returnValue = returnValue.replaceAll("\'", "&#39;");
return returnValue;
}
public static String clearXSSMaximum(String value) {
String returnValue = value;
returnValue = clearXSSMinimum(returnValue);
returnValue = returnValue.replaceAll("%00", null);
returnValue = returnValue.replaceAll("%", "&#37;");
// \\. => .
returnValue = returnValue.replaceAll("\\.\\./", ""); // ../
returnValue = returnValue.replaceAll("\\.\\.\\\\", ""); // ..\
returnValue = returnValue.replaceAll("\\./", ""); // ./
returnValue = returnValue.replaceAll("%2F", "");
return returnValue;
}
public static String filePathBlackList(String value) {
String returnValue = value;
if (returnValue == null || returnValue.trim().equals("")) {
return "";
}
returnValue = returnValue.replaceAll("\\.\\./", ""); // ../
returnValue = returnValue.replaceAll("\\.\\.\\\\", ""); // ..\
return returnValue;
}
/**
* .
*
* @param value
* @return
*/
public static String filePathReplaceAll(String value) {
String returnValue = value;
if (returnValue == null || returnValue.trim().equals("")) {
return "";
}
returnValue = returnValue.replaceAll("/", "");
returnValue = returnValue.replaceAll("\\", "");
returnValue = returnValue.replaceAll("\\.\\.", ""); // ..
returnValue = returnValue.replaceAll("&", "");
return returnValue;
}
public static String filePathWhiteList(String value) {
return value; // TODO
}
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(";", "");
}
/*
public static void main(String[] args) {
String test = null;
test = "<script language='javascript' encoding=\"utf-8\">q&a</script>";
System.out.println("clearXSSMinimum() Test");
System.out.println(test);
System.out.println("=>");
System.out.println(clearXSSMinimum(test));
System.out.println();
test = "/a/b/c../..\\";
System.out.println("clearXSSMaximum() Test");
System.out.println(test);
System.out.println(" =>");
System.out.println(clearXSSMaximum(test));
System.out.println();
test = "/a/b/c/../../../..\\..\\";
System.out.println("filePathBlackList() Test");
System.out.println(test);
System.out.println("=>");
System.out.println(filePathBlackList(test));
System.out.println();
test = "192.168.0.1";
System.out.println("isIPAddress() test");
System.out.println("IP : " + test + " => " + isIPAddress(test));
test = "abc def*%;-+,ghi";
System.out.println("removeSQLInjectionRisk() test");
System.out.println(test + " => " + removeSQLInjectionRisk(test));
}
//*/
}

View File

@ -0,0 +1,48 @@
package egovframework.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() {
}
public void initVariables(){
firstPageLabel = "<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/admins/first.gif\" alt=\"처음\" border=\"0\"/></a>&#160;";
previousPageLabel = "<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/admins/prev.gif\" alt=\"이전\" border=\"0\"/></a>&#160;";
currentPageLabel = "<strong style='color:#FF0000;'>{0}</strong>&#160;";
otherPageLabel = "<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \">{2}</a>&#160;";
nextPageLabel = "<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/admins/next.gif\" alt=\"다음\" border=\"0\"/></a>&#160;";
lastPageLabel = "<a href=\"?pageIndex={1}\" onclick=\"{0}({1});return false; \"><img src=\"" + servletContext.getContextPath() + "/images/admins/last.gif\" alt=\"마지막\" border=\"0\"/></a>&#160;";
}
public void setServletContext(ServletContext servletContext) {
this.servletContext = servletContext;
initVariables();
}
}

View File

@ -0,0 +1,50 @@
package egovframework.com.cmm;
/**
* IncludedInfo annotation VO
* @author
* @since 2011.08.26
* @version 2.0.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2011.08.26
*
* </pre>
*/
public class IncludedCompInfoVO {
private String name;
private String listUrl;
private int order;
private int gid;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getListUrl() {
return listUrl;
}
public void setListUrl(String listUrl) {
this.listUrl = listUrl;
}
public int getOrder() {
return order;
}
public void setOrder(int order) {
this.order = order;
}
public int getGid() {
return gid;
}
public void setGid(int gid) {
this.gid = gid;
}
}

View File

@ -0,0 +1,250 @@
package egovframework.com.cmm;
import java.io.Serializable;
/**
* @Class Name : LoginVO.java
* @Description : Login VO class
* @Modification Information
* @
* @
* @ ------- -------- ---------------------------
* @ 2009.03.03
*
* @author
* @since 2009.03.03
* @version 1.0
* @see
*
*/
public class LoginVO implements Serializable{
/**
*
*/
private static final long serialVersionUID = -8274004534207618049L;
/** 아이디 */
private String id;
/** 이름 */
private String name;
/** 주민등록번호 */
private String ihidNum;
/** 이메일주소 */
private String email;
/** 비밀번호 */
private String password;
/** 비밀번호 힌트 */
private String passwordHint;
/** 비밀번호 정답 */
private String passwordCnsr;
/** 사용자구분 */
private String userSe;
/** 조직(부서)ID */
private String orgnztId;
/** 조직(부서)명 */
private String orgnztNm;
/** 고유아이디 */
private String uniqId;
/** 로그인 후 이동할 페이지 */
private String url;
/** 사용자 IP정보 */
private String ip;
/** GPKI인증 DN */
private String dn;
/**
* id attribute .
* @return String
*/
public String getId() {
return id;
}
/**
* id attribute .
* @param id String
*/
public void setId(String id) {
this.id = id;
}
/**
* name attribute .
* @return String
*/
public String getName() {
return name;
}
/**
* name attribute .
* @param name String
*/
public void setName(String name) {
this.name = name;
}
/**
* ihidNum attribute .
* @return String
*/
public String getIhidNum() {
return ihidNum;
}
/**
* ihidNum attribute .
* @param ihidNum String
*/
public void setIhidNum(String ihidNum) {
this.ihidNum = ihidNum;
}
/**
* email attribute .
* @return String
*/
public String getEmail() {
return email;
}
/**
* email attribute .
* @param email String
*/
public void setEmail(String email) {
this.email = email;
}
/**
* password attribute .
* @return String
*/
public String getPassword() {
return password;
}
/**
* password attribute .
* @param password String
*/
public void setPassword(String password) {
this.password = password;
}
/**
* passwordHint attribute .
* @return String
*/
public String getPasswordHint() {
return passwordHint;
}
/**
* passwordHint attribute .
* @param passwordHint String
*/
public void setPasswordHint(String passwordHint) {
this.passwordHint = passwordHint;
}
/**
* passwordCnsr attribute .
* @return String
*/
public String getPasswordCnsr() {
return passwordCnsr;
}
/**
* passwordCnsr attribute .
* @param passwordCnsr String
*/
public void setPasswordCnsr(String passwordCnsr) {
this.passwordCnsr = passwordCnsr;
}
/**
* userSe attribute .
* @return String
*/
public String getUserSe() {
return userSe;
}
/**
* userSe attribute .
* @param userSe String
*/
public void setUserSe(String userSe) {
this.userSe = userSe;
}
/**
* orgnztId attribute .
* @return String
*/
public String getOrgnztId() {
return orgnztId;
}
/**
* orgnztId attribute .
* @param orgnztId String
*/
public void setOrgnztId(String orgnztId) {
this.orgnztId = orgnztId;
}
/**
* uniqId attribute .
* @return String
*/
public String getUniqId() {
return uniqId;
}
/**
* uniqId attribute .
* @param uniqId String
*/
public void setUniqId(String uniqId) {
this.uniqId = uniqId;
}
/**
* url attribute .
* @return String
*/
public String getUrl() {
return url;
}
/**
* url attribute .
* @param url String
*/
public void setUrl(String url) {
this.url = url;
}
/**
* ip attribute .
* @return String
*/
public String getIp() {
return ip;
}
/**
* ip attribute .
* @param ip String
*/
public void setIp(String ip) {
this.ip = ip;
}
/**
* dn attribute .
* @return String
*/
public String getDn() {
return dn;
}
/**
* dn attribute .
* @param dn String
*/
public void setDn(String dn) {
this.dn = dn;
}
/**
* @return the orgnztNm
*/
public String getOrgnztNm() {
return orgnztNm;
}
/**
* @param orgnztNm the orgnztNm to set
*/
public void setOrgnztNm(String orgnztNm) {
this.orgnztNm = orgnztNm;
}
}

View File

@ -0,0 +1,119 @@
package egovframework.com.cmm;
import java.io.Serializable;
/**
* VO
* @author
* @since 2009.03.06
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.03.06
*
* </pre>
*/
public class SessionVO implements Serializable {
/** 아이디 */
private String sUserId;
/** 이름 */
private String sUserNm;
/** 이메일 */
private String sEmail;
/** 사용자구분 */
private String sUserSe;
/** 조직(부서)ID */
private String orgnztId;
/** 고유아이디 */
private String uniqId;
/**
* sUserId attribute .
* @return String
*/
public String getSUserId() {
return sUserId;
}
/**
* sUserId attribute .
* @param sUserId String
*/
public void setSUserId(String userId) {
sUserId = userId;
}
/**
* sUserNm attribute .
* @return String
*/
public String getSUserNm() {
return sUserNm;
}
/**
* sUserNm attribute .
* @param sUserNm String
*/
public void setSUserNm(String userNm) {
sUserNm = userNm;
}
/**
* sEmail attribute .
* @return String
*/
public String getSEmail() {
return sEmail;
}
/**
* sEmail attribute .
* @param sEmail String
*/
public void setSEmail(String email) {
sEmail = email;
}
/**
* sUserSe attribute .
* @return String
*/
public String getSUserSe() {
return sUserSe;
}
/**
* sUserSe attribute .
* @param sUserSe String
*/
public void setSUserSe(String userSe) {
sUserSe = userSe;
}
/**
* orgnztId attribute .
* @return String
*/
public String getOrgnztId() {
return orgnztId;
}
/**
* orgnztId attribute .
* @param orgnztId String
*/
public void setOrgnztId(String orgnztId) {
this.orgnztId = orgnztId;
}
/**
* uniqId attribute .
* @return String
*/
public String getUniqId() {
return uniqId;
}
/**
* uniqId attribute .
* @param uniqId String
*/
public void setUniqId(String uniqId) {
this.uniqId = uniqId;
}
}

View File

@ -0,0 +1,33 @@
package egovframework.com.cmm.annotation;
/**
* annotation
* Controller annotation ,
* Controller url mapping
* annotation .
* @author
* @since 2011.08.26
* @version 2.0.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2011.08.26
*
* </pre>
*/
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@Retention(RetentionPolicy.RUNTIME)
public @interface IncludedInfo {
String name() default ""; // 컴포넌트의 한글 이름
String listUrl() default ""; // 컴포넌트의 목록정보조회를 위한 URL
int order() default 0; // 자동 생성되는 메뉴 목록에 표시되는 순서
int gid() default 0; // 컴포넌트의 Group ID(대분류 구분)
}

View File

@ -0,0 +1,47 @@
/*
* Copyright 2008-2009 MOPAS(MINISTRY OF SECURITY AND PUBLIC ADMINISTRATION).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package egovframework.com.cmm.filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
public class HTMLTagFilter implements Filter{
private FilterConfig config;
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
//System.out.println("HTMLTagFilter doFilter start!!!~~~~");
chain.doFilter(new HTMLTagFilterRequestWrapper((HttpServletRequest)request), response);
}
public void init(FilterConfig config) throws ServletException {
this.config = config;
}
public void destroy() {
}
}

View File

@ -0,0 +1,112 @@
/*
* Copyright 2008-2009 MOPAS(MINISTRY OF SECURITY AND PUBLIC ADMINISTRATION).
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package egovframework.com.cmm.filter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletRequestWrapper;
public class HTMLTagFilterRequestWrapper extends HttpServletRequestWrapper {
public HTMLTagFilterRequestWrapper(HttpServletRequest request) {
super(request);
}
public String[] getParameterValues(String parameter) {
String[] values = super.getParameterValues(parameter);
if(values==null){
return null;
}
for (int i = 0; i < values.length; i++) {
if (values[i] != null) {
StringBuffer strBuff = new StringBuffer();
for (int j = 0; j < values[i].length(); j++) {
char c = values[i].charAt(j);
switch (c) {
case '<':
strBuff.append("&lt;");
break;
case '>':
strBuff.append("&gt;");
break;
//case '&':
//strBuff.append("&amp;");
//break;
case '"':
strBuff.append("&quot;");
break;
case '\'':
strBuff.append("&apos;");
break;
default:
strBuff.append(c);
break;
}
}
values[i] = strBuff.toString();
//System.out.println("values -" + strBuff.toString() );
} else {
values[i] = null;
}
}
//System.out.println("HTMLTag values -" + values);
return values;
}
public String getParameter(String parameter) {
String value = super.getParameter(parameter);
if(value==null){
return null;
}
StringBuffer strBuff = new StringBuffer();
for (int i = 0; i < value.length(); i++) {
char c = value.charAt(i);
switch (c) {
case '<':
strBuff.append("&lt;");
break;
case '>':
strBuff.append("&gt;");
break;
case '&':
strBuff.append("&amp;");
break;
case '"':
strBuff.append("&quot;");
break;
case '\'':
strBuff.append("&apos;");
break;
default:
strBuff.append(c);
break;
}
}
value = strBuff.toString();
//System.out.println("HTMLTag value -" + value);
return value;
}
}

View File

@ -0,0 +1,80 @@
package egovframework.com.cmm.interceptor;
import java.util.Iterator;
import java.util.Set;
import java.util.regex.Pattern;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.ModelAndViewDefiningException;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import egovframework.com.cmm.LoginVO;
import egovframework.com.cmm.util.EgovUserDetailsHelper;
/**
*
* @author
* @since 2011.07.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2011.07.01
* 2011.09.07 URL
* </pre>
*/
public class AuthenticInterceptor extends HandlerInterceptorAdapter {
private Set<String> permittedURL;
public void setPermittedURL(Set<String> permittedURL) {
this.permittedURL = permittedURL;
}
/**
* (LoginVO) .
* (LoginVO) , .
*/
@Override
public boolean preHandle(HttpServletRequest request,
HttpServletResponse response, Object handler) throws Exception {
String requestURI = request.getRequestURI(); //요청 URI
boolean isPermittedURL = false;
LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
if(loginVO != null){
return true;
}else{
for(Iterator<String> it = this.permittedURL.iterator(); it.hasNext();){
String urlPattern = request.getContextPath() + (String) it.next();
if(Pattern.matches(urlPattern, requestURI)){// 정규표현식을 이용해서 요청 URI가 허용된 URL에 맞는지 점검함.
isPermittedURL = true;
}
}
if(!isPermittedURL){
ModelAndView modelAndView = new ModelAndView("redirect:/uat/uia/egovLoginUsr.do");
throw new ModelAndViewDefiningException(modelAndView);
}else{
return true;
}
}
}
}

View File

@ -0,0 +1,42 @@
package egovframework.com.cmm.interceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import egovframework.com.cmm.LoginVO;
import egovframework.com.cmm.util.EgovUserDetailsHelper;
/**
* IP
* @author
* @since 2013.03.28
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ---------- -------- ---------------------------
* 2013.03.28
* </pre>
*/
public class IpObtainInterceptor extends HandlerInterceptorAdapter {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
String clientIp = request.getRemoteAddr();
LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
if (loginVO != null) {
loginVO.setIp(clientIp);
}
return true;
}
}

View File

@ -0,0 +1,192 @@
package egovframework.com.cmm.service;
import java.io.Serializable;
/**
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* </pre>
*/
public class CmmnDetailCode implements Serializable {
/*
* ID
*/
private String codeId = "";
/*
* ID
*/
private String codeIdNm = "";
/*
*
*/
private String code = "";
/*
*
*/
private String codeNm = "";
/*
*
*/
private String codeDc = "";
/*
*
*/
private String useAt = "";
/*
* ID
*/
private String frstRegisterId = "";
/*
* ID
*/
private String lastUpdusrId = "";
/**
* codeId attribute .
* @return String
*/
public String getCodeId() {
return codeId;
}
/**
* codeId attribute .
* @param codeId String
*/
public void setCodeId(String codeId) {
this.codeId = codeId;
}
/**
* codeIdNm attribute .
* @return String
*/
public String getCodeIdNm() {
return codeIdNm;
}
/**
* codeIdNm attribute .
* @param codeIdNm String
*/
public void setCodeIdNm(String codeIdNm) {
this.codeIdNm = codeIdNm;
}
/**
* code attribute .
* @return String
*/
public String getCode() {
return code;
}
/**
* code attribute .
* @param code String
*/
public void setCode(String code) {
this.code = code;
}
/**
* codeNm attribute .
* @return String
*/
public String getCodeNm() {
return codeNm;
}
/**
* codeNm attribute .
* @param codeNm String
*/
public void setCodeNm(String codeNm) {
this.codeNm = codeNm;
}
/**
* codeDc attribute .
* @return String
*/
public String getCodeDc() {
return codeDc;
}
/**
* codeDc attribute .
* @param codeDc String
*/
public void setCodeDc(String codeDc) {
this.codeDc = codeDc;
}
/**
* useAt attribute .
* @return String
*/
public String getUseAt() {
return useAt;
}
/**
* useAt attribute .
* @param useAt String
*/
public void setUseAt(String useAt) {
this.useAt = useAt;
}
/**
* frstRegisterId attribute .
* @return String
*/
public String getFrstRegisterId() {
return frstRegisterId;
}
/**
* frstRegisterId attribute .
* @param frstRegisterId String
*/
public void setFrstRegisterId(String frstRegisterId) {
this.frstRegisterId = frstRegisterId;
}
/**
* lastUpdusrId attribute .
* @return String
*/
public String getLastUpdusrId() {
return lastUpdusrId;
}
/**
* lastUpdusrId attribute .
* @param lastUpdusrId String
*/
public void setLastUpdusrId(String lastUpdusrId) {
this.lastUpdusrId = lastUpdusrId;
}
}

View File

@ -0,0 +1,118 @@
package egovframework.com.cmm.service;
import java.util.List;
import java.util.Map;
/**
* @Class Name : EgovFileMngService.java
* @Description :
* @Modification Information
*
*
* ------- ------- -------------------
* 2009. 3. 25.
*
* @author
* @since 2009. 3. 25.
* @version
* @see
*
*/
public interface EgovFileMngService {
/**
* .
*
* @param fvo
* @return
* @throws Exception
*/
public List<FileVO> selectFileInfs(FileVO fvo) throws Exception;
/**
* ( ) .
*
* @param fvo
* @throws Exception
*/
public String insertFileInf(FileVO fvo) throws Exception;
/**
* ( ) .
*
* @param fvoList
* @throws Exception
*/
@SuppressWarnings("unchecked")
public String insertFileInfs(List fvoList) throws Exception;
/**
* ( ) .
*
* @param fvoList
* @throws Exception
*/
@SuppressWarnings("unchecked")
public void updateFileInfs(List fvoList) throws Exception;
/**
* .
*
* @param fvoList
* @throws Exception
*/
@SuppressWarnings("unchecked")
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;
}

View File

@ -0,0 +1,537 @@
package egovframework.com.cmm.service;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.multipart.MultipartFile;
import egovframework.com.cmm.EgovWebUtil;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
/**
* @Class Name : EgovFileMngUtil.java
* @Description :
* @Modification Information
*
* ------- -------- ---------------------------
* 2009.02.13 2011.08.09 utl.fcc Dependency
* getTimeStamp()
* @author
* @since 2009. 02. 13
* @version 1.0
* @see
*
*/
@Component("EgovFileMngUtil")
public class EgovFileMngUtil {
public static final int BUFF_SIZE = 2048;
@Resource(name = "egovFileIdGnrService")
private EgovIdGnrService idgenService;
private static final Logger LOG = Logger.getLogger(EgovFileMngUtil.class.getName());
/**
* .
*
* @param files
* @return
* @throws Exception
*/
public List<FileVO> parseFileInf(Map<String, MultipartFile> files, String KeyStr, int fileKeyParam,
String atchFileId, String storePath) throws Exception {
int fileKey = fileKeyParam;
String storePathString = "";
String atchFileIdString = "";
if ("".equals(storePath) || storePath == null) {
storePathString = EgovProperties.getProperty("Globals.fileStorePath");
} else {
storePathString = EgovProperties.getProperty(storePath);
}
if ("".equals(atchFileId) || atchFileId == null) {
atchFileIdString = idgenService.getNextStringId();
} else {
atchFileIdString = atchFileId;
}
File saveFolder = new File(EgovWebUtil.filePathBlackList(storePathString));
if (!saveFolder.exists() || saveFolder.isFile()) {
saveFolder.mkdirs();
}
Iterator<Entry<String, MultipartFile>> itr = files.entrySet().iterator();
MultipartFile file;
String filePath = "";
List<FileVO> result = new ArrayList<FileVO>();
FileVO fvo;
while (itr.hasNext()) {
Entry<String, MultipartFile> entry = itr.next();
file = entry.getValue();
String orginFileName = file.getOriginalFilename();
// --------------------------------------
// 원 파일명이 없는 경우 처리
// (첨부가 되지 않은 input file type)
// --------------------------------------
if ("".equals(orginFileName)) {
continue;
}
//// ------------------------------------
int index = orginFileName.lastIndexOf(".");
// String fileName = orginFileName.substring(0, index);
String fileExt = orginFileName.substring(index + 1);
String newName = KeyStr + getTimeStamp() + fileKey;
long _size = file.getSize();
if (!"".equals(orginFileName)) {
filePath = storePathString + File.separator + newName;
file.transferTo(new File(EgovWebUtil.filePathBlackList(filePath)));
}
fvo = new FileVO();
fvo.setFileExtsn(fileExt);
fvo.setFileStreCours(storePathString);
fvo.setFileMg(Long.toString(_size));
fvo.setOrignlFileNm(orginFileName);
fvo.setStreFileNm(newName);
fvo.setAtchFileId(atchFileIdString);
fvo.setFileSn(String.valueOf(fileKey));
// 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;
try {
stream = file.getInputStream();
File cFile = new File(stordFilePath);
if (!cFile.isDirectory()) {
boolean _flag = cFile.mkdir();
if (!_flag) {
throw new IOException("Directory creation Failed ");
}
}
bos = new FileOutputStream(stordFilePath + File.separator + newName);
int bytesRead = 0;
byte[] buffer = new byte[BUFF_SIZE];
while ((bytesRead = stream.read(buffer, 0, BUFF_SIZE)) != -1) {
bos.write(buffer, 0, bytesRead);
}
} catch (FileNotFoundException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} finally {
if (bos != null) {
try {
bos.close();
} catch (FileNotFoundException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ignore) {
LOG.debug("IGNORED: " + ignore.getMessage());
}
}
if (stream != null) {
try {
stream.close();
} catch (FileNotFoundException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ignore) {
LOG.debug("IGNORED: " + ignore.getMessage());
}
}
}
}
/**
* .
*
* @param request
* @param response
* @throws Exception
*/
public static void downFile(HttpServletRequest request, HttpServletResponse response) throws Exception {
String downFileName = "";
String orgFileName = "";
if ((String) request.getAttribute("downFile") == null) {
downFileName = "";
} else {
downFileName = (String) request.getAttribute("downFile");
}
if ((String) request.getAttribute("orgFileName") == null) {
orgFileName = "";
} else {
orgFileName = (String) request.getAttribute("orginFile");
}
orgFileName = orgFileName.replaceAll("\r", "").replaceAll("\n", "");
File file = new File(EgovWebUtil.filePathBlackList(downFileName));
if (!file.exists()) {
throw new FileNotFoundException(downFileName);
}
if (!file.isFile()) {
throw new FileNotFoundException(downFileName);
}
byte[] b = new byte[BUFF_SIZE]; // buffer size 2K.
response.setContentType("application/x-msdownload");
response.setHeader("Content-Disposition:",
"attachment; filename=" + new String(orgFileName.getBytes(), "UTF-8"));
response.setHeader("Content-Transfer-Encoding", "binary");
response.setHeader("Pragma", "no-cache");
response.setHeader("Expires", "0");
BufferedInputStream fin = null;
BufferedOutputStream outs = null;
try {
fin = new BufferedInputStream(new FileInputStream(file));
outs = new BufferedOutputStream(response.getOutputStream());
int read = 0;
while ((read = fin.read(b)) != -1) {
outs.write(b, 0, read);
}
} finally {
if (outs != null) {
try {
outs.close();
} catch (FileNotFoundException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ignore) {
// System.out.println("IGNORED: " + ignore.getMessage());
LOG.debug("IGNORED: " + ignore.getMessage());
}
}
if (fin != null) {
try {
fin.close();
} catch (FileNotFoundException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ignore) {
// System.out.println("IGNORED: " + ignore.getMessage());
LOG.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 = getTimeStamp(); // 2012.11 KISA 보안조치
writeFile(file, newName, stordFilePath);
// storedFilePath는 지정
map.put(Globals.ORIGIN_FILE_NM, orginFileName);
map.put(Globals.UPLOAD_FILE_NM, newName);
map.put(Globals.FILE_EXT, fileExt);
map.put(Globals.FILE_PATH, stordFilePath);
map.put(Globals.FILE_SIZE, String.valueOf(size));
return map;
}
/**
* .
*
* @param file
* @param newName
* @param stordFilePath
* @throws Exception
*/
protected static void writeFile(MultipartFile file, String newName, String stordFilePath) throws Exception {
InputStream stream = null;
OutputStream bos = null;
try {
stream = file.getInputStream();
File cFile = new File(EgovWebUtil.filePathBlackList(stordFilePath));
if (!cFile.isDirectory())
cFile.mkdir();
bos = new FileOutputStream(EgovWebUtil.filePathBlackList(stordFilePath + File.separator + newName));
int bytesRead = 0;
byte[] buffer = new byte[BUFF_SIZE];
while ((bytesRead = stream.read(buffer, 0, BUFF_SIZE)) != -1) {
bos.write(buffer, 0, bytesRead);
}
} catch (FileNotFoundException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception e) {
// e.printStackTrace();
// throw new RuntimeException(e); // 보안점검 후속조치
Logger.getLogger(EgovFileMngUtil.class).debug("IGNORED: " + e.getMessage());
} finally {
if (bos != null) {
try {
bos.close();
} catch (FileNotFoundException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ignore) {
Logger.getLogger(EgovFileMngUtil.class).debug("IGNORED: " + ignore.getMessage());
}
}
if (stream != null) {
try {
stream.close();
} catch (FileNotFoundException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ignore) {
Logger.getLogger(EgovFileMngUtil.class).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 = streFileNm;
String orgFileName = orignFileNm;
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 (FileNotFoundException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ignore) {
Logger.getLogger(EgovFileMngUtil.class).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>&copy; webAccess");
* printwriter.println("</html>"); printwriter.flush(); printwriter.close(); }
* //
*/
/*
* response.setContentType("application/x-msdownload");
* response.setHeader("Content-Disposition:", "attachment; filename=" + new
* String(orgFileName.getBytes(),"UTF-8" ));
* response.setHeader("Content-Transfer-Encoding","binary");
* response.setHeader("Pragma","no-cache"); response.setHeader("Expires","0");
*
* BufferedInputStream fin = new BufferedInputStream(new FileInputStream(file));
* BufferedOutputStream outs = new
* BufferedOutputStream(response.getOutputStream()); int read = 0;
*
* while ((read = fin.read(b)) != -1) { outs.write(b,0,read); }
* log.debug(this.getClass().getName()
* +" BufferedOutputStream Write Complete!!! ");
*
* outs.close(); fin.close(); //
*/
}
/**
* 2011.08.09 utl.fcc Dependency
* 17TIMESTAMP
*
* @param
* @return Timestamp
* @exception MyException
* @see
*/
private static String getTimeStamp() {
String rtnStr = null;
// 문자열로 변환하기 위한 패턴 설정(년도-월-일 시:분:초:초(자정이후 초))
String pattern = "yyyyMMddhhmmssSSS";
try {
SimpleDateFormat sdfCurrent = new SimpleDateFormat(pattern, Locale.KOREA);
Timestamp ts = new Timestamp(System.currentTimeMillis());
rtnStr = sdfCurrent.format(ts.getTime());
} catch (NumberFormatException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception e) {
// e.printStackTrace();
// throw new RuntimeException(e); // 보안점검 후속조치
LOG.debug("IGNORED: " + e.getMessage());
}
return rtnStr;
}
}

View File

@ -0,0 +1,376 @@
package egovframework.com.cmm.service;
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.apache.log4j.Logger;
import egovframework.com.cmm.EgovWebUtil;
/**
* Class Name : EgovProperties.java
* Description : properties Globals
* .
* Modification Information
*
*
* ------- -------- ---------------------------
* 2009.01.19
* 2011.07.20 Globals
* @author
* @since 2009. 01. 19
* @version 1.0
* @see
*
*/
public class EgovProperties{
//프로퍼티값 로드시 에러발생하면 반환되는 에러문자열
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") + System.getProperty("file.separator") + "egovProps"
+ System.getProperty("file.separator") + "globals.properties";*/
// public static final String RELATIVE_PATH_PREFIX = EgovProperties.class.getResource("").getPath()
// + System.getProperty("file.separator") + ".." + System.getProperty("file.separator")
// + ".." + System.getProperty("file.separator") + ".." + System.getProperty("file.separator");
public static final String RELATIVE_PATH_PREFIX = EgovProperties.class.getResource("").getPath().substring(0, EgovProperties.class.getResource("").getPath().lastIndexOf("com"));
public static final String GLOBALS_PROPERTIES_FILE = RELATIVE_PATH_PREFIX + "egovProps" + System.getProperty("file.separator") + "globals.properties";
public static final String GEOINFO_PROPERTIES_FILE = RELATIVE_PATH_PREFIX + "egovProps" + System.getProperty("file.separator") + "geoinfo.properties";
public static final String GEOINFOWEB_PROPERTIES_FILE = RELATIVE_PATH_PREFIX + "egovProps" + System.getProperty("file.separator") + "geoinfoWeb.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(EgovWebUtil.filePathBlackList(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 (FileNotFoundException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ex) {
//ex.printStackTrace();
//System.out.println("IGNORE: " + ex); // 2011.10.10 보안점검 후속조치
Logger.getLogger(EgovProperties.class).debug("IGNORED: " + ex.getMessage());
}
}
return value;
}
/**
* Key (Globals.properties )
* @param keyName String
* @return String
*/
public static String getProperty(String keyName){
String value = ERR_CODE;
value="99";
debug(GLOBALS_PROPERTIES_FILE + " : " + keyName);
FileInputStream fis = null;
try{
Properties props = new Properties();
fis = new FileInputStream(EgovWebUtil.filePathBlackList(GLOBALS_PROPERTIES_FILE));
props.load(new java.io.BufferedInputStream(fis));
value = props.getProperty(keyName).trim();
}catch(FileNotFoundException fne){
debug(fne);
}catch(IOException ioe){
debug(ioe);
}catch(Exception e){
debug(e);
}finally{
try {
if (fis != null) fis.close();
} catch (FileNotFoundException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ex) {
//ex.printStackTrace();
//System.out.println("IGNORE: " + ex); // 2011.10.10 보안점검 후속조치
Logger.getLogger(EgovProperties.class).debug("IGNORED: " + ex.getMessage());
}
}
return value;
}
/**
* Key (geoinfo.properties )
* @param keyName String
* @return String
*/
public static String getGeoinfoProperty(String keyName){
String value = ERR_CODE;
value="99";
debug(GEOINFO_PROPERTIES_FILE + " : " + keyName);
FileInputStream fis = null;
try{
Properties props = new Properties();
fis = new FileInputStream(EgovWebUtil.filePathBlackList(GEOINFO_PROPERTIES_FILE));
props.load(new java.io.BufferedInputStream(fis));
value = props.getProperty(keyName).trim();
}catch(FileNotFoundException fne){
debug(fne);
}catch(IOException ioe){
debug(ioe);
}catch(Exception e){
debug(e);
}finally{
try {
if (fis != null) fis.close();
} catch (FileNotFoundException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ex) {
//ex.printStackTrace();
//System.out.println("IGNORE: " + ex); // 2011.10.10 보안점검 후속조치
Logger.getLogger(EgovProperties.class).debug("IGNORED: " + ex.getMessage());
}
}
return value;
}
/**
* Key (geoinfoWeb.properties )
* @param keyName String
* @return String
*/
public static String getGeoinfoWebProperty(String keyName){
String value = ERR_CODE;
value="99";
debug(GEOINFOWEB_PROPERTIES_FILE + " : " + keyName);
FileInputStream fis = null;
try{
Properties props = new Properties();
fis = new FileInputStream(EgovWebUtil.filePathBlackList(GEOINFOWEB_PROPERTIES_FILE));
props.load(new java.io.BufferedInputStream(fis));
value = props.getProperty(keyName).trim();
}catch(FileNotFoundException fne){
debug(fne);
}catch(IOException ioe){
debug(ioe);
}catch(Exception e){
debug(e);
}finally{
try {
if (fis != null) fis.close();
} catch (FileNotFoundException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ex) {
//ex.printStackTrace();
//System.out.println("IGNORE: " + ex); // 2011.10.10 보안점검 후속조치
Logger.getLogger(EgovProperties.class).debug("IGNORED: " + ex.getMessage());
}
}
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(EgovWebUtil.filePathBlackList(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 (FileNotFoundException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ex) {
//ex.printStackTrace();
debug(ex); // 2011.10.10 보안점검 후속조치
}
}
}
/**
* 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(EgovWebUtil.filePathBlackList(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 (FileNotFoundException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ex) {
//ex.printStackTrace();
//System.out.println("IGNORE: " + ex); // 2011.10.10 보안점검 후속조치
Logger.getLogger(EgovProperties.class).debug("IGNORED: " + ex.getMessage());
}
}
}
/**
* (key-value) .
* @param property String
* @return ArrayList
*/
public static ArrayList loadPropertyFile(String property){
// key - value 형태로 된 배열 결과
ArrayList keyList = new ArrayList();
String src = property.replace('\\', FILE_SEPARATOR).replace('/', FILE_SEPARATOR);
FileInputStream fis = null;
try
{
File srcFile = new File(EgovWebUtil.filePathBlackList(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 map = new HashMap();
String key = (String)plist.nextElement();
map.put(key, props.getProperty(key));
keyList.add(map);
}
}
}
} catch (FileNotFoundException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ex){
//ex.printStackTrace();
debug(ex); // 2011.10.10 보안점검 후속조치
} finally {
try {
if (fis != null) fis.close();
} catch (FileNotFoundException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (NumberFormatException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (IOException e) {
Logger.getLogger(EgovProperties.class).error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
} catch (Exception ex) {
//ex.printStackTrace();
//System.out.println("IGNORE: " + ex); // 2011.10.10 보안점검 후속조치
Logger.getLogger(EgovProperties.class).debug("IGNORED: " + ex.getMessage());
}
}
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.getLogger(EgovProperties.class).debug("IGNORED: " + ((Exception)obj).getMessage());
}
}
}

View File

@ -0,0 +1,26 @@
package egovframework.com.cmm.service;
import java.util.List;
public interface EgovUserDetailsService {
/**
* VO .
* @return Object - ValueObject
*/
public Object getAuthenticatedUser();
/**
* .
* ) [ROLE_ADMIN, ROLE_USER, ROLE_A, ROLE_B, ROLE_RESTRICTED, IS_AUTHENTICATED_FULLY, IS_AUTHENTICATED_REMEMBERED, IS_AUTHENTICATED_ANONYMOUSLY]
* @return List -
*/
public List<String> getAuthorities();
/**
* .
* @return Boolean - (TRUE / FALSE)
*/
public Boolean isAuthenticated();
}

View File

@ -0,0 +1,240 @@
package egovframework.com.cmm.service;
import java.io.Serializable;
import org.apache.commons.lang.builder.ToStringBuilder;
/**
* @Class Name : FileVO.java
* @Description : VO
* @Modification Information
*
*
* ------- ------- -------------------
* 2009. 3. 25.
*
* @author
* @since 2009. 3. 25.
* @version
* @see
*
*/
@SuppressWarnings("serial")
public class FileVO implements Serializable {
/**
*
*/
public String atchFileId = "";
/**
*
*/
public String creatDt = "";
/**
*
*/
public String fileCn = "";
/**
*
*/
public String fileExtsn = "";
/**
*
*/
public String fileMg = "";
/**
*
*/
public String fileSn = "";
/**
*
*/
public String fileStreCours = "";
/**
*
*/
public String orignlFileNm = "";
/**
*
*/
public String streFileNm = "";
/**
* atchFileId attribute .
*
* @return the atchFileId
*/
public String getAtchFileId() {
return atchFileId;
}
/**
* atchFileId attribute .
*
* @param atchFileId
* the atchFileId to set
*/
public void setAtchFileId(String atchFileId) {
this.atchFileId = atchFileId;
}
/**
* creatDt attribute .
*
* @return the creatDt
*/
public String getCreatDt() {
return creatDt;
}
/**
* creatDt attribute .
*
* @param creatDt
* the creatDt to set
*/
public void setCreatDt(String creatDt) {
this.creatDt = creatDt;
}
/**
* fileCn attribute .
*
* @return the fileCn
*/
public String getFileCn() {
return fileCn;
}
/**
* fileCn attribute .
*
* @param fileCn
* the fileCn to set
*/
public void setFileCn(String fileCn) {
this.fileCn = fileCn;
}
/**
* fileExtsn attribute .
*
* @return the fileExtsn
*/
public String getFileExtsn() {
return fileExtsn;
}
/**
* fileExtsn attribute .
*
* @param fileExtsn
* the fileExtsn to set
*/
public void setFileExtsn(String fileExtsn) {
this.fileExtsn = fileExtsn;
}
/**
* fileMg attribute .
*
* @return the fileMg
*/
public String getFileMg() {
return fileMg;
}
/**
* fileMg attribute .
*
* @param fileMg
* the fileMg to set
*/
public void setFileMg(String fileMg) {
this.fileMg = fileMg;
}
/**
* fileSn attribute .
*
* @return the fileSn
*/
public String getFileSn() {
return fileSn;
}
/**
* fileSn attribute .
*
* @param fileSn
* the fileSn to set
*/
public void setFileSn(String fileSn) {
this.fileSn = fileSn;
}
/**
* fileStreCours attribute .
*
* @return the fileStreCours
*/
public String getFileStreCours() {
return fileStreCours;
}
/**
* fileStreCours attribute .
*
* @param fileStreCours
* the fileStreCours to set
*/
public void setFileStreCours(String fileStreCours) {
this.fileStreCours = fileStreCours;
}
/**
* orignlFileNm attribute .
*
* @return the orignlFileNm
*/
public String getOrignlFileNm() {
return orignlFileNm;
}
/**
* orignlFileNm attribute .
*
* @param orignlFileNm
* the orignlFileNm to set
*/
public void setOrignlFileNm(String orignlFileNm) {
this.orignlFileNm = orignlFileNm;
}
/**
* streFileNm attribute .
*
* @return the streFileNm
*/
public String getStreFileNm() {
return streFileNm;
}
/**
* streFileNm attribute .
*
* @param streFileNm
* the streFileNm to set
*/
public void setStreFileNm(String streFileNm) {
this.streFileNm = streFileNm;
}
/**
* toString .
*/
public String toString() {
return ToStringBuilder.reflectionToString(this);
}
}

View File

@ -0,0 +1,58 @@
package egovframework.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 {
//OS 유형
public static final String OS_TYPE = EgovProperties.getProperty("Globals.OsType");
//DB 유형
public static final String DB_TYPE = EgovProperties.getProperty("Globals.DbType");
//메인 페이지
public static final String MAIN_PAGE = EgovProperties.getProperty("Globals.MainPage");
//ShellFile 경로
public static final String SHELL_FILE_PATH = EgovProperties.getPathProperty("Globals.ShellFilePath");
//퍼로퍼티 파일 위치
public static final String CONF_PATH = EgovProperties.getPathProperty("Globals.ConfPath");
//Server정보 프로퍼티 위치
public static final String SERVER_CONF_PATH = EgovProperties.getPathProperty("Globals.ServerConfPath");
//Client정보 프로퍼티 위치
public static final String CLIENT_CONF_PATH = EgovProperties.getPathProperty("Globals.ClientConfPath");
//파일포맷 정보 프로퍼티 위치
public static final String FILE_FORMAT_PATH = EgovProperties.getPathProperty("Globals.FileFormatPath");
//파일 업로드 원 파일명
public static final String ORIGIN_FILE_NM = "originalFileName";
//파일 확장자
public static final String FILE_EXT = "fileExtension";
//파일크기
public static final String FILE_SIZE = "fileSize";
//업로드된 파일명
public static final String UPLOAD_FILE_NM = "uploadFileName";
//파일경로
public static final String FILE_PATH = "filePath";
//메일발송요청 XML파일경로
public static final String MAIL_REQUEST_PATH = EgovProperties.getPathProperty("Globals.MailRequestPath");
//메일발송응답 XML파일경로
public static final String MAIL_RESPONSE_PATH = EgovProperties.getPathProperty("Globals.MailRResponsePath");
// G4C 연결용 IP (localhost)
public static final String LOCAL_IP = EgovProperties.getProperty("Globals.LocalIp");
}

View File

@ -0,0 +1,37 @@
/**
*
*/
package egovframework.com.cmm.service.impl;
import javax.annotation.Resource;
import com.ibatis.sqlmap.client.SqlMapClient;
import egovframework.rte.psl.dataaccess.EgovAbstractDAO;
/**
* EgovComAbstractDAO.java
*
* @author
* @since 2011. 9. 23.
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- ------------- ----------------------
* 2011. 9. 23.
* </pre>
*/
public abstract class EgovComAbstractDAO extends EgovAbstractDAO{
@Resource(name="egov.sqlMapClient")
public void setSuperSqlMapClient(SqlMapClient sqlMapClient) {
super.setSuperSqlMapClient(sqlMapClient);
}
}

View File

@ -0,0 +1,161 @@
package egovframework.com.cmm.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;
import egovframework.com.cmm.service.EgovFileMngService;
import egovframework.com.cmm.service.FileVO;
import egovframework.rte.fdl.cmmn.AbstractServiceImpl;
/**
* @Class Name : EgovFileMngServiceImpl.java
* @Description :
* @Modification Information
*
*
* ------- ------- -------------------
* 2009. 3. 25.
*
* @author
* @since 2009. 3. 25.
* @version
* @see
*
*/
@Service("EgovFileMngService")
public class EgovFileMngServiceImpl extends AbstractServiceImpl implements EgovFileMngService {
@Resource(name = "FileManageDAO")
private FileManageDAO fileMngDAO;
public static final Logger LOGGER = Logger.getLogger(EgovFileMngServiceImpl.class.getName());
/**
* .
*
* @see egovframework.com.cmm.service.EgovFileMngService#deleteFileInfs(java.util.List)
*/
@SuppressWarnings("unchecked")
public void deleteFileInfs(List fvoList) throws Exception {
fileMngDAO.deleteFileInfs(fvoList);
}
/**
* ( ) .
*
* @see egovframework.com.cmm.service.EgovFileMngService#insertFileInf(egovframework.com.cmm.service.FileVO)
*/
public String insertFileInf(FileVO fvo) throws Exception {
String atchFileId = fvo.getAtchFileId();
fileMngDAO.insertFileInf(fvo);
return atchFileId;
}
/**
* ( ) .
*
* @see egovframework.com.cmm.service.EgovFileMngService#insertFileInfs(java.util.List)
*/
@SuppressWarnings("unchecked")
public String insertFileInfs(List fvoList) throws Exception {
String atchFileId = "";
if (fvoList.size() != 0) {
atchFileId = fileMngDAO.insertFileInfs(fvoList);
}
if(atchFileId == ""){
atchFileId = null;
}
return atchFileId;
}
/**
* .
*
* @see egovframework.com.cmm.service.EgovFileMngService#selectFileInfs(egovframework.com.cmm.service.FileVO)
*/
public List<FileVO> selectFileInfs(FileVO fvo) throws Exception {
return fileMngDAO.selectFileInfs(fvo);
}
/**
* ( ) .
*
* @see egovframework.com.cmm.service.EgovFileMngService#updateFileInfs(java.util.List)
*/
@SuppressWarnings("unchecked")
public void updateFileInfs(List fvoList) throws Exception {
//Delete & Insert
fileMngDAO.updateFileInfs(fvoList);
}
/**
* .
*
* @see egovframework.com.cmm.service.EgovFileMngService#deleteFileInf(egovframework.com.cmm.service.FileVO)
*/
public void deleteFileInf(FileVO fvo) throws Exception {
fileMngDAO.deleteFileInf(fvo);
}
/**
* .
*
* @see egovframework.com.cmm.service.EgovFileMngService#selectFileInf(egovframework.com.cmm.service.FileVO)
*/
public FileVO selectFileInf(FileVO fvo) throws Exception {
return fileMngDAO.selectFileInf(fvo);
}
/**
* .
*
* @see egovframework.com.cmm.service.EgovFileMngService#getMaxFileSN(egovframework.com.cmm.service.FileVO)
*/
public int getMaxFileSN(FileVO fvo) throws Exception {
return fileMngDAO.getMaxFileSN(fvo);
}
/**
* .
*
* @see egovframework.com.cmm.service.EgovFileMngService#deleteAllFileInf(egovframework.com.cmm.service.FileVO)
*/
public void deleteAllFileInf(FileVO fvo) throws Exception {
fileMngDAO.deleteAllFileInf(fvo);
}
/**
* .
*
* @see egovframework.com.cmm.service.EgovFileMngService#selectFileListByFileNm(egovframework.com.cmm.service.FileVO)
*/
public Map<String, Object> selectFileListByFileNm(FileVO fvo) throws Exception {
List<FileVO> result = fileMngDAO.selectFileListByFileNm(fvo);
int cnt = fileMngDAO.selectFileListCntByFileNm(fvo);
Map<String, Object> map = new HashMap<String, Object>();
map.put("resultList", result);
map.put("resultCnt", Integer.toString(cnt));
return map;
}
/**
* .
*
* @see egovframework.com.cmm.service.EgovFileMngService#selectImageFileList(egovframework.com.cmm.service.FileVO)
*/
public List<FileVO> selectImageFileList(FileVO vo) throws Exception {
return fileMngDAO.selectImageFileList(vo);
}
}

View File

@ -0,0 +1,83 @@
package egovframework.com.cmm.service.impl;
import java.util.ArrayList;
import java.util.List;
import egovframework.com.cmm.LoginVO;
import egovframework.com.cmm.service.EgovUserDetailsService;
import egovframework.rte.fdl.cmmn.AbstractServiceImpl;
/**
*
* @author
* @since 2011. 8. 12.
* @version 1.0
* @see
*
* <pre>
* (Modification Information)
*
*
* ------- -------- ---------------------------
* 2011. 8. 12.
*
* </pre>
*/
public class EgovTestUserDetailsServiceImpl extends AbstractServiceImpl implements
EgovUserDetailsService {
public Object getAuthenticatedUser() {
LoginVO loginVO = new LoginVO();
loginVO.setId("TEST1");
loginVO.setPassword("a4ayc/80/OGda4BO/1o/V0etpOqiLx1JwB5S3beHW0s=");
loginVO.setUserSe("USR");
loginVO.setEmail("a3@aa.aa");
loginVO.setIhidNum("1111111111118");
loginVO.setName("더미사용자");
loginVO.setOrgnztId("ORGNZT_0000000000000");
loginVO.setUniqId("USRCNFRM_00000000000");
return loginVO;
// return
// RequestContextHolder.getRequestAttributes().getAttribute("loginVO",
// RequestAttributes.SCOPE_SESSION);
}
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;
}
public Boolean isAuthenticated() {
// 인증된 유저인지 확인한다.
/*if (RequestContextHolder.getRequestAttributes() == null) {
return false;
} else {
if (RequestContextHolder.getRequestAttributes().getAttribute(
"loginVO", RequestAttributes.SCOPE_SESSION) == null) {
return false;
} else {
return true;
}
}*/
return true;
}
}

View File

@ -0,0 +1,66 @@
package egovframework.com.cmm.service.impl;
import java.util.ArrayList;
import java.util.List;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import egovframework.com.cmm.service.EgovUserDetailsService;
import egovframework.rte.fdl.cmmn.AbstractServiceImpl;
/**
*
* @author
* @since 2011. 6. 25.
* @version 1.0
* @see
*
* <pre>
* (Modification Information)
*
*
* ------- -------- ---------------------------
* 2011. 8. 12.
*
* </pre>
*/
public class EgovUserDetailsSessionServiceImpl extends AbstractServiceImpl implements
EgovUserDetailsService {
public Object getAuthenticatedUser() {
return RequestContextHolder.getRequestAttributes().getAttribute("loginVO", RequestAttributes.SCOPE_SESSION);
}
public List<String> getAuthorities() {
// 권한 설정을 리턴한다.
List<String> listAuth = new ArrayList<String>();
return listAuth;
}
public Boolean isAuthenticated() {
// 인증된 유저인지 확인한다.
if (RequestContextHolder.getRequestAttributes() == null) {
return false;
} else {
if (RequestContextHolder.getRequestAttributes().getAttribute(
"loginVO", RequestAttributes.SCOPE_SESSION) == null) {
return false;
} else {
return true;
}
}
}
}

View File

@ -0,0 +1,187 @@
package egovframework.com.cmm.service.impl;
import java.util.Iterator;
import java.util.List;
import org.springframework.stereotype.Repository;
import egovframework.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 {
//private static final Logger LOG = Logger.getLogger(this.getClass());
/**
* ( ) .
*
* @param fileList
* @return
* @throws Exception
*/
@SuppressWarnings("unchecked")
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
*/
@SuppressWarnings("unchecked")
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
*/
@SuppressWarnings("unchecked")
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("FileManageDAO.selectFileList", vo);
}
/**
* .
*
* @param fvo
* @return
* @throws Exception
*/
public int getMaxFileSN(FileVO fvo) throws Exception {
return (Integer)getSqlMapClientTemplate().queryForObject("FileManageDAO.getMaxFileSN", fvo);
}
/**
* .
*
* @param fvo
* @return
* @throws Exception
*/
public FileVO selectFileInf(FileVO fvo) throws Exception {
return (FileVO)selectByPk("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("FileManageDAO.selectFileListByFileNm", fvo);
}
/**
* .
*
* @param fvo
* @return
* @throws Exception
*/
public int selectFileListCntByFileNm(FileVO fvo) throws Exception {
return (Integer)getSqlMapClientTemplate().queryForObject("FileManageDAO.selectFileListCntByFileNm", fvo);
}
/**
* .
*
* @param vo
* @return
* @throws Exception
*/
@SuppressWarnings("unchecked")
public List<FileVO> selectImageFileList(FileVO vo) throws Exception {
return list("FileManageDAO.selectImageFileList", vo);
}
}

View File

@ -0,0 +1,68 @@
package egovframework.com.cmm.util;
import java.util.List;
import egovframework.com.cmm.service.EgovUserDetailsService;
/**
* EgovUserDetails Helper
*
* @author sjyoon
* @since 2009.06.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- ------------- ----------------------
* 2009.03.10 sjyoon
* 2011.07.01 interface
* </pre>
*/
public class EgovUserDetailsHelper {
static EgovUserDetailsService egovUserDetailsService;
public EgovUserDetailsService getEgovUserDetailsService() {
return egovUserDetailsService;
}
public void setEgovUserDetailsService(
EgovUserDetailsService egovUserDetailsService) {
this.egovUserDetailsService = egovUserDetailsService;
}
/**
* VO .
* @return Object - ValueObject
*/
public static Object getAuthenticatedUser() {
return egovUserDetailsService.getAuthenticatedUser();
}
/**
* .
*
* @return List -
*/
public static List<String> getAuthorities() {
return egovUserDetailsService.getAuthorities();
}
/**
* .
* @return Boolean - (TRUE / FALSE)
*/
public static Boolean isAuthenticated() {
return egovUserDetailsService.isAuthenticated();
}
}

View File

@ -0,0 +1,22 @@
package egovframework.com.cmm.web;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.beans.propertyeditors.StringTrimmerEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.support.WebBindingInitializer;
import org.springframework.web.context.request.WebRequest;
public class EgovBindingInitializer implements WebBindingInitializer {
public void initBinder(WebDataBinder binder, WebRequest request) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setLenient(false);
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, false));
binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
}
}

View File

@ -0,0 +1,189 @@
package egovframework.com.cmm.web;
import java.io.FileNotFoundException;
import java.io.IOException;
/**
* IncludedInfo annotation
* Controller
* <Notice>
*
* URL ,
*
*
* <Disclaimer>
*
*
* @author
* @since 2011.08.26
* @version 2.0.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2011.08.26
* 2011.09.16
* 2011.09.26 header, footer
* </pre>
*/
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.util.Map;
import java.util.TreeMap;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import egovframework.com.cmm.IncludedCompInfoVO;
import egovframework.com.cmm.LoginVO;
import egovframework.com.cmm.annotation.IncludedInfo;
import egovframework.com.cmm.service.EgovProperties;
import egovframework.com.cmm.util.EgovUserDetailsHelper;
@Controller
public class EgovComIndexController implements ApplicationContextAware ,InitializingBean {
private ApplicationContext applicationContext;
protected static final Log LOG = LogFactory.getLog(EgovComIndexController.class);
private Map map;
public void afterPropertiesSet() throws Exception {
// TODO Auto-generated method stub
}
public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException {
// TODO Auto-generated method stub
this.applicationContext = applicationContext;
LOG.info("EgovComIndexController setApplicationContext method has called!");
}
@RequestMapping("/index.do")
public String index(ModelMap model){
return "egovframework/com/cmm/EgovUnitMain";
}
@RequestMapping("/EgovTop.do")
public String top(){
return "egovframework/com/cmm/EgovUnitTop";
}
@RequestMapping("/EgovBottom.do")
public String bottom(){
return "egovframework/com/cmm/EgovUnitBottom";
}
@RequestMapping("/EgovContent.do")
public String setContent(ModelMap model){
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
model.addAttribute("loginVO", loginVO);
return "egovframework/com/cmm/EgovUnitContent";
}
@RequestMapping("/EgovLeft.do")
public String setLeftMenu(ModelMap model){
/*최초 한 번만 실행하여 map에 저장해 놓는다.*/
if(map == null){
map = new TreeMap();
RequestMapping rmAnnotation;
IncludedInfo annotation;
IncludedCompInfoVO zooVO;
/*
* EgovLoginController AOP Proxy reflection
*
*/
try{
Class loginController = Class.forName("egovframework.com.uat.uia.web.EgovLoginController");
Method[] methods = loginController.getMethods();
for(int i = 0; i< methods.length ;i++){
annotation = methods[i].getAnnotation(IncludedInfo.class);
if(annotation != null){
LOG.debug("Found @IncludedInfo Method : " + methods[i] );
zooVO = new IncludedCompInfoVO();
zooVO.setName(annotation.name());
zooVO.setOrder(annotation.order());
zooVO.setGid(annotation.gid());
rmAnnotation = methods[i].getAnnotation(RequestMapping.class);
if("".equals(annotation.listUrl()) && rmAnnotation != null){
zooVO.setListUrl(rmAnnotation.value()[0]);
}
else{
zooVO.setListUrl(annotation.listUrl());
}
map.put(zooVO.getOrder(),zooVO);
}
}
}
catch (IndexOutOfBoundsException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
}
catch (NumberFormatException e) {
LOG.error("IGNORE:", e); // 2011.10.10 보안점검 후속조치
}
catch(Exception e){
LOG.error("No egovframework.com.uat.uia.web.EgovLoginController!!");
}
/* 여기까지 AOP Proxy로 인한 임시 코드 */
/*@Controller Annotation 처리된 클래스를 모두 찾는다.*/
Map<String, Object> myZoos = applicationContext.getBeansWithAnnotation(Controller.class);
LOG.debug("How many Controllers : " + myZoos.size());
for (final Object myZoo : myZoos.values()) {
Class<? extends Object> zooClass = myZoo.getClass();
Method[] methods = zooClass.getMethods();
LOG.debug("Controller Detected " + zooClass);
for(int i = 0; i< methods.length ;i++){
annotation = methods[i].getAnnotation(IncludedInfo.class);
if(annotation != null){
//LOG.debug("Found @IncludedInfo Method : " + methods[i] );
zooVO = new IncludedCompInfoVO();
zooVO.setName(annotation.name());
zooVO.setOrder(annotation.order());
zooVO.setGid(annotation.gid());
/*
* url @IncludedInfo @RequestMapping
*/
rmAnnotation = methods[i].getAnnotation(RequestMapping.class);
if("".equals(annotation.listUrl())){
zooVO.setListUrl(rmAnnotation.value()[0]);
}
else{
zooVO.setListUrl(annotation.listUrl());
}
map.put(zooVO.getOrder(),zooVO);
}
}
}
}
model.addAttribute("resultList", map.values());
LOG.debug("EgovComIndexController index is called " );
return "egovframework/com/cmm/EgovUnitLeft";
}
}

View File

@ -0,0 +1,58 @@
package egovframework.com.cmm.web;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import egovframework.rte.fdl.property.EgovPropertyService;
/**
* @Class Name : EgovComUtlController.java
* @Description : Controller
* @Modification Information
* @
* @
* @ ------- -------- ---------------------------
* @ 2009.03.02
* @ 2011.10.07 .action -> .do
*
* @author
* @since 2009.03.02
* @version 1.0
* @see
*
*/
@Controller
public class EgovComUtlController {
//@Resource(name = "egovUserManageService")
//private EgovUserManageService egovUserManageService;
/** EgovPropertyService */
@Resource(name = "propertiesService")
protected EgovPropertyService propertiesService;
/**
* JSP
*/
@RequestMapping(value="/EgovPageLink.do")
public String moveToPage(@RequestParam("link") String linkPage){
String link = linkPage;
// service 사용하여 리턴할 결과값 처리하는 부분은 생략하고 단순 페이지 링크만 처리함
if (linkPage==null || linkPage.equals("")){
link="egovframework/com/cmm/egovError";
}
return link;
}
/**
* validato rule dynamic Javascript
*/
@RequestMapping("/validator.do")
public String validate(){
return "egovframework/com/cmm/validator";
}
}

View File

@ -0,0 +1,212 @@
package egovframework.com.cmm.web;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
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.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import egovframework.com.cmm.service.EgovFileMngService;
import egovframework.com.cmm.service.FileVO;
import egovframework.com.cmm.util.EgovUserDetailsHelper;
/**
*
* @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;
private static final Logger LOG = Logger.getLogger(EgovFileDownloadController.class.getName());
/**
* .
*
* @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("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("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);
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(Map<String, Object> commandMap, HttpServletRequest request, HttpServletResponse response) throws Exception {
String atchFileId = (String)commandMap.get("atchFileId");
String fileSn = (String)commandMap.get("fileSn");
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
if (isAuthenticated) {
FileVO fileVO = new FileVO();
fileVO.setAtchFileId(atchFileId);
fileVO.setFileSn(fileSn);
FileVO fvo = fileService.selectFileInf(fileVO);
File uFile = new File(fvo.getFileStreCours(), fvo.getStreFileNm());
int fSize = (int)uFile.length();
if (fSize > 0) {
String mimetype = "application/x-msdownload";
//response.setBufferSize(fSize); // OutOfMemeory 발생
response.setContentType(mimetype);
//response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(fvo.getOrignlFileNm(), "utf-8") + "\"");
setDisposition(fvo.getOrignlFileNm(), request, response);
response.setContentLength(fSize);
/*
* FileCopyUtils.copy(in, response.getOutputStream());
* in.close();
* response.getOutputStream().flush();
* response.getOutputStream().close();
*/
BufferedInputStream in = null;
BufferedOutputStream out = null;
try {
in = new BufferedInputStream(new FileInputStream(uFile));
out = new BufferedOutputStream(response.getOutputStream());
FileCopyUtils.copy(in, out);
out.flush();
} catch (FileNotFoundException ex) {
LOG.debug("IGNORED: " + ex);
} catch (IOException ex) {
LOG.debug("IGNORED: " + ex);
} catch (Exception ex) {
LOG.debug("IGNORED: " + ex.getMessage());
} finally {
if (in != null) {
try {
in.close();
} catch (FileNotFoundException ex) {
LOG.debug("IGNORED: " + ex);
} catch (IOException ex) {
LOG.debug("IGNORED: " + ex);
} catch (Exception ignore) {
// no-op
LOG.debug("IGNORED: " + ignore.getMessage());
}
}
if (out != null) {
try {
out.close();
} catch (FileNotFoundException ex) {
LOG.debug("IGNORED: " + ex);
} catch (IOException ex) {
LOG.debug("IGNORED: " + ex);
} catch (Exception ignore) {
// no-op
LOG.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>&copy; webAccess");
printwriter.println("</html>");
printwriter.flush();
printwriter.close();
}
}
}
}

View File

@ -0,0 +1,165 @@
package egovframework.com.cmm.web;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.log4j.Logger;
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;
import egovframework.com.cmm.service.EgovFileMngService;
import egovframework.com.cmm.service.FileVO;
import egovframework.com.cmm.util.EgovUserDetailsHelper;
/**
* , ,
* @author
* @since 2009.06.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.3.25
*
* </pre>
*/
@Controller
public class EgovFileMngController {
@Resource(name = "EgovFileMngService")
private EgovFileMngService fileService;
private static final Logger LOG = Logger.getLogger(EgovFileMngController.class.getName());
/**
* .
*
* @param fileVO
* @param atchFileId
* @param sessionVO
* @param model
* @return
* @throws Exception
*/
@RequestMapping("/cmm/fms/selectFileInfs.do")
public String selectFileInfs(@ModelAttribute("searchVO") FileVO fileVO, Map<String, Object> commandMap, ModelMap model) throws Exception {
String atchFileId = (String)commandMap.get("param_atchFileId");
fileVO.setAtchFileId(atchFileId);
List<FileVO> result = fileService.selectFileInfs(fileVO);
model.addAttribute("fileList", result);
model.addAttribute("updateFlag", "N");
model.addAttribute("fileListCnt", result.size());
model.addAttribute("atchFileId", atchFileId);
return "egovframework/com/cmm/fms/EgovFileList";
}
/**
* .
*
* @param fileVO
* @param atchFileId
* @param sessionVO
* @param model
* @return
* @throws Exception
*/
@RequestMapping("/cmm/fms/selectFileInfsForUpdate.do")
public String selectFileInfsForUpdate(@ModelAttribute("searchVO") FileVO fileVO, Map<String, Object> commandMap,
//SessionVO sessionVO,
ModelMap model) throws Exception {
String atchFileId = (String)commandMap.get("param_atchFileId");
fileVO.setAtchFileId(atchFileId);
List<FileVO> result = fileService.selectFileInfs(fileVO);
model.addAttribute("fileList", result);
model.addAttribute("updateFlag", "Y");
model.addAttribute("fileListCnt", result.size());
model.addAttribute("atchFileId", atchFileId);
return "egovframework/com/cmm/fms/EgovFileList";
}
/**
* .
*
* @param fileVO
* @param returnUrl
* @param sessionVO
* @param model
* @return
* @throws Exception
*/
@RequestMapping("/cmm/fms/deleteFileInfs.do")
public String deleteFileInf(@ModelAttribute("searchVO") FileVO fileVO, @RequestParam("returnUrl") String returnUrl,
//SessionVO sessionVO,
HttpServletRequest request,
ModelMap model) throws Exception {
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
if (isAuthenticated) {
fileService.deleteFileInf(fileVO);
}
//--------------------------------------------
// contextRoot가 있는 경우 제외 시켜야 함
//--------------------------------------------
////return "forward:/cmm/fms/selectFileInfs.do";
//return "forward:" + returnUrl;
if ("".equals(request.getContextPath()) || "/".equals(request.getContextPath())) {
return "forward:" + returnUrl;
}
if (returnUrl.startsWith(request.getContextPath())) {
return "forward:" + returnUrl.substring(returnUrl.indexOf("/", 1));
} else {
return "forward:" + returnUrl;
}
////------------------------------------------
}
/**
* .
*
* @param fileVO
* @param atchFileId
* @param sessionVO
* @param model
* @return
* @throws Exception
*/
@RequestMapping("/cmm/fms/selectImageFileInfs.do")
public String selectImageFileInfs(@ModelAttribute("searchVO") FileVO fileVO, Map<String, Object> commandMap,
//SessionVO sessionVO,
ModelMap model) throws Exception {
String atchFileId = (String)commandMap.get("atchFileId");
fileVO.setAtchFileId(atchFileId);
List<FileVO> result = fileService.selectImageFileList(fileVO);
model.addAttribute("fileList", result);
return "egovframework/com/cmm/fms/EgovImgFileList";
}
}

View File

@ -0,0 +1,158 @@
/*package egovframework.com.cmm.web;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import egovframework.com.cmm.SessionVO;
import egovframework.com.cmm.service.EgovFileMngService;
import egovframework.com.cmm.service.FileVO;
*//**
* @Class Name : EgovImageProcessController.java
* @Description :
* @Modification Information
*
*
* ------- ------- -------------------
* 2009. 4. 2.
*
* @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 LOG = Logger.getLogger(EgovImageProcessController.class.getName());
*//**
* .
*
* @param atchFileId
* @param fileSn
* @param sessionVO
* @param model
* @param response
* @throws Exception
*//*
@RequestMapping("/cmm/fms/getImage.do")
public void getImageInf(SessionVO sessionVO, ModelMap model, Map<String, Object> commandMap, HttpServletResponse response) throws Exception {
//@RequestParam("atchFileId") String atchFileId,
//@RequestParam("fileSn") String fileSn,
String atchFileId = (String)commandMap.get("atchFileId");
String fileSn = (String)commandMap.get("fileSn");
FileVO vo = new FileVO();
vo.setAtchFileId(atchFileId);
vo.setFileSn(fileSn);
FileVO fvo = fileService.selectFileInf(vo);
//String fileLoaction = fvo.getFileStreCours() + fvo.getStreFileNm();
// 2011.10.10 보안점검 후속조치
File file = null;
FileInputStream fis = null;
BufferedInputStream in = null;
ByteArrayOutputStream bStream = null;
try {
file = new File(fvo.getFileStreCours(), fvo.getStreFileNm());
fis = new FileInputStream(file);
in = new BufferedInputStream(fis);
bStream = new ByteArrayOutputStream();
int imgByte;
while ((imgByte = in.read()) != -1) {
bStream.write(imgByte);
}
String type = "";
if (fvo.getFileExtsn() != null && !"".equals(fvo.getFileExtsn())) {
if ("jpg".equals(fvo.getFileExtsn().toLowerCase())) {
type = "image/jpeg";
} else {
type = "image/" + fvo.getFileExtsn().toLowerCase();
}
type = "image/" + fvo.getFileExtsn().toLowerCase();
} else {
LOG.debug("Image fileType is null.");
}
response.setHeader("Content-Type", type);
response.setContentLength(bStream.size());
bStream.writeTo(response.getOutputStream());
response.getOutputStream().flush();
response.getOutputStream().close();
// 2011.10.10 보안점검 후속조치 끝
} finally {
if (bStream != null) {
try {
bStream.close();
} catch (FileNotFoundException ex) {
LOG.debug("IGNORED: " + ex);
} catch (IOException ex) {
LOG.debug("IGNORED: " + ex);
} catch (Exception ignore) {
//System.out.println("IGNORE: " + ignore);
LOG.debug("IGNORE: " + ignore.getMessage());
}
}
if (in != null) {
try {
in.close();
} catch (FileNotFoundException ex) {
LOG.debug("IGNORED: " + ex);
} catch (IOException ex) {
LOG.debug("IGNORED: " + ex);
} catch (Exception ignore) {
//System.out.println("IGNORE: " + ignore);
LOG.debug("IGNORE: " + ignore.getMessage());
}
}
if (fis != null) {
try {
fis.close();
} catch (FileNotFoundException ex) {
LOG.debug("IGNORED: " + ex);
} catch (IOException ex) {
LOG.debug("IGNORED: " + ex);
} catch (Exception ignore) {
//System.out.println("IGNORE: " + ignore);
LOG.debug("IGNORE: " + ignore.getMessage());
}
}
}
}
}
*/

View File

@ -0,0 +1,134 @@
package egovframework.com.cmm.web;
/*
* Copyright 2001-2006 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the ";License&quot;);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS"; BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletContext;
import org.apache.commons.fileupload.FileItem;
import org.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 {
public EgovMultipartResolver() {
}
/**
* multipart resolver .
*
* @param servletContext
*/
public EgovMultipartResolver(ServletContext servletContext) {
super(servletContext);
}
/**
* multipart parsing .
*/
@SuppressWarnings("unchecked")
@Override
protected MultipartParsingResult parseFileItems(List fileItems, String encoding) {
//스프링 3.0변경으로 수정한 부분
MultiValueMap<String, MultipartFile> multipartFiles = new LinkedMultiValueMap<String, MultipartFile>();
Map<String, String[]> multipartParameters = new HashMap<String, String[]>();
// Extract multipart files and multipart parameters.
for (Iterator it = fileItems.iterator(); it.hasNext();) {
FileItem fileItem = (FileItem)it.next();
if (fileItem.isFormField()) {
String value = null;
if (encoding != null) {
try {
value = fileItem.getString(encoding);
} catch (UnsupportedEncodingException ex) {
if (logger.isWarnEnabled()) {
logger.warn("Could not decode multipart item '" + fileItem.getFieldName() + "' with encoding '" + encoding
+ "': using platform default");
}
value = fileItem.getString();
}
} else {
value = fileItem.getString();
}
String[] curParam = (String[])multipartParameters.get(fileItem.getFieldName());
if (curParam == null) {
// simple form field
multipartParameters.put(fileItem.getFieldName(), new String[] { value });
} else {
// array of simple form fields
String[] newParam = StringUtils.addStringToArray(curParam, value);
multipartParameters.put(fileItem.getFieldName(), newParam);
}
} else {
if (fileItem.getSize() > 0) {
// multipart file field
CommonsMultipartFile file = new CommonsMultipartFile(fileItem);
//스프링 3.0 업그레이드 API변경으로인한 수정
List<MultipartFile> fileList = new ArrayList<MultipartFile>();
fileList.add(file);
if (multipartFiles.put(fileItem.getName(), fileList) != null) { // CHANGED!!
throw new MultipartException("Multiple files for field name [" + file.getName()
+ "] found - not supported by MultipartResolver");
}
if (logger.isDebugEnabled()) {
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);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,27 @@
package egovframework.com.json;
/**
* The JSONException is thrown by the JSON.org classes then things are amiss.
* @author JSON.org
* @version 2008-09-18
*/
public class JSONException extends Exception {
private Throwable cause;
/**
* Constructs a JSONException with an explanatory message.
* @param message Detail about the reason for the exception.
*/
public JSONException(String message) {
super(message);
}
public JSONException(Throwable t) {
super(t.getMessage());
this.cause = t;
}
public Throwable getCause() {
return this.cause;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
package egovframework.com.json;
/**
* The <code>JSONString</code> interface allows a <code>toJSONString()</code>
* method so that a class can change the behavior of
* <code>JSONObject.toString()</code>, <code>JSONArray.toString()</code>,
* and <code>JSONWriter.value(</code>Object<code>)</code>. The
* <code>toJSONString</code> method will be used instead of the default behavior
* of using the Object's <code>toString()</code> method and quoting the result.
*/
public interface JSONString {
/**
* The <code>toJSONString</code> method allows a class to produce its own JSON
* serialization.
*
* @return A strictly syntactically correct JSON text.
*/
public String toJSONString();
}

View File

@ -0,0 +1,428 @@
package egovframework.com.json;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Reader;
import java.io.StringReader;
/*
Copyright (c) 2002 JSON.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The Software shall be used for Good, not Evil.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**
* A JSONTokener takes a source string and extracts characters and tokens from
* it. It is used by the JSONObject and JSONArray constructors to parse JSON
* source strings.
*
* @author JSON.org
* @version 2008-09-18
*/
public class JSONTokener {
private int index;
private Reader reader;
private char lastChar;
private boolean useLastChar;
/**
* Construct a JSONTokener from a string.
*
* @param reader
* A reader.
*/
public JSONTokener(Reader reader) {
this.reader = reader.markSupported() ? reader : new BufferedReader(reader);
this.useLastChar = false;
this.index = 0;
}
/**
* Construct a JSONTokener from a string.
*
* @param s
* A source string.
*/
public JSONTokener(String s) {
this(new StringReader(s));
}
/**
* Back up one character. This provides a sort of lookahead capability, so
* that you can test for a digit or letter before attempting to parse the
* next number or identifier.
*/
public void back() throws JSONException {
if (useLastChar || index <= 0) {
throw new JSONException("Stepping back two steps is not supported");
}
index -= 1;
useLastChar = true;
}
/**
* Get the hex value of a character (base16).
*
* @param c
* A character between '0' and '9' or between 'A' and 'F' or
* between 'a' and 'f'.
* @return An int between 0 and 15, or -1 if c was not a hex digit.
*/
public static int dehexchar(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
if (c >= 'A' && c <= 'F') {
return c - ('A' - 10);
}
if (c >= 'a' && c <= 'f') {
return c - ('a' - 10);
}
return -1;
}
/**
* Determine if the source string still contains characters that next() can
* consume.
*
* @return true if not yet at the end of the source.
*/
public boolean more() throws JSONException {
char nextChar = next();
if (nextChar == 0) {
return false;
}
back();
return true;
}
/**
* Get the next character in the source string.
*
* @return The next character, or 0 if past the end of the source string.
*/
public char next() throws JSONException {
if (this.useLastChar) {
this.useLastChar = false;
if (this.lastChar != 0) {
this.index += 1;
}
return this.lastChar;
}
int c;
try {
c = this.reader.read();
} catch (IOException exc) {
throw new JSONException(exc);
}
if (c <= 0) { // End of stream
this.lastChar = 0;
return 0;
}
this.index += 1;
this.lastChar = (char) c;
return this.lastChar;
}
/**
* Consume the next character, and check that it matches a specified
* character.
*
* @param c
* The character to match.
* @return The character.
* @throws JSONException
* if the character does not match.
*/
public char next(char c) throws JSONException {
char n = next();
if (n != c) {
throw syntaxError("Expected '" + c + "' and instead saw '" + n + "'");
}
return n;
}
/**
* Get the next n characters.
*
* @param n
* The number of characters to take.
* @return A string of n characters.
* @throws JSONException
* Substring bounds error if there are not n characters
* remaining in the source string.
*/
public String next(int n) throws JSONException {
if (n == 0) {
return "";
}
char[] buffer = new char[n];
int pos = 0;
if (this.useLastChar) {
this.useLastChar = false;
buffer[0] = this.lastChar;
pos = 1;
}
try {
int len;
while ((pos < n) && ((len = reader.read(buffer, pos, n - pos)) != -1)) {
pos += len;
}
} catch (IOException exc) {
throw new JSONException(exc);
}
this.index += pos;
if (pos < n) {
throw syntaxError("Substring bounds error");
}
this.lastChar = buffer[n - 1];
return new String(buffer);
}
/**
* Get the next char in the string, skipping whitespace.
*
* @throws JSONException
* @return A character, or 0 if there are no more characters.
*/
public char nextClean() throws JSONException {
for (;;) {
char c = next();
if (c == 0 || c > ' ') {
return c;
}
}
}
/**
* Return the characters up to the next close quote character. Backslash
* processing is done. The formal JSON format does not allow strings in
* single quotes, but an implementation is allowed to accept them.
*
* @param quote
* The quoting character, either <code>"</code>
* &nbsp;<small>(double quote)</small> or <code>'</code>
* &nbsp;<small>(single quote)</small>.
* @return A String.
* @throws JSONException
* Unterminated string.
*/
public String nextString(char quote) throws JSONException {
char c;
StringBuffer sb = new StringBuffer();
for (;;) {
c = next();
switch (c) {
case 0:
case '\n':
case '\r':
throw syntaxError("Unterminated string");
case '\\':
c = next();
switch (c) {
case 'b':
sb.append('\b');
break;
case 't':
sb.append('\t');
break;
case 'n':
sb.append('\n');
break;
case 'f':
sb.append('\f');
break;
case 'r':
sb.append('\r');
break;
case 'u':
sb.append((char) Integer.parseInt(next(4), 16));
break;
case '"':
case '\'':
case '\\':
case '/':
sb.append(c);
break;
default:
throw syntaxError("Illegal escape.");
}
break;
default:
if (c == quote) {
return sb.toString();
}
sb.append(c);
}
}
}
/**
* Get the text up but not including the specified character or the end of
* line, whichever comes first.
*
* @param d
* A delimiter character.
* @return A string.
*/
public String nextTo(char d) throws JSONException {
StringBuffer sb = new StringBuffer();
for (;;) {
char c = next();
if (c == d || c == 0 || c == '\n' || c == '\r') {
if (c != 0) {
back();
}
return sb.toString().trim();
}
sb.append(c);
}
}
/**
* Get the text up but not including one of the specified delimiter
* characters or the end of line, whichever comes first.
*
* @param delimiters
* A set of delimiter characters.
* @return A string, trimmed.
*/
public String nextTo(String delimiters) throws JSONException {
char c;
StringBuffer sb = new StringBuffer();
for (;;) {
c = next();
if (delimiters.indexOf(c) >= 0 || c == 0 || c == '\n' || c == '\r') {
if (c != 0) {
back();
}
return sb.toString().trim();
}
sb.append(c);
}
}
/**
* Get the next value. The value can be a Boolean, Double, Integer,
* JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object.
*
* @throws JSONException
* If syntax error.
*
* @return An object.
*/
public Object nextValue() throws JSONException {
char c = nextClean();
String s;
switch (c) {
case '"':
case '\'':
return nextString(c);
case '{':
back();
return new JSONObject(this);
case '[':
case '(':
back();
return new JSONArray(this);
}
/*
* Handle unquoted text. This could be the values true, false, or null,
* or it can be a number. An implementation (such as this one) is
* allowed to also accept non-standard forms.
*
* Accumulate characters until we reach the end of the text or a
* formatting character.
*/
StringBuffer sb = new StringBuffer();
while (c >= ' ' && ",:]}/\\\"[{;=#".indexOf(c) < 0) {
sb.append(c);
c = next();
}
back();
s = sb.toString().trim();
if (s.equals("")) {
throw syntaxError("Missing value");
}
return JSONObject.stringToValue(s);
}
/**
* Skip characters until the next character is the requested character. If
* the requested character is not found, no characters are skipped.
*
* @param to
* A character to skip to.
* @return The requested character, or zero if the requested character is
* not found.
*/
public char skipTo(char to) throws JSONException {
char c;
try {
int startIndex = this.index;
reader.mark(Integer.MAX_VALUE);
do {
c = next();
if (c == 0) {
reader.reset();
this.index = startIndex;
return c;
}
} while (c != to);
} catch (IOException exc) {
throw new JSONException(exc);
}
back();
return c;
}
/**
* Make a JSONException to signal a syntax error.
*
* @param message
* The error message.
* @return A JSONException object, suitable for throwing
*/
public JSONException syntaxError(String message) {
return new JSONException(message + toString());
}
/**
* Make a printable string of this JSONTokener.
*
* @return " at character [this.index]"
*/
public String toString() {
return " at character " + index;
}
}

View File

@ -0,0 +1,109 @@
package egovframework.com.ssi.syi.iis.service;
import java.io.Serializable;
/**
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class CntcInstt implements Serializable {
/*
* ID
*/
private String insttId = "";
/*
*
*/
private String insttNm = "";
/*
* ID
*/
private String frstRegisterId = "";
/*
* ID
*/
private String lastUpdusrId = "";
/**
* insttId attribute .
* @return String
*/
public String getInsttId() {
return insttId;
}
/**
* insttId attribute .
* @param insttId String
*/
public void setInsttId(String insttId) {
this.insttId = insttId;
}
/**
* insttNm attribute .
* @return String
*/
public String getInsttNm() {
return insttNm;
}
/**
* insttNm attribute .
* @param insttNm String
*/
public void setInsttNm(String insttNm) {
this.insttNm = insttNm;
}
/**
* 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;
}
}

View File

@ -0,0 +1,197 @@
package egovframework.com.ssi.syi.iis.service;
import java.io.Serializable;
/**
*
* VO
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class CntcInsttVO extends CntcInstt implements Serializable {
/** 검색조건 */
private String searchCondition = "";
/** 검색Keyword */
private String searchKeyword = "";
/** 검색사용여부 */
private String searchUseYn = "";
/** 현재페이지 */
private int pageIndex = 1;
/** 페이지갯수 */
private int pageUnit = 10;
/** 페이지사이즈 */
private int pageSize = 10;
/** firstIndex */
private int firstIndex = 1;
/** lastIndex */
private int lastIndex = 1;
/** recordCountPerPage */
private int recordCountPerPage = 10;
/**
* searchCondition attribute .
* @return String
*/
public String getSearchCondition() {
return searchCondition;
}
/**
* searchCondition attribute .
* @param searchCondition String
*/
public void setSearchCondition(String searchCondition) {
this.searchCondition = searchCondition;
}
/**
* searchKeyword attribute .
* @return String
*/
public String getSearchKeyword() {
return searchKeyword;
}
/**
* searchKeyword attribute .
* @param searchKeyword String
*/
public void setSearchKeyword(String searchKeyword) {
this.searchKeyword = searchKeyword;
}
/**
* searchUseYn attribute .
* @return String
*/
public String getSearchUseYn() {
return searchUseYn;
}
/**
* searchUseYn attribute .
* @param searchUseYn String
*/
public void setSearchUseYn(String searchUseYn) {
this.searchUseYn = searchUseYn;
}
/**
* pageIndex attribute .
* @return int
*/
public int getPageIndex() {
return pageIndex;
}
/**
* pageIndex attribute .
* @param pageIndex int
*/
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
/**
* pageUnit attribute .
* @return int
*/
public int getPageUnit() {
return pageUnit;
}
/**
* pageUnit attribute .
* @param pageUnit int
*/
public void setPageUnit(int pageUnit) {
this.pageUnit = pageUnit;
}
/**
* pageSize attribute .
* @return int
*/
public int getPageSize() {
return pageSize;
}
/**
* pageSize attribute .
* @param pageSize int
*/
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
/**
* firstIndex attribute .
* @return int
*/
public int getFirstIndex() {
return firstIndex;
}
/**
* firstIndex attribute .
* @param firstIndex int
*/
public void setFirstIndex(int firstIndex) {
this.firstIndex = firstIndex;
}
/**
* lastIndex attribute .
* @return int
*/
public int getLastIndex() {
return lastIndex;
}
/**
* lastIndex attribute .
* @param lastIndex int
*/
public void setLastIndex(int lastIndex) {
this.lastIndex = lastIndex;
}
/**
* recordCountPerPage attribute .
* @return int
*/
public int getRecordCountPerPage() {
return recordCountPerPage;
}
/**
* recordCountPerPage attribute .
* @param recordCountPerPage int
*/
public void setRecordCountPerPage(int recordCountPerPage) {
this.recordCountPerPage = recordCountPerPage;
}
}

View File

@ -0,0 +1,192 @@
package egovframework.com.ssi.syi.iis.service;
import java.io.Serializable;
/**
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class CntcService implements Serializable {
/*
* ID
*/
private String insttId = "";
/*
* ID
*/
private String sysId = "";
/*
* ID
*/
private String svcId = "";
/*
*
*/
private String svcNm = "";
/*
* ID
*/
private String requestMessageId = "";
/*
* ID
*/
private String rspnsMessageId = "";
/*
* ID
*/
private String frstRegisterId = "";
/*
* ID
*/
private String lastUpdusrId = "";
/**
* insttId attribute .
* @return String
*/
public String getInsttId() {
return insttId;
}
/**
* insttId attribute .
* @param insttId String
*/
public void setInsttId(String insttId) {
this.insttId = insttId;
}
/**
* sysId attribute .
* @return String
*/
public String getSysId() {
return sysId;
}
/**
* sysId attribute .
* @param sysId String
*/
public void setSysId(String sysId) {
this.sysId = sysId;
}
/**
* svcId attribute .
* @return String
*/
public String getSvcId() {
return svcId;
}
/**
* svcId attribute .
* @param svcId String
*/
public void setSvcId(String svcId) {
this.svcId = svcId;
}
/**
* svcNm attribute .
* @return String
*/
public String getSvcNm() {
return svcNm;
}
/**
* svcNm attribute .
* @param svcNm String
*/
public void setSvcNm(String svcNm) {
this.svcNm = svcNm;
}
/**
* requestMessageId attribute .
* @return String
*/
public String getRequestMessageId() {
return requestMessageId;
}
/**
* requestMessageId attribute .
* @param requestMessageId String
*/
public void setRequestMessageId(String requestMessageId) {
this.requestMessageId = requestMessageId;
}
/**
* rspnsMessageId attribute .
* @return String
*/
public String getRspnsMessageId() {
return rspnsMessageId;
}
/**
* rspnsMessageId attribute .
* @param rspnsMessageId String
*/
public void setRspnsMessageId(String rspnsMessageId) {
this.rspnsMessageId = rspnsMessageId;
}
/**
* 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;
}
}

View File

@ -0,0 +1,197 @@
package egovframework.com.ssi.syi.iis.service;
import java.io.Serializable;
/**
*
* VO
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class CntcServiceVO extends CntcService implements Serializable {
/** 검색조건 */
private String searchCondition = "";
/** 검색Keyword */
private String searchKeyword = "";
/** 검색사용여부 */
private String searchUseYn = "";
/** 현재페이지 */
private int pageIndex = 1;
/** 페이지갯수 */
private int pageUnit = 10;
/** 페이지사이즈 */
private int pageSize = 10;
/** firstIndex */
private int firstIndex = 1;
/** lastIndex */
private int lastIndex = 1;
/** recordCountPerPage */
private int recordCountPerPage = 10;
/**
* searchCondition attribute .
* @return String
*/
public String getSearchCondition() {
return searchCondition;
}
/**
* searchCondition attribute .
* @param searchCondition String
*/
public void setSearchCondition(String searchCondition) {
this.searchCondition = searchCondition;
}
/**
* searchKeyword attribute .
* @return String
*/
public String getSearchKeyword() {
return searchKeyword;
}
/**
* searchKeyword attribute .
* @param searchKeyword String
*/
public void setSearchKeyword(String searchKeyword) {
this.searchKeyword = searchKeyword;
}
/**
* searchUseYn attribute .
* @return String
*/
public String getSearchUseYn() {
return searchUseYn;
}
/**
* searchUseYn attribute .
* @param searchUseYn String
*/
public void setSearchUseYn(String searchUseYn) {
this.searchUseYn = searchUseYn;
}
/**
* pageIndex attribute .
* @return int
*/
public int getPageIndex() {
return pageIndex;
}
/**
* pageIndex attribute .
* @param pageIndex int
*/
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
/**
* pageUnit attribute .
* @return int
*/
public int getPageUnit() {
return pageUnit;
}
/**
* pageUnit attribute .
* @param pageUnit int
*/
public void setPageUnit(int pageUnit) {
this.pageUnit = pageUnit;
}
/**
* pageSize attribute .
* @return int
*/
public int getPageSize() {
return pageSize;
}
/**
* pageSize attribute .
* @param pageSize int
*/
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
/**
* firstIndex attribute .
* @return int
*/
public int getFirstIndex() {
return firstIndex;
}
/**
* firstIndex attribute .
* @param firstIndex int
*/
public void setFirstIndex(int firstIndex) {
this.firstIndex = firstIndex;
}
/**
* lastIndex attribute .
* @return int
*/
public int getLastIndex() {
return lastIndex;
}
/**
* lastIndex attribute .
* @param lastIndex int
*/
public void setLastIndex(int lastIndex) {
this.lastIndex = lastIndex;
}
/**
* recordCountPerPage attribute .
* @return int
*/
public int getRecordCountPerPage() {
return recordCountPerPage;
}
/**
* recordCountPerPage attribute .
* @param recordCountPerPage int
*/
public void setRecordCountPerPage(int recordCountPerPage) {
this.recordCountPerPage = recordCountPerPage;
}
}

View File

@ -0,0 +1,151 @@
package egovframework.com.ssi.syi.iis.service;
import java.io.Serializable;
/**
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class CntcSystem implements Serializable {
/*
* ID
*/
private String insttId = "";
/*
* ID
*/
private String sysId = "";
/*
*
*/
private String sysNm = "";
/*
* IP
*/
private String sysIp = "";
/*
* ID
*/
private String frstRegisterId = "";
/*
* ID
*/
private String lastUpdusrId = "";
/**
* insttId attribute .
* @return String
*/
public String getInsttId() {
return insttId;
}
/**
* insttId attribute .
* @param insttId String
*/
public void setInsttId(String insttId) {
this.insttId = insttId;
}
/**
* sysId attribute .
* @return String
*/
public String getSysId() {
return sysId;
}
/**
* sysId attribute .
* @param sysId String
*/
public void setSysId(String sysId) {
this.sysId = sysId;
}
/**
* sysNm attribute .
* @return String
*/
public String getSysNm() {
return sysNm;
}
/**
* sysNm attribute .
* @param sysNm String
*/
public void setSysNm(String sysNm) {
this.sysNm = sysNm;
}
/**
* sysIp attribute .
* @return String
*/
public String getSysIp() {
return sysIp;
}
/**
* sysIp attribute .
* @param sysIp String
*/
public void setSysIp(String sysIp) {
this.sysIp = sysIp;
}
/**
* 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;
}
}

View File

@ -0,0 +1,197 @@
package egovframework.com.ssi.syi.iis.service;
import java.io.Serializable;
/**
*
* VO
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class CntcSystemVO extends CntcSystem implements Serializable {
/** 검색조건 */
private String searchCondition = "";
/** 검색Keyword */
private String searchKeyword = "";
/** 검색사용여부 */
private String searchUseYn = "";
/** 현재페이지 */
private int pageIndex = 1;
/** 페이지갯수 */
private int pageUnit = 10;
/** 페이지사이즈 */
private int pageSize = 10;
/** firstIndex */
private int firstIndex = 1;
/** lastIndex */
private int lastIndex = 1;
/** recordCountPerPage */
private int recordCountPerPage = 10;
/**
* searchCondition attribute .
* @return String
*/
public String getSearchCondition() {
return searchCondition;
}
/**
* searchCondition attribute .
* @param searchCondition String
*/
public void setSearchCondition(String searchCondition) {
this.searchCondition = searchCondition;
}
/**
* searchKeyword attribute .
* @return String
*/
public String getSearchKeyword() {
return searchKeyword;
}
/**
* searchKeyword attribute .
* @param searchKeyword String
*/
public void setSearchKeyword(String searchKeyword) {
this.searchKeyword = searchKeyword;
}
/**
* searchUseYn attribute .
* @return String
*/
public String getSearchUseYn() {
return searchUseYn;
}
/**
* searchUseYn attribute .
* @param searchUseYn String
*/
public void setSearchUseYn(String searchUseYn) {
this.searchUseYn = searchUseYn;
}
/**
* pageIndex attribute .
* @return int
*/
public int getPageIndex() {
return pageIndex;
}
/**
* pageIndex attribute .
* @param pageIndex int
*/
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
/**
* pageUnit attribute .
* @return int
*/
public int getPageUnit() {
return pageUnit;
}
/**
* pageUnit attribute .
* @param pageUnit int
*/
public void setPageUnit(int pageUnit) {
this.pageUnit = pageUnit;
}
/**
* pageSize attribute .
* @return int
*/
public int getPageSize() {
return pageSize;
}
/**
* pageSize attribute .
* @param pageSize int
*/
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
/**
* firstIndex attribute .
* @return int
*/
public int getFirstIndex() {
return firstIndex;
}
/**
* firstIndex attribute .
* @param firstIndex int
*/
public void setFirstIndex(int firstIndex) {
this.firstIndex = firstIndex;
}
/**
* lastIndex attribute .
* @return int
*/
public int getLastIndex() {
return lastIndex;
}
/**
* lastIndex attribute .
* @param lastIndex int
*/
public void setLastIndex(int lastIndex) {
this.lastIndex = lastIndex;
}
/**
* recordCountPerPage attribute .
* @return int
*/
public int getRecordCountPerPage() {
return recordCountPerPage;
}
/**
* recordCountPerPage attribute .
* @param recordCountPerPage int
*/
public void setRecordCountPerPage(int recordCountPerPage) {
this.recordCountPerPage = recordCountPerPage;
}
}

View File

@ -0,0 +1,157 @@
package egovframework.com.ssi.syi.iis.service;
import java.util.List;
/**
*
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public interface EgovCntcInsttService {
/**
* .
* @param cntcInstt
* @throws Exception
*/
void deleteCntcInstt(CntcInstt cntcInstt) throws Exception;
/**
* .
* @param cntcInstt
* @throws Exception
*/
void deleteCntcSystem(CntcSystem cntcSystem) throws Exception;
/**
* .
* @param cntcInstt
* @throws Exception
*/
void deleteCntcService(CntcService cntcService) throws Exception;
/**
* .
* @param cntcInstt
* @throws Exception
*/
void insertCntcInstt(CntcInstt cntcInstt) throws Exception;
/**
* .
* @param cntcInstt
* @throws Exception
*/
void insertCntcSystem(CntcSystem cntcSystem) throws Exception;
/**
* .
* @param cntcService
* @throws Exception
*/
void insertCntcService(CntcService cntcService) throws Exception;
/**
* .
* @param cntcInstt
* @return CntcInstt()
* @throws Exception
*/
CntcInstt selectCntcInsttDetail(CntcInstt cntcInstt) throws Exception;
/**
* .
* @param cntcInstt
* @return CntcInstt()
* @throws Exception
*/
CntcSystem selectCntcSystemDetail(CntcSystem cntcSystem) throws Exception;
/**
* .
* @param cntcInstt
* @return CntcInstt()
* @throws Exception
*/
CntcService selectCntcServiceDetail(CntcService cntcService) throws Exception;
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
List selectCntcInsttList(CntcInsttVO searchVO) throws Exception;
/**
* .
* @param searchVO
* @return int( )
*/
int selectCntcInsttListTotCnt(CntcInsttVO searchVO) throws Exception;
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
List selectCntcSystemList(CntcSystemVO searchVO) throws Exception;
/**
* .
* @param searchVO
* @return int( )
*/
int selectCntcSystemListTotCnt(CntcSystemVO searchVO) throws Exception;
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
List selectCntcServiceList(CntcServiceVO searchVO) throws Exception;
/**
* .
* @param searchVO
* @return int( )
*/
int selectCntcServiceListTotCnt(CntcServiceVO searchVO) throws Exception;
/**
* .
* @param cntcInstt
* @throws Exception
*/
void updateCntcInstt(CntcInstt cntcInstt) throws Exception;
/**
* .
* @param cntcInstt
* @throws Exception
*/
void updateCntcSystem(CntcSystem cntcSystem) throws Exception;
/**
* .
* @param cntcInstt
* @throws Exception
*/
void updateCntcService(CntcService cntcService) throws Exception;
}

View File

@ -0,0 +1,202 @@
package egovframework.com.ssi.syi.iis.service.impl;
import java.util.List;
import org.springframework.stereotype.Repository;
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
import egovframework.com.ssi.syi.iis.service.CntcInstt;
import egovframework.com.ssi.syi.iis.service.CntcInsttVO;
import egovframework.com.ssi.syi.iis.service.CntcService;
import egovframework.com.ssi.syi.iis.service.CntcServiceVO;
import egovframework.com.ssi.syi.iis.service.CntcSystem;
import egovframework.com.ssi.syi.iis.service.CntcSystemVO;
/**
*
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
@Repository("CntcInsttDAO")
public class CntcInsttDAO extends EgovComAbstractDAO {
/**
* .
* @param cntcInstt
* @throws Exception
*/
public void deleteCntcInstt(CntcInstt cntcInstt) throws Exception {
delete("CntcInsttDAO.deleteCntcInstt", cntcInstt);
}
/**
* .
* @param cntcInstt
* @throws Exception
*/
public void deleteCntcSystem(CntcSystem cntcSystem) throws Exception {
delete("CntcInsttDAO.deleteCntcSystem", cntcSystem);
}
/**
* .
* @param cntcInstt
* @throws Exception
*/
public void deleteCntcService(CntcService cntcService) throws Exception {
delete("CntcInsttDAO.deleteCntcService", cntcService);
}
/**
* .
* @param cntcInstt
* @throws Exception
*/
public void insertCntcInstt(CntcInstt cntcInstt) throws Exception {
insert("CntcInsttDAO.insertCntcInstt", cntcInstt);
}
/**
* .
* @param cntcInstt
* @throws Exception
*/
public void insertCntcSystem(CntcSystem cntcSystem) throws Exception {
insert("CntcInsttDAO.insertCntcSystem", cntcSystem);
}
/**
* .
* @param cntcInstt
* @throws Exception
*/
public void insertCntcService(CntcService cntcService) throws Exception {
insert("CntcInsttDAO.insertCntcService", cntcService);
}
/**
* .
* @param cntcInstt
* @return CntcInstt()
*/
public CntcInstt selectCntcInsttDetail(CntcInstt cntcInstt) throws Exception {
return (CntcInstt) selectByPk("CntcInsttDAO.selectCntcInsttDetail", cntcInstt);
}
/**
* .
* @param cntcInstt
* @return CntcInstt()
*/
public CntcSystem selectCntcSystemDetail(CntcSystem cntcSystem) throws Exception {
return (CntcSystem) selectByPk("CntcInsttDAO.selectCntcSystemDetail", cntcSystem);
}
/**
* .
* @param cntcInstt
* @return CntcInstt()
*/
public CntcService selectCntcServiceDetail(CntcService cntcService) throws Exception {
return (CntcService) selectByPk("CntcInsttDAO.selectCntcServiceDetail", cntcService);
}
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
public List selectCntcInsttList(CntcInsttVO searchVO) throws Exception {
return list("CntcInsttDAO.selectCntcInsttList", searchVO);
}
/**
* .
* @param searchVO
* @return int( )
*/
public int selectCntcInsttListTotCnt(CntcInsttVO searchVO) throws Exception {
return (Integer)getSqlMapClientTemplate().queryForObject("CntcInsttDAO.selectCntcInsttListTotCnt", searchVO);
}
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
public List selectCntcSystemList(CntcSystemVO searchVO) throws Exception {
return list("CntcInsttDAO.selectCntcSystemList", searchVO);
}
/**
* .
* @param searchVO
* @return int( )
*/
public int selectCntcSystemListTotCnt(CntcSystemVO searchVO) throws Exception {
return (Integer)getSqlMapClientTemplate().queryForObject("CntcInsttDAO.selectCntcSystemListTotCnt", searchVO);
}
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
public List selectCntcServiceList(CntcServiceVO searchVO) throws Exception {
return list("CntcInsttDAO.selectCntcServiceList", searchVO);
}
/**
* .
* @param searchVO
* @return int( )
*/
public int selectCntcServiceListTotCnt(CntcServiceVO searchVO) throws Exception {
return (Integer)getSqlMapClientTemplate().queryForObject("CntcInsttDAO.selectCntcServiceListTotCnt", searchVO);
}
/**
* .
* @param cntcInstt
* @throws Exception
*/
public void updateCntcInstt(CntcInstt cntcInstt) throws Exception {
update("CntcInsttDAO.updateCntcInstt", cntcInstt);
}
/**
* .
* @param cntcInstt
* @throws Exception
*/
public void updateCntcSystem(CntcSystem cntcSystem) throws Exception {
update("CntcInsttDAO.updateCntcSystem", cntcSystem);
}
/**
* .
* @param cntcInstt
* @throws Exception
*/
public void updateCntcService(CntcService cntcService) throws Exception {
update("CntcInsttDAO.updateCntcService", cntcService);
}
}

View File

@ -0,0 +1,174 @@
package egovframework.com.ssi.syi.iis.service.impl;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import egovframework.com.ssi.syi.iis.service.CntcInstt;
import egovframework.com.ssi.syi.iis.service.CntcInsttVO;
import egovframework.com.ssi.syi.iis.service.CntcService;
import egovframework.com.ssi.syi.iis.service.CntcServiceVO;
import egovframework.com.ssi.syi.iis.service.CntcSystem;
import egovframework.com.ssi.syi.iis.service.CntcSystemVO;
import egovframework.com.ssi.syi.iis.service.EgovCntcInsttService;
import egovframework.rte.fdl.cmmn.AbstractServiceImpl;
/**
*
* .
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
@Service("CntcInsttService")
public class EgovCntcInsttServiceImpl extends AbstractServiceImpl implements EgovCntcInsttService {
@Resource(name="CntcInsttDAO")
private CntcInsttDAO cntcInsttDAO;
/**
* .
*/
public void deleteCntcInstt(CntcInstt cntcInstt) throws Exception {
cntcInsttDAO.deleteCntcInstt(cntcInstt);
}
/**
* .
*/
public void deleteCntcSystem(CntcSystem cntcSystem) throws Exception {
cntcInsttDAO.deleteCntcSystem(cntcSystem);
}
/**
* .
*/
public void deleteCntcService(CntcService cntcService) throws Exception {
cntcInsttDAO.deleteCntcService(cntcService);
}
/**
* .
*/
public void insertCntcInstt(CntcInstt cntcInstt) throws Exception {
cntcInsttDAO.insertCntcInstt(cntcInstt);
}
/**
* .
*/
public void insertCntcSystem(CntcSystem cntcSystem) throws Exception {
cntcInsttDAO.insertCntcSystem(cntcSystem);
}
/**
* .
*/
public void insertCntcService(CntcService cntcService) throws Exception {
cntcInsttDAO.insertCntcService(cntcService);
}
/**
* .
*/
public CntcInstt selectCntcInsttDetail(CntcInstt cntcInstt) throws Exception {
CntcInstt ret = (CntcInstt)cntcInsttDAO.selectCntcInsttDetail(cntcInstt);
return ret;
}
/**
* .
*/
public CntcSystem selectCntcSystemDetail(CntcSystem cntcSystem) throws Exception {
CntcSystem ret = (CntcSystem)cntcInsttDAO.selectCntcSystemDetail(cntcSystem);
return ret;
}
/**
* .
*/
public CntcService selectCntcServiceDetail(CntcService cntcService) throws Exception {
CntcService ret = (CntcService)cntcInsttDAO.selectCntcServiceDetail(cntcService);
return ret;
}
/**
* .
*/
public List selectCntcInsttList(CntcInsttVO searchVO) throws Exception {
return cntcInsttDAO.selectCntcInsttList(searchVO);
}
/**
* .
*/
public int selectCntcInsttListTotCnt(CntcInsttVO searchVO) throws Exception {
return cntcInsttDAO.selectCntcInsttListTotCnt(searchVO);
}
/**
* .
*/
public List selectCntcSystemList(CntcSystemVO searchVO) throws Exception {
return cntcInsttDAO.selectCntcSystemList(searchVO);
}
/**
* .
*/
public int selectCntcSystemListTotCnt(CntcSystemVO searchVO) throws Exception {
return cntcInsttDAO.selectCntcSystemListTotCnt(searchVO);
}
/**
* .
*/
public List selectCntcServiceList(CntcServiceVO searchVO) throws Exception {
return cntcInsttDAO.selectCntcServiceList(searchVO);
}
/**
* .
*/
public int selectCntcServiceListTotCnt(CntcServiceVO searchVO) throws Exception {
return cntcInsttDAO.selectCntcServiceListTotCnt(searchVO);
}
/**
* .
*/
public void updateCntcInstt(CntcInstt cntcInstt) throws Exception {
cntcInsttDAO.updateCntcInstt(cntcInstt);
}
/**
* .
*/
public void updateCntcSystem(CntcSystem cntcSystem) throws Exception {
cntcInsttDAO.updateCntcSystem(cntcSystem);
}
/**
* .
*/
public void updateCntcService(CntcService cntcService) throws Exception {
cntcInsttDAO.updateCntcService(cntcService);
}
}

View File

@ -0,0 +1,704 @@
package egovframework.com.ssi.syi.iis.web;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springmodules.validation.commons.DefaultBeanValidator;
import egovframework.com.cmm.LoginVO;
import egovframework.com.cmm.annotation.IncludedInfo;
import egovframework.com.cmm.util.EgovUserDetailsHelper;
import egovframework.com.ssi.syi.iis.service.CntcInstt;
import egovframework.com.ssi.syi.iis.service.CntcInsttVO;
import egovframework.com.ssi.syi.iis.service.CntcService;
import egovframework.com.ssi.syi.iis.service.CntcServiceVO;
import egovframework.com.ssi.syi.iis.service.CntcSystem;
import egovframework.com.ssi.syi.iis.service.CntcSystemVO;
import egovframework.com.ssi.syi.iis.service.EgovCntcInsttService;
import egovframework.com.ssi.syi.ims.service.CntcMessageVO;
import egovframework.com.ssi.syi.ims.service.EgovCntcMessageService;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import egovframework.rte.fdl.property.EgovPropertyService;
import egovframework.rte.psl.dataaccess.util.EgovMap;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
/**
*
* Controller
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
* 2011.8.26 IncludedInfo annotation
* 2011.09.14
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
@Controller
public class EgovCntcInsttController {
@Resource(name = "CntcInsttService")
private EgovCntcInsttService cntcInsttService;
@Resource(name = "CntcMessageService")
private EgovCntcMessageService cntcMessageService;
/** EgovIdGnrService */
@Resource(name="egovCntcInsttIdGnrService")
private EgovIdGnrService idgenService;
/** EgovIdGnrService */
@Resource(name="egovCntcSystemIdGnrService")
private EgovIdGnrService idgenServiceSys;
/** EgovIdGnrService */
@Resource(name="egovCntcServiceIdGnrService")
private EgovIdGnrService idgenServiceSvc;
/** EgovPropertyService */
@Resource(name = "propertiesService")
protected EgovPropertyService propertiesService;
@Autowired
private DefaultBeanValidator beanValidator;
/**
* .
* @param loginVO
* @param cntcInstt
* @param model
* @return "forward:/ssi/syi/iis/EgovCcmAdministCodeList.do"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/iis/removeCntcInstt.do")
public String deleteCntcInstt (CntcInstt cntcInstt
, ModelMap model
) throws Exception {
cntcInsttService.deleteCntcInstt(cntcInstt);
return "forward:/ssi/syi/iis/getCntcInsttList.do";
}
/**
* .
* @param loginVO
* @param cntcSystem
* @param model
* @return "forward:/ssi/syi/iis/EgovCcmAdministCodeList.do"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/iis/removeCntcSystem.do")
public String deleteCntcSystem(CntcSystem cntcSystem
, ModelMap model
) throws Exception {
cntcInsttService.deleteCntcSystem(cntcSystem);
return "forward:/ssi/syi/iis/getCntcInsttList.do";
}
/**
* .
* @param loginVO
* @param cntcSystem
* @param model
* @return "forward:/ssi/syi/iis/EgovCcmAdministCodeList.do"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/iis/removeCntcService.do")
public String deleteCntcService(CntcService cntcService
, ModelMap model
) throws Exception {
cntcInsttService.deleteCntcService(cntcService);
return "forward:/ssi/syi/iis/getCntcInsttList.do";
}
/**
* .
* @param loginVO
* @param cntcInstt
* @param bindingResult
* @param model
* @return "egovframework/com/ssi/syi/iis/EgovCntcInsttRegist"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/iis/addCntcInstt.do")
public String insertCntcInstt (@ModelAttribute("cntcInstt") CntcInstt cntcInstt
, BindingResult bindingResult
, Map commandMap
, ModelMap model
) throws Exception {
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("")) {
return "egovframework/com/ssi/syi/iis/EgovCntcInsttRegist";
} else if (sCmd.equals("Regist")) {
beanValidator.validate(cntcInstt, bindingResult);
if (bindingResult.hasErrors()){
return "egovframework/com/ssi/syi/iis/EgovCntcInsttRegist";
}
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
cntcInstt.setFrstRegisterId(uniqId);
// ID Generation
String sInsttId = idgenService.getNextStringId();
cntcInstt.setInsttId(sInsttId);
cntcInsttService.insertCntcInstt(cntcInstt);
return "forward:/ssi/syi/iis/getCntcInsttList.do";
} else {
return "forward:/ssi/syi/iis/getCntcInsttList.do";
}
}
/**
* .
* @param loginVO
* @param cntcSystem
* @param bindingResult
* @param model
* @return "egovframework/com/ssi/syi/iis/EgovCntcSystemRegist"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/iis/addCntcSystem.do")
public String insertCntcSystem(@ModelAttribute("cntcSystem") CntcSystem cntcSystem
, BindingResult bindingResult
, Map commandMap
, ModelMap model
) throws Exception {
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("")) {
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = (List)cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
return "egovframework/com/ssi/syi/iis/EgovCntcSystemRegist";
} else if (sCmd.equals("Regist")) {
beanValidator.validate(cntcSystem, bindingResult);
if (bindingResult.hasErrors()){
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = (List)cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
return "egovframework/com/ssi/syi/iis/EgovCntcSystemRegist";
}
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
cntcSystem.setFrstRegisterId(uniqId);
// ID Generation
String sSysId = idgenServiceSys.getNextStringId();
cntcSystem.setSysId(sSysId);
cntcInsttService.insertCntcSystem(cntcSystem);
return "forward:/ssi/syi/iis/getCntcInsttDetail.do";
} else {
return "forward:/ssi/syi/iis/getCntcInsttDetail.do";
}
}
/**
* .
* @param loginVO
* @param cntcService
* @param bindingResult
* @param model
* @return "egovframework/com/ssi/syi/iis/EgovCntcServiceRegist"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/iis/addCntcService.do")
public String insertCntcService(@ModelAttribute("cntcService") CntcService cntcService
, BindingResult bindingResult
, Map commandMap
, ModelMap model
) throws Exception {
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("")) {
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
// 연계시스템 리스트박스 데이터
CntcSystemVO searchCntcSystemVO;
searchCntcSystemVO = new CntcSystemVO();
searchCntcSystemVO.setRecordCountPerPage(999999);
searchCntcSystemVO.setFirstIndex(0);
searchCntcSystemVO.setSearchCondition("CodeList");
if (cntcService.getInsttId().equals("")) {
if (cntcInsttList.size() > 0) {
EgovMap emp = (EgovMap)cntcInsttList.get(0);
cntcService.setInsttId(emp.get("insttId").toString());
}
}
searchCntcSystemVO.setInsttId(cntcService.getInsttId());
List cntcSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcSystemList", cntcSystemList);
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
return "egovframework/com/ssi/syi/iis/EgovCntcServiceRegist";
} else if (sCmd.equals("Regist")) {
beanValidator.validate(cntcService, bindingResult);
if (bindingResult.hasErrors()){
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
// 연계시스템 리스트박스 데이터
CntcSystemVO searchCntcSystemVO;
searchCntcSystemVO = new CntcSystemVO();
searchCntcSystemVO.setRecordCountPerPage(999999);
searchCntcSystemVO.setFirstIndex(0);
searchCntcSystemVO.setSearchCondition("CodeList");
if (cntcService.getInsttId().equals("")) {
if (cntcInsttList.size() > 0) {
EgovMap emp = (EgovMap)cntcInsttList.get(0);
cntcService.setInsttId(emp.get("insttId").toString());
}
}
searchCntcSystemVO.setInsttId(cntcService.getInsttId());
List cntcSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcSystemList", cntcSystemList);
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
return "egovframework/com/ssi/syi/iis/EgovCntcServiceRegist";
}
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
cntcService.setFrstRegisterId(uniqId);
// ID Generation
String sSvcId = idgenServiceSvc.getNextStringId();
cntcService.setSvcId(sSvcId);
cntcInsttService.insertCntcService(cntcService);
return "forward:/ssi/syi/iis/getCntcInsttDetail.do";
} else {
return "forward:/ssi/syi/iis/getCntcInsttDetail.do";
}
}
/**
* .
* @param loginVO
* @param cntcInstt
* @param model
* @return "egovframework/com/ssi/syi/iis/EgovCcmCntcInsttDetail"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/iis/getCntcInsttDetail.do")
public String selectCntcInsttDetail (@ModelAttribute("cntcInstt") CntcInstt cntcInstt
, @ModelAttribute("cntcSystemVO") CntcSystemVO cntcSystemVO
, @ModelAttribute("cntcServiceVO") CntcServiceVO cntcServiceVO
, ModelMap model
) throws Exception {
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
/* 연계기관 상세 */
CntcInstt vo = cntcInsttService.selectCntcInsttDetail(cntcInstt);
model.addAttribute("result", vo);
/* 연계시스템 리스트 */
cntcSystemVO.setRecordCountPerPage(999999);
cntcSystemVO.setFirstIndex(0);
cntcSystemVO.setSearchCondition("CodeList");
List cntcSystemList = cntcInsttService.selectCntcSystemList(cntcSystemVO);
model.addAttribute("cntcSystemList", cntcSystemList);
/* 연계서비스 리스트 */
cntcServiceVO.setRecordCountPerPage(999999);
cntcServiceVO.setFirstIndex(0);
cntcServiceVO.setSearchCondition("CodeList_InsttId");
List cntcServiceList = cntcInsttService.selectCntcServiceList(cntcServiceVO);
model.addAttribute("cntcServiceList", cntcServiceList);
return "egovframework/com/ssi/syi/iis/EgovCntcInsttDetail";
}
/**
* .
* @param loginVO
* @param searchVO
* @param model
* @return "egovframework/com/ssi/syi/iis/EgovCntcInsttList"
* @throws Exception
*/
@IncludedInfo(name="연계기관관리", listUrl="/ssi/syi/iis/getCntcInsttList.do", order = 1240,gid = 70)
@RequestMapping(value="/ssi/syi/iis/getCntcInsttList.do")
public String selectCntcInsttList (@ModelAttribute("searchVO") CntcInsttVO searchVO
, ModelMap model
) throws Exception {
/** EgovPropertyService.sample */
searchVO.setPageUnit(propertiesService.getInt("pageUnit"));
searchVO.setPageSize(propertiesService.getInt("pageSize"));
/** pageing */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
List CmmnCodeList = cntcInsttService.selectCntcInsttList(searchVO);
model.addAttribute("resultList", CmmnCodeList);
int totCnt = cntcInsttService.selectCntcInsttListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
model.addAttribute("paginationInfo", paginationInfo);
return "egovframework/com/ssi/syi/iis/EgovCntcInsttList";
}
/**
* .
* @param loginVO
* @param cntcInstt
* @param bindingResult
* @param commandMap
* @param model
* @return "egovframework/com/ssi/syi/iis/EgovCntcInsttUpdt"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/iis/updateCntcInstt.do")
public String updateCntcInstt (@ModelAttribute("cntcInstt") CntcInstt cntcInstt
, BindingResult bindingResult
, Map commandMap
, ModelMap model
) throws Exception {
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("")) {
CntcInstt vo = cntcInsttService.selectCntcInsttDetail(cntcInstt);
model.addAttribute("cntcInstt", vo);
return "egovframework/com/ssi/syi/iis/EgovCntcInsttUpdt";
} else if (sCmd.equals("Modify")) {
beanValidator.validate(cntcInstt, bindingResult);
if (bindingResult.hasErrors()){
CntcInstt vo = cntcInsttService.selectCntcInsttDetail(cntcInstt);
model.addAttribute("cntcInstt", vo);
return "egovframework/com/ssi/syi/iis/EgovCntcInsttUpdt";
}
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
cntcInstt.setLastUpdusrId(uniqId);
cntcInsttService.updateCntcInstt(cntcInstt);
return "forward:/ssi/syi/iis/getCntcInsttList.do";
} else {
return "forward:/ssi/syi/iis/getCntcInsttList.do";
}
}
/**
* .
* @param loginVO
* @param cntcInstt
* @param bindingResult
* @param commandMap
* @param model
* @return "egovframework/com/ssi/syi/iis/EgovCntcSystemModify"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/iis/updateCntcSystem.do")
public String updateCntcSystem(@ModelAttribute("cntcSystem") CntcSystem cntcSystem
, BindingResult bindingResult
, Map commandMap
, ModelMap model
) throws Exception {
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("")) {
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
// 연계시스템 리스트박스 데이터 2011.09.14
CntcSystemVO searchCntcSystemVO;
searchCntcSystemVO = new CntcSystemVO();
searchCntcSystemVO.setRecordCountPerPage(999999);
searchCntcSystemVO.setFirstIndex(0);
searchCntcSystemVO.setSearchCondition("CodeList");
if (cntcSystem.getInsttId().equals("")) {
if (cntcInsttList.size() > 0) {
EgovMap emp = (EgovMap)cntcInsttList.get(0);
cntcSystem.setInsttId(emp.get("insttId").toString());
}
}
searchCntcSystemVO.setInsttId(cntcSystem.getInsttId());
List cntcSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcSystemList", cntcSystemList);
// 연계메시지 리스트박스 데이터 2011.09.14
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
CntcSystem vo = cntcInsttService.selectCntcSystemDetail(cntcSystem);
model.addAttribute("cntcSystem", vo);
return "egovframework/com/ssi/syi/iis/EgovCntcSystemUpdt";
} else if (sCmd.equals("Modify")) {
beanValidator.validate(cntcSystem, bindingResult);
if (bindingResult.hasErrors()){
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
// 연계시스템 리스트박스 데이터 2011.09.14
CntcSystemVO searchCntcSystemVO;
searchCntcSystemVO = new CntcSystemVO();
searchCntcSystemVO.setRecordCountPerPage(999999);
searchCntcSystemVO.setFirstIndex(0);
searchCntcSystemVO.setSearchCondition("CodeList");
if (cntcSystem.getInsttId().equals("")) {
if (cntcInsttList.size() > 0) {
EgovMap emp = (EgovMap)cntcInsttList.get(0);
cntcSystem.setInsttId(emp.get("insttId").toString());
}
}
searchCntcSystemVO.setInsttId(cntcSystem.getInsttId());
List cntcSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcSystemList", cntcSystemList);
// 연계메시지 리스트박스 데이터 2011.09.14
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
CntcSystem vo = cntcInsttService.selectCntcSystemDetail(cntcSystem);
model.addAttribute("cntcSystem", vo);
return "egovframework/com/ssi/syi/iis/EgovCntcSystemUpdt";
}
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
cntcSystem.setLastUpdusrId(uniqId);
cntcInsttService.updateCntcSystem(cntcSystem);
return "forward:/ssi/syi/iis/getCntcInsttList.do";
} else {
return "forward:/ssi/syi/iis/getCntcInsttList.do";
}
}
/**
* .
* @param loginVO
* @param cntcService
* @param bindingResult
* @param commandMap
* @param model
* @return "egovframework/com/ssi/syi/iis/EgovCntcServiceModify"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/iis/updateCntcService.do")
public String updateCntcService(@ModelAttribute("cntcService") CntcService cntcService
, BindingResult bindingResult
, Map commandMap
, ModelMap model
) throws Exception {
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("")) {
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
// 연계시스템 리스트박스 데이터
CntcSystemVO searchCntcSystemVO;
searchCntcSystemVO = new CntcSystemVO();
searchCntcSystemVO.setRecordCountPerPage(999999);
searchCntcSystemVO.setFirstIndex(0);
searchCntcSystemVO.setSearchCondition("CodeList");
if (cntcService.getInsttId().equals("")) {
if (cntcInsttList.size() > 0) {
EgovMap emp = (EgovMap)cntcInsttList.get(0);
cntcService.setInsttId(emp.get("insttId").toString());
}
}
searchCntcSystemVO.setInsttId(cntcService.getInsttId());
List cntcSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcSystemList", cntcSystemList);
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
CntcService vo = cntcInsttService.selectCntcServiceDetail(cntcService);
model.addAttribute("cntcService", vo);
return "egovframework/com/ssi/syi/iis/EgovCntcServiceUpdt";
} else if (sCmd.equals("Modify")) {
beanValidator.validate(cntcService, bindingResult);
if (bindingResult.hasErrors()){
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
// 연계시스템 리스트박스 데이터
CntcSystemVO searchCntcSystemVO;
searchCntcSystemVO = new CntcSystemVO();
searchCntcSystemVO.setRecordCountPerPage(999999);
searchCntcSystemVO.setFirstIndex(0);
searchCntcSystemVO.setSearchCondition("CodeList");
if (cntcService.getInsttId().equals("")) {
if (cntcInsttList.size() > 0) {
EgovMap emp = (EgovMap)cntcInsttList.get(0);
cntcService.setInsttId(emp.get("insttId").toString());
}
}
searchCntcSystemVO.setInsttId(cntcService.getInsttId());
List cntcSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcSystemList", cntcSystemList);
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
CntcService vo = cntcInsttService.selectCntcServiceDetail(cntcService);
model.addAttribute("cntcService", vo);
return "egovframework/com/ssi/syi/iis/EgovCntcServiceUpdt";
}
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
cntcService.setLastUpdusrId(uniqId);
cntcInsttService.updateCntcService(cntcService);
return "forward:/ssi/syi/iis/getCntcInsttList.do";
} else {
return "forward:/ssi/syi/iis/getCntcInsttList.do";
}
}
/**
* Map .
* @param commandMap
* @return
*/
public String printParameterMap(Map commandMap){
String ret = "";
for(Object key:commandMap.keySet()){
Object value = commandMap.get(key);
ret += "key:" + key.toString() + " value:" + value.toString();
}
return ret;
}
}

View File

@ -0,0 +1,130 @@
package egovframework.com.ssi.syi.ims.service;
import java.io.Serializable;
/**
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class CntcMessage implements Serializable {
/*
* ID
*/
private String cntcMessageId = "";
/*
*
*/
private String cntcMessageNm = "";
/*
* ID
*/
private String upperCntcMessageId = "";
/*
* ID
*/
private String frstRegisterId = "";
/*
* ID
*/
private String lastUpdusrId = "";
/**
* cntcMessageId attribute .
* @return String
*/
public String getCntcMessageId() {
return cntcMessageId;
}
/**
* cntcMessageId attribute .
* @param cntcMessageId String
*/
public void setCntcMessageId(String cntcMessageId) {
this.cntcMessageId = cntcMessageId;
}
/**
* cntcMessageNm attribute .
* @return String
*/
public String getCntcMessageNm() {
return cntcMessageNm;
}
/**
* cntcMessageNm attribute .
* @param cntcMessageNm String
*/
public void setCntcMessageNm(String cntcMessageNm) {
this.cntcMessageNm = cntcMessageNm;
}
/**
* upperCntcMessageId attribute .
* @return String
*/
public String getUpperCntcMessageId() {
return upperCntcMessageId;
}
/**
* upperCntcMessageId attribute .
* @param upperCntcMessageId String
*/
public void setUpperCntcMessageId(String upperCntcMessageId) {
this.upperCntcMessageId = upperCntcMessageId;
}
/**
* 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;
}
}

View File

@ -0,0 +1,170 @@
package egovframework.com.ssi.syi.ims.service;
import java.io.Serializable;
/**
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class CntcMessageItem implements Serializable {
/*
* ID
*/
private String cntcMessageId = "";
/*
* ID
*/
private String itemId = "";
/*
*
*/
private String itemNm = "";
/*
*
*/
private String itemType = "";
/*
*
*/
private int itemLt = 0 ;
/*
* ID
*/
private String frstRegisterId = "";
/*
* ID
*/
private String lastUpdusrId = "";
/**
* cntcMessageId attribute .
* @return String
*/
public String getCntcMessageId() {
return cntcMessageId;
}
/**
* cntcMessageId attribute .
* @param cntcMessageId String
*/
public void setCntcMessageId(String cntcMessageId) {
this.cntcMessageId = cntcMessageId;
}
/**
* itemId attribute .
* @return String
*/
public String getItemId() {
return itemId;
}
/**
* itemId attribute .
* @param itemId String
*/
public void setItemId(String itemId) {
this.itemId = itemId;
}
/**
* itemNm attribute .
* @return String
*/
public String getItemNm() {
return itemNm;
}
/**
* itemNm attribute .
* @param itemNm String
*/
public void setItemNm(String itemNm) {
this.itemNm = itemNm;
}
/**
* itemType attribute .
* @return String
*/
public String getItemType() {
return itemType;
}
/**
* itemType attribute .
* @param itemType String
*/
public void setItemType(String itemType) {
this.itemType = itemType;
}
/**
* itemLt attribute .
* @return int
*/
public int getItemLt() {
return itemLt;
}
/**
* itemLt attribute .
* @param itemLt int
*/
public void setItemLt(int itemLt) {
this.itemLt = itemLt;
}
/**
* 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;
}
}

View File

@ -0,0 +1,197 @@
package egovframework.com.ssi.syi.ims.service;
import java.io.Serializable;
/**
*
* VO
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class CntcMessageItemVO extends CntcMessageItem implements Serializable {
/** 검색조건 */
private String searchCondition = "";
/** 검색Keyword */
private String searchKeyword = "";
/** 검색사용여부 */
private String searchUseYn = "";
/** 현재페이지 */
private int pageIndex = 1;
/** 페이지갯수 */
private int pageUnit = 10;
/** 페이지사이즈 */
private int pageSize = 10;
/** firstIndex */
private int firstIndex = 1;
/** lastIndex */
private int lastIndex = 1;
/** recordCountPerPage */
private int recordCountPerPage = 10;
/**
* searchCondition attribute .
* @return String
*/
public String getSearchCondition() {
return searchCondition;
}
/**
* searchCondition attribute .
* @param searchCondition String
*/
public void setSearchCondition(String searchCondition) {
this.searchCondition = searchCondition;
}
/**
* searchKeyword attribute .
* @return String
*/
public String getSearchKeyword() {
return searchKeyword;
}
/**
* searchKeyword attribute .
* @param searchKeyword String
*/
public void setSearchKeyword(String searchKeyword) {
this.searchKeyword = searchKeyword;
}
/**
* searchUseYn attribute .
* @return String
*/
public String getSearchUseYn() {
return searchUseYn;
}
/**
* searchUseYn attribute .
* @param searchUseYn String
*/
public void setSearchUseYn(String searchUseYn) {
this.searchUseYn = searchUseYn;
}
/**
* pageIndex attribute .
* @return int
*/
public int getPageIndex() {
return pageIndex;
}
/**
* pageIndex attribute .
* @param pageIndex int
*/
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
/**
* pageUnit attribute .
* @return int
*/
public int getPageUnit() {
return pageUnit;
}
/**
* pageUnit attribute .
* @param pageUnit int
*/
public void setPageUnit(int pageUnit) {
this.pageUnit = pageUnit;
}
/**
* pageSize attribute .
* @return int
*/
public int getPageSize() {
return pageSize;
}
/**
* pageSize attribute .
* @param pageSize int
*/
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
/**
* firstIndex attribute .
* @return int
*/
public int getFirstIndex() {
return firstIndex;
}
/**
* firstIndex attribute .
* @param firstIndex int
*/
public void setFirstIndex(int firstIndex) {
this.firstIndex = firstIndex;
}
/**
* lastIndex attribute .
* @return int
*/
public int getLastIndex() {
return lastIndex;
}
/**
* lastIndex attribute .
* @param lastIndex int
*/
public void setLastIndex(int lastIndex) {
this.lastIndex = lastIndex;
}
/**
* recordCountPerPage attribute .
* @return int
*/
public int getRecordCountPerPage() {
return recordCountPerPage;
}
/**
* recordCountPerPage attribute .
* @param recordCountPerPage int
*/
public void setRecordCountPerPage(int recordCountPerPage) {
this.recordCountPerPage = recordCountPerPage;
}
}

View File

@ -0,0 +1,197 @@
package egovframework.com.ssi.syi.ims.service;
import java.io.Serializable;
/**
*
* VO
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class CntcMessageVO extends CntcMessage implements Serializable {
/** 검색조건 */
private String searchCondition = "";
/** 검색Keyword */
private String searchKeyword = "";
/** 검색사용여부 */
private String searchUseYn = "";
/** 현재페이지 */
private int pageIndex = 1;
/** 페이지갯수 */
private int pageUnit = 10;
/** 페이지사이즈 */
private int pageSize = 10;
/** firstIndex */
private int firstIndex = 1;
/** lastIndex */
private int lastIndex = 1;
/** recordCountPerPage */
private int recordCountPerPage = 10;
/**
* searchCondition attribute .
* @return String
*/
public String getSearchCondition() {
return searchCondition;
}
/**
* searchCondition attribute .
* @param searchCondition String
*/
public void setSearchCondition(String searchCondition) {
this.searchCondition = searchCondition;
}
/**
* searchKeyword attribute .
* @return String
*/
public String getSearchKeyword() {
return searchKeyword;
}
/**
* searchKeyword attribute .
* @param searchKeyword String
*/
public void setSearchKeyword(String searchKeyword) {
this.searchKeyword = searchKeyword;
}
/**
* searchUseYn attribute .
* @return String
*/
public String getSearchUseYn() {
return searchUseYn;
}
/**
* searchUseYn attribute .
* @param searchUseYn String
*/
public void setSearchUseYn(String searchUseYn) {
this.searchUseYn = searchUseYn;
}
/**
* pageIndex attribute .
* @return int
*/
public int getPageIndex() {
return pageIndex;
}
/**
* pageIndex attribute .
* @param pageIndex int
*/
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
/**
* pageUnit attribute .
* @return int
*/
public int getPageUnit() {
return pageUnit;
}
/**
* pageUnit attribute .
* @param pageUnit int
*/
public void setPageUnit(int pageUnit) {
this.pageUnit = pageUnit;
}
/**
* pageSize attribute .
* @return int
*/
public int getPageSize() {
return pageSize;
}
/**
* pageSize attribute .
* @param pageSize int
*/
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
/**
* firstIndex attribute .
* @return int
*/
public int getFirstIndex() {
return firstIndex;
}
/**
* firstIndex attribute .
* @param firstIndex int
*/
public void setFirstIndex(int firstIndex) {
this.firstIndex = firstIndex;
}
/**
* lastIndex attribute .
* @return int
*/
public int getLastIndex() {
return lastIndex;
}
/**
* lastIndex attribute .
* @param lastIndex int
*/
public void setLastIndex(int lastIndex) {
this.lastIndex = lastIndex;
}
/**
* recordCountPerPage attribute .
* @return int
*/
public int getRecordCountPerPage() {
return recordCountPerPage;
}
/**
* recordCountPerPage attribute .
* @param recordCountPerPage int
*/
public void setRecordCountPerPage(int recordCountPerPage) {
this.recordCountPerPage = recordCountPerPage;
}
}

View File

@ -0,0 +1,112 @@
package egovframework.com.ssi.syi.ims.service;
import java.util.List;
/**
*
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public interface EgovCntcMessageService {
/**
* .
* @param cntcMessage
* @throws Exception
*/
void deleteCntcMessage(CntcMessage cntcMessage) throws Exception;
/**
* .
* @param cntcMessage
* @throws Exception
*/
void deleteCntcMessageItem(CntcMessageItem cntcMessageItem) throws Exception;
/**
* .
* @param cntcMessage
* @throws Exception
*/
void insertCntcMessage(CntcMessage cntcMessage) throws Exception;
/**
* .
* @param cntcMessage
* @throws Exception
*/
void insertCntcMessageItem(CntcMessageItem cntcMessageItem) throws Exception;
/**
* .
* @param cntcMessage
* @return CntcMessage()
* @throws Exception
*/
CntcMessage selectCntcMessageDetail(CntcMessage cntcMessage) throws Exception;
/**
* .
* @param cntcMessage
* @return CntcMessage()
* @throws Exception
*/
CntcMessageItem selectCntcMessageItemDetail(CntcMessageItem cntcMessageItem) throws Exception;
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
List selectCntcMessageList(CntcMessageVO searchVO) throws Exception;
/**
* .
* @param searchVO
* @return int( )
*/
int selectCntcMessageListTotCnt(CntcMessageVO searchVO) throws Exception;
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
List selectCntcMessageItemList(CntcMessageItemVO searchVO) throws Exception;
/**
* .
* @param searchVO
* @return int( )
*/
int selectCntcMessageItemListTotCnt(CntcMessageItemVO searchVO) throws Exception;
/**
* .
* @param cntcMessage
* @throws Exception
*/
void updateCntcMessage(CntcMessage cntcMessage) throws Exception;
/**
* .
* @param cntcMessage
* @throws Exception
*/
void updateCntcMessageItem(CntcMessageItem cntcMessageItem) throws Exception;
}

View File

@ -0,0 +1,145 @@
package egovframework.com.ssi.syi.ims.service.impl;
import java.util.List;
import org.springframework.stereotype.Repository;
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
import egovframework.com.ssi.syi.ims.service.CntcMessage;
import egovframework.com.ssi.syi.ims.service.CntcMessageItem;
import egovframework.com.ssi.syi.ims.service.CntcMessageItemVO;
import egovframework.com.ssi.syi.ims.service.CntcMessageVO;
/**
*
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
@Repository("CntcMessageDAO")
public class CntcMessageDAO extends EgovComAbstractDAO {
/**
* .
* @param cntcMessage
* @throws Exception
*/
public void deleteCntcMessage(CntcMessage cntcMessage) throws Exception {
delete("CntcMessageDAO.deleteCntcMessage", cntcMessage);
}
/**
* .
* @param cntcMessage
* @throws Exception
*/
public void deleteCntcMessageItem(CntcMessageItem cntcMessageItem) throws Exception {
delete("CntcMessageDAO.deleteCntcMessageItem", cntcMessageItem);
}
/**
* .
* @param cntcMessage
* @throws Exception
*/
public void insertCntcMessage(CntcMessage cntcMessage) throws Exception {
insert("CntcMessageDAO.insertCntcMessage", cntcMessage);
}
/**
* .
* @param cntcMessage
* @throws Exception
*/
public void insertCntcMessageItem(CntcMessageItem cntcMessageItem) throws Exception {
insert("CntcMessageDAO.insertCntcMessageItem", cntcMessageItem);
}
/**
* .
* @param cntcMessage
* @return CntcMessage()
*/
public CntcMessage selectCntcMessageDetail(CntcMessage cntcMessage) throws Exception {
return (CntcMessage) selectByPk("CntcMessageDAO.selectCntcMessageDetail", cntcMessage);
}
/**
* .
* @param cntcMessage
* @return CntcMessage()
*/
public CntcMessageItem selectCntcMessageItemDetail(CntcMessageItem cntcMessageItem) throws Exception {
return (CntcMessageItem) selectByPk("CntcMessageDAO.selectCntcMessageItemDetail", cntcMessageItem);
}
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
public List selectCntcMessageList(CntcMessageVO searchVO) throws Exception {
return list("CntcMessageDAO.selectCntcMessageList", searchVO);
}
/**
* .
* @param searchVO
* @return int( )
*/
public int selectCntcMessageListTotCnt(CntcMessageVO searchVO) throws Exception {
return (Integer)getSqlMapClientTemplate().queryForObject("CntcMessageDAO.selectCntcMessageListTotCnt", searchVO);
}
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
public List selectCntcMessageItemList(CntcMessageItemVO searchVO) throws Exception {
return list("CntcMessageDAO.selectCntcMessageItemList", searchVO);
}
/**
* .
* @param searchVO
* @return int( )
*/
public int selectCntcMessageItemListTotCnt(CntcMessageItemVO searchVO) throws Exception {
return (Integer)getSqlMapClientTemplate().queryForObject("CntcMessageDAO.selectCntcMessageItemListTotCnt", searchVO);
}
/**
* .
* @param cntcMessage
* @throws Exception
*/
public void updateCntcMessage(CntcMessage cntcMessage) throws Exception {
update("CntcMessageDAO.updateCntcMessage", cntcMessage);
}
/**
* .
* @param cntcMessage
* @throws Exception
*/
public void updateCntcMessageItem(CntcMessageItem cntcMessageItem) throws Exception {
update("CntcMessageDAO.updateCntcMessageItem", cntcMessageItem);
}
}

View File

@ -0,0 +1,128 @@
package egovframework.com.ssi.syi.ims.service.impl;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import egovframework.com.ssi.syi.ims.service.CntcMessage;
import egovframework.com.ssi.syi.ims.service.CntcMessageItem;
import egovframework.com.ssi.syi.ims.service.CntcMessageItemVO;
import egovframework.com.ssi.syi.ims.service.CntcMessageVO;
import egovframework.com.ssi.syi.ims.service.EgovCntcMessageService;
import egovframework.rte.fdl.cmmn.AbstractServiceImpl;
/**
*
* .
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
@Service("CntcMessageService")
public class EgovCntcMessageServiceImpl extends AbstractServiceImpl implements EgovCntcMessageService {
@Resource(name="CntcMessageDAO")
private CntcMessageDAO cntcMessageDAO;
/**
* .
*/
public void deleteCntcMessage(CntcMessage cntcMessage) throws Exception {
cntcMessageDAO.deleteCntcMessage(cntcMessage);
}
/**
* .
*/
public void deleteCntcMessageItem(CntcMessageItem cntcMessageItem) throws Exception {
cntcMessageDAO.deleteCntcMessageItem(cntcMessageItem);
}
/**
* .
*/
public void insertCntcMessage(CntcMessage cntcMessage) throws Exception {
cntcMessageDAO.insertCntcMessage(cntcMessage);
}
/**
* .
*/
public void insertCntcMessageItem(CntcMessageItem cntcMessageItem) throws Exception {
cntcMessageDAO.insertCntcMessageItem(cntcMessageItem);
}
/**
* .
*/
public CntcMessage selectCntcMessageDetail(CntcMessage cntcMessage) throws Exception {
CntcMessage ret = (CntcMessage)cntcMessageDAO.selectCntcMessageDetail(cntcMessage);
return ret;
}
/**
* .
*/
public CntcMessageItem selectCntcMessageItemDetail(CntcMessageItem cntcMessageItem) throws Exception {
CntcMessageItem ret = (CntcMessageItem)cntcMessageDAO.selectCntcMessageItemDetail(cntcMessageItem);
return ret;
}
/**
* .
*/
public List selectCntcMessageList(CntcMessageVO searchVO) throws Exception {
return cntcMessageDAO.selectCntcMessageList(searchVO);
}
/**
* .
*/
public int selectCntcMessageListTotCnt(CntcMessageVO searchVO) throws Exception {
return cntcMessageDAO.selectCntcMessageListTotCnt(searchVO);
}
/**
* .
*/
public List selectCntcMessageItemList(CntcMessageItemVO searchVO) throws Exception {
return cntcMessageDAO.selectCntcMessageItemList(searchVO);
}
/**
* .
*/
public int selectCntcMessageItemListTotCnt(CntcMessageItemVO searchVO) throws Exception {
return cntcMessageDAO.selectCntcMessageItemListTotCnt(searchVO);
}
/**
* .
*/
public void updateCntcMessage(CntcMessage cntcMessage) throws Exception {
cntcMessageDAO.updateCntcMessage(cntcMessage);
}
/**
* .
*/
public void updateCntcMessageItem(CntcMessageItem cntcMessageItem) throws Exception {
cntcMessageDAO.updateCntcMessageItem(cntcMessageItem);
}
}

View File

@ -0,0 +1,425 @@
package egovframework.com.ssi.syi.ims.web;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springmodules.validation.commons.DefaultBeanValidator;
import egovframework.com.cmm.LoginVO;
import egovframework.com.cmm.annotation.IncludedInfo;
import egovframework.com.cmm.util.EgovUserDetailsHelper;
import egovframework.com.ssi.syi.ims.service.CntcMessage;
import egovframework.com.ssi.syi.ims.service.CntcMessageItem;
import egovframework.com.ssi.syi.ims.service.CntcMessageItemVO;
import egovframework.com.ssi.syi.ims.service.CntcMessageVO;
import egovframework.com.ssi.syi.ims.service.EgovCntcMessageService;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import egovframework.rte.fdl.property.EgovPropertyService;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
/**
*
* Controller
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
* 2011.8.26 IncludedInfo annotation
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
@Controller
public class EgovCntcMessageController {
@Resource(name = "CntcMessageService")
private EgovCntcMessageService cntcMessageService;
/** EgovIdGnrService */
@Resource(name="egovCntcMessageIdGnrService")
private EgovIdGnrService idgenService;
/** EgovIdGnrService */
@Resource(name="egovCntcMessageItemIdGnrService")
private EgovIdGnrService idgenServiceItem;
/** EgovPropertyService */
@Resource(name = "propertiesService")
protected EgovPropertyService propertiesService;
@Autowired
private DefaultBeanValidator beanValidator;
/**
* .
* @param loginVO
* @param cntcMessage
* @param model
* @return "forward:/ssi/syi/ims/EgovCcmAdministCodeList.do"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/ims/removeCntcMessage.do")
public String deleteCntcMessage (CntcMessage cntcMessage
, ModelMap model
) throws Exception {
cntcMessageService.deleteCntcMessage(cntcMessage);
return "forward:/ssi/syi/ims/getCntcMessageList.do";
}
/**
* .
* @param loginVO
* @param cntcMessageItem
* @param model
* @return "forward:/ssi/syi/ims/EgovCcmAdministCodeList.do"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/ims/removeCntcMessageItem.do")
public String deleteCntcMessageItem (CntcMessageItem cntcMessageItem
, ModelMap model
) throws Exception {
cntcMessageService.deleteCntcMessageItem(cntcMessageItem);
return "forward:/ssi/syi/ims/getCntcMessageList.do";
}
/**
* .
* @param loginVO
* @param cntcMessage
* @param bindingResult
* @param model
* @return "egovframework/com/ssi/syi/ims/EgovCcmCntcMessageRegist"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/ims/addCntcMessage.do")
public String insertCntcMessage (@ModelAttribute("cntcMessage") CntcMessage cntcMessage
, BindingResult bindingResult
, Map commandMap
, ModelMap model
) throws Exception {
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("")) {
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
return "egovframework/com/ssi/syi/ims/EgovCntcMessageRegist";
} else if (sCmd.equals("Regist")) {
beanValidator.validate(cntcMessage, bindingResult);
if (bindingResult.hasErrors()){
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
return "egovframework/com/ssi/syi/ims/EgovCntcMessageRegist";
}
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
cntcMessage.setFrstRegisterId(uniqId);
// ID Generation
String sCntcMessageId = idgenService.getNextStringId();
cntcMessage.setCntcMessageId(sCntcMessageId);
cntcMessageService.insertCntcMessage(cntcMessage);
return "forward:/ssi/syi/ims/getCntcMessageList.do";
} else {
return "forward:/ssi/syi/ims/getCntcMessageList.do";
}
}
/**
* .
* @param loginVO
* @param cntcMessageItem
* @param bindingResult
* @param model
* @return "egovframework/com/ssi/syi/ims/EgovCcmCntcMessageRegist"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/ims/addCntcMessageItem.do")
public String insertCntcMessageItem (@ModelAttribute("cntcMessageItem") CntcMessageItem cntcMessageItem
, BindingResult bindingResult
, Map commandMap
, ModelMap model
) throws Exception {
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("")) {
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
return "egovframework/com/ssi/syi/ims/EgovCntcMessageItemRegist";
} else if (sCmd.equals("Regist")) {
beanValidator.validate(cntcMessageItem, bindingResult);
if (bindingResult.hasErrors()){
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
return "egovframework/com/ssi/syi/ims/EgovCntcMessageItemRegist";
}
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
cntcMessageItem.setFrstRegisterId(uniqId);
// ID Generation
String sItemId = idgenServiceItem.getNextStringId();
cntcMessageItem.setItemId(sItemId);
cntcMessageService.insertCntcMessageItem(cntcMessageItem);
return "forward:/ssi/syi/ims/getCntcMessageDetail.do";
} else {
return "forward:/ssi/syi/ims/getCntcMessageDetail.do";
}
}
/**
* .
* @param loginVO
* @param cntcMessage
* @param model
* @return "egovframework/com/ssi/syi/ims/EgovCcmCntcMessageDetail"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/ims/getCntcMessageDetail.do")
public String selectCntcMessageDetail (@ModelAttribute("cntcMessage") CntcMessage cntcMessage
, @ModelAttribute("cntcMessageItemVO") CntcMessageItemVO cntcMessageItemVO
, ModelMap model
) throws Exception {
/* 연계메시지 상세 */
CntcMessage vo = cntcMessageService.selectCntcMessageDetail(cntcMessage);
model.addAttribute("result", vo);
/* 연계메시지항목 리스트 */
cntcMessageItemVO.setRecordCountPerPage(9999999);
cntcMessageItemVO.setFirstIndex(0);
cntcMessageItemVO.setSearchCondition("CodeList");
List cntcMessageItemList = cntcMessageService.selectCntcMessageItemList(cntcMessageItemVO);
model.addAttribute("cntcMessageItemList", cntcMessageItemList);
return "egovframework/com/ssi/syi/ims/EgovCntcMessageDetail";
}
/**
* .
* @param loginVO
* @param searchVO
* @param model
* @return "egovframework/com/ssi/syi/ims/EgovCcmCntcMessageList"
* @throws Exception
*/
@IncludedInfo(name="연계메시지관리", listUrl="/ssi/syi/ims/getCntcMessageList.do", order = 1230,gid = 70)
@RequestMapping(value="/ssi/syi/ims/getCntcMessageList.do")
public String selectCntcMessageList (@ModelAttribute("searchVO") CntcMessageVO searchVO
, ModelMap model
) throws Exception {
/** EgovPropertyService.sample */
searchVO.setPageUnit(propertiesService.getInt("pageUnit"));
searchVO.setPageSize(propertiesService.getInt("pageSize"));
/** pageing */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
List CmmnCodeList = cntcMessageService.selectCntcMessageList(searchVO);
model.addAttribute("resultList", CmmnCodeList);
int totCnt = cntcMessageService.selectCntcMessageListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
model.addAttribute("paginationInfo", paginationInfo);
return "egovframework/com/ssi/syi/ims/EgovCntcMessageList";
}
/**
* .
* @param loginVO
* @param cntcMessage
* @param bindingResult
* @param commandMap
* @param model
* @return "egovframework/com/ssi/syi/ims/EgovCcmAdministCodeModify"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/ims/updateCntcMessage.do")
public String updateCntcMessage (@ModelAttribute("cntcMessage") CntcMessage cntcMessage
, BindingResult bindingResult
, Map commandMap
, ModelMap model
) throws Exception {
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("")) {
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
CntcMessage vo = cntcMessageService.selectCntcMessageDetail(cntcMessage);
model.addAttribute("cntcMessage", vo);
return "egovframework/com/ssi/syi/ims/EgovCntcMessageUpdt";
} else if (sCmd.equals("Modify")) {
beanValidator.validate(cntcMessage, bindingResult);
if (bindingResult.hasErrors()){
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
CntcMessage vo = cntcMessageService.selectCntcMessageDetail(cntcMessage);
model.addAttribute("cntcMessage", vo);
return "egovframework/com/ssi/syi/ims/EgovCntcMessageUpdt";
}
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
cntcMessage.setLastUpdusrId(uniqId);
cntcMessageService.updateCntcMessage(cntcMessage);
return "forward:/ssi/syi/ims/getCntcMessageList.do";
} else {
return "forward:/ssi/syi/ims/getCntcMessageList.do";
}
}
/**
* .
* @param loginVO
* @param cntcMessageItem
* @param bindingResult
* @param commandMap
* @param model
* @return "egovframework/com/ssi/syi/ims/EgovCcmAdministCodeModify"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/ims/updateCntcMessageItem.do")
public String updateCntcMessageItem (@ModelAttribute("cntcMessageItem") CntcMessageItem cntcMessageItem
, BindingResult bindingResult
, Map commandMap
, ModelMap model
) throws Exception {
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("")) {
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
CntcMessageItem vo = cntcMessageService.selectCntcMessageItemDetail(cntcMessageItem);
model.addAttribute("cntcMessageItem", vo);
return "egovframework/com/ssi/syi/ims/EgovCntcMessageItemUpdt";
} else if (sCmd.equals("Modify")) {
beanValidator.validate(cntcMessageItem, bindingResult);
if (bindingResult.hasErrors()){
// 연계메시지 리스트박스 데이터
CntcMessageVO searchCntcMessageVO;
searchCntcMessageVO = new CntcMessageVO();
searchCntcMessageVO.setRecordCountPerPage(999999);
searchCntcMessageVO.setFirstIndex(0);
searchCntcMessageVO.setSearchCondition("CodeList");
List cntcMessageList = (List)cntcMessageService.selectCntcMessageList(searchCntcMessageVO);
model.addAttribute("cntcMessageList", cntcMessageList);
CntcMessageItem vo = cntcMessageService.selectCntcMessageItemDetail(cntcMessageItem);
model.addAttribute("cntcMessageItem", vo);
return "egovframework/com/ssi/syi/ims/EgovCntcMessageItemUpdt";
}
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
cntcMessageItem.setLastUpdusrId(uniqId);
cntcMessageService.updateCntcMessageItem(cntcMessageItem);
return "forward:/ssi/syi/ims/getCntcMessageList.do";
} else {
return "forward:/ssi/syi/ims/getCntcMessageList.do";
}
}
/**
* Map .
* @param commandMap
* @return
*/
public String printParameterMap(Map commandMap){
String ret = "";
for(Object key:commandMap.keySet()){
Object value = commandMap.get(key);
ret += "key:" + key.toString() + " value:" + value.toString();
}
return ret;
}
}

View File

@ -0,0 +1,361 @@
package egovframework.com.ssi.syi.ist.service;
import java.io.Serializable;
/**
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class CntcSttus implements Serializable {
/*
* ID
*/
private String cntcId = "";
/*
*
*/
private String cntcNm = "";
/*
*
*/
private String cntcType = "";
/*
*
*/
private String cntAll = "";
/*
*
*/
private String cntSuccess = "";
/*
*
*/
private String cntFail = "";
/*
* ID
*/
private String provdInsttId = "";
/*
*
*/
private String provdInsttNm = "";
/*
* ID
*/
private String provdSysId = "";
/*
*
*/
private String provdSysNm = "";
/*
* ID
*/
private String provdSvcId = "";
/*
*
*/
private String provdSvcNm = "";
/*
* ID
*/
private String requstInsttId = "";
/*
*
*/
private String requstInsttNm = "";
/*
* ID
*/
private String requstSysId = "";
/*
*
*/
private String requstSysNm = "";
/**
* cntcId attribute .
* @return String
*/
public String getCntcId() {
return cntcId;
}
/**
* cntcId attribute .
* @param cntcId String
*/
public void setCntcId(String cntcId) {
this.cntcId = cntcId;
}
/**
* cntcNm attribute .
* @return String
*/
public String getCntcNm() {
return cntcNm;
}
/**
* cntcNm attribute .
* @param cntcNm String
*/
public void setCntcNm(String cntcNm) {
this.cntcNm = cntcNm;
}
/**
* cntcType attribute .
* @return String
*/
public String getCntcType() {
return cntcType;
}
/**
* cntcType attribute .
* @param cntcType String
*/
public void setCntcType(String cntcType) {
this.cntcType = cntcType;
}
/**
* cntAll attribute .
* @return String
*/
public String getCntAll() {
return cntAll;
}
/**
* cntAll attribute .
* @param cntAll String
*/
public void setCntAll(String cntAll) {
this.cntAll = cntAll;
}
/**
* cntSuccess attribute .
* @return String
*/
public String getCntSuccess() {
return cntSuccess;
}
/**
* cntSuccess attribute .
* @param cntSuccess String
*/
public void setCntSuccess(String cntSuccess) {
this.cntSuccess = cntSuccess;
}
/**
* cntFail attribute .
* @return String
*/
public String getCntFail() {
return cntFail;
}
/**
* cntFail attribute .
* @param cntFail String
*/
public void setCntFail(String cntFail) {
this.cntFail = cntFail;
}
/**
* provdInsttId attribute .
* @return String
*/
public String getProvdInsttId() {
return provdInsttId;
}
/**
* provdInsttId attribute .
* @param provdInsttId String
*/
public void setProvdInsttId(String provdInsttId) {
this.provdInsttId = provdInsttId;
}
/**
* provdInsttNm attribute .
* @return String
*/
public String getProvdInsttNm() {
return provdInsttNm;
}
/**
* provdInsttNm attribute .
* @param provdInsttNm String
*/
public void setProvdInsttNm(String provdInsttNm) {
this.provdInsttNm = provdInsttNm;
}
/**
* provdSysId attribute .
* @return String
*/
public String getProvdSysId() {
return provdSysId;
}
/**
* provdSysId attribute .
* @param provdSysId String
*/
public void setProvdSysId(String provdSysId) {
this.provdSysId = provdSysId;
}
/**
* provdSysNm attribute .
* @return String
*/
public String getProvdSysNm() {
return provdSysNm;
}
/**
* provdSysNm attribute .
* @param provdSysNm String
*/
public void setProvdSysNm(String provdSysNm) {
this.provdSysNm = provdSysNm;
}
/**
* provdSvcId attribute .
* @return String
*/
public String getProvdSvcId() {
return provdSvcId;
}
/**
* provdSvcId attribute .
* @param provdSvcId String
*/
public void setProvdSvcId(String provdSvcId) {
this.provdSvcId = provdSvcId;
}
/**
* provdSvcNm attribute .
* @return String
*/
public String getProvdSvcNm() {
return provdSvcNm;
}
/**
* provdSvcNm attribute .
* @param provdSvcNm String
*/
public void setProvdSvcNm(String provdSvcNm) {
this.provdSvcNm = provdSvcNm;
}
/**
* requstInsttId attribute .
* @return String
*/
public String getRequstInsttId() {
return requstInsttId;
}
/**
* requstInsttId attribute .
* @param requstInsttId String
*/
public void setRequstInsttId(String requstInsttId) {
this.requstInsttId = requstInsttId;
}
/**
* requstInsttNm attribute .
* @return String
*/
public String getRequstInsttNm() {
return requstInsttNm;
}
/**
* requstInsttNm attribute .
* @param requstInsttNm String
*/
public void setRequstInsttNm(String requstInsttNm) {
this.requstInsttNm = requstInsttNm;
}
/**
* requstSysId attribute .
* @return String
*/
public String getRequstSysId() {
return requstSysId;
}
/**
* requstSysId attribute .
* @param requstSysId String
*/
public void setRequstSysId(String requstSysId) {
this.requstSysId = requstSysId;
}
/**
* requstSysNm attribute .
* @return String
*/
public String getRequstSysNm() {
return requstSysNm;
}
/**
* requstSysNm attribute .
* @param requstSysNm String
*/
public void setRequstSysNm(String requstSysNm) {
this.requstSysNm = requstSysNm;
}
}

View File

@ -0,0 +1,197 @@
package egovframework.com.ssi.syi.ist.service;
import java.io.Serializable;
/**
*
* VO
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class CntcSttusVO extends CntcSttus implements Serializable {
/** 검색조건 */
private String searchCondition = "";
/** 검색Keyword */
private String searchKeyword = "";
/** 검색사용여부 */
private String searchUseYn = "";
/** 현재페이지 */
private int pageIndex = 1;
/** 페이지갯수 */
private int pageUnit = 10;
/** 페이지사이즈 */
private int pageSize = 10;
/** firstIndex */
private int firstIndex = 1;
/** lastIndex */
private int lastIndex = 1;
/** recordCountPerPage */
private int recordCountPerPage = 10;
/**
* searchCondition attribute .
* @return String
*/
public String getSearchCondition() {
return searchCondition;
}
/**
* searchCondition attribute .
* @param searchCondition String
*/
public void setSearchCondition(String searchCondition) {
this.searchCondition = searchCondition;
}
/**
* searchKeyword attribute .
* @return String
*/
public String getSearchKeyword() {
return searchKeyword;
}
/**
* searchKeyword attribute .
* @param searchKeyword String
*/
public void setSearchKeyword(String searchKeyword) {
this.searchKeyword = searchKeyword;
}
/**
* searchUseYn attribute .
* @return String
*/
public String getSearchUseYn() {
return searchUseYn;
}
/**
* searchUseYn attribute .
* @param searchUseYn String
*/
public void setSearchUseYn(String searchUseYn) {
this.searchUseYn = searchUseYn;
}
/**
* pageIndex attribute .
* @return int
*/
public int getPageIndex() {
return pageIndex;
}
/**
* pageIndex attribute .
* @param pageIndex int
*/
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
/**
* pageUnit attribute .
* @return int
*/
public int getPageUnit() {
return pageUnit;
}
/**
* pageUnit attribute .
* @param pageUnit int
*/
public void setPageUnit(int pageUnit) {
this.pageUnit = pageUnit;
}
/**
* pageSize attribute .
* @return int
*/
public int getPageSize() {
return pageSize;
}
/**
* pageSize attribute .
* @param pageSize int
*/
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
/**
* firstIndex attribute .
* @return int
*/
public int getFirstIndex() {
return firstIndex;
}
/**
* firstIndex attribute .
* @param firstIndex int
*/
public void setFirstIndex(int firstIndex) {
this.firstIndex = firstIndex;
}
/**
* lastIndex attribute .
* @return int
*/
public int getLastIndex() {
return lastIndex;
}
/**
* lastIndex attribute .
* @param lastIndex int
*/
public void setLastIndex(int lastIndex) {
this.lastIndex = lastIndex;
}
/**
* recordCountPerPage attribute .
* @return int
*/
public int getRecordCountPerPage() {
return recordCountPerPage;
}
/**
* recordCountPerPage attribute .
* @param recordCountPerPage int
*/
public void setRecordCountPerPage(int recordCountPerPage) {
this.recordCountPerPage = recordCountPerPage;
}
}

View File

@ -0,0 +1,48 @@
package egovframework.com.ssi.syi.ist.service;
import java.util.List;
/**
*
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public interface EgovCntcSttusService {
/**
* .
* @param cntcMessage
* @return CntcMessage()
* @throws Exception
*/
CntcSttus selectCntcSttusDetail(CntcSttus CntcSttus) throws Exception;
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
List selectCntcSttusList(CntcSttusVO searchVO) throws Exception;
/**
* .
* @param searchVO
* @return int( )
*/
int selectCntcSttusListTotCnt(CntcSttusVO searchVO) throws Exception;
}

View File

@ -0,0 +1,62 @@
package egovframework.com.ssi.syi.ist.service.impl;
import java.util.List;
import org.springframework.stereotype.Repository;
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
import egovframework.com.ssi.syi.ist.service.CntcSttus;
import egovframework.com.ssi.syi.ist.service.CntcSttusVO;
/**
*
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
@Repository("CntcSttusDAO")
public class CntcSttusDAO extends EgovComAbstractDAO {
/**
* .
* @param CntcSttus
* @return CntcSttus()
*/
public CntcSttus selectCntcSttusDetail(CntcSttus CntcSttus) throws Exception {
return (CntcSttus) selectByPk("CntcSttusDAO.selectCntcSttusDetail", CntcSttus);
}
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
public List selectCntcSttusList(CntcSttusVO searchVO) throws Exception {
return list("CntcSttusDAO.selectCntcSttusList", searchVO);
}
/**
* .
* @param searchVO
* @return int( )
*/
public int selectCntcSttusListTotCnt(CntcSttusVO searchVO) throws Exception {
return (Integer)getSqlMapClientTemplate().queryForObject("CntcSttusDAO.selectCntcSttusListTotCnt", searchVO);
}
}

View File

@ -0,0 +1,62 @@
package egovframework.com.ssi.syi.ist.service.impl;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import egovframework.com.ssi.syi.ist.service.CntcSttus;
import egovframework.com.ssi.syi.ist.service.CntcSttusVO;
import egovframework.com.ssi.syi.ist.service.EgovCntcSttusService;
import egovframework.rte.fdl.cmmn.AbstractServiceImpl;
/**
*
* .
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
@Service("CntcSttusService")
public class EgovCntcSttusServiceImpl extends AbstractServiceImpl implements EgovCntcSttusService {
@Resource(name="CntcSttusDAO")
private CntcSttusDAO cntcSttusDAO;
/**
* .
*/
public CntcSttus selectCntcSttusDetail(CntcSttus CntcSttus) throws Exception {
CntcSttus ret = (CntcSttus)cntcSttusDAO.selectCntcSttusDetail(CntcSttus);
return ret;
}
/**
* .
*/
public List selectCntcSttusList(CntcSttusVO searchVO) throws Exception {
return cntcSttusDAO.selectCntcSttusList(searchVO);
}
/**
* .
*/
public int selectCntcSttusListTotCnt(CntcSttusVO searchVO) throws Exception {
return cntcSttusDAO.selectCntcSttusListTotCnt(searchVO);
}
}

View File

@ -0,0 +1,120 @@
package egovframework.com.ssi.syi.ist.web;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
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 egovframework.com.cmm.annotation.IncludedInfo;
import egovframework.com.ssi.syi.ist.service.CntcSttus;
import egovframework.com.ssi.syi.ist.service.CntcSttusVO;
import egovframework.com.ssi.syi.ist.service.EgovCntcSttusService;
import egovframework.rte.fdl.property.EgovPropertyService;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
/**
*
* Controller
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
* 2011.8.26 IncludedInfo annotation
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
@Controller
public class EgovCntcSttusController {
@Resource(name = "CntcSttusService")
private EgovCntcSttusService cntcSttusService;
/** EgovPropertyService */
@Resource(name = "propertiesService")
protected EgovPropertyService propertiesService;
/**
* .
* @param loginVO
* @param CntcSttus
* @param model
* @return "egovframework/com/cmm/sym/ccm/EgovCcmCntcSttusDetail"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/ist/getCntcSttusDetail.do")
public String selectCntcSttusLogDetail (CntcSttus CntcSttus
, ModelMap model
) throws Exception {
CntcSttus vo = cntcSttusService.selectCntcSttusDetail(CntcSttus);
model.addAttribute("result", vo);
return "egovframework/com/ssi/syi/ist/EgovCntcSttusDetail";
}
/**
* .
* @param loginVO
* @param searchVO
* @param model
* @return "egovframework/com/cmm/sym/ccm/EgovCcmCntcSttusList"
* @throws Exception
*/
@IncludedInfo(name="연계현황관리", listUrl="/ssi/syi/ist/getCntcSttusList.do", order = 1220,gid = 70)
@RequestMapping(value="/ssi/syi/ist/getCntcSttusList.do")
public String selectCntcSttusLogList (@ModelAttribute("searchVO") CntcSttusVO searchVO
, ModelMap model
) throws Exception {
/** EgovPropertyService.sample */
searchVO.setPageUnit(propertiesService.getInt("pageUnit"));
searchVO.setPageSize(propertiesService.getInt("pageSize"));
/** pageing */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
List CmmnCodeList = cntcSttusService.selectCntcSttusList(searchVO);
model.addAttribute("resultList", CmmnCodeList);
int totCnt = cntcSttusService.selectCntcSttusListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
model.addAttribute("paginationInfo", paginationInfo);
return "egovframework/com/ssi/syi/ist/EgovCntcSttusList";
}
/**
* Map .
* @param commandMap
* @return
*/
public String printParameterMap(Map commandMap){
String ret = "";
for(Object key:commandMap.keySet()){
Object value = commandMap.get(key);
ret += "key:" + key.toString() + " value:" + value.toString();
}
return ret;
}
}

View File

@ -0,0 +1,77 @@
package egovframework.com.ssi.syi.sim.service;
import java.util.List;
/**
*
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public interface EgovSystemCntcService {
/**
* .
* @param systemCntc
* @throws Exception
*/
void deleteSystemCntc(SystemCntc systemCntc) throws Exception;
/**
* .
* @param systemCntc
* @throws Exception
*/
void insertSystemCntc(SystemCntc systemCntc) throws Exception;
/**
* .
* @param systemCntc
* @return SystemCntc()
* @throws Exception
*/
SystemCntc selectSystemCntcDetail(SystemCntc systemCntc) throws Exception;
/**
* /.
* @param systemCntc
* @return SystemCntc()
* @throws Exception
*/
void confirmSystemCntc(SystemCntc systemCntc) throws Exception;
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
List selectSystemCntcList(SystemCntcVO searchVO) throws Exception;
/**
* .
* @param searchVO
* @return int( )
*/
int selectSystemCntcListTotCnt(SystemCntcVO searchVO) throws Exception;
/**
* .
* @param systemCntc
* @throws Exception
*/
void updateSystemCntc(SystemCntc systemCntc) throws Exception;
}

View File

@ -0,0 +1,319 @@
package egovframework.com.ssi.syi.sim.service;
import java.io.Serializable;
/**
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class SystemCntc implements Serializable {
/*
* ID
*/
private String cntcId = "";
/*
*
*/
private String cntcNm = "";
/*
*
*/
private String cntcType = "";
/*
* ID
*/
private String provdInsttId = "";
/*
* ID
*/
private String provdSysId = "";
/*
* ID
*/
private String provdSvcId = "";
/*
* ID
*/
private String requstInsttId = "";
/*
* ID
*/
private String requstSysId = "";
/*
*
*/
private String confmAt = "";
/*
*
*/
private String useAt = "";
/*
*
*/
private String validBeginDe = "";
/*
*
*/
private String validEndDe = "";
/*
* ID
*/
private String frstRegisterId = "";
/*
* ID
*/
private String lastUpdusrId = "";
/**
* cntcId attribute .
* @return String
*/
public String getCntcId() {
return cntcId;
}
/**
* cntcId attribute .
* @param cntcId String
*/
public void setCntcId(String cntcId) {
this.cntcId = cntcId;
}
/**
* cntcNm attribute .
* @return String
*/
public String getCntcNm() {
return cntcNm;
}
/**
* cntcNm attribute .
* @param cntcNm String
*/
public void setCntcNm(String cntcNm) {
this.cntcNm = cntcNm;
}
/**
* cntcType attribute .
* @return String
*/
public String getCntcType() {
return cntcType;
}
/**
* cntcType attribute .
* @param cntcType String
*/
public void setCntcType(String cntcType) {
this.cntcType = cntcType;
}
/**
* provdInsttId attribute .
* @return String
*/
public String getProvdInsttId() {
return provdInsttId;
}
/**
* provdInsttId attribute .
* @param provdInsttId String
*/
public void setProvdInsttId(String provdInsttId) {
this.provdInsttId = provdInsttId;
}
/**
* provdSysId attribute .
* @return String
*/
public String getProvdSysId() {
return provdSysId;
}
/**
* provdSysId attribute .
* @param provdSysId String
*/
public void setProvdSysId(String provdSysId) {
this.provdSysId = provdSysId;
}
/**
* provdSvcId attribute .
* @return String
*/
public String getProvdSvcId() {
return provdSvcId;
}
/**
* provdSvcId attribute .
* @param provdSvcId String
*/
public void setProvdSvcId(String provdSvcId) {
this.provdSvcId = provdSvcId;
}
/**
* requstInsttId attribute .
* @return String
*/
public String getRequstInsttId() {
return requstInsttId;
}
/**
* requstInsttId attribute .
* @param requstInsttId String
*/
public void setRequstInsttId(String requstInsttId) {
this.requstInsttId = requstInsttId;
}
/**
* requstSysId attribute .
* @return String
*/
public String getRequstSysId() {
return requstSysId;
}
/**
* requstSysId attribute .
* @param requstSysId String
*/
public void setRequstSysId(String requstSysId) {
this.requstSysId = requstSysId;
}
/**
* confmAt attribute .
* @return String
*/
public String getConfmAt() {
return confmAt;
}
/**
* confmAt attribute .
* @param confmAt String
*/
public void setConfmAt(String confmAt) {
this.confmAt = confmAt;
}
/**
* useAt attribute .
* @return String
*/
public String getUseAt() {
return useAt;
}
/**
* useAt attribute .
* @param useAt String
*/
public void setUseAt(String useAt) {
this.useAt = useAt;
}
/**
* validBeginDe attribute .
* @return String
*/
public String getValidBeginDe() {
return validBeginDe;
}
/**
* validBeginDe attribute .
* @param validBeginDe String
*/
public void setValidBeginDe(String validBeginDe) {
this.validBeginDe = validBeginDe;
}
/**
* validEndDe attribute .
* @return String
*/
public String getValidEndDe() {
return validEndDe;
}
/**
* validEndDe attribute .
* @param validEndDe String
*/
public void setValidEndDe(String validEndDe) {
this.validEndDe = validEndDe;
}
/**
* 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;
}
}

View File

@ -0,0 +1,197 @@
package egovframework.com.ssi.syi.sim.service;
import java.io.Serializable;
/**
*
* VO
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
public class SystemCntcVO extends SystemCntc implements Serializable {
/** 검색조건 */
private String searchCondition = "";
/** 검색Keyword */
private String searchKeyword = "";
/** 검색사용여부 */
private String searchUseYn = "";
/** 현재페이지 */
private int pageIndex = 1;
/** 페이지갯수 */
private int pageUnit = 10;
/** 페이지사이즈 */
private int pageSize = 10;
/** firstIndex */
private int firstIndex = 1;
/** lastIndex */
private int lastIndex = 1;
/** recordCountPerPage */
private int recordCountPerPage = 10;
/**
* searchCondition attribute .
* @return String
*/
public String getSearchCondition() {
return searchCondition;
}
/**
* searchCondition attribute .
* @param searchCondition String
*/
public void setSearchCondition(String searchCondition) {
this.searchCondition = searchCondition;
}
/**
* searchKeyword attribute .
* @return String
*/
public String getSearchKeyword() {
return searchKeyword;
}
/**
* searchKeyword attribute .
* @param searchKeyword String
*/
public void setSearchKeyword(String searchKeyword) {
this.searchKeyword = searchKeyword;
}
/**
* searchUseYn attribute .
* @return String
*/
public String getSearchUseYn() {
return searchUseYn;
}
/**
* searchUseYn attribute .
* @param searchUseYn String
*/
public void setSearchUseYn(String searchUseYn) {
this.searchUseYn = searchUseYn;
}
/**
* pageIndex attribute .
* @return int
*/
public int getPageIndex() {
return pageIndex;
}
/**
* pageIndex attribute .
* @param pageIndex int
*/
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
/**
* pageUnit attribute .
* @return int
*/
public int getPageUnit() {
return pageUnit;
}
/**
* pageUnit attribute .
* @param pageUnit int
*/
public void setPageUnit(int pageUnit) {
this.pageUnit = pageUnit;
}
/**
* pageSize attribute .
* @return int
*/
public int getPageSize() {
return pageSize;
}
/**
* pageSize attribute .
* @param pageSize int
*/
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
/**
* firstIndex attribute .
* @return int
*/
public int getFirstIndex() {
return firstIndex;
}
/**
* firstIndex attribute .
* @param firstIndex int
*/
public void setFirstIndex(int firstIndex) {
this.firstIndex = firstIndex;
}
/**
* lastIndex attribute .
* @return int
*/
public int getLastIndex() {
return lastIndex;
}
/**
* lastIndex attribute .
* @param lastIndex int
*/
public void setLastIndex(int lastIndex) {
this.lastIndex = lastIndex;
}
/**
* recordCountPerPage attribute .
* @return int
*/
public int getRecordCountPerPage() {
return recordCountPerPage;
}
/**
* recordCountPerPage attribute .
* @param recordCountPerPage int
*/
public void setRecordCountPerPage(int recordCountPerPage) {
this.recordCountPerPage = recordCountPerPage;
}
}

View File

@ -0,0 +1,89 @@
package egovframework.com.ssi.syi.sim.service.impl;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import egovframework.com.ssi.syi.sim.service.EgovSystemCntcService;
import egovframework.com.ssi.syi.sim.service.SystemCntc;
import egovframework.com.ssi.syi.sim.service.SystemCntcVO;
import egovframework.rte.fdl.cmmn.AbstractServiceImpl;
/**
*
* .
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
@Service("SystemCntcService")
public class EgovSystemCntcServiceImpl extends AbstractServiceImpl implements EgovSystemCntcService {
@Resource(name="SystemCntcDAO")
private SystemCntcDAO systemCntcDAO;
/**
* .
*/
public void deleteSystemCntc(SystemCntc systemCntc) throws Exception {
systemCntcDAO.deleteSystemCntc(systemCntc);
}
/**
* .
*/
public void insertSystemCntc(SystemCntc systemCntc) throws Exception {
systemCntcDAO.insertSystemCntc(systemCntc);
}
/**
* .
*/
public SystemCntc selectSystemCntcDetail(SystemCntc systemCntc) throws Exception {
SystemCntc ret = (SystemCntc)systemCntcDAO.selectSystemCntcDetail(systemCntc);
return ret;
}
/**
* /.
*/
public void confirmSystemCntc(SystemCntc systemCntc) throws Exception {
systemCntcDAO.confirmSystemCntc(systemCntc);
}
/**
* .
*/
public List selectSystemCntcList(SystemCntcVO searchVO) throws Exception {
return systemCntcDAO.selectSystemCntcList(searchVO);
}
/**
* .
*/
public int selectSystemCntcListTotCnt(SystemCntcVO searchVO) throws Exception {
return systemCntcDAO.selectSystemCntcListTotCnt(searchVO);
}
/**
* .
*/
public void updateSystemCntc(SystemCntc systemCntc) throws Exception {
systemCntcDAO.updateSystemCntc(systemCntc);
}
}

View File

@ -0,0 +1,98 @@
package egovframework.com.ssi.syi.sim.service.impl;
import java.util.List;
import org.springframework.stereotype.Repository;
import egovframework.com.cmm.service.impl.EgovComAbstractDAO;
import egovframework.com.ssi.syi.sim.service.SystemCntc;
import egovframework.com.ssi.syi.sim.service.SystemCntcVO;
/**
*
*
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
@Repository("SystemCntcDAO")
public class SystemCntcDAO extends EgovComAbstractDAO {
/**
* .
* @param systemCntc
* @throws Exception
*/
public void deleteSystemCntc(SystemCntc systemCntc) throws Exception {
delete("SystemCntcDAO.deleteSystemCntc", systemCntc);
}
/**
* .
* @param systemCntc
* @throws Exception
*/
public void insertSystemCntc(SystemCntc systemCntc) throws Exception {
insert("SystemCntcDAO.insertSystemCntc", systemCntc);
}
/**
* .
* @param systemCntc
* @return SystemCntc()
*/
public SystemCntc selectSystemCntcDetail(SystemCntc systemCntc) throws Exception {
return (SystemCntc) selectByPk("SystemCntcDAO.selectSystemCntcDetail", systemCntc);
}
/**
* /.
* @param systemCntc
* @throws Exception
*/
public void confirmSystemCntc(SystemCntc systemCntc) throws Exception {
update("SystemCntcDAO.confirmSystemCntc", systemCntc);
}
/**
* .
* @param searchVO
* @return List( )
* @throws Exception
*/
public List selectSystemCntcList(SystemCntcVO searchVO) throws Exception {
return list("SystemCntcDAO.selectSystemCntcList", searchVO);
}
/**
* .
* @param searchVO
* @return int( )
*/
public int selectSystemCntcListTotCnt(SystemCntcVO searchVO) throws Exception {
return (Integer)getSqlMapClientTemplate().queryForObject("SystemCntcDAO.selectSystemCntcListTotCnt", searchVO);
}
/**
* .
* @param systemCntc
* @throws Exception
*/
public void updateSystemCntc(SystemCntc systemCntc) throws Exception {
update("SystemCntcDAO.updateSystemCntc", systemCntc);
}
}

View File

@ -0,0 +1,560 @@
package egovframework.com.ssi.syi.sim.web;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springmodules.validation.commons.DefaultBeanValidator;
import egovframework.com.cmm.EgovMessageSource;
import egovframework.com.cmm.LoginVO;
import egovframework.com.cmm.annotation.IncludedInfo;
import egovframework.com.cmm.util.EgovUserDetailsHelper;
import egovframework.com.ssi.syi.iis.service.CntcInsttVO;
import egovframework.com.ssi.syi.iis.service.CntcServiceVO;
import egovframework.com.ssi.syi.iis.service.CntcSystemVO;
import egovframework.com.ssi.syi.iis.service.EgovCntcInsttService;
import egovframework.com.ssi.syi.sim.service.EgovSystemCntcService;
import egovframework.com.ssi.syi.sim.service.SystemCntc;
import egovframework.com.ssi.syi.sim.service.SystemCntcVO;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import egovframework.rte.fdl.property.EgovPropertyService;
import egovframework.rte.psl.dataaccess.util.EgovMap;
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
/**
*
* Controller
* @author
* @since 2009.04.01
* @version 1.0
* @see
*
* <pre>
* << (Modification Information) >>
*
*
* ------- -------- ---------------------------
* 2009.04.01
* 2011.8.26 IncludedInfo annotation
*
* Copyright (C) 2009 by MOPAS All right reserved.
* </pre>
*/
@Controller
public class EgovSystemCntcController {
@Resource(name = "SystemCntcService")
private EgovSystemCntcService systemCntcService;
@Resource(name = "CntcInsttService")
private EgovCntcInsttService cntcInsttService;
/** EgovIdGnrService */
@Resource(name="egovSystemCntcIdGnrService")
private EgovIdGnrService idgenService;
/** EgovMessageSource */
@Resource(name="egovMessageSource")
EgovMessageSource egovMessageSource;
/** EgovPropertyService */
@Resource(name = "propertiesService")
protected EgovPropertyService propertiesService;
@Autowired
private DefaultBeanValidator beanValidator;
/**
* .
* @param loginVO
* @param systemCntc
* @param model
* @return "forward:/ssi/syi/sim/EgovCcmAdministCodeList.do"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/sim/removeSystemCntc.do")
public String deleteSystemCntc (SystemCntc systemCntc
, ModelMap model
) throws Exception {
systemCntcService.deleteSystemCntc(systemCntc);
return "forward:/ssi/syi/sim/getSystemCntcList.do";
}
/**
* .
* @param loginVO
* @param systemCntc
* @param bindingResult
* @param model
* @return "egovframework/com/ssi/syi/sim/EgovCcmSystemCntcRegist"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/sim/addSystemCntc.do")
public String insertSystemCntc (@ModelAttribute("systemCntc") SystemCntc systemCntc
, BindingResult bindingResult
, Map commandMap
, ModelMap model
) throws Exception {
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("")) {
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
// 연계시스템 리스트박스 데이터
CntcSystemVO searchCntcSystemVO;
searchCntcSystemVO = new CntcSystemVO();
searchCntcSystemVO.setRecordCountPerPage(999999);
searchCntcSystemVO.setFirstIndex(0);
searchCntcSystemVO.setSearchCondition("CodeList");
if (systemCntc.getProvdInsttId().equals("")) {
if(cntcInsttList.size()>0) {
EgovMap emp = (EgovMap)cntcInsttList.get(0);
systemCntc.setProvdInsttId(emp.get("insttId").toString());
}
}
searchCntcSystemVO.setInsttId(systemCntc.getProvdInsttId());
List cntcProvdSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcProvdSystemList", cntcProvdSystemList);
if (systemCntc.getRequstInsttId().equals("")) {
if(cntcInsttList.size()>0) {
EgovMap emp = (EgovMap)cntcInsttList.get(0);
systemCntc.setRequstInsttId(emp.get("insttId").toString());
}
}
searchCntcSystemVO.setInsttId(systemCntc.getRequstInsttId());
List cntcRequstSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcRequstSystemList", cntcRequstSystemList);
// 연계서비스 리스트박스 데이터
CntcServiceVO searchCntcServiceVO;
searchCntcServiceVO = new CntcServiceVO();
searchCntcServiceVO.setRecordCountPerPage(999999);
searchCntcServiceVO.setFirstIndex(0);
searchCntcServiceVO.setSearchCondition("CodeList");
searchCntcServiceVO.setInsttId(systemCntc.getProvdInsttId());
if (systemCntc.getProvdSysId().equals("")) {
if(cntcProvdSystemList.size()>0) {
EgovMap emp = (EgovMap)cntcProvdSystemList.get(0);
systemCntc.setProvdSysId(emp.get("sysId").toString());
}
}
searchCntcServiceVO.setSysId(systemCntc.getProvdSysId());
List cntcProvdServiceList = cntcInsttService.selectCntcServiceList(searchCntcServiceVO);
model.addAttribute("cntcProvdServiceList", cntcProvdServiceList);
return "egovframework/com/ssi/syi/sim/EgovSystemCntcRegist";
} else if (sCmd.equals("Regist")) {
beanValidator.validate(systemCntc, bindingResult);
if (bindingResult.hasErrors()){
return "egovframework/com/ssi/syi/sim/EgovSystemCntcRegist";
}
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
systemCntc.setFrstRegisterId(uniqId);
// ID Generation
String sCntcId = idgenService.getNextStringId();
systemCntc.setCntcId(sCntcId);
systemCntcService.insertSystemCntc(systemCntc);
return "forward:/ssi/syi/sim/getSystemCntcList.do";
} else {
return "forward:/ssi/syi/sim/getSystemCntcList.do";
}
}
/**
* .
* @param loginVO
* @param systemCntc
* @param model
* @return "egovframework/com/ssi/syi/sim/EgovCcmSystemCntcDetail"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/sim/getSystemCntcDetail.do")
public String selectSystemCntcDetail (SystemCntc systemCntc
, ModelMap model
) throws Exception {
// 0. Spring Security 사용자권한 처리
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
if(!isAuthenticated) {
model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
return "egovframework/com/uat/uia/EgovLoginUsr";
}
String selfUri = "/ssi/syi/sim/getSystemCntcDetail.do";
model.addAttribute("selfUri", selfUri);
SystemCntc vo = systemCntcService.selectSystemCntcDetail(systemCntc);
model.addAttribute("result", vo);
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
// 연계시스템 리스트박스 데이터
CntcSystemVO searchCntcSystemVO;
searchCntcSystemVO = new CntcSystemVO();
searchCntcSystemVO.setRecordCountPerPage(999999);
searchCntcSystemVO.setFirstIndex(0);
searchCntcSystemVO.setSearchCondition("CodeList");
searchCntcSystemVO.setInsttId(vo.getProvdInsttId());
List cntcProvdSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcProvdSystemList", cntcProvdSystemList);
searchCntcSystemVO.setInsttId(vo.getRequstInsttId());
List cntcRequstSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcRequstSystemList", cntcRequstSystemList);
// 연계서비스 리스트박스 데이터
CntcServiceVO searchCntcServiceVO;
searchCntcServiceVO = new CntcServiceVO();
searchCntcServiceVO.setRecordCountPerPage(999999);
searchCntcServiceVO.setFirstIndex(0);
searchCntcServiceVO.setSearchCondition("CodeList");
searchCntcServiceVO.setInsttId(vo.getProvdInsttId());
searchCntcServiceVO.setSysId(vo.getProvdSysId());
List cntcProvdServiceList = cntcInsttService.selectCntcServiceList(searchCntcServiceVO);
model.addAttribute("cntcProvdServiceList", cntcProvdServiceList);
return "egovframework/com/ssi/syi/sim/EgovSystemCntcDetail";
}
/**
* .
* @param loginVO
* @param searchVO
* @param model
* @return "egovframework/com/ssi/syi/sim/EgovCcmSystemCntcList"
* @throws Exception
*/
@IncludedInfo(name="시스템연계관리", listUrl="/ssi/syi/sim/getSystemCntcList.do", order = 1210,gid = 70)
@RequestMapping(value="/ssi/syi/sim/getSystemCntcList.do")
public String selectSystemCntcList (@ModelAttribute("searchVO") SystemCntcVO searchVO
, ModelMap model
) throws Exception {
// 0. Spring Security 사용자권한 처리
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
if(!isAuthenticated) {
model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
return "egovframework/com/uat/uia/EgovLoginUsr";
}
String selfUri = "/ssi/syi/sim/getSystemCntcList.do";
model.addAttribute("selfUri", selfUri);
/** EgovPropertyService.sample */
searchVO.setPageUnit(propertiesService.getInt("pageUnit"));
searchVO.setPageSize(propertiesService.getInt("pageSize"));
/** pageing */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
List CmmnCodeList = systemCntcService.selectSystemCntcList(searchVO);
model.addAttribute("resultList", CmmnCodeList);
int totCnt = systemCntcService.selectSystemCntcListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
model.addAttribute("paginationInfo", paginationInfo);
return "egovframework/com/ssi/syi/sim/EgovSystemCntcList";
}
/**
* .
* @param loginVO
* @param integInstt
* @param bindingResult
* @param commandMap
* @param model
* @return "egovframework/com/ssi/syi/sim/EgovCcmAdministCodeModify"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/sim/updateSystemCntc.do")
public String updateSystemCntc (@ModelAttribute("systemCntc") SystemCntc systemCntc
, BindingResult bindingResult
, Map commandMap
, ModelMap model
) throws Exception {
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("")) {
if (systemCntc.getCntcNm().equals("")) {
SystemCntc vo = systemCntcService.selectSystemCntcDetail(systemCntc);
model.addAttribute("systemCntc", vo);
systemCntc.setProvdInsttId(vo.getProvdInsttId());
systemCntc.setRequstInsttId(vo.getRequstInsttId());
systemCntc.setProvdSysId(vo.getProvdSysId());
}
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
// 연계시스템 리스트박스 데이터
CntcSystemVO searchCntcSystemVO;
searchCntcSystemVO = new CntcSystemVO();
searchCntcSystemVO.setRecordCountPerPage(999999);
searchCntcSystemVO.setFirstIndex(0);
searchCntcSystemVO.setSearchCondition("CodeList");
searchCntcSystemVO.setInsttId(systemCntc.getProvdInsttId());
List cntcProvdSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcProvdSystemList", cntcProvdSystemList);
searchCntcSystemVO.setInsttId(systemCntc.getRequstInsttId());
List cntcRequstSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcRequstSystemList", cntcRequstSystemList);
// 연계서비스 리스트박스 데이터
CntcServiceVO searchCntcServiceVO;
searchCntcServiceVO = new CntcServiceVO();
searchCntcServiceVO.setRecordCountPerPage(999999);
searchCntcServiceVO.setFirstIndex(0);
searchCntcServiceVO.setSearchCondition("CodeList");
searchCntcServiceVO.setInsttId(systemCntc.getProvdInsttId());
searchCntcServiceVO.setSysId(systemCntc.getProvdSysId());
List cntcProvdServiceList = cntcInsttService.selectCntcServiceList(searchCntcServiceVO);
model.addAttribute("cntcProvdServiceList", cntcProvdServiceList);
return "egovframework/com/ssi/syi/sim/EgovSystemCntcUpdt";
} else if (sCmd.equals("Modify")) {
beanValidator.validate(systemCntc, bindingResult);
if (bindingResult.hasErrors()){
if (systemCntc.getCntcNm().equals("")) {
SystemCntc vo = systemCntcService.selectSystemCntcDetail(systemCntc);
model.addAttribute("systemCntc", vo);
systemCntc.setProvdInsttId(vo.getProvdInsttId());
systemCntc.setRequstInsttId(vo.getRequstInsttId());
systemCntc.setProvdSysId(vo.getProvdSysId());
}
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
// 연계시스템 리스트박스 데이터
CntcSystemVO searchCntcSystemVO;
searchCntcSystemVO = new CntcSystemVO();
searchCntcSystemVO.setRecordCountPerPage(999999);
searchCntcSystemVO.setFirstIndex(0);
searchCntcSystemVO.setSearchCondition("CodeList");
searchCntcSystemVO.setInsttId(systemCntc.getProvdInsttId());
List cntcProvdSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcProvdSystemList", cntcProvdSystemList);
searchCntcSystemVO.setInsttId(systemCntc.getRequstInsttId());
List cntcRequstSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcRequstSystemList", cntcRequstSystemList);
// 연계서비스 리스트박스 데이터
CntcServiceVO searchCntcServiceVO;
searchCntcServiceVO = new CntcServiceVO();
searchCntcServiceVO.setRecordCountPerPage(999999);
searchCntcServiceVO.setFirstIndex(0);
searchCntcServiceVO.setSearchCondition("CodeList");
searchCntcServiceVO.setInsttId(systemCntc.getProvdInsttId());
searchCntcServiceVO.setSysId(systemCntc.getProvdSysId());
List cntcProvdServiceList = cntcInsttService.selectCntcServiceList(searchCntcServiceVO);
model.addAttribute("cntcProvdServiceList", cntcProvdServiceList);
return "egovframework/com/ssi/syi/sim/EgovSystemCntcUpdt";
}
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
systemCntc.setLastUpdusrId(uniqId);
systemCntcService.updateSystemCntc(systemCntc);
return "forward:/ssi/syi/sim/getSystemCntcList.do";
} else {
return "forward:/ssi/syi/sim/getSystemCntcList.do";
}
}
/**
* .
* @param loginVO
* @param integInstt
* @param bindingResult
* @param commandMap
* @param model
* @return "egovframework/com/ssi/syi/sim/EgovCcmAdministCodeModify"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/scm/getConfirmSystemCntcList.do")
//@RequestMapping(value="/ssi/syi/sim/getSystemCntcList.do")
public String selectConfirmSystemCntcList (@ModelAttribute("searchVO") SystemCntcVO searchVO
, ModelMap model
) throws Exception {
// 0. Spring Security 사용자권한 처리
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
if(!isAuthenticated) {
model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
return "egovframework/com/uat/uia/EgovLoginUsr";
}
String selfUri = "/ssi/syi/scm/getConfirmSystemCntcList.do";
model.addAttribute("selfUri", selfUri);
/** EgovPropertyService.sample */
searchVO.setPageUnit(propertiesService.getInt("pageUnit"));
searchVO.setPageSize(propertiesService.getInt("pageSize"));
/** pageing */
PaginationInfo paginationInfo = new PaginationInfo();
paginationInfo.setCurrentPageNo(searchVO.getPageIndex());
paginationInfo.setRecordCountPerPage(searchVO.getPageUnit());
paginationInfo.setPageSize(searchVO.getPageSize());
searchVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
searchVO.setLastIndex(paginationInfo.getLastRecordIndex());
searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
List CmmnCodeList = systemCntcService.selectSystemCntcList(searchVO);
model.addAttribute("resultList", CmmnCodeList);
int totCnt = systemCntcService.selectSystemCntcListTotCnt(searchVO);
paginationInfo.setTotalRecordCount(totCnt);
model.addAttribute("paginationInfo", paginationInfo);
return "egovframework/com/ssi/syi/sim/EgovSystemCntcList";
}
/**
* .
* @param loginVO
* @param systemCntc
* @param model
* @return "egovframework/com/ssi/syi/sim/EgovCcmSystemCntcDetail"
* @throws Exception
*/
@RequestMapping(value="/ssi/syi/scm/getConfirmSystemCntcDetail.do")
//@RequestMapping(value="/ssi/syi/sim/getSystemCntcDetail.do")
public String selectConfirmSystemCntcDetail (SystemCntc systemCntc
, Map commandMap
, ModelMap model
) throws Exception {
// 0. Spring Security 사용자권한 처리
Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
if(!isAuthenticated) {
model.addAttribute("message", egovMessageSource.getMessage("fail.common.login"));
return "egovframework/com/uat/uia/EgovLoginUsr";
}
String sCmd = commandMap.get("cmd") == null ? "" : (String)commandMap.get("cmd");
if (sCmd.equals("Confirm")) {
// 로그인VO에서 사용자 정보 가져오기
LoginVO loginVO = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser();
String uniqId = loginVO.getUniqId();
systemCntc.setLastUpdusrId(uniqId);
systemCntcService.confirmSystemCntc(systemCntc);
}
String selfUri = "/ssi/syi/scm/getConfirmSystemCntcDetail.do";
model.addAttribute("selfUri", selfUri);
SystemCntc vo = systemCntcService.selectSystemCntcDetail(systemCntc);
model.addAttribute("result", vo);
// 연계기관 리스트박스 데이터
CntcInsttVO searchCntcInsttVO;
searchCntcInsttVO = new CntcInsttVO();
searchCntcInsttVO.setRecordCountPerPage(999999);
searchCntcInsttVO.setFirstIndex(0);
searchCntcInsttVO.setSearchCondition("CodeList");
List cntcInsttList = cntcInsttService.selectCntcInsttList(searchCntcInsttVO);
model.addAttribute("cntcInsttList", cntcInsttList);
// 연계시스템 리스트박스 데이터
CntcSystemVO searchCntcSystemVO;
searchCntcSystemVO = new CntcSystemVO();
searchCntcSystemVO.setRecordCountPerPage(999999);
searchCntcSystemVO.setFirstIndex(0);
searchCntcSystemVO.setSearchCondition("CodeList");
searchCntcSystemVO.setInsttId(vo.getProvdInsttId());
List cntcProvdSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcProvdSystemList", cntcProvdSystemList);
searchCntcSystemVO.setInsttId(vo.getRequstInsttId());
List cntcRequstSystemList = cntcInsttService.selectCntcSystemList(searchCntcSystemVO);
model.addAttribute("cntcRequstSystemList", cntcRequstSystemList);
// 연계서비스 리스트박스 데이터
CntcServiceVO searchCntcServiceVO;
searchCntcServiceVO = new CntcServiceVO();
searchCntcServiceVO.setRecordCountPerPage(999999);
searchCntcServiceVO.setFirstIndex(0);
searchCntcServiceVO.setSearchCondition("CodeList");
searchCntcServiceVO.setInsttId(vo.getProvdInsttId());
searchCntcServiceVO.setSysId(vo.getProvdSysId());
List cntcProvdServiceList = cntcInsttService.selectCntcServiceList(searchCntcServiceVO);
model.addAttribute("cntcProvdServiceList", cntcProvdServiceList);
return "egovframework/com/ssi/syi/sim/EgovSystemCntcDetail";
}
/**
* Map .
* @param commandMap
* @return
*/
public String printParameterMap(Map commandMap){
String ret = "";
for(Object key:commandMap.keySet()){
Object value = commandMap.get(key);
ret += "key:" + key.toString() + " value:" + value.toString();
}
return ret;
}
}

View File

@ -0,0 +1,145 @@
package geoinfo.com;
import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.security.AlgorithmParameters;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.InvalidParameterSpecException;
import java.util.Base64;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.spec.SecretKeySpec;
public class CryptoUtil {
/**
* MD5 .
*
* @param msg
* @return
*/
// public static String md5(String msg) throws NoSuchAlgorithmException {
// MessageDigest md = MessageDigest.getInstance("MD5");
// md.update(msg.getBytes());
// return CryptoUtil.byteToHexString(md.digest());
// }
/**
* SHA-256 .
*
* @param msg
* @return
*/
// public static String sha256(String msg) throws NoSuchAlgorithmException {
// MessageDigest md = MessageDigest.getInstance("SHA-256");
// md.reset();
// md.update(msg.getBytes());
// return CryptoUtil.byteToHexString(md.digest());
// }
/**
* HEX .
* @param data
* @return
*/
public static String byteToHexString(byte[] data) {
StringBuilder sb = new StringBuilder();
for(byte b : data) {
sb.append(Integer.toString((b & 0xff) + 0x100, 16).substring(1));
}
return sb.toString();
}
/**
* AES 256 .
* @param msg
* @param key
* @return
* @throws NoSuchAlgorithmException
* @throws InvalidKeySpecException
* @throws NoSuchPaddingException
* @throws InvalidKeyException
* @throws InvalidParameterSpecException
* @throws UnsupportedEncodingException
* @throws BadPaddingException
* @throws IllegalBlockSizeException
*/
public static String encryptAES256(String msg, String key) throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException, InvalidKeyException, InvalidParameterSpecException, UnsupportedEncodingException, BadPaddingException, IllegalBlockSizeException {
SecureRandom random = new SecureRandom();
byte bytes[] = new byte[20];
random.nextBytes(bytes);
byte[] saltBytes = bytes;
// Password-Based Key Derivation function 2
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
// 70000번 해시하여 256 bit 길이의 키를 만든다.
PBEKeySpec spec = new PBEKeySpec(key.toCharArray(), saltBytes, 70000, 256);
SecretKey secretKey = factory.generateSecret(spec);
SecretKeySpec secret = new SecretKeySpec(secretKey.getEncoded(), "AES");
// 알고리즘/모드/패딩
// CBC : Cipher Block Chaining Mode
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, secret);
AlgorithmParameters params = cipher.getParameters();
// Initial Vector(1단계 암호화 블록용)
byte[] ivBytes = params.getParameterSpec(IvParameterSpec.class).getIV();
byte[] encryptedTextBytes = cipher.doFinal(msg.getBytes("UTF-8"));
byte[] buffer = new byte[saltBytes.length + ivBytes.length + encryptedTextBytes.length];
System.arraycopy(saltBytes, 0, buffer, 0, saltBytes.length);
System.arraycopy(ivBytes, 0, buffer, saltBytes.length, ivBytes.length);
System.arraycopy(encryptedTextBytes, 0, buffer, saltBytes.length + ivBytes.length, encryptedTextBytes.length);
return Base64.getEncoder().encodeToString(buffer);
}
/**
* .
* @param msg
* @param key
* @return
* @throws NoSuchPaddingException
* @throws NoSuchAlgorithmException
* @throws InvalidKeySpecException
* @throws InvalidAlgorithmParameterException
* @throws InvalidKeyException
* @throws BadPaddingException
* @throws IllegalBlockSizeException
*/
public static String decryptAES256(String msg, String key) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeySpecException, InvalidAlgorithmParameterException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
ByteBuffer buffer = ByteBuffer.wrap(Base64.getDecoder().decode(msg));
byte[] saltBytes = new byte[20];
buffer.get(saltBytes, 0, saltBytes.length);
byte[] ivBytes = new byte[cipher.getBlockSize()];
buffer.get(ivBytes, 0, ivBytes.length);
byte[] encryoptedTextBytes = new byte[buffer.capacity() - saltBytes.length - ivBytes.length];
buffer.get(encryoptedTextBytes);
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
PBEKeySpec spec = new PBEKeySpec(key.toCharArray(), saltBytes, 70000, 256);
SecretKey secretKey = factory.generateSecret(spec);
SecretKeySpec secret = new SecretKeySpec(secretKey.getEncoded(), "AES");
cipher.init(Cipher.DECRYPT_MODE, secret, new IvParameterSpec(ivBytes));
byte[] decryptedTextBytes = cipher.doFinal(encryoptedTextBytes);
return new String(decryptedTextBytes);
}
}

View File

@ -0,0 +1,54 @@
package geoinfo.com;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import geoinfo.websocket.WSHandler;
/**
* <pre>
* @project : geoinfo_eGov
* @package : geoinfo.com
* @className : GeoInfoSessionMgrListener
* @date : 2018. 8. 27. 10:00:09
* @author :
* @description :
* </pre>
*/
public class GeoInfoSessionMgrListener implements HttpSessionBindingListener {
private final static Logger logger = LoggerFactory.getLogger(GeoInfoSessionMgrListener.class);
/**
* . (session.setAttribute...)
* Hashtable .
*/
@Override
public void valueBound(HttpSessionBindingEvent event) {
if (MultiLoginPreventor.findByLoginId(event.getName())){
MultiLoginPreventor.invalidateByLoginId(event.getName());
}
logger.debug("start valueBound - {} " , event.getName());
System.out.println("valueBound 사용자 로그인 : " + event.getName());
MultiLoginPreventor.input(event.getName(), event.getSession());
}
/**
* .(invalidate)
* hashtable .
*/
@Override
public void valueUnbound(HttpSessionBindingEvent event) {
logger.debug("valueUnBound - {} " , event.getName());
System.out.println("valueUnBound 사용자 로그아웃 : " + event.getName());
MultiLoginPreventor.remove(event.getName(), event.getSession());
}
}

View File

@ -0,0 +1,146 @@
package geoinfo.com;
import java.util.ArrayList;
import org.springframework.web.servlet.ModelAndView;
import egovframework.com.json.JSONObject;
import egovframework.rte.psl.dataaccess.util.EgovMap;
public class GeoinfoCommon {
public static ModelAndView setPage(int rowCount, int page, ModelAndView mv, String taget){
//////////////////////////////////////////////////////////
/////////////////////페이징 처리////////////////////////
//////////////////////////////////////////////////////////
int _pageIndex = 0;
int _lastPageIndex = 0;
_pageIndex = 0;
_lastPageIndex = rowCount;
_pageIndex = (_pageIndex > 0) ? _pageIndex : 0;
_lastPageIndex = (_lastPageIndex > 0) ? _lastPageIndex : 0;
_pageIndex = (_pageIndex > _lastPageIndex) ? _lastPageIndex : _pageIndex;
int numberOfPages = _lastPageIndex ;
int nowPage = page;
//시작페이지
int startPage= ((nowPage / 10) * 10) ;
if (startPage <= 0){
startPage = 0 ;
}
//종료페이지
int endPage = startPage + 9 ;
if (numberOfPages <= endPage ){
endPage = numberOfPages ;
}
//이전 페이지 10개
int frontPage = nowPage - 1;
if (frontPage < 0){
frontPage = 0 ;
}
//이후페이지 10개
int nextPage = nowPage + 1 ;
if (numberOfPages <= nextPage ){
nextPage = numberOfPages ;
}
String pageLink = " ";
for (int idx = startPage; idx <= endPage ; idx++)
{
if(idx == nowPage){
pageLink = pageLink + "<span class='navi_cur'>" + (idx + 1) + "</span> \n";
}else{
//pageLink = pageLink + "<a href='" + taget + ".do?page=" + idx + "' class='navi'>" + (idx + 1) + "</a> \n"; // 202007 삭제
pageLink = pageLink + "<a href='#' onClick=\"" + "gourlPage(" + "'" + taget + "'," + "'" + idx + "'" + ");\" class='navi'>" + (idx + 1) + "</a> \n";
}
}
mv.addObject("pageNum", pageLink);
mv.addObject("frontPage", frontPage);
mv.addObject("nextPage", nextPage);
mv.addObject("numberOfPage", endPage);
return mv;
}
public static String parseData(String val){
if(val != null){
val = val.replaceAll("<","&lt;");
val = val.replaceAll(">","&gt;");
val = val.replaceAll("&","&amp;");
}
return val;
}
public static String inverseData(String val){
val = val.replaceAll("&lt;","<");
val = val.replaceAll("&gt;",">");
val = val.replaceAll("&amp;","&");
return val;
}
public static String strReplace(String value){
//value=value.replaceAll("&","&amp;");
value=value.replaceAll("<","&lt;");
value=value.replaceAll(">","&amp;");
value=value.replaceAll("%00",null);
value=value.replaceAll("\"","&#34;");
value=value.replaceAll("\'","&#39;");
value=value.replaceAll("%","");
value=value.replaceAll("../","");
value=value.replaceAll("..\\\\","");
value=value.replaceAll("./","");
value=value.replaceAll("%2F","");
value=value.replaceAll("SELECT","");
value=value.replaceAll("FROM","");
value=value.replaceAll("WHERE","");
value=value.replaceAll("OR","");
value=value.replaceAll("FROM","");
value=value.replaceAll("WHERE","");
value=value.replaceAll("AND","");
value=value.replaceAll("CHAR","");
value=value.replaceAll("select","");
value=value.replaceAll("from","");
value=value.replaceAll("where","");
value=value.replaceAll("char","");
value=value.replaceAll("int","");
value=value.replaceAll("style","");
value=value.replaceAll("script","");
value=value.replaceAll("alert","");
value=value.replaceAll("'","\'");
value=value.replaceAll("1=1","");
return value.toString();
}
public static String searchStrReNll(String value){
if(value == null || value.equals(""))
{
value=value.replaceAll("<","");
value=value.replaceAll(">","");
value=value.replaceAll("\"","");
value=value.replaceAll("\'","");
value=value.replaceAll("%","");
value=value.replaceAll("../","");
value=value.replaceAll("..\\\\","");
value=value.replaceAll("./","");
value=value.replaceAll("/","");
value=value.replaceAll("'","");
value=value.replaceAll("(","");
value=value.replaceAll(")","");
value=value.replaceAll("-","");
value=value.replaceAll("=","");
}
return value.toString();
}
}

View File

@ -0,0 +1,455 @@
package geoinfo.com;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
public class KISA_SHA256 {
BASE64Encoder encoder = new BASE64Encoder();
BASE64Decoder decoder = new BASE64Decoder();
public String Sha256Encrypt(byte[] plainTextByte) throws Exception {
byte[] bszDigest = new byte[32];
SHA256_Encrypt( plainTextByte, plainTextByte.length, bszDigest );
return encoder.encode(bszDigest);
}
public byte[] Sha256EncryptB(byte[] plainTextByte) throws Exception {
byte[] bszDigest = new byte[32];
SHA256_Encrypt( plainTextByte, plainTextByte.length, bszDigest );
return bszDigest;
}
public static final int BIG_ENDIAN = 0;
public static final int LITTLE_ENDIAN = 1;
public static void arraycopy(byte[] dst, byte[] src, int length) {
for(int i=0; i<length; i++) {
dst[i] = src[i];
}
}
public static void arraycopy_offset(byte[] dst, int dst_offset, byte[] src, int src_offset, int length) {
for(int i=0; i<length; i++) {
dst[dst_offset+i] = src[src_offset+i];
}
}
public static void arrayinit(byte[] dst, byte value, int length) {
for(int i=0; i<length; i++) {
dst[i] = value;
}
}
public static void arrayinit_offset(byte[] dst, int dst_offset, byte value, int length) {
for(int i=0; i<length; i++) {
dst[dst_offset+i] = value;
}
}
public static void memcpy(int[] dst, byte[] src, int length, int ENDIAN) {
int iLen = length / 4;
for(int i=0; i<iLen; i++) {
byte_to_int(dst, i, src, i*4, ENDIAN);
}
}
public static void memcpy(int[] dst, int[] src, int src_offset, int length) {
int iLen = length / 4 + ((length % 4 != 0)?1:0);
for(int i=0; i<iLen; i++) {
dst[i] = src[src_offset+i];
}
}
public static void set_byte_for_int(int[] dst, int b_offset, byte value, int ENDIAN) {
if(ENDIAN == BIG_ENDIAN) {
int shift_value = (3-b_offset%4)*8;
int mask_value = 0x0ff << shift_value;
int mask_value2 = ~mask_value;
int value2 = (value&0x0ff) << shift_value;
dst[b_offset/4] = (dst[b_offset/4] & mask_value2) | (value2 & mask_value);
} else {
int shift_value = (b_offset%4)*8;
int mask_value = 0x0ff << shift_value;
int mask_value2 = ~mask_value;
int value2 = (value&0x0ff) << shift_value;
dst[b_offset/4] = (dst[b_offset/4] & mask_value2) | (value2 & mask_value);
}
}
public static byte get_byte_for_int(int[] src, int b_offset, int ENDIAN) {
if(ENDIAN == BIG_ENDIAN) {
int shift_value = (3-b_offset%4)*8;
int mask_value = 0x0ff << shift_value;
int value = (src[b_offset/4] & mask_value) >> shift_value;
return (byte)value;
} else {
int shift_value = (b_offset%4)*8;
int mask_value = 0x0ff << shift_value;
int value = (src[b_offset/4] & mask_value) >> shift_value;
return (byte)value;
}
}
public static byte[] get_bytes_for_ints(int[] src, int offset, int ENDIAN) {
int iLen = src.length-offset;
byte[] result = new byte[(iLen)*4];
for(int i=0; i<iLen; i++) {
int_to_byte(result, i*4, src, offset+i, ENDIAN);
}
return result;
}
public static void byte_to_int(int[] dst, int dst_offset, byte[] src, int src_offset, int ENDIAN) {
if(ENDIAN == BIG_ENDIAN) {
dst[dst_offset] = ((0x0ff&src[src_offset]) << 24) | ((0x0ff&src[src_offset+1]) << 16) | ((0x0ff&src[src_offset+2]) << 8) | ((0x0ff&src[src_offset+3]));
} else {
dst[dst_offset] = ((0x0ff&src[src_offset])) | ((0x0ff&src[src_offset+1]) << 8) | ((0x0ff&src[src_offset+2]) << 16) | ((0x0ff&src[src_offset+3]) << 24);
}
}
public static int byte_to_int(byte[] src, int src_offset, int ENDIAN) {
if(ENDIAN == BIG_ENDIAN) {
return ((0x0ff&src[src_offset]) << 24) | ((0x0ff&src[src_offset+1]) << 16) | ((0x0ff&src[src_offset+2]) << 8) | ((0x0ff&src[src_offset+3]));
} else {
return ((0x0ff&src[src_offset])) | ((0x0ff&src[src_offset+1]) << 8) | ((0x0ff&src[src_offset+2]) << 16) | ((0x0ff&src[src_offset+3]) << 24);
}
}
public static int byte_to_int_big_endian(byte[] src, int src_offset) {
return ((0x0ff&src[src_offset]) << 24) | ((0x0ff&src[src_offset+1]) << 16) | ((0x0ff&src[src_offset+2]) << 8) | ((0x0ff&src[src_offset+3]));
}
public static void int_to_byte(byte[] dst, int dst_offset, int[] src, int src_offset, int ENDIAN) {
int_to_byte_unit(dst, dst_offset, src[src_offset], ENDIAN);
}
public static void int_to_byte_unit(byte[] dst, int dst_offset, int src, int ENDIAN) {
if(ENDIAN == BIG_ENDIAN) {
dst[dst_offset] = (byte)((src>> 24) & 0x0ff);
dst[dst_offset+1] = (byte)((src >> 16) & 0x0ff);
dst[dst_offset+2] = (byte)((src >> 8) & 0x0ff);
dst[dst_offset+3] = (byte)((src) & 0x0ff);
} else {
dst[dst_offset] = (byte)((src) & 0x0ff);
dst[dst_offset+1] = (byte)((src >> 8) & 0x0ff);
dst[dst_offset+2] = (byte)((src >> 16) & 0x0ff);
dst[dst_offset+3] = (byte)((src >> 24) & 0x0ff);
}
}
public static void int_to_byte_unit_big_endian(byte[] dst, int dst_offset, int src) {
dst[dst_offset] = (byte)((src>> 24) & 0x0ff);
dst[dst_offset+1] = (byte)((src >> 16) & 0x0ff);
dst[dst_offset+2] = (byte)((src >> 8) & 0x0ff);
dst[dst_offset+3] = (byte)((src) & 0x0ff);
}
public static int URShift(int x, int n) {
if(n == 0)
return x;
if(n >= 32)
return 0;
int v = x >> n;
int v_mask = ~(0x80000000 >> (n-1));
return v & v_mask;
}
public static final long INT_RANGE_MAX = (long)Math.pow(2, 32);
public static long intToUnsigned(int x) {
if(x >= 0)
return x;
return x + INT_RANGE_MAX;
}
// DEFAULT : JAVA = BIG_ENDIAN
private static int ENDIAN = BIG_ENDIAN;
private static final int SHA256_DIGEST_BLOCKLEN = 64;
private static final int SHA256_DIGEST_VALUELEN = 32;
private static final int SHA256_K[] =
{
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
};
private static final int ROTL_ULONG(int x, int n) {
return (x << n) | URShift(x, 32 - n);
}
private static final int ROTR_ULONG(int x, int n) {
return URShift(x, n) | (x << (32 - (n)));
}
private static final int ENDIAN_REVERSE_ULONG(int dwS) {
return ( (ROTL_ULONG((dwS), 8) & 0x00ff00ff) | (ROTL_ULONG((dwS), 24) & 0xff00ff00) );
}
private static final void BIG_D2B(int D, byte[] B, int B_offset) {
int_to_byte_unit(B, B_offset, D, ENDIAN);
}
private static final int RR(int x, int n) { return ROTR_ULONG(x, n); }
private static final int SS(int x, int n) { return URShift(x, n); }
private static final int Ch(int x, int y, int z) { return ((x & y) ^ ((~x) & z)); }
private static final int Maj(int x, int y, int z) { return ((x & y) ^ (x & z) ^ (y & z)); }
private static final int Sigma0(int x) { return (RR(x, 2) ^ RR(x, 13) ^ RR(x, 22)); }
private static final int Sigma1(int x) { return (RR(x, 6) ^ RR(x, 11) ^ RR(x, 25)); }
private static final int RHO0(int x) { return (RR(x, 7) ^ RR(x, 18) ^ SS(x, 3)); }
private static final int RHO1(int x) { return (RR(x, 17) ^ RR(x, 19) ^ SS(x, 10)); }
private static final int abcdefgh_a = 0;
private static final int abcdefgh_b = 1;
private static final int abcdefgh_c = 2;
private static final int abcdefgh_d = 3;
private static final int abcdefgh_e = 4;
private static final int abcdefgh_f = 5;
private static final int abcdefgh_g = 6;
private static final int abcdefgh_h = 7;
private static final void FF(int[] abcdefgh, int a, int b, int c, int d, int e, int f, int g, int h, int[] X, int j) {
long T1;
T1 = intToUnsigned(abcdefgh[h]) + intToUnsigned(Sigma1(abcdefgh[e])) + intToUnsigned(Ch(abcdefgh[e], abcdefgh[f], abcdefgh[g])) + intToUnsigned(SHA256_K[j]) + intToUnsigned(X[j]);
abcdefgh[d] += T1;
abcdefgh[h] = (int)(T1 + intToUnsigned(Sigma0(abcdefgh[a])) + intToUnsigned(Maj(abcdefgh[a], abcdefgh[b], abcdefgh[c])));
}
private static final int GetData(byte[] x, int x_offset) {
return byte_to_int(x, x_offset, ENDIAN);
}
//*********************************************************************************************************************************
// o SHA256_Transform() : 512 비트 단위 블록의 메시지를 입력 받아 연쇄변수를 갱신하는 압축 함수로써
// 4 라운드(64 단계)로 구성되며 8개의 연쇄변수(a, b, c, d, e, f, g, h)를 사용
// o 입력 : Message - 입력 메시지의 포인터 변수
// ChainVar - 연쇄변수의 포인터 변수
// o 출력 :
//*********************************************************************************************************************************
private static void SHA256_Transform(byte[] Message, int[] ChainVar) {
int abcdefgh[] = new int[8];
int T1[] = new int[1];
int X[] = new int[64];
int j;
for (j = 0; j < 16; j++)
X[j] = GetData(Message, j*4);
for (j = 16; j < 64; j++)
X[j] = (int)(intToUnsigned(RHO1(X[j - 2])) + intToUnsigned(X[j - 7]) + intToUnsigned(RHO0(X[j - 15])) + intToUnsigned(X[j - 16]));
abcdefgh[abcdefgh_a] = ChainVar[0];
abcdefgh[abcdefgh_b] = ChainVar[1];
abcdefgh[abcdefgh_c] = ChainVar[2];
abcdefgh[abcdefgh_d] = ChainVar[3];
abcdefgh[abcdefgh_e] = ChainVar[4];
abcdefgh[abcdefgh_f] = ChainVar[5];
abcdefgh[abcdefgh_g] = ChainVar[6];
abcdefgh[abcdefgh_h] = ChainVar[7];
for (j = 0; j < 64; j += 8)
{
FF(abcdefgh, abcdefgh_a, abcdefgh_b, abcdefgh_c, abcdefgh_d, abcdefgh_e, abcdefgh_f, abcdefgh_g, abcdefgh_h, X, j + 0);
FF(abcdefgh, abcdefgh_h, abcdefgh_a, abcdefgh_b, abcdefgh_c, abcdefgh_d, abcdefgh_e, abcdefgh_f, abcdefgh_g, X, j + 1);
FF(abcdefgh, abcdefgh_g, abcdefgh_h, abcdefgh_a, abcdefgh_b, abcdefgh_c, abcdefgh_d, abcdefgh_e, abcdefgh_f, X, j + 2);
FF(abcdefgh, abcdefgh_f, abcdefgh_g, abcdefgh_h, abcdefgh_a, abcdefgh_b, abcdefgh_c, abcdefgh_d, abcdefgh_e, X, j + 3);
FF(abcdefgh, abcdefgh_e, abcdefgh_f, abcdefgh_g, abcdefgh_h, abcdefgh_a, abcdefgh_b, abcdefgh_c, abcdefgh_d, X, j + 4);
FF(abcdefgh, abcdefgh_d, abcdefgh_e, abcdefgh_f, abcdefgh_g, abcdefgh_h, abcdefgh_a, abcdefgh_b, abcdefgh_c, X, j + 5);
FF(abcdefgh, abcdefgh_c, abcdefgh_d, abcdefgh_e, abcdefgh_f, abcdefgh_g, abcdefgh_h, abcdefgh_a, abcdefgh_b, X, j + 6);
FF(abcdefgh, abcdefgh_b, abcdefgh_c, abcdefgh_d, abcdefgh_e, abcdefgh_f, abcdefgh_g, abcdefgh_h, abcdefgh_a, X, j + 7);
}
ChainVar[0] += abcdefgh[abcdefgh_a];
ChainVar[1] += abcdefgh[abcdefgh_b];
ChainVar[2] += abcdefgh[abcdefgh_c];
ChainVar[3] += abcdefgh[abcdefgh_d];
ChainVar[4] += abcdefgh[abcdefgh_e];
ChainVar[5] += abcdefgh[abcdefgh_f];
ChainVar[6] += abcdefgh[abcdefgh_g];
ChainVar[7] += abcdefgh[abcdefgh_h];
}
/**
@brief
@param Info : SHA256_Process
*/
public static void SHA256_Init( SHA256_INFO Info ) {
Info.uChainVar[0] = 0x6a09e667;
Info.uChainVar[1] = 0xbb67ae85;
Info.uChainVar[2] = 0x3c6ef372;
Info.uChainVar[3] = 0xa54ff53a;
Info.uChainVar[4] = 0x510e527f;
Info.uChainVar[5] = 0x9b05688c;
Info.uChainVar[6] = 0x1f83d9ab;
Info.uChainVar[7] = 0x5be0cd19;
Info.uHighLength = Info.uLowLength = 0;
}
/**
@brief
@param Info : SHA256_Init ( .)
@param pszMessage :
@param inLen :
*/
public static void SHA256_Process( SHA256_INFO Info, byte[] pszMessage, int uDataLen ) {
int pszMessage_offset;
if((Info.uLowLength += (uDataLen << 3)) < 0) {
Info.uHighLength++;
}
Info.uHighLength += URShift(uDataLen,29);
pszMessage_offset = 0;
while (uDataLen >= SHA256_DIGEST_BLOCKLEN) {
arraycopy_offset(Info.szBuffer, 0, pszMessage, pszMessage_offset, SHA256_DIGEST_BLOCKLEN);
SHA256_Transform(Info.szBuffer, Info.uChainVar);
pszMessage_offset += SHA256_DIGEST_BLOCKLEN;
uDataLen -= SHA256_DIGEST_BLOCKLEN;
}
arraycopy_offset(Info.szBuffer, 0, pszMessage, pszMessage_offset, uDataLen);
}
/**
@brief
@param Info : SHA256_Init ( .)
@param pszDigest :
*/
public static void SHA256_Close( SHA256_INFO Info, byte[] pszDigest ) {
int i, Index;
Index = URShift(Info.uLowLength, 3) % SHA256_DIGEST_BLOCKLEN;
Info.szBuffer[Index++] = (byte)0x80;
if (Index > SHA256_DIGEST_BLOCKLEN - 8) {
arrayinit_offset(Info.szBuffer, Index, (byte)0, SHA256_DIGEST_BLOCKLEN - Index);
SHA256_Transform(Info.szBuffer, Info.uChainVar);
arrayinit(Info.szBuffer, (byte)0, SHA256_DIGEST_BLOCKLEN - 8);
}
else {
arrayinit_offset(Info.szBuffer, Index, (byte)0, SHA256_DIGEST_BLOCKLEN - Index - 8);
}
if(ENDIAN == LITTLE_ENDIAN) {
Info.uLowLength = ENDIAN_REVERSE_ULONG(Info.uLowLength);
Info.uHighLength = ENDIAN_REVERSE_ULONG(Info.uHighLength);
}
int_to_byte_unit(Info.szBuffer, ((int)(SHA256_DIGEST_BLOCKLEN / 4 - 2))*4, Info.uHighLength, ENDIAN);
int_to_byte_unit(Info.szBuffer, ((int)(SHA256_DIGEST_BLOCKLEN / 4 - 1))*4, Info.uLowLength, ENDIAN);
SHA256_Transform(Info.szBuffer, Info.uChainVar);
for (i = 0; i < SHA256_DIGEST_VALUELEN; i += 4)
BIG_D2B((Info.uChainVar)[i / 4], pszDigest, i);
}
/**
@brief
@param pszMessage :
@param pszDigest :
@remarks SHA256_Init, SHA256_Process, SHA256_Close .
*/
public static void SHA256_Encrypt( byte[] pszMessage, int uPlainTextLen, byte[] pszDigest ) {
SHA256_INFO info = new SHA256_INFO();
SHA256_Init( info );
SHA256_Process( info, pszMessage, uPlainTextLen );
SHA256_Close( info, pszDigest );
}
public static class SHA256_INFO {
public int uChainVar[] = new int[SHA256_DIGEST_VALUELEN / 4];
public int uHighLength;
public int uLowLength;
public byte szBuffer[] = new byte[SHA256_DIGEST_BLOCKLEN];
}
public byte[] getBytes(String data) {
String[] str = data.split(",");
byte[] result = new byte[str.length];
for(int i=0; i<result.length; i++) {
result[i] = getHex(str[i]);
}
return result;
}
public String getString(byte[] data) {
String result = "";
for(int i=0; i<data.length; i++) {
result = result + toHex(data[i]);
}
return result;
}
public byte getHex(String str) {
str = str.trim();
if(str.length() == 0)
str = "00";
else if(str.length() == 1)
str = "0" + str;
str = str.toUpperCase();
return (byte)(getHexNibble(str.charAt(0)) * 16 + getHexNibble(str.charAt(1)));
}
public byte getHexNibble(char c) {
if(c >= '0' && c<='9')
return (byte)(c - '0');
if(c >= 'A' && c<='F')
return (byte)(c - 'A' + 10);
return 0;
}
public String toHex(int b) {
char c[] = new char[2];
c[0] = toHexNibble((b>>4) & 0x0f);
c[1] = toHexNibble(b & 0x0f);
return new String(c);
}
public char toHexNibble(int b) {
if(b >= 0 && b <= 9)
return (char)(b + '0');
if(b >= 0x0a && b <= 0x0f)
return (char)(b + 'A' - 10);
return '0';
}
}
// private String shaEncrypt(String plainTextStr){
// String encrypt_plainText = "";
// String encrypt_cipherText = "";
// String encrypt_cipherText_base64 = "";
// String shaPassTemp = "";
// String shaPass = "";
// byte[] plainText = plainTextStr.getBytes("UTF-8");
// String cipherTextStr = getString(Sha256EncryptB(plainText));
// encrypt_plainText = plainTextStr;
// // encrypt_cipherText = cipherTextStr;
// shaPassTemp = encrypt_cipherText.substring(0,20);
// shaPass = shaPassTemp.toLowerCase();
// return shaPass;
// }

View File

@ -0,0 +1,61 @@
package geoinfo.com;
import java.util.Enumeration;
import java.util.concurrent.ConcurrentHashMap;
import javax.servlet.http.HttpSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import geoinfo.com.interceptor.UserLoginInterceptor;
import geoinfo.main.main.MainController;
/**
* <pre>
* @project : geoinfo_eGov
* @package : geoinfo.com
* @className : MultiLoginPreventor
* @date : 2018. 8. 27. 2:58:05
* @author : user
* @description :
* </pre>
*/
public class MultiLoginPreventor {
private final static Logger logger = LoggerFactory.getLogger(MultiLoginPreventor.class);
private static ConcurrentHashMap<String, HttpSession> loginUsers = new ConcurrentHashMap<String, HttpSession>();
public static boolean findByLoginId(String loginId) {
return loginUsers.containsKey(loginId);
}
public static void invalidateByLoginId(String loginId) {
Enumeration<String> e = loginUsers.keys();
while ( e.hasMoreElements() ) {
String key = (String) e.nextElement();
if ( key.equals( loginId ) ) {
// MainController.flag = true;
loginUsers.get(key).invalidate();
}
}
}
public static void input(String loginId, HttpSession session) {
loginUsers.put(loginId, session);
//logger.debug(" 사용자 로그인 : {}" , loginId);
//System.out.println("MultiLoginPreventor input 사용자 로그인 : " + loginId);
}
public static void remove(String loginId, HttpSession session) {
loginUsers.remove(loginId, session);
//logger.debug(" 사용 로그아웃 : {}" , loginId);
//System.out.println("MultiLoginPreventor remove 사용자 로그아웃 : " + loginId);
}
}

View File

@ -0,0 +1,104 @@
package geoinfo.com;
public class PaginationInfo {
/**
* Required Fields
* - .
*
* currentPageNo :
* recordCountPerPage :
* pageSize : ,
* totalRecordCount : .
*/
private int currentPageNo;
private int recordCountPerPage;
private int pageSize;
private int totalRecordCount;
public int getRecordCountPerPage() {
return recordCountPerPage;
}
public void setRecordCountPerPage(int recordCountPerPage) {
this.recordCountPerPage = recordCountPerPage;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getCurrentPageNo() {
return currentPageNo;
}
public void setCurrentPageNo(int currentPageNo) {
this.currentPageNo = currentPageNo;
}
public void setTotalRecordCount(int totalRecordCount) {
this.totalRecordCount = totalRecordCount;
}
public int getTotalRecordCount() {
return totalRecordCount;
}
/**
* Not Required Fields
* - Required Fields .
*
* totalPageCount:
* firstPageNoOnPageList :
* lastPageNoOnPageList :
* firstRecordIndex : SQL rownum.
* lastRecordIndex : SQL rownum.
*/
private int totalPageCount;
private int firstPageNoOnPageList;
private int lastPageNoOnPageList;
private int firstRecordIndex;
private int lastRecordIndex;
public int getTotalPageCount() {
totalPageCount = ((getTotalRecordCount() - 1) / getRecordCountPerPage()) + 1;
return totalPageCount;
}
public int getFirstPageNo() {
return 1;
}
public int getLastPageNo() {
return getTotalPageCount();
}
public int getFirstPageNoOnPageList() {
firstPageNoOnPageList = ((getCurrentPageNo() - 1) / getPageSize()) * getPageSize() + 1;
return firstPageNoOnPageList;
}
public int getLastPageNoOnPageList() {
lastPageNoOnPageList = getFirstPageNoOnPageList() + getPageSize() - 1;
if (lastPageNoOnPageList > getTotalPageCount()) {
lastPageNoOnPageList = getTotalPageCount();
}
return lastPageNoOnPageList;
}
public int getFirstRecordIndex() {
firstRecordIndex = (getCurrentPageNo() - 1) * getRecordCountPerPage();
return firstRecordIndex;
}
public int getLastRecordIndex() {
lastRecordIndex = getCurrentPageNo() * getRecordCountPerPage();
return lastRecordIndex;
}
}

View File

@ -0,0 +1,51 @@
//package geoinfo.com;
//
//import java.sql.Statement;
//import java.util.Properties;
//
//import org.aopalliance.intercept.Invocation;
//import org.apache.ibatis.executor.statement.StatementHandler;
//import org.apache.ibatis.plugin.Interceptor;
//import org.apache.ibatis.plugin.Intercepts;
//import org.apache.ibatis.plugin.Plugin;
//import org.apache.ibatis.plugin.Signature;
//
//
// @Intercepts({@Signature(type=StatementHandler.class, method="update", args={Statement.class})})
// public class SelectInterceptor implements Interceptor{
//
// @Override
// public Object intercept(Invocation invocation) throws Throwable {
// StatementHandler handler = (StatementHandler)invocation.getTarget();
//
// // 쿼리
// String sql = handler.getBoundSql().getSql();
//
// // 쿼리실행시 맵핑되는 파라메터들
// String param = handler.getParameterHandler().getParameterObject()!=null ?
// handler.getParameterHandler().getParameterObject().toString() : "";
//
// // DB에다 로그 insert
// /////////////////
// ////////////////
//
// return invocation.proceed();
// }
//
// @Override
// public Object plugin(Object target) {
// return Plugin.wrap(target, this);
// }
//
// @Override
// public void setProperties(Properties properties) {
// }
//
// @Override
// public Object intercept(org.apache.ibatis.plugin.Invocation arg0)
// throws Throwable {
// // TODO Auto-generated method stub
// return null;
// }
// }
//}

View File

@ -0,0 +1,647 @@
package geoinfo.com;
import comm.framework.dbcp.*;
import java.sql.*;
import java.util.*;
import org.jfree.util.Log;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ictway.comm.web.WebUtil;
public class WebConfirm
{
private final static Logger logger = LoggerFactory.getLogger(WebConfirm.class);
Connection connection = null;
ConnectionPool connectionPool;
DatabaseQuery query;
ResultSet resultSet = null;
String sql;
int resultCnt;
boolean resultBool;
WebUtil wUtil = new WebUtil();
String user = "geoinfo";
String pw = "geoinfo";
//String url = "jdbc:oracle:thin:@192.168.0.71:1521:orcl";
/*String url = "jdbc:oracle:thin:@192.168.0.29:1521:xe";이전*/
String url = "jdbc:oracle:thin:@192.168.0.8:3452:orcl";
/*
* public WebConfirm() { this.connection = null; this.connectionPool = null;
* this.query = null; this.resultSet = null; this.sql = ""; this.resultCnt = 0;
* this.resultBool = false; }
*/
public boolean ConfirmProject(final String PROJECT_CODE) {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
connection = DriverManager.getConnection(url,user,pw);
resultBool = false;
connectionPool = new ConnectionPool();
//(connection = connectionPool.getConnection()).setAutoCommit(false);
exeQuery(sql = "DELETE FROM TBL_META_INFO WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
sql = "INSERT INTO TBL_META_INFO SELECT * FROM TEMP_META_INFO WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
final String master_company = getMasterCompany(PROJECT_CODE);
final String master_company_code = getCompany("TBL_MASTER_COMPANY", master_company);
final String const_company = getProjectInfo(PROJECT_CODE, "PROJECT_CONST_COMPANY");
final String const_company_code = getCompany("TBL_CONST_COMPANY", const_company);
final String design_company = getProjectInfo(PROJECT_CODE, "PROJECT_DESIGN_COMPANY");
final String design_company_code = getCompany("TBL_DESIGN_COMPANY", design_company);
final String admin_company = getProjectInfo(PROJECT_CODE, "PROJECT_ADMIN_COMPANY");
final String admin_company_code = getCompany("TBL_ADMIN_COMPANY", admin_company);
final String work_company = getProjectInfo(PROJECT_CODE, "PROJECT_WORK_COMPANY");
final String work_company_code = getCompany("TBL_WORK_COMPANY", work_company);
exeQuery(sql = "DELETE FROM TBL_PROJECT_INFO WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
sql = "INSERT INTO TBL_PROJECT_INFO ";
sql += "(CLASS_CODE, ";
sql += " PROJECT_CODE,";
sql += " PROJECT_NAME, ";
sql += " PROJECT_TYPE, ";
sql += " PROJECT_MASTER_COMPANY_CODE, ";
sql += " PROJECT_CONST_COMPANY_CODE, ";
sql += " PROJECT_DESIGN_COMPANY_CODE, ";
sql += " PROJECT_ADMIN_COMPANY_CODE,";
sql += " PROJECT_WORK_COMPANY_CODE, ";
sql += " PROJECT_START_DATE, ";
sql += " PROJECT_END_DATE, ";
sql += " PROJECT_HOLE_NUMBER, ";
sql += " PROJECT_DESC, ";
sql += " PRO_GOAL, ";
sql += " PROJECT_RANGE, ";
sql += " PROJECT_START_SPOT, ";
sql += " PROJECT_END_SPOT)";
sql += " SELECT ";
sql += " CLASS_DETAIL_CODE, ";
sql += " PROJECT_CODE,";
sql += " PROJECT_NAME,";
sql += " NVL(PROJECT_INSTRUCTION_DESC,'') || ' ' || FUNC_COMM_NAME('CM006',PROJECT_INSTRUCTION_CODE) || ' ' || FUNC_COMM_NAME('CM005',PROJECT_CONSTRUCTION_CODE) AS PROJECT_TYPE, ";
sql = sql + " '" + master_company_code + "' PROJECT_MASTER_COMPANY_CODE,";
sql = sql + " '" + const_company_code + "' PROJECT_CONST_COMPANY_CODE,";
sql = sql + " '" + design_company_code + "' PROJECT_DESIGN_COMPANY_CODE,";
sql = sql + " '" + admin_company_code + "' PROJECT_ADMIN_COMPANY_CODE,";
sql = sql + " '" + work_company_code + "' PROJECT_WORK_COMPANY_CODE,";
sql += " TO_CHAR(TO_DATE(PROJECT_START_DATE),'YYYY-MM-DD') PROJECT_START_DATE,";
sql += " TO_CHAR(TO_DATE(PROJECT_END_DATE),'YYYY-MM-DD') PROJECT_END_DATE,";
sql += " PROJECT_HOLE_NUMBER,";
sql += " PROJECT_DESC,";
sql += " PROJECT_GOAL,";
sql += " PROJECT_LANGE,";
sql += " PROJECT_START_SPOT_SD||PROJECT_START_SPOT_SGG||PROJECT_START_SPOT PROJECT_START_SPOT,";
sql += " PROJECT_END_SPOT_SD||PROJECT_END_SPOT_SGG||PROJECT_END_SPOT PROJECT_END_SPOT";
sql += " FROM TEMP_PROJECT_INFO WHERE PROJECT_CODE = [PROJECT_CODE] ";
resultCnt += exeQuery(sql, PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_TOPO_GEOLOGY WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
sql = "\n INSERT INTO TBL_TOPO_GEOLOGY(PROJECT_CODE,TGEO_TOPOGRAPHY,TGEO_GEOLOGY,TGEO_REMARK)";
sql += "\n SELECT PROJECT_CODE,TGEO_TOPOGRAPHY,TGEO_GEOLOGY,TGEO_REMARK FROM TEMP_TOPO_GEOLOGY WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_HEADER WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
sql = "SELECT PROJECT_CODE, HOLE_CODE, HOLE_LOCATION_X AS X, HOLE_LOCATION_Y AS Y FROM TEMP_HEADER WHERE PROJECT_CODE = [PROJECT_CODE]";
(query = new DatabaseQuery(sql)).setParam("PROJECT_CODE", PROJECT_CODE);
resultSet = query.execute(connection);
while (resultSet.next()) {
Map map = wUtil.setCoordinateChgXY(resultSet.getDouble("X"), resultSet.getDouble("Y"), "4326", "5186");
sql = "INSERT INTO TBL_HEADER ( ";
sql += " \n PROJECT_CODE, ";
sql += " \n HOLE_CODE, ";
sql += " \n HOLE_NAME, ";
sql += " \n HOLE_PURPOSE, ";
sql += " \n HOLE_EL, ";
sql += " \n HOLE_TOTAL_DEPTH, ";
sql += " \n HOLE_WL, ";
sql += " \n HOLE_DATE_FROM, ";
sql += " \n HOLE_DATE_TO, ";
sql += " \n HOLE_BORING_BY, ";
sql += " \n HOLE_INSPECTED_BY, ";
sql += " \n HOLE_BORING_METHOD, ";
sql += " \n HOLE_BORING_MACHINE, ";
sql += " \n HOLE_DIA, ";
sql += " \n HOLE_CASING_DEPTH, ";
sql += " \n HOLE_ADMINISTRATIVE_DISTRICT, ";
sql += " \n HOLE_DB_INPUTDAY, ";
sql += " \n HOLE_DB_INPUTBY, ";
sql += " \n HOLE_DB_INPUTCOMP, ";
sql += " \n HOLE_TYPE, ";
sql += " \n LAYER_CLASS_CODE, ";
sql += " \n SITE_PIC, ";
sql += " \n HOLE_COORDINATE, ";
sql += " \n HOLE_LOCATION_X, ";
sql += " \n HOLE_LOCATION_Y, ";
sql += " \n HOLE_LOCATION_LONGITUDE, ";
sql += " \n HOLE_LOCATION_LATITUDE, ";
sql += " \n HOLE_LOCATION_TM_X, ";
sql += " \n HOLE_LOCATION_TM_Y, ";
sql += " \n HOLE_OR_X, ";
sql += " \n HOLE_OR_Y )";
sql += " \n SELECT";
sql += " \n PROJECT_CODE,";
sql += " \n HOLE_CODE,";
sql += " \n HOLE_NAME,";
sql += " \n '' HOLE_PURPOSE,";
sql += " \n HOLE_EL,";
sql += " \n HOLE_TOTAL_DEPTH,";
sql += " \n HOLE_WL,";
sql += " \n TO_CHAR(TO_DATE(HOLE_DATE_FROM),'YYYY-MM-DD') HOLE_DATE_FROM,";
sql += " \n TO_CHAR(TO_DATE(HOLE_DATE_TO),'YYYY-MM-DD') HOLE_DATE_TO,";
sql += " \n HOLE_BORING_BY,";
sql += " \n HOLE_INSPECTED_BY,";
sql += " \n FUNC_COMM_NAME('CM009',HOLE_BORING_METHOD) HOLE_BORING_METHOD,";
sql += " \n HOLE_BORING_MACHINE,";
sql += " \n HOLE_DIA,";
sql += " \n HOLE_CASING_DEPTH,";
sql += " \n HOLE_ADMIN_DISTRICT_SD||HOLE_ADMIN_DISTRICT_SGG||HOLE_ADMINISTRATIVE_DISTRICT,";
sql += " \n TO_CHAR(TO_DATE(HOLE_DB_INPUTDAY),'YYYY-MM-DD') HOLE_DB_INPUTDAY,";
sql += " \n HOLE_DB_INPUTBY,";
sql += " \n HOLE_DB_INPUTCOMP,";
sql += " \n HOLE_TYPE,";
sql += " \n '' LAYER_CLASS_CODE,";
sql += " \n SITE_PIC,";
sql += " \n HOLE_COORDINATE,";
sql += " \n HOLE_LOCATION_X,";
sql += " \n HOLE_LOCATION_Y,";
sql += " \n HOLE_LOCATION_X,";
sql += " \n HOLE_LOCATION_Y,";
sql = sql + " \n " + map.get("X").toString() + ",";
sql = sql + " \n " + map.get("Y").toString() + ", ";
sql += " \n HOLE_OR_X,";
sql += " \n HOLE_OR_Y ";
sql += " \n FROM TEMP_HEADER WHERE PROJECT_CODE = [PROJECT_CODE]";
sql += " \n AND HOLE_CODE = [HOLE_CODE]";
(query = new DatabaseQuery(sql)).setParam("PROJECT_CODE", PROJECT_CODE);
query.setParam("HOLE_CODE", resultSet.getString("HOLE_CODE"));
resultCnt += query.executeUpdate(connection);
query.close();
final StringBuffer sbQuery = new StringBuffer();
sbQuery.append(" INSERT INTO TBL_HEADER_HOLE ( ");
sbQuery.append(" GID ");
sbQuery.append(" , THE_GEOM ");
sbQuery.append(" , PROJECT_CODE ");
sbQuery.append(" , HOLE_CODE ");
sbQuery.append(" , CLASS_CODE ");
sbQuery.append(" , HOLE_LOCATION_TM_X ");
sbQuery.append(" , HOLE_LOCATION_TM_Y ");
sbQuery.append(" , HOLE_OR_TM_X ");
sbQuery.append(" , HOLE_OR_TM_Y ");
sbQuery.append(" , HOLE_TM_ORIGIN ");
sbQuery.append(" , HOLE_DB_INPUTDAY ");
sbQuery.append(" , LAST_UPDATE ");
sbQuery.append(" ) ");
sbQuery.append(" SELECT ");
sbQuery.append(" SEQ_TBL_HEADER_HOLE.NEXTVAL ");
sbQuery.append(" , SDO_GEOMETRY(2001, null, SDO_POINT_TYPE( B.HOLE_LOCATION_TM_X, B.HOLE_LOCATION_TM_Y, NULL), NULL, NULL) ");
sbQuery.append(" , A.PROJECT_CODE ");
sbQuery.append(" , B.HOLE_CODE ");
sbQuery.append(" , A.CLASS_CODE ");
sbQuery.append(" , B.HOLE_LOCATION_TM_X ");
sbQuery.append(" , B.HOLE_LOCATION_TM_Y ");
sbQuery.append(" , B.HOLE_OR_TM_X ");
sbQuery.append(" , B.HOLE_OR_TM_Y ");
sbQuery.append(" , B.HOLE_TM_ORIGIN ");
sbQuery.append(" , B.HOLE_DB_INPUTDAY ");
sbQuery.append(" , SYSDATE ");
sbQuery.append(" FROM TBL_PROJECT_INFO A ");
sbQuery.append(" , TBL_HEADER B ");
sbQuery.append(" WHERE A.PROJECT_CODE = B.PROJECT_CODE ");
sbQuery.append(" AND B.HOLE_CODE = [HOLE_CODE] ");
(query = new DatabaseQuery(sbQuery.toString())).setParam("HOLE_CODE", resultSet.getString("HOLE_CODE"));
resultCnt += query.executeUpdate(connection);
query.close();
}
exeQuery(sql = "DELETE FROM TBL_HEADER_CORE WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
sql = "INSERT INTO TBL_HEADER_CORE SELECT * FROM TEMP_HEADER_CORE WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_LAYER_INFO WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
sql = " \n INSERT INTO TBL_LAYER_INFO ";
sql += " \n (HOLE_CODE, ";
sql += " \n LAYER_DEPTH_FROM, ";
sql += " \n LAYER_DEPTH_TO, ";
sql += " \n LAYER_CODE, ";
sql += " \n LAYER_THICKNESS, ";
sql += " \n LAYER_ENG_NAME, ";
sql += " \n LAYER_SCIENCE_NAME, ";
sql += " \n LAYER_SOIL_COLOR, ";
sql += " \n LAYER_DESC, ";
sql += " \n LAYER_CLASS_CODE) ";
sql += " \n SELECT ";
sql += " \n HOLE_CODE, ";
sql += " \n LAYER_DEPTH_FROM, ";
sql += " \n LAYER_DEPTH_TO, ";
sql += " \n LAYER_CODE , ";
sql += " \n LAYER_THICKNESS, ";
sql += " \n LAYER_ENG_NAME , ";
sql += " \n LAYER_SCIENCE_NAME, ";
sql += " \n LAYER_SOIL_COLOR, ";
sql += " \n LAYER_DESC, ";
sql += " \n '' LAYER_CLASS_CODE ";
sql += " \n FROM TEMP_LAYER_INFO WHERE PROJECT_CODE = [PROJECT_CODE] ";
resultCnt += exeQuery(sql, PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_SPT WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_RQD WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_DSF WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_FIELD_PRESSUREMETER WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_SLICKENSIDE_INFO WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_Q WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_RMR WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_FIELD_WATERPRESSURE WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_WP_TEST WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_FIELD_PERMEABILITY WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_FIELDPER_SUB WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_FIELD_CONE_PENETRATION WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_CONE_PENETRATION_IMAGES WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
sql = " \n INSERT INTO TBL_SPT(HOLE_CODE, DEPTH_SPT, SPT_N, SPT_DEPTH ) ";
sql += " \n SELECT HOLE_CODE, DEPTH_SPT, SPT_N, SPT_DEPTH FROM TEMP_SPT WHERE PROJECT_CODE = [PROJECT_CODE] ";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_RQD(HOLE_CODE, RT_DEPTH_FROM, RT_DEPTH_TO, RT_RQD, RT_TCR )";
sql += " \n SELECT HOLE_CODE, RT_DEPTH_FROM, RT_DEPTH_TO, RT_RQD, RT_TCR FROM TEMP_RQD WHERE PROJECT_CODE = [PROJECT_CODE] ";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_DSF(HOLE_CODE, DSF_DEPTH_FROM, DSF_DEPTH_TO, DSF_DECOMPOSITION, DSF_STRENGTH, DSF_FRACTURING )";
sql += " \n SELECT HOLE_CODE, DSF_DEPTH_FROM, DSF_DEPTH_TO, DSF_DECOMPOSITION, DSF_STRENGTH, DSF_FRACTURING FROM TEMP_DSF ";
sql += " \n WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_FIELD_PRESSUREMETER(HOLE_CODE,FIELDPRES_CODE,FIELDPRES_TUBE_TYPE,FIELDPRES_INSPECTED_BY,FIELDPRES_CHECKED_BY, ";
sql += " \n FIELDPRES_DEPTH,FIELDPRES_KP,FIELDPRES_EP,GRAPH_IMAGE)";
sql += " \n SELECT HOLE_CODE,FIELDPRES_CODE,FIELDPRES_TUBE_TYPE,FIELDPRES_INSPECTED_BY,FIELDPRES_CHECKED_BY,";
sql += " \n FIELDPRES_DEPTH,FIELDPRES_KP,FIELDPRES_EP,GRAPH_IMAGE FROM TEMP_FIELD_PRESSUREMETER";
sql += " \n WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_SLICKENSIDE_INFO(HOLE_CODE, SLICKENSIDE_DEPTH_FROM, SLICKENSIDE_DEPTH_TO, SLICKENSIDE_DIRECTION,";
sql += " \n SLICKENSIDE_ANGLE, SLICKENSIDE_MAX, SLICKENSIDE_MIN, SLICKENSIDE_AVG, SLICKENSIDE_ROUGH )";
sql += " \n SELECT HOLE_CODE, SLICKENSIDE_DEPTH_FROM, SLICKENSIDE_DEPTH_TO, SLICKENSIDE_DIRECTION,";
sql += " \n SLICKENSIDE_ANGLE, SLICKENSIDE_MAX, SLICKENSIDE_MIN, SLICKENSIDE_AVG, SLICKENSIDE_ROUGH FROM TEMP_SLICKENSIDE_INFO";
sql += " \n WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_Q(PROJECT_CODE,HOLE_CODE,DEPTH_FROM,DEPTH_TO,ROCK_TYPE,";
sql += " \n RQD,RQD_DESC,JN,JN_DESC,JR,JR_DESC,JA,JA_DESC,JW,JW_DESC,SRF,SRF_DESC)";
sql += " \n SELECT PROJECT_CODE,HOLE_CODE,DEPTH_FROM,DEPTH_TO,ROCK_TYPE,";
sql += " \n RQD,RQD_DESC,JN,JN_DESC,JR,JR_DESC,JA,JA_DESC,JW,JW_DESC,SRF,SRF_DESC FROM TEMP_Q";
sql += " \n WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_RMR(PROJECT_CODE,HOLE_CODE,DEPTH_FROM,DEPTH_TO,ROCK_TYPE,ROCK_STRENGTH,";
sql += " \n ROCK_STRENGTH_POINT,ROCK_STRENGTH_DESC,RQD,RQD_POINT,RQD_DESC,JOINTS_SPACING,JOINTS_SPACING_POINT,JOINTS_SPACING_DESC,JOINT_CONDITION,";
sql += " \n JOINT_CONDITION_POINT,GROUNDWATER_CONDITION,GROUNDWATER_CONDITION_POINT,JOINT_ORIENTATION,JOINT_ORIENTATION_POINT,JOINT_ORIENTATION_DESC)";
sql += " \n SELECT PROJECT_CODE,HOLE_CODE,DEPTH_FROM,DEPTH_TO,ROCK_TYPE,ROCK_STRENGTH,";
sql += " \n ROCK_STRENGTH_POINT,ROCK_STRENGTH_DESC,RQD,RQD_POINT,RQD_DESC,JOINTS_SPACING,JOINTS_SPACING_POINT,JOINTS_SPACING_DESC,JOINT_CONDITION,";
sql += " \n JOINT_CONDITION_POINT,GROUNDWATER_CONDITION,GROUNDWATER_CONDITION_POINT,JOINT_ORIENTATION,JOINT_ORIENTATION_POINT,JOINT_ORIENTATION_DESC";
sql += " \n FROM TEMP_RMR WHERE PROJECT_CODE = [PROJECT_CODE] ";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_FIELD_WATERPRESSURE(HOLE_CODE,WP_CODE,FIELDWP_PACKER_TYPE,FIELDWP_DEPTH_FROM,FIELDWP_DEPTH_TO,";
sql += " \n FIELDWP_TEST_SPACING,FIELDWB_WATER_PRESSURE,FIELDWP_AVG_PERMEABILITY,FIELDWP_LU,FIELDWP_INSPECTED_BY,FIELDWP_CHECKED_BY,";
sql += " \n FIELDWP_REMARK,GRAPH_IMAGE)";
sql += " \n SELECT HOLE_CODE,WP_CODE,FIELDWP_PACKER_TYPE,FIELDWP_DEPTH_FROM,FIELDWP_DEPTH_TO,";
sql += " \n FIELDWP_TEST_SPACING,FIELDWB_WATER_PRESSURE,FIELDWP_AVG_PERMEABILITY,FIELDWP_LU,FIELDWP_INSPECTED_BY,FIELDWP_CHECKED_BY,";
sql += " \n FIELDWP_REMARK,GRAPH_IMAGE FROM TEMP_FIELD_WATERPRESSURE";
sql += " \n WHERE PROJECT_CODE = [PROJECT_CODE] ";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_WP_TEST (HOLE_CODE,WP_CODE,WPTEST_ORDER,WPTEST_WATER_PRESSURE,WPTEST_TOTAL_HEAD,WPTEST_QUANTITY,WPTEST_PERMEABILITY,";
sql += " \n WPLUGEON_ORDER,WPLUGEON_PRESSURE,WPLUGEON_INJECT_WATER,WPLUGEON_LU)";
sql += " \n SELECT HOLE_CODE,WP_CODE,WPTEST_ORDER,WPTEST_WATER_PRESSURE,WPTEST_TOTAL_HEAD,WPTEST_QUANTITY,WPTEST_PERMEABILITY,";
sql += " \n WPLUGEON_ORDER,WPLUGEON_PRESSURE,WPLUGEON_INJECT_WATER,WPLUGEON_LU FROM TEMP_WP_TEST";
sql += " \n WHERE PROJECT_CODE = [PROJECT_CODE] ";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_FIELD_PERMEABILITY(HOLE_CODE, FIELDPER_CODE, FIELDPER_DEPTH_FROM, FIELDPER_DEPTH_TO, FIELDPER_CASING_DIA,";
sql += " \n FIELDPER_CASING_HEIGHT, FIELDPER_AVG_PERMEABILITY, FIELDPER_REMARK, GRAPH_IMAGE ) ";
sql += " \n SELECT HOLE_CODE, FIELDPER_CODE, FIELDPER_DEPTH_FROM, FIELDPER_DEPTH_TO, FIELDPER_CASING_DIA,";
sql += " \n FIELDPER_CASING_HEIGHT, FIELDPER_AVG_PERMEABILITY, FIELDPER_REMARK, GRAPH_IMAGE FROM TEMP_FIELD_PERMEABILITY ";
sql += " \n WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_FIELDPER_SUB(HOLE_CODE, FIELDPER_CODE, FIELDPER_SUB_TIME, FIELDPER_SUB_TOTAL_HEAD, FIELDPER_SUB_FALLING_HEAD, ";
sql += " \n FIELDPER_SUB_WATER_LOOSE, FIELDPER_SUB_QUANTITY, FIELDPER_SUB_PERMEABILITY ) ";
sql += " \n SELECT HOLE_CODE, FIELDPER_CODE, FIELDPER_SUB_TIME, FIELDPER_SUB_TOTAL_HEAD, FIELDPER_SUB_FALLING_HEAD,";
sql += " \n FIELDPER_SUB_WATER_LOOSE, FIELDPER_SUB_QUANTITY, FIELDPER_SUB_PERMEABILITY FROM TEMP_FIELDPER_SUB";
sql += " \n WHERE PROJECT_CODE = [PROJECT_CODE] ";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_FIELD_CONE_PENETRATION SELECT * FROM TEMP_FIELD_CONE_PENETRATION WHERE PROJECT_CODE = [PROJECT_CODE] ";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_CONE_PENETRATION_IMAGES SELECT * FROM TEMP_CONE_PENETRATION_IMAGES WHERE PROJECT_CODE = [PROJECT_CODE] ";
resultCnt += exeQuery(sql, PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_SAMPLE_INFO WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
sql = " \n INSERT INTO TBL_SAMPLE_INFO(HOLE_CODE, SAMPLE_CODE, SAMPLE_NUMBER, SAMPLE_SAMPLING_METHOD, SAMPLE_DEPTH_FROM, SAMPLE_DEPTH_TO, ";
sql += " \n SAMPLE_SHAPE, SAMPLE_YN, SAMPLE_WC, SAMPLE_GS, SAMPLE_LL, SAMPLE_PI, SAMPLE_DESC , SAMPLE_RD, SAMPLE_USCS)";
sql += " \n SELECT HOLE_CODE, SAMPLE_CODE, SAMPLE_NUMBER, SAMPLE_SAMPLING_METHOD, SAMPLE_DEPTH_FROM, SAMPLE_DEPTH_TO, SAMPLE_SHAPE , ";
sql += " \n (SELECT DECODE(COUNT(*),0,'0','1') FROM TEMP_CONSOLIDATION_USUAL WHERE SAMPLE_CODE = A.SAMPLE_CODE) || ";
sql += " \n (SELECT DECODE(COUNT(*),0,'0','1') FROM TEMP_TRIAXIAL_USUAL WHERE SAMPLE_CODE = A.SAMPLE_CODE) || ";
sql += " \n (SELECT DECODE(COUNT(*),0,'0','1') FROM TEMP_UNCONFINED_USUAL WHERE SAMPLE_CODE = A.SAMPLE_CODE) || ";
sql += " \n (SELECT DECODE(COUNT(*),0,'0','1') FROM TEMP_CLASSIFICATION WHERE SAMPLE_CODE = A.SAMPLE_CODE) || ";
sql += " \n (SELECT DECODE(COUNT(*),0,'0','1') FROM TEMP_CBR_COMPAC WHERE SAMPLE_CODE = A.SAMPLE_CODE) ";
sql += " \n SAMPLE_SHAPE, ";
sql += " \n SAMPLE_WC, SAMPLE_GS, SAMPLE_LL, SAMPLE_PI, SAMPLE_DESC , SAMPLE_RD, SAMPLE_USCS";
sql += " \n FROM TEMP_SAMPLE_INFO A WHERE PROJECT_CODE= [PROJECT_CODE] ";
resultCnt += exeQuery(sql, PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_CLASSIFICATION WHERE SUBSTR(SAMPLE_CODE,1,LENGTH(TRIM(SAMPLE_CODE))-9) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_CBR_COMPAC WHERE SUBSTR(SAMPLE_CODE,1,LENGTH(TRIM(SAMPLE_CODE))-9) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_CONSOLIDATION WHERE SUBSTR(SAMPLE_CODE,1,LENGTH(TRIM(SAMPLE_CODE))-9) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_CONSOLIDATION_USUAL WHERE SUBSTR(SAMPLE_CODE,1,LENGTH(TRIM(SAMPLE_CODE))-9) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_UNCONFINED_USUAL WHERE SUBSTR(SAMPLE_CODE,1,LENGTH(TRIM(SAMPLE_CODE))-9) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_TRIAXIAL_USUAL WHERE SUBSTR(SAMPLE_CODE,1,LENGTH(TRIM(SAMPLE_CODE))-9) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_TRIAXIAL_CU WHERE SUBSTR(TRI_CODE,1,LENGTH(TRIM(TRI_CODE))-11) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_TRIAXIAL_UU WHERE SUBSTR(TRI_CODE,1,LENGTH(TRIM(TRI_CODE))-11) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_RESONANT_USUAL WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_RESONANT WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_REPEATED_TRIAXIAL_USUAL WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_REPEATED_TRIAXIAL WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
sql = "\n insert into TBL_CLASSIFICATION(SAMPLE_CODE,CLASSI_NATURE,CLASSI_GRAVEL,CLASSI_SAND,CLASSI_SILT,CLASSI_CLAY,CLASSI_D10,CLASSI_D30,CLASSI_D60,CLASSI_CU,";
sql += "\n CLASSI_CG,CLASSI_NO4,CLASSI_NO6,CLASSI_NO8,CLASSI_NO10,CLASSI_NO12,CLASSI_NO16,CLASSI_NO20,CLASSI_NO30,CLASSI_NO40,CLASSI_NO50,";
sql += "\n CLASSI_NO60,CLASSI_NO70,CLASSI_NO100,CLASSI_NO140,CLASSI_NO200,CLASSI_NO005,GRAPH_IMAGE)";
sql += "\n SELECT SAMPLE_CODE,CLASSI_NATURE,CLASSI_GRAVEL,CLASSI_SAND,CLASSI_SILT,CLASSI_CLAY,CLASSI_D10,CLASSI_D30,CLASSI_D60,CLASSI_CU,";
sql += "\n CLASSI_CG,CLASSI_NO4,CLASSI_NO6,CLASSI_NO8,CLASSI_NO10,CLASSI_NO12,CLASSI_NO16,CLASSI_NO20,CLASSI_NO30,CLASSI_NO40,CLASSI_NO50,";
sql += "\n CLASSI_NO60,CLASSI_NO70,CLASSI_NO100,CLASSI_NO140,CLASSI_NO200,CLASSI_NO005,GRAPH_IMAGE";
sql += "\n FROM TEMP_CLASSIFICATION WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n insert into TBL_CBR_COMPAC(SAMPLE_CODE,CBR_MOD_CBR,CBR_D_RD,CBR_D_GS,CBR_D_COMPACTION,CBR_D_CMC,CBR_A_RD,CBR_A_GS,CBR_A_COMPACTION,CBR_A_CMC,";
sql += " \n CBR_55_SWELLING,CBR_55_SOAKING,CBR_55_MOULDING,CBR_25_SWELLING,CBR_25_SOAKING,CBR_25_MOULDING,CBR_10_SWELLING,CBR_10_SOAKING,";
sql += " \n CBR_10_MOULDING,GRAPH_IMAGE1,GRAPH_IMAGE2)";
sql += " \n SELECT SAMPLE_CODE,CBR_MOD_CBR,CBR_D_RD,CBR_D_GS,CBR_D_COMPACTION,CBR_D_CMC,CBR_A_RD,CBR_A_GS,CBR_A_COMPACTION,CBR_A_CMC,";
sql += " \n CBR_55_SWELLING,CBR_55_SOAKING,CBR_55_MOULDING,CBR_25_SWELLING,CBR_25_SOAKING,CBR_25_MOULDING,CBR_10_SWELLING,CBR_10_SOAKING,";
sql += " \n CBR_10_MOULDING,GRAPH_IMAGE1,GRAPH_IMAGE2";
sql += " \n FROM TEMP_CBR_COMPAC WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "\n insert into TBL_CONSOLIDATION_USUAL(SAMPLE_CODE,CONSOL_SAMPLE_DIA,CONSOL_SAMPLE_HEIGHT,CONSOL_W0,CONSOL_WF,CONSOL_S0,CONSOL_SF,CONSOL_RD,CONSOL_RF,";
sql += "\n CONSOL_PC,CONSOL_CC,GRAPH_IMAGE)";
sql += "\n SELECT SAMPLE_CODE,CONSOL_SAMPLE_DIA,CONSOL_SAMPLE_HEIGHT,CONSOL_W0,CONSOL_WF,CONSOL_S0,CONSOL_SF,CONSOL_RD,CONSOL_RF,";
sql += "\n CONSOL_PC,CONSOL_CC,GRAPH_IMAGE FROM TEMP_CONSOLIDATION_USUAL WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "\n insert into TBL_CONSOLIDATION(SAMPLE_CODE,CONSOL_P,CONSOL_SETTLEMENT,CONSOL_T90,CONSOL_E,CONSOL_TWOHA,CONSOL_AV,CONSOL_CV,CONSOL_MV,";
sql += "\n CONSOL_K,CONSOL_RP)";
sql += "\n SELECT SAMPLE_CODE,CONSOL_P,CONSOL_SETTLEMENT,CONSOL_T90,CONSOL_E,CONSOL_TWOHA,CONSOL_AV,CONSOL_CV,CONSOL_MV,";
sql += "\n CONSOL_K,CONSOL_RP FROM TEMP_CONSOLIDATION WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n insert into TBL_UNCONFINED_USUAL(SAMPLE_CODE,UNCONF_RINGFACTOR,UNCONF_LOAD_SCALE,UNCONF_UNDISTURB_HEIGHT,UNCONF_UNDISTURB_DIA,";
sql += " \n UNCONF_UNDISTURB_W,UNCONF_UNDISTURB_RT,UNCONF_UNDISTURB_E,UNCONF_UNDISTURB_S,";
sql += " \n UNCONF_UNDISTURB_COMPSTRENGTH,UNCONF_REMOULD_HEIGHT,UNCONF_REMOULD_DIA,UNCONF_REMOULD_W,UNCONF_REMOULD_RT,UNCONF_REMOULD_E,";
sql += " \n UNCONF_REMOULD_S,UNCONF_REMOULD_COMPSTRENGTH,UNCONF_SAMPLE_SHAPE,GRAPH_IMAGE)";
sql += " \n SELECT SAMPLE_CODE,UNCONF_RINGFACTOR,UNCONF_LOAD_SCALE,UNCONF_UNDISTURB_HEIGHT,UNCONF_UNDISTURB_DIA,";
sql += " \n UNCONF_UNDISTURB_W,UNCONF_UNDISTURB_RT,UNCONF_UNDISTURB_E,UNCONF_UNDISTURB_S,";
sql += " \n UNCONF_UNDISTURB_COMPSTRENGTH,UNCONF_REMOULD_HEIGHT,UNCONF_REMOULD_DIA,UNCONF_REMOULD_W,UNCONF_REMOULD_RT,UNCONF_REMOULD_E,";
sql += " \n UNCONF_REMOULD_S,UNCONF_REMOULD_COMPSTRENGTH,UNCONF_SAMPLE_SHAPE,GRAPH_IMAGE";
sql += " \n FROM TEMP_UNCONFINED_USUAL WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n insert into TBL_TRIAXIAL_USUAL(SAMPLE_CODE, TRI_CODE,TRI_TYPEOFSAMPLE,TRI_TYPEOFTEST,TRI_TYPEOFCONTROLLEDTEST,TRI_NOSTRAIN,TRI_PHI_U,";
sql += " \n TRI_CU,GRAPH_IMAGE1,GRAPH_IMAGE2 )";
sql += " \n SELECT SAMPLE_CODE, TRI_CODE,TRI_TYPEOFSAMPLE,TRI_TYPEOFTEST,TRI_TYPEOFCONTROLLEDTEST,TRI_NOSTRAIN,TRI_PHI_U,";
sql += " \n TRI_CU,GRAPH_IMAGE1,GRAPH_IMAGE2 FROM TEMP_TRIAXIAL_USUAL WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n insert into TBL_TRIAXIAL_CU(TRI_CODE,TRICU_TESTORDER,TRICU_TESTCODE,TRICU_W0,TRICU_RD0,TRICU_S0,TRICU_E0,TRICU_WF,TRICU_RDF,";
sql += " \n TRICU_SF,TRICU_EF,TRICU_U0,TRICU_SIGMA3,TRICU_MAXSIGMA,TRICU_ULTSIGMA,TRICU_D0,TRICU_H0,TRICU_UF)";
sql += " \n SELECT TRI_CODE,TRICU_TESTORDER,TRICU_TESTCODE,TRICU_W0,TRICU_RD0,TRICU_S0,TRICU_E0,TRICU_WF,TRICU_RDF,";
sql += " \n TRICU_SF,TRICU_EF,TRICU_U0,TRICU_SIGMA3,TRICU_MAXSIGMA,TRICU_ULTSIGMA,TRICU_D0,TRICU_H0,TRICU_UF";
sql += " \n FROM TEMP_TRIAXIAL_CU WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n insert into TBL_TRIAXIAL_UU(TRI_CODE,TRIUU_TESTORDER,TRIUU_TESTCODE,TRIUU_W0,TRIUU_RD0,TRIUU_S0,TRIUU_E0,TRIUU_U0,TRIUU_SIGMA3,";
sql += " \n TRIUU_MAXSIGMA,TRIUU_ULTSIGMA,TRIUU_D0,TRIUU_H0)";
sql += " \n SELECT TRI_CODE,TRIUU_TESTORDER,TRIUU_TESTCODE,TRIUU_W0,TRIUU_RD0,TRIUU_S0,TRIUU_E0,TRIUU_U0,TRIUU_SIGMA3,";
sql += " \n TRIUU_MAXSIGMA,TRIUU_ULTSIGMA,TRIUU_D0,TRIUU_H0";
sql += " \n FROM TEMP_TRIAXIAL_UU WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_RESONANT_USUAL SELECT * FROM TEMP_RESONANT_USUAL WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_RESONANT SELECT * FROM TEMP_RESONANT WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_REPEATED_TRIAXIAL_USUAL SELECT * FROM TEMP_REPEATED_TRIAXIAL_USUAL WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_REPEATED_TRIAXIAL SELECT * FROM TEMP_REPEATED_TRIAXIAL WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_ROCK_POINTLOAD WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_ROCK_JOINTSHEAR WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_ROCK_TRIAXIAL WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_ROCK_UNIAXIAL WHERE SUBSTR(HOLE_CODE,1,LENGTH(TRIM(HOLE_CODE))-5) = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_ROCK_RESONANT_USUAL WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_ROCK_RESONANT WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_ROCK_REPEATED_TRIAXIAL_U WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_ROCK_REPEATED_TRIAXIAL WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
sql = " \n INSERT INTO TBL_ROCK_POINTLOAD(HOLE_CODE,ROCK_POINT_CODE,TEST_ORDER,RPOINT_DEPTH_FROM,RPOINT_DEPTH_TO,RPOINT_DIA,";
sql += " \n RPOINT_LENGTH,RPOINT_TESILESTRENGTH,RPOINT_POINTSTRENGTH,RPOINT_UNIAXIAL,GRAPH_IMAGE)";
sql += " \n SELECT HOLE_CODE,ROCK_POINT_CODE,TEST_ORDER, DEPTH_FROM, DEPTH_TO, DIA,";
sql += " \n LENGTH,TESILESTRENGTH,POINTSTRENGTH,UNIAXIAL,GRAPH_IMAGE";
sql += " \n FROM TEMP_ROCK_POINTLOAD WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_ROCK_JOINTSHEAR(HOLE_CODE,RJOINT_CODE,TEST_ORDER,RJOINT_DEPTH_FROM,RJOINT_DEPTH_TO,RJOINT_PHI,RJOINT_C,";
sql += " \n RJOINT_NORAML_STRESS,RJOINT_SHEAR_STRESS,RJOINT_JCS,GRAPH_IMAGE)";
sql += " \n SELECT HOLE_CODE,RJOINT_CODE,TEST_ORDER,RJOINT_DEPTH_FROM,RJOINT_DEPTH_TO,RJOINT_PHI,RJOINT_C,";
sql += " \n RJOINT_NORAML_STRESS,RJOINT_SHEAR_STRESS,RJOINT_JCS,GRAPH_IMAGE";
sql += " \n FROM TEMP_ROCK_JOINTSHEAR WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_ROCK_TRIAXIAL(HOLE_CODE,RTRI_CODE,TEST_ORDER,RTRI_DEPTH_FROM, RTRI_DEPTH_TO,RTRI_PHI,RTRI_C,RTRI_TENSILESTRENGTH,";
sql += " \n RTRI_50_DIA,RTRI_50_LENGTH,RTRI_50_CONFPRES,RTRI_50_MAXSTRENGTH,RTRI_100_DIA,RTRI_100_LENGTH,RTRI_100_CONFPRES,RTRI_100_MAXSTRENGTH,";
sql += " \n RTRI_150_DIA,RTRI_150_LENGTH,RTRI_150_CONFPRES,RTRI_150_MAXSTRENGTH,GRAPH_IMAGE)";
sql += " \n SELECT HOLE_CODE,RTRI_CODE,TEST_ORDER,RTRI_DEPTH_FROM, RTRI_DEPTH_TO,RTRI_PHI,RTRI_C,RTRI_TENSILESTRENGTH,";
sql += " \n RTRI_50_DIA,RTRI_50_LENGTH,RTRI_50_CONFPRES,RTRI_50_MAXSTRENGTH,RTRI_100_DIA,RTRI_100_LENGTH,RTRI_100_CONFPRES,RTRI_100_MAXSTRENGTH,";
sql += " \n RTRI_150_DIA,RTRI_150_LENGTH,RTRI_150_CONFPRES,RTRI_150_MAXSTRENGTH,GRAPH_IMAGE";
sql += " \n FROM TEMP_ROCK_TRIAXIAL WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = " \n INSERT INTO TBL_ROCK_UNIAXIAL(HOLE_CODE,RUNI_CODE,TEST_ORDER,RUNI_DEPTH_FROM,RUNI_DEPTH_TO,RUNI_LENGTH,RUNI_DIA,";
sql += " \n RUNI_GS,RUNI_WAVEV,RUNI_ABS,RUNI_UNI_STRENGTH,RUNI_YOUNG,RUNI_POISSON,GRAPH_IMAGE1,GRAPH_IMAGE2)";
sql += " \n SELECT HOLE_CODE,RUNI_CODE,TEST_ORDER,RUNI_DEPTH_FROM,RUNI_DEPTH_TO,RUNI_LENGTH,RUNI_DIA,RUNI_GS,";
sql += " \n CASE WHEN RUNI_WAVE_P IS NOT NULL AND RUNI_WAVE_S IS NOT NULL THEN RUNI_WAVE_P || ',' || RUNI_WAVE_S";
sql += " \n ELSE '-' END RUNI_WAVEV,";
sql += " \n RUNI_ABS,RUNI_UNI_STRENGTH,RUNI_YOUNG,RUNI_POISSON,GRAPH_IMAGE1,GRAPH_IMAGE2 ";
sql += " \n FROM TEMP_ROCK_UNIAXIAL WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_ROCK_RESONANT_USUAL SELECT * FROM TEMP_ROCK_RESONANT_USUAL WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_ROCK_RESONANT SELECT * FROM TEMP_ROCK_RESONANT WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_ROCK_REPEATED_TRIAXIAL_U SELECT * FROM TEMP_ROCK_REPEATED_TRIAXIAL_U WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_ROCK_REPEATED_TRIAXIAL SELECT * FROM TEMP_ROCK_REPEATED_TRIAXIAL WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_BOREHOLE_WAVE WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_BOREHOLE_WAVE_PS WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_DOWNHOLE WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_DOWNHOLE_PS WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_DENSITY WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_DENSITY_SUB WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
sql = "INSERT INTO TBL_BOREHOLE_WAVE SELECT * FROM TEMP_BOREHOLE_WAVE WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_BOREHOLE_WAVE_PS SELECT * FROM TEMP_BOREHOLE_WAVE_PS WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_DOWNHOLE SELECT * FROM TEMP_DOWNHOLE WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_DOWNHOLE_PS SELECT * FROM TEMP_DOWNHOLE_PS WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_DENSITY SELECT * FROM TEMP_DENSITY WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_DENSITY_SUB SELECT * FROM TEMP_DENSITY_SUB WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_RESISTIVITY_SURVEY WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_RESISTIVITY_SURVEY_SUB WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_RESISTIVITY_SURVEY_FILE WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_REFRACTION_SURVEY WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_REFRACTION_SURVEY_SUB WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_REFRACTION_SURVEY_FILE WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
sql = "INSERT INTO TBL_RESISTIVITY_SURVEY SELECT * FROM TEMP_RESISTIVITY_SURVEY WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_RESISTIVITY_SURVEY_SUB SELECT * FROM TEMP_RESISTIVITY_SURVEY_SUB WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_RESISTIVITY_SURVEY_FILE SELECT * FROM TEMP_RESISTIVITY_SURVEY_FILE WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_REFRACTION_SURVEY SELECT * FROM TEMP_REFRACTION_SURVEY WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_REFRACTION_SURVEY_SUB SELECT * FROM TEMP_REFRACTION_SURVEY_SUB WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
sql = "INSERT INTO TBL_REFRACTION_SURVEY_FILE SELECT * FROM TEMP_REFRACTION_SURVEY_FILE WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
exeQuery(sql = "DELETE FROM TBL_EXPERT_OPINION WHERE PROJECT_CODE = [PROJECT_CODE]", PROJECT_CODE);
sql = "INSERT INTO TBL_EXPERT_OPINION SELECT * FROM TEMP_EXPERT_OPINION WHERE PROJECT_CODE = [PROJECT_CODE]";
resultCnt += exeQuery(sql, PROJECT_CODE);
connection.commit();
resultBool = true;
}
catch (SQLException e) {
logger.debug("error", e);
if (connection != null) {
try {
connection.rollback();
}
catch (SQLException sqle) {
System.out.println("e.getMessage() : " + sqle.getMessage());
}
}
try {
connection.setAutoCommit(true);
if (query != null) {
query.close();
}
if (connectionPool != null) {
connectionPool.close(connection);
}
if (resultSet != null) {
resultSet.close();
}
}
catch (SQLException sqe) {
System.out.println("e.getMessage() : " + sqe.getMessage());
}
}
catch (Exception e) {
System.out.println("e.getMessage() : " + e.getMessage());
if (connection != null) {
try {
connection.rollback();
}
catch (SQLException sqle) {
System.out.println("e.getMessage() : " + sqle.getMessage());
}
}
try {
connection.setAutoCommit(true);
if (query != null) {
query.close();
}
if (connectionPool != null) {
connectionPool.close(connection);
}
if (resultSet != null) {
resultSet.close();
}
}
catch (SQLException sqe) {
System.out.println("e.getMessage() : " + sqe.getMessage());
}
}
finally {
try {
connection.setAutoCommit(true);
if (query != null) {
query.close();
}
if (connectionPool != null) {
connectionPool.close(connection);
}
if (resultSet != null) {
resultSet.close();
}
}
catch (SQLException sqe2) {
System.out.println("e.getMessage() : " + sqe2.getMessage());
}
}
return resultBool;
}
public String getProjectInfo(final String project_code, final String col_name) throws SQLException {
String sql = "";
String column_value = "";
sql = "SELECT * FROM TEMP_PROJECT_INFO WHERE PROJECT_CODE = [PROJECT_CODE]";
(query = new DatabaseQuery(sql)).setParam("PROJECT_CODE", project_code);
resultSet = query.execute(connection);
if (resultSet.next()) {
column_value = isnull(resultSet.getString(col_name));
}
return column_value;
}
public String getMasterCompany(final String project_code) throws SQLException {
String sql = "";
String value = "";
sql += " \n SELECT ";
sql += " \n FUNC_MASTER_COMPANY_NAME(PROJECT_MASTER_COMPANY_O_CODE, PROJECT_MASTER_COMPANY_TW_CODE, PROJECT_MASTER_COMPANY_TH_CODE, PROJECT_MASTER_COMPANY_F_CODE,PROJECT_MASTER_COMPANY_NAME) AS COMPANY ";
sql += " \n FROM TEMP_PROJECT_INFO WHERE PROJECT_CODE = [PROJECT_CODE]";
(query = new DatabaseQuery(sql)).setParam("PROJECT_CODE", project_code);
resultSet = query.execute(connection);
if (resultSet.next()) {
value = isnull(resultSet.getString("COMPANY"));
}
return value;
}
public String getCompany(final String tbl_name, final String com_name) throws SQLException {
String sql = "";
String com_code = "";
if (!"".equals(com_name)) {
sql = "SELECT COM_CODE FROM " + tbl_name + " WHERE COM_NAME = [COM_NAME]";
(query = new DatabaseQuery(sql)).setParam("COM_NAME", com_name);
resultSet = query.execute(connection);
if (resultSet.next()) {
com_code = isnull(resultSet.getString("COM_CODE"));
}
else {
sql = "SELECT MAX(TO_NUMBER(COM_CODE))+1 AS MAX_CODE FROM " + tbl_name;
query = new DatabaseQuery(sql);
resultSet = query.execute(connection);
if (resultSet.next()) {
com_code = isnull(resultSet.getString("MAX_CODE"));
}
sql = "INSERT INTO " + tbl_name + "(COM_CODE, COM_NAME)";
sql += "VALUES ([COM_CODE],[COM_NAME]) ";
(query = new DatabaseQuery(sql)).setParam("COM_CODE", com_code);
query.setParam("COM_NAME", com_name);
query.executeUpdate(connection);
}
}
return com_code;
}
public int exeQuery(final String qry, final String project_code) throws SQLException {
int affectRow = 0;
if (!"".equals(qry)) {
(query = new DatabaseQuery(qry)).setParam("PROJECT_CODE", project_code);
affectRow = query.executeUpdate(connection);
}
return affectRow;
}
public String isnull(String s) {
if (s == null) {
s = "";
}
else {
s = s;
}
return s;
}
public String isnull(String s, final String re) {
if (s == null) {
s = re;
}
else {
s = s;
}
return s;
}
}

View File

@ -0,0 +1,214 @@
package geoinfo.com.database;
import java.io.IOException;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Timer;
import java.util.TimerTask;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.core.io.Resource;
public class HotDeployableMybatisSessionFactoryBean extends SqlSessionFactoryBean implements DisposableBean {
private static final Logger LOGGER = LoggerFactory.getLogger(HotDeployableMybatisSessionFactoryBean.class);
private SqlSessionFactory proxy;
private int interval = 500;
private boolean running = false;
private Timer timer;
private TimerTask task;
private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
private final Lock r = rwl.readLock();
private final Lock w = rwl.writeLock();
public Resource[] mapperLocations;
@Override
public void setMapperLocations(Resource[] mapperLocations) {
super.setMapperLocations(mapperLocations);
this.mapperLocations = mapperLocations;
}
public void setInterval(int interval) {
this.interval = interval;
}
public void refresh() throws Exception {
w.lock();
try {
super.afterPropertiesSet();
} finally {
w.unlock();
}
LOGGER.debug("Mybatis Mapper File Reloaded!");
}
@Override
public void afterPropertiesSet() throws Exception {
super.afterPropertiesSet();
setRefreshable();
}
private void setRefreshable() {
proxy = (SqlSessionFactory) Proxy.newProxyInstance(
SqlSessionFactory.class.getClassLoader(),
new Class[]{SqlSessionFactory.class},
new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method,
Object[] args) throws Throwable {
// log.debug("method.getName() : " + method.getName());
return method.invoke(getParentObject(), args);
}
});
task = new TimerTask() {
private final Map<Resource, Long> map = new HashMap<Resource, Long>();
@Override
public void run() {
if (isModified()) {
try {
refresh();
} catch (NumberFormatException e) {
if (LOGGER.isDebugEnabled()) {
LOGGER.error("Refresh Error Exception", e);
} else {
LOGGER.error("Refresh Error Exception");
}
} catch (SQLException e) {
if (LOGGER.isDebugEnabled()) {
LOGGER.error("Refresh Error Exception", e);
} else {
LOGGER.error("Refresh Error Exception");
}
} catch (Exception e) {
if (LOGGER.isDebugEnabled()) {
LOGGER.error("Refresh Error Exception", e);
} else {
LOGGER.error("Refresh Error Exception");
}
}
}
}
private boolean isModified() {
boolean retVal = false;
if (mapperLocations != null) {
for (int i = 0; i < mapperLocations.length; i++) {
Resource mappingLocation = mapperLocations[i];
retVal |= findModifiedResource(mappingLocation);
}
}
return retVal;
}
private boolean findModifiedResource(Resource resource) {
boolean retVal = false;
List<String> modifiedResources = new ArrayList<String>();
try {
long modified = resource.lastModified();
if (map.containsKey(resource)) {
long lastModified = map.get(resource).longValue();
if (lastModified != modified) {
map.put(resource, new Long(modified));
modifiedResources.add(resource.getDescription());
retVal = true;
}
} else {
map.put(resource, new Long(modified));
}
} catch (NumberFormatException e) {
LOGGER.debug("Exception: " + e);
} catch (IOException e) {
LOGGER.debug("Exception: " + e.toString());
} catch (Exception e) {
LOGGER.debug("Exception: " + e);
}
if (retVal) {
LOGGER.debug("Mybatis Mapper File Changed: " + modifiedResources);
}
return retVal;
}
};
timer = new Timer(true);
resetInterval();
}
private Object getParentObject() throws Exception {
r.lock();
try {
return super.getObject();
} finally {
r.unlock();
}
}
@Override
public SqlSessionFactory getObject() {
return this.proxy;
}
@Override
public Class<? extends SqlSessionFactory> getObjectType() {
return (this.proxy != null ? this.proxy.getClass() : SqlSessionFactory.class);
}
@Override
public boolean isSingleton() {
return true;
}
public void setCheckInterval(int ms) {
interval = ms;
if (timer != null) {
resetInterval();
}
}
private void resetInterval() {
if (running) {
timer.cancel();
running = false;
}
if (interval > 0) {
timer.schedule(task, 0, interval);
running = true;
}
}
@Override
public void destroy() {
timer.cancel();
}
}

View File

@ -0,0 +1,196 @@
package geoinfo.com.file;
import egovframework.com.cmm.service.EgovProperties;
import geoinfo.com.GeoinfoCommon;
import geoinfo.com.file.service.File2019Service;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.util.Calendar;
import java.util.Map;
import java.util.StringTokenizer;
import javax.annotation.Resource;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class File2019Controller {
@Resource(name = "file2019Service")
private File2019Service file2019Service;
public String filePath = EgovProperties.getProperty("Geoinfo.FilePath");
// 파일 다운로드
@RequestMapping(value = "file2019.do")
public void download(Map<String, Object> map, HttpServletResponse response, HttpServletRequest request, @RequestParam("stored_file_name") String stored_file_name, @RequestParam("target") String target, @RequestParam("idx") int idx) throws Exception {
try {
map.put("stored_file_name", stored_file_name);
map.put("target", target);
map.put("board_idx", idx);
Map<String, Object> result = null;
result = file2019Service.selectWebCommFileInfo(map);
if (result != null) {
String storedFileName = (String) result.get("STORED_FILE_NAME");
String originalFileName = (String) result.get("ORIGINAL_FILE_NAME");
System.out.println(filePath + storedFileName);
File file = new File(request.getRealPath("/files") + "/" + storedFileName);
if (file.exists()) {
FileInputStream fis = new FileInputStream(file);
// BufferedInputStream bis = new BufferedInputStream(fis);
byte[] buffer = new byte[(int) file.length()];
// byte fileByte[] = FileUtils.readFileToByteArray(file);
response.setContentType("application/download; charset=utf-8");
response.setContentLength(buffer.length);
response.setHeader("Content-Disposition", "attachment; fileName=\"" + URLEncoder.encode(originalFileName, "UTF-8") + "\";");
response.setHeader("Content-Transfer-Encoding", "binary");
OutputStream out = response.getOutputStream();
try {
FileCopyUtils.copy(fis, out);
} finally {
if (fis != null) {
try {
fis.close();
} catch (IOException ioe) {
}
}
}
out.flush();
fis.close();
} else {
response.setCharacterEncoding("euc-kr");
PrintWriter writer = response.getWriter();
writer.println("<script type='text/javascript'>");
writer.println("alert('해당 파일이 존재하지 않습니다.');");
writer.println("history.go(-1);");
writer.println("</script>");
writer.flush();
}
} else {
response.setCharacterEncoding("euc-kr");
PrintWriter writer = response.getWriter();
writer.println("<script type='text/javascript'>");
writer.println("alert('해당 파일이 존재하지 않습니다.');");
writer.println("history.go(-1);");
writer.println("</script>");
writer.flush();
}
} catch (Exception ex) {
System.out.println(ex);
}
}
@RequestMapping(value = "/com/file2019DownloadPopup")
public void fileDownload(ModelMap model,
HttpServletRequest request,
HttpServletResponse response,
@RequestParam Map<String, Object> params) throws Exception {
//System.out.println("/com/fileDownloadPopup.do start!!!~~~~~~~");
String filePath3D = request.getSession().getServletContext().getRealPath("/") + EgovProperties.getProperty("Geoinfo.FilePath3D");
String reportPath = request.getSession().getServletContext().getRealPath("/") + EgovProperties.getProperty("Geoinfo.Report");
String version = (String)params.get("version");
String filePath = "";
String saveFileName = "";
String saveFileName1 = "";
if("old".equals(version)){
String sFileFolder = request.getSession().getServletContext().getRealPath("/") + "files/4dim/";
String cFileFolder = request.getSession().getServletContext().getRealPath("/") + "files/cad/";
String iFileFolder = request.getSession().getServletContext().getRealPath("/") + "files/shape/";
String agu = (String)params.get("agu");
String agu2 = (String)params.get("agu2");
String aFolder = (String)params.get("aFolder");
String adong1 = (String)params.get("adong");
String type = (String)params.get("type");
if(type.equals("cad")){
filePath = cFileFolder + agu + "/"+agu2+"/" + aFolder + "/" + adong1 + ".zip";
}else if(type.equals("shp")){
filePath = iFileFolder + agu + "/"+agu2+"/" + aFolder + "/" + adong1 + ".zip";
}else{
filePath = sFileFolder + agu + "/"+agu2+"/" + aFolder + "/" + adong1 + ".4d";
}
}else{
String crwdId = (String)params.get("crwdId");
String folder = (String)params.get("model");
//filePath = filePath3D + crwdId + "/" + folder + "/" + "split_" + crwdId + ".4d";
//System.out.println("Geoinfo.FilePath3D - " + EgovProperties.getProperty("Geoinfo.FilePath3D"));
filePath = EgovProperties.getProperty("Geoinfo.FilePath3D") + "/crwd_id/" + folder + "/" + crwdId.toLowerCase() + ".4d";
//filePath = filePath3D + "crwd_id/" + folder + "/" + crwdId.toLowerCase() + ".4d";
saveFileName = crwdId + ".4d";
saveFileName1 = saveFileName ;
System.out.println("1filePath - " + filePath);
}
if("report".equals(version)){
String projectCode = (String)params.get("projectCode");
String saveName = (String)params.get("fileName");
saveFileName = (String)params.get("saveName");
saveFileName1 = new String(saveFileName.getBytes("8859_1"), "utf-8");
//filePath = reportPath + projectCode + "/" + saveName;
// 2018.09.20. 모의해킹. (마) 경로추적 및 파일 다운로드 취약점.
filePath = reportPath + projectCode + "/" + saveName.replace("../", "/").replace("./", "/").replace("..\\", "/").replace(".\\", "/");
System.out.println("report filePath - " + filePath);
}
File file = new File(filePath);
if (file.exists()) {
FileInputStream fis = new FileInputStream(file);
byte[] buffer = new byte[(int) file.length()];
response.setContentType("application/download; charset=utf-8");
response.setContentLength(buffer.length);
response.setHeader("Content-Disposition", "attachment; fileName=\"" + URLEncoder.encode(saveFileName1, "UTF-8") + "\";");
response.setHeader("Content-Transfer-Encoding", "binary");
OutputStream out = response.getOutputStream();
try {
FileCopyUtils.copy(fis, out);
} finally {
if (fis != null) {
try {
fis.close();
} catch (IOException ioe) {
}
}
}
out.flush();
fis.close();
} else {
response.setCharacterEncoding("euc-kr");
PrintWriter writer = response.getWriter();
writer.println("<script type='text/javascript'>");
writer.println("alert('해당 파일이 존재하지 않습니다.');");
writer.println("this.close();");
writer.println("</script>");
writer.flush();
}
}
}

View File

@ -0,0 +1,88 @@
package geoinfo.com.file;
import java.util.ArrayList;
import egovframework.com.cmm.service.EgovProperties;
/**
* <pre>
* @project : geoinfo_eGov
* @package : geoinfo.com.file
* @className : FileCmmn
* @date : 2018. 9. 10. 10:02:49
* @author : user
* @description : .
* </pre>
*/
public class FileCmmn {
public static final String EXT_IMG_TYPE = EgovProperties.getProperty("Globals.FileExtImg");
//DB 유형
public static final String EXT_ZIP_TYPE = EgovProperties.getProperty("Globals.FileExtZip");
private static String[] imgTypeList, zipTypeList = null;
private static FileCmmn fileCmmn = null;
public FileCmmn() {
if ( EXT_IMG_TYPE != null ) {
imgTypeList = EXT_IMG_TYPE.split(",");
}
if ( EXT_ZIP_TYPE != null ) {
zipTypeList = EXT_ZIP_TYPE.split(",");
}
}
public static synchronized FileCmmn getInstance() {
if ( fileCmmn == null ) {
fileCmmn = new FileCmmn();
}
return fileCmmn;
}
public static String getFileList(String type) {
if ( type.equals("IMG")) {
return EXT_IMG_TYPE;
} else {
return EXT_ZIP_TYPE;
}
}
public static boolean isImgCheck(String fileName) {
boolean isChk = false;
//System.out.println(" fileName = " + fileName );
// EXT_IMG_TYPE 만 가능하다.
for ( String img : imgTypeList ) {
//System.out.println("img = " + img );
if ( fileName.toLowerCase().endsWith(img)) {
isChk = true;
break;
}
}
//System.out.println("isChk = " + isChk);
return isChk;
}
public static boolean isZipCheck(String fileName) {
boolean isChk = false;
// EXT_IMG_TYPE 만 가능하다.
for ( String zip : zipTypeList ) {
if ( fileName.toLowerCase().endsWith(zip)) {
isChk = true;
break;
}
}
return isChk;
}
}

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