feat(itms): ncmsToIamsDataTrans → datatrans subtree 이식 (히스토리 보존)

git-subtree-dir: datatrans
git-subtree-mainline: b60fd84fb9
git-subtree-split: 7c9701e4e5
This commit is contained in:
itms-merge-dev 2026-07-17 17:01:15 +09:00
commit c057b0feb5
91 changed files with 5175 additions and 0 deletions

23
datatrans/.classpath Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="bin/main" path="src/main/java">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="bin/main" path="src/main/resources">
<attributes>
<attribute name="gradle_scope" value="main"/>
<attribute name="gradle_used_by_scope" value="main,test"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11/"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer">
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="bin/default"/>
</classpath>

6
datatrans/.gitattributes vendored Normal file
View File

@ -0,0 +1,6 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf

5
datatrans/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# Ignore Gradle project-specific cache directory
.gradle
# Ignore Gradle build output directory
build

41
datatrans/.project Normal file
View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ncmsToIamsDataTrans</name>
<comment>Project lib created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>

28
datatrans/.project.bak Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>urpBaseResource</name>
<comment>Project lib created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,2 @@
connection.project.dir=
eclipse.preferences.version=1

View File

@ -0,0 +1,4 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.source=11

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="ncmsToIamsDataTrans">
<property name="context-root" value="ncmsToIamsDataTrans"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/resources"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="src/main/java"/>
<wb-resource deploy-path="/" source-path="src/main/webapp"/>
</wb-module>
</project-modules>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<fixed facet="jst.java"/>
<fixed facet="jst.web"/>
<installed facet="jst.web" version="2.4"/>
<installed facet="jst.java" version="11"/>
</faceted-project>

View File

@ -0,0 +1,2 @@
boot.validation.initialized=true
eclipse.preferences.version=1

View File

@ -0,0 +1,67 @@
# Service port
server:
port: 9002
# JPA 설정, JSP 설정
spring:
devtools:
livereload:
enabled: true
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER
# 인증서버에서 JWT 보안키 확인
security:
oauth2:
resourceserver:
jwt:
jwk-set-uri:
http://localhost:9001/oauth/token_key
# Primary db information
ncmsdb:
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
jdbcUrl: jdbc:log4jdbc:mysql://192.168.8.138:3307/kccfnova?characterEncoding=UTF-8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true
username: yT4l55I/Xl4v8LeoTQhh1w==
password: aqmsYeReTVvoQ4r2bfAjYg==
maximumPoolSize: 35
minimumIdle: 2
connectionTimeout: 3000
idleTimeout: 300000
testOnBorrow: true
validationQuery: SELECT 1
iamsdb:
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
jdbcUrl: jdbc:log4jdbc:mysql://192.168.8.138:3307/uac_cltr_db?characterEncoding=UTF-8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true
username: kSLzt543nkDJ/ta9rnLTCA==
password: kSLzt543nkDJ/ta9rnLTCA==
maximumPoolSize: 35
minimumIdle: 2
connectionTimeout: 3000
idleTimeout: 300000
testOnBorrow: true
validationQuery: SELECT 1
# SQL Log 관련 setting
log4jdbc:
spylogdelegator:
name: net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
dump:
sql:
maxlinelength: 0
logging.level.jdbc.sqlonly: info
logging.level.jdbc.sqltiming: false
logging.level.jdbc.audit: false
logging.level.jdbc.resultset: false
logging.level.jdbc.resultsettable: info
logging.level.jdbc.connection: false
file:
ncms:
basefolder : D:/z_temp_pro/kccf_temp
iams:
basefolder : D:/z_temp_pro/kccf_temp/repo
fileCpYn : N

View File

@ -0,0 +1,67 @@
# Service port
server:
port: 9002
# JPA 설정, JSP 설정
spring:
devtools:
livereload:
enabled: true
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER
# 인증서버에서 JWT 보안키 확인
security:
oauth2:
resourceserver:
jwt:
jwk-set-uri:
http://localhost:9001/oauth/token_key
# Primary db information
ncmsdb:
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
jdbcUrl: jdbc:log4jdbc:mysql://127.0.0.1:3306/kccfnova?characterEncoding=UTF-8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true
username: yT4l55I/Xl4v8LeoTQhh1w==
password: aqmsYeReTVvoQ4r2bfAjYg==
maximumPoolSize: 35
minimumIdle: 2
connectionTimeout: 3000
idleTimeout: 300000
testOnBorrow: true
validationQuery: SELECT 1
iamsdb:
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
jdbcUrl: jdbc:log4jdbc:mysql://10.10.30.237:3306/uac_cltr_db?characterEncoding=UTF-8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true
username: kSLzt543nkDJ/ta9rnLTCA==
password: kSLzt543nkDJ/ta9rnLTCA==
maximumPoolSize: 35
minimumIdle: 2
connectionTimeout: 3000
idleTimeout: 300000
testOnBorrow: true
validationQuery: SELECT 1
# SQL Log 관련 setting
log4jdbc:
spylogdelegator:
name: net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
dump:
sql:
maxlinelength: 0
logging.level.jdbc.sqlonly: info
logging.level.jdbc.sqltiming: false
logging.level.jdbc.audit: false
logging.level.jdbc.resultset: false
logging.level.jdbc.resultsettable: info
logging.level.jdbc.connection: false
file:
ncms:
basefolder : /nfs_nas/minio/amsweb-opt
iams:
basefolder : /nfs_nas/uac/repo
fileCpYn : Y

Binary file not shown.

View File

@ -0,0 +1,2 @@
log4jdbc.spylogdelegator.name = net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
log4jdbc.dump.sql.maxlinelength=0

View File

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<contextName>${HOSTNAME}</contextName>
<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n
</Pattern>
</encoder>
</appender>
<!--
<root level="error">
<appender-ref ref="consoleAppender" />
</root>
<logger name="TRACE_LOGGER" level="error" additivity="false">
<appender-ref ref="consoleAppender" />
</logger>
-->
<root level="info">
<appender-ref ref="consoleAppender" />
</root>
<logger name="TRACE_LOGGER" level="info" additivity="false">
<appender-ref ref="consoleAppender" />
</logger>
<!-- 일단 사용하지 않음 -->
<!--
<property name="LOG_DIR" value="/var/log/LAMP" />
<springProfile name="!local">
<appender name="rollingFileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</encoder>
<file>${LOG_DIR}/${HOSTNAME}_server.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_DIR}/${HOSTNAME}_server.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>200MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>10</maxHistory>
</rollingPolicy>
</appender>
<appender name="asyncAppender" class="ch.qos.logback.classic.AsyncAppender">
<discardingThreshold>0</discardingThreshold>
<queueSize>10000</queueSize>
<appender-ref ref="rollingFileAppender" />
</appender>
<appender name="traceRollingFileAppend" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%msg%n</Pattern>
</encoder>
<file>${LOG_DIR}/${HOSTNAME}_trace.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_DIR}/${HOSTNAME}_trace.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>200MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>10</maxHistory>
</rollingPolicy>
</appender>
<appender name="traceLogAppend" class="ch.qos.logback.classic.AsyncAppender">
<discardingThreshold>0</discardingThreshold>
<queueSize>10000</queueSize>
<appender-ref ref="traceRollingFileAppend" />
</appender>
<root level="info">
<appender-ref ref="asyncAppender" />
</root>
<logger name="TRACE_LOGGER" level="info" additivity="false">
<appender-ref ref="traceLogAppend" />
</logger>
</springProfile>
-->
</Configuration>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting name="jdbcTypeForNull" value="NULL"/>
<setting name="defaultStatementTimeout" value="1800"/>
<setting name="callSettersOnNulls" value="true"/>
<setting name="defaultFetchSize" value="1000" />
<setting name="mapUnderscoreToCamelCase" value="true"/>
</settings>
<!--
<typeAliases>
<typeAlias alias="UserVO" type="com.gdsc.ImgEd.domain.UserVO" />
<typeAlias alias="ImageInfoVO" type="com.gdsc.ImgEd.domain.ImageInfoVO" />
<typeAlias alias="ImageMetaVO" type="com.gdsc.ImgEd.domain.ImageMetaVO" />
<typeAlias alias="IspnMngInfoVO" type="com.gdsc.ImgEd.domain.IspnMngInfoVO" />
<typeAlias alias="IspnMngInfo2VO" type="com.gdsc.ImgEd.domain.IspnMngInfo2VO" />
<typeAlias alias="IspnMngInfo4VO" type="com.gdsc.ImgEd.domain.IspnMngInfo4VO" />
<typeAlias alias="IspnMngInfo5VO" type="com.gdsc.ImgEd.domain.IspnMngInfo5VO" />
</typeAliases>
-->
<typeAliases>
<!--
<typeAlias alias="CommonVO" type="com.urpsys.baseapi.domain.CommonVO" />
-->
</typeAliases>
</configuration>

View File

@ -0,0 +1,185 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.urpsys.kccfbat.iams.dao.IamsDataDao">
<select id="selectExistMaster" parameterType="String" resultType="String">
<![CDATA[
/* IcmsDataDao.selectExistMaster */
select if(count(1)>0, 'Y', 'N') as bexist
from rg_master
where set_no =#{strSetNo}
]]>
</select>
<insert id="insertRgMaster" parameterType="java.util.LinkedHashMap">
insert into rg_master
(
master_id
, use_flag
, set_id
, reg_status
, title
, keyword
, type_div_cd
, erecord_flag
, org_nm
, creat_yyyy
, presv_term_cd
, expt_disuse_yyyy
, oper_read_range_cd
, open_div_cd
, reg_id
, reg_dd
, mod_id
, mod_dd
, mng_org_cd
, page_cnt
, series_id
, digital_yn
, oper_out_range_cd
, mng_org_nm
, asset_type
, tags
, management_code
, interface_id
, set_no
, digital_read_yn
, prsvn_proc_trgt_yn
, dtls_type_div_cd
)
values
(
#{master_id }
, #{use_flag }
, #{set_id }
, #{reg_status }
, #{title }
, #{keyword }
, #{type_div_cd }
, #{erecord_flag }
, #{org_nm }
, #{creat_yyyy }
, #{presv_term_cd }
, #{expt_disuse_yyyy }
, #{oper_read_range_cd }
, #{open_div_cd }
, #{reg_id }
, sysdate()
, #{mod_id }
, sysdate()
, #{mng_org_cd }
, #{page_cnt }
, #{series_id }
, #{digital_yn }
, #{oper_out_range_cd }
, #{mng_org_nm }
, #{asset_type }
, #{tag }
, #{management_code }
, #{interface_id }
, #{set_no }
, #{digital_read_yn }
, #{prsvn_proc_trgt_yn }
, ''
)
</insert>
<insert id="insertJattchfile" parameterType="java.util.LinkedHashMap">
insert into j_attachfile
(
file_mask
, file_id
, file_seq
, file_name
, file_size
, download_count
, atch_type_cd
, digital_read_yn
)
values
(
#{file_mask }
, #{file_id }
, #{file_seq }
, #{file_name }
, #{file_size }
, #{download_count }
, #{atch_type_cd }
, #{digital_read_yn }
)
</insert>
<insert id="insertUareMaster" parameterType="java.util.LinkedHashMap">
insert into uare_master
(
f_id
, org_name
, volume_id
, v_seq
, length
, comp_yn
, encrypt_yn
, org_date
, reg_date
, reg_time
, commit_stat
, session_key
, reg_user_id
, file_key
, f_group
, f_index
, bef_commit_stat
, repository
, clipid
, offset
)
values
(
#{f_id }
, #{org_name }
, #{volume_id }
, #{v_seq }
, #{length }
, #{comp_yn }
, #{encrypt_yn }
, #{org_date }
, #{reg_date }
, #{reg_time }
, #{commit_stat }
, #{session_key }
, #{reg_user_id }
, #{file_key }
, #{f_group }
, #{f_index }
, #{bef_commit_stat }
, #{repository }
, #{clipid }
, #{offset }
)
</insert>
<insert id="insertUacRecord" parameterType="java.util.LinkedHashMap">
insert into uac_record
(
record_id
, type_div_cd
, book_spcm_cpy_yn
)
values
(
#{record_id }
, #{type_div_cd }
, 'N'
)
</insert>
</mapper>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting name="jdbcTypeForNull" value="NULL"/>
<setting name="defaultStatementTimeout" value="1800"/>
<setting name="callSettersOnNulls" value="true"/>
<setting name="defaultFetchSize" value="1000" />
<setting name="mapUnderscoreToCamelCase" value="true"/>
</settings>
<!--
<typeAliases>
<typeAlias alias="UserVO" type="com.gdsc.ImgEd.domain.UserVO" />
<typeAlias alias="ImageInfoVO" type="com.gdsc.ImgEd.domain.ImageInfoVO" />
<typeAlias alias="ImageMetaVO" type="com.gdsc.ImgEd.domain.ImageMetaVO" />
<typeAlias alias="IspnMngInfoVO" type="com.gdsc.ImgEd.domain.IspnMngInfoVO" />
<typeAlias alias="IspnMngInfo2VO" type="com.gdsc.ImgEd.domain.IspnMngInfo2VO" />
<typeAlias alias="IspnMngInfo4VO" type="com.gdsc.ImgEd.domain.IspnMngInfo4VO" />
<typeAlias alias="IspnMngInfo5VO" type="com.gdsc.ImgEd.domain.IspnMngInfo5VO" />
</typeAliases>
-->
<typeAliases>
<typeAlias alias="CommonVO" type="com.urpsys.kccfbat.domain.CommonVO" />
</typeAliases>
</configuration>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.urpsys.kccfbat.ncms.dao.CommonDao">
<select id="selectTest1" parameterType="String" resultType="String">
<![CDATA[
select '1' as val1
]]>
</select>
<select id="selectTest2" parameterType="String" resultType="CommonVO">
<![CDATA[
select 'value01' as val1
, 'value02' as val2
, 'value03' as val3
, 'value04' as val4
, 'value05' as val5
]]>
</select>
</mapper>

View File

@ -0,0 +1,243 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.urpsys.kccfbat.ncms.dao.NcmsDataDao">
<select id="selectMultimediaAssets" resultType="java.util.LinkedHashMap">
<![CDATA[
/* icmsDataDao.selectMultimediaAssets */
select
id
, culture_resource_addinfo_id
, major_category_id
, minor_category_id
, asset_type
, management_code
, content_type_id
, org_file
, reg_file
, is_series
, series_no
, is_open
, is_original_open
, closed_reason
, closed_reason_desc
, title
, subtitle
, thumbnail
, tags_old
, keywords_old
, description
, additional_desc
, province
, city
, address
, latitude
, longitude
, council_code
, published_year
, publisher
, author
, supplier
, source_category_id
, source_name
, copyright
, copyright_manage_dept
, third_party_copyright
, preservation_period
, licence_id
, website_name
, is_available_link
, link_checkup_date
, full_url
, short_url
, encoding_status
, is_cms_send
, topic_group
, deleted_at
, created_at
, updated_at
, reg_file2
, opt_file
, thumbnail2
, thumbnail_manual
, generated_at
, file_size
, volume
, total_page_count
, isbn
, width
, height
, alt
, caption
, is_use_subtitles
, org_subtitle_file
, reg_subtitle_file
, subtitle_text
, is_3d
, exif_shooting_date
, 재생시간
, codec
, is_card_news
, sort_order
, is_main_image
, asset_link
, culture_resource_id
, ocr_text_file
, ocr_split_page_num
, is_ocr_complete
, table_of_contents
, pdf_abstract
, asset_media_type_id
, province_id
, city_id
, is_used
, is_checked
, need_thumbnail_copy
, thumbnail_src
, need_asset_move
, old_id
from multimedia_assets a
where (iams_tran_yn is null or iams_tran_yn = '')
and deleted_at is null
and id ='132041'
limit 1;
]]>
</select>
<select id="selectCulterResource" parameterType="String" resultType="java.util.LinkedHashMap">
<![CDATA[
/* ncmsDataDao.selectCulterResource */
select
id
, council
, idx
, major
, minor
, title
, volume
, author
, publisher
, genyear
, amount
, province
, city
, category
, keywords
, count
, have_file
, need_digital
, `desc`
, location
, worker
, worked_at
, mh
, deleted_at
, content_user_groups
, content_user_types
, created_at
, updated_at
, scan1
, writer_select
, major_category_id
, minor_category_id
, subject_id
, child_subject_id
, council_id
, category_id
, local_culture_id
, asset_type_id
, parent_theme_id
, theme_id
, content_user_type_id
, content_user_group_id
, age_id
, chronological_start_id
, chronological_end_id
, thumbnail
, thumbnail_copyright
from culture_resources a
where a.id = #{culture_resource_id}
]]>
</select>
<select id="selectMedia" parameterType="String" resultType="java.util.LinkedHashMap">
<![CDATA[
/* ncmsDataDao.selectMedia */
select
id
, model_type
, model_id
, collection_name
, name
, file_name
, mime_type
, disk
, size
, manipulations
, custom_properties
, responsive_images
, order_column
, created_at
, updated_at
from media a
where a.model_id = #{culture_resource_id}
]]>
</select>
<select id="selectTypeDivCd" parameterType="int" resultType="String">
<![CDATA[
select case when code = 'A' then 'IT_BOOK' -- 도서간행물
when code = 'B' then 'IT_DOC' -- 문서
when code = 'C' then 'IT_PHOTO' -- 시청각물
when code = 'D' then 'IT_MAP' -- 도안
when code = 'E' then 'IT_MUSE' -- 박물
when code = 'F' then 'IT_ETC' -- 기타
when code = 'G' then 'IT_WEB' -- 웹정보자료
when code = 'H' then 'IT_TEXT' -- 원고
else 'X'
end as type_div_cd
from categories
where id = #{id}
]]>
</select>
<!-- 관리부서 찾기 -->
<select id="selectMngOrgCd" parameterType="int" resultType="String">
<![CDATA[
select a.code
from councils a
where id = #{id}
]]>
</select>
<!-- 관리부서명 찾기 -->
<select id="selectMngOrgNm" parameterType="int" resultType="String">
<![CDATA[
select a.name
from councils a
where id = #{id}
]]>
</select>
<!-- 결과값 처리 -->
<update id="updateResultMultimediaAssets" parameterType="java.util.LinkedHashMap">
/* ncmsDataDao.updateResultMultimediaAssets */
update multimedia_assets
SET iams_tran_yn = #{iams_tran_yn}
, iams_tran_dt = sysdate()
, iams_tran_remark = #{iams_tran_remark}
, iams_tran_master_id = #{iams_tran_master_id}
WHERE id = #{id}
</update>
</mapper>

View File

@ -0,0 +1 @@
aes256.key=52f48aa1c7435bc11bf909d9d7d1d5932f4bacd8184ec5c1eed6d03ee17fe126

Binary file not shown.

96
datatrans/build.gradle Normal file
View File

@ -0,0 +1,96 @@
plugins
{
id 'org.springframework.boot' version '2.6.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'org.asciidoctor.convert' version '1.5.8'
id 'java'
id 'war'
}
group = 'com.urpsys'
version = '1.0.0-SNAPSHOT'
sourceCompatibility = '11'
configurations
{
compileOnly
{
extendsFrom annotationProcessor
}
}
repositories
{
mavenCentral()
maven { url "https://maven.egovframe.go.kr/maven/" } // egovframe maven
}
ext
{
set('snippetsDir', file("build/generated-snippets"))
}
dependencies
{
implementation 'org.springframework.boot:spring-boot-starter-batch'
implementation 'org.springframework.boot:spring-boot-starter-cache'
implementation 'org.springframework.boot:spring-boot-starter-integration'
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-quartz'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation ('org.springframework.boot:spring-boot-starter-web')
{
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
}
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2' // DB
// oracle connect lib
// implementation group: 'com.oracle.database.jdbc', name: 'ojdbc8', version: '21.8.0.0'
// runtimeOnly 'org.mariadb.jdbc:mariadb-java-client' // mariadb
implementation 'com.mysql:mysql-connector-j:8.2.0'
implementation 'org.springframework.boot:spring-boot-starter-undertow'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'
implementation 'org.apache.commons:commons-lang3:3.12.0'
compileOnly 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.projectlombok:lombok:1.18.20'
testCompileOnly 'org.projectlombok:lombok:1.18.20'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.20'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
implementation 'commons-codec:commons-codec:1.15' //
implementation 'org.bgee.log4jdbc-log4j2:log4jdbc-log4j2-jdbc4.1:1.16' // sql log
implementation 'org.springframework.security.oauth:spring-security-oauth2:2.3.8.RELEASE'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.3' // javax.xml.bind.JAXBException
implementation 'org.springframework.security:spring-security-jwt:1.0.9.RELEASE'
implementation 'com.konghq:unirest-java:3.7.02' // http
// 2023.07.31 swagger
implementation 'io.springfox:springfox-swagger2:2.9.2'
implementation 'io.springfox:springfox-swagger-ui:2.9.2'
}
test
{
outputs.dir snippetsDir
useJUnitPlatform()
}
asciidoctor
{
inputs.dir snippetsDir
dependsOn test
}

Binary file not shown.

View File

@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

234
datatrans/gradlew vendored Normal file
View File

@ -0,0 +1,234 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://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.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

89
datatrans/gradlew.bat vendored Normal file
View File

@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

10
datatrans/settings.gradle Normal file
View File

@ -0,0 +1,10 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user manual at https://docs.gradle.org/7.4.2/userguide/multi_project_builds.html
*/
rootProject.name = 'ncmsToIamsDataTrans'

View File

@ -0,0 +1,11 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user manual at https://docs.gradle.org/7.4.2/userguide/multi_project_builds.html
*/
rootProject.name = 'urpBaseResource'

View File

@ -0,0 +1,124 @@
package com.urpsys.kccfbat;
import java.io.InputStream;
import java.security.InvalidKeyException;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.Hex;
/**
* Hello world!
*
*/
public class Aes256Test
{
private static SecretKey keySpec; // keySpec
private static IvParameterSpec ivSpec; // ivSpec
public static void main( String[] args )
{
InputStream fis = null;
String secretKey = null;
System.out.println( "Hello World!" );
secretKey = "52f48aa1c7435bc11bf909d9d7d1d5932f4bacd8184ec5c1eed6d03ee17fe126";
/*
if(args.length !=2 )
{
System.out.println("Invalid args , args length 2 input ");
System.exit(0);
}
*/
args = new String[2];
args[0] = "enc";
args[1] = "uac_cltr";
try
{
byte[] secretKeyBytes = Hex.decodeHex(secretKey);
if (secretKeyBytes.length != 32)
{
System.out.println("Invalid key (key length is not valid) ");
System.exit(0);
}
byte[] ivBytes = new byte[16];
System.arraycopy(secretKeyBytes, 0, ivBytes, 0, 16);
keySpec = new SecretKeySpec(secretKeyBytes, "AES");
ivSpec = new IvParameterSpec(ivBytes);
if(args[0].equals("enc"))
{
System.out.println( "암호로 변경" );
if (args[1] == null)
{
System.out.println("변경할 문자열이 없습니다.");
}
String encryptedStr = null;
try
{
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec);
byte[] encrypted = cipher.doFinal(args[1].getBytes("UTF-8"));
encryptedStr = new String(Base64.encodeBase64(encrypted));
}
catch (Exception ex)
{
ex.printStackTrace();
}
System.out.println( "["+ args[1] +"] 암호화로 변경 =============>"+ encryptedStr);
}
else if(args[0].equals("dec"))
{
System.out.println( "평문으로 변경" );
if (args[1] == null)
{
System.out.println("변경할 문자열이 없습니다.");
}
String decryptedStr = null;
try {
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
byte[] byteStr = Base64.decodeBase64(args[1].getBytes("UTF-8"));
decryptedStr = new String(cipher.doFinal(byteStr), "UTF-8");
}
catch (Exception ex)
{
ex.printStackTrace();
}
System.out.println( "["+ args[1] +"] 평문으로 변경 =============>"+ decryptedStr);
}
}
catch(Exception e)
{
e.printStackTrace();
}
}
}

View File

@ -0,0 +1,145 @@
package com.urpsys.kccfbat.common.crypto;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.InvalidKeyException;
import java.util.Properties;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.codec.binary.Hex;
import org.springframework.core.io.ClassPathResource;
import com.urpsys.kccfbat.common.util.CommonUtil;
/**
* aes 256 암호화 클래스
*
* @author 나혁제
* @since 2023.02.28
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2023.02.28 나혁제 최초작성
*
* </pre>
*/
public class Aes256Cipher
{
private SecretKey keySpec; // keySpec
private IvParameterSpec ivSpec; // ivSpec
/**
* Aes256Cipher 생성자
*
* @param keyFile 파일 위치를 입력 받음
* @throws IOException 파일 io 발생하는 익셉션
* @throws InvalidKeyException key가 잘못되었을 경우 발생하는 익셉션
* @throws DecoderException 암호화된 문자열을 decoding할 발생하는 익셉션
*/
public Aes256Cipher() throws IOException, InvalidKeyException, DecoderException
{
String activeProfile = (CommonUtil.nvl(System.getProperty("spring.profiles.active")));
InputStream fis = null;
String secretKey = null;
try
{
fis = new ClassPathResource("secrets/UrpSystem.keystore").getInputStream();
Properties props = new Properties();
props.load(fis);
secretKey = props.getProperty("aes256.key");
}
catch (Exception ex)
{
ex.printStackTrace();
}
finally
{
fis.close();
}
byte[] secretKeyBytes = Hex.decodeHex(secretKey);
if (secretKeyBytes.length != 32) {
throw new InvalidKeyException("Invalid key (key length is not valid) ");
}
byte[] ivBytes = new byte[16];
System.arraycopy(secretKeyBytes, 0, ivBytes, 0, 16);
keySpec = new SecretKeySpec(secretKeyBytes, "AES");
ivSpec = new IvParameterSpec(ivBytes);
}
/**
* encryption 하는 메소드
*
* @param plainStr 평문을 입력 받음
* @return 암호화된 문자열
*/
public String encrypt(String plainStr)
{
if (plainStr == null) {
return null;
}
String encryptedStr = null;
try {
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec);
byte[] encrypted = cipher.doFinal(plainStr.getBytes("UTF-8"));
encryptedStr = new String(Base64.encodeBase64(encrypted));
} catch (Exception ex) {
ex.printStackTrace();
}
return encryptedStr;
}
/**
* 암호화된 문자열을 복호화하는 메소드
*
* @param encryptedStr 암호화된 문자열
* @return 암호화가 해제된 문자열
*/
public String decrypt(String encryptedStr)
{
if (encryptedStr == null)
{
return null;
}
String decryptedStr = null;
try {
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec);
byte[] byteStr = Base64.decodeBase64(encryptedStr.getBytes("UTF-8"));
decryptedStr = new String(cipher.doFinal(byteStr), "UTF-8");
} catch (Exception ex) {
ex.printStackTrace();
}
return decryptedStr;
}
}

View File

@ -0,0 +1,114 @@
package com.urpsys.kccfbat.common.exception;
import java.sql.SQLSyntaxErrorException;
import lombok.Getter;
/**
* Custom exception 클래스
*
* @author 나혁제
* @since 2023.02.28
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2023.02.28 나혁제 최초작성
*
* </pre>
*/
public class CustomException extends Exception
{
private static final long serialVersionUID = 3559302713942492181L;
@Getter
private String errorCode;
@Getter
private String errorMsg;
/**
* 생성자(throwable를 받아서 exception 종류에 따라 에러 코드 정의하는 클래스)
* 에러코드 처리 부분은 향후 db에서 에러코드 읽어와서 매핑하는 것으로
* 변경 가능성 있음
* @param throwable
*/
public CustomException(Throwable throwable) {
Throwable rootThrowable = getRootCause(throwable);
// TODO 에러 코드는 상세 정의해서 define 해야
if(rootThrowable instanceof SQLSyntaxErrorException) {
this.errorCode = "100";
this.errorMsg = "SQL 오류";
} else if(rootThrowable instanceof ArithmeticException) {
this.errorCode = "200";
this.errorMsg = "연산 오류";
} else {
this.errorCode = "900";
this.errorMsg = "Unknown Error";
}
}
/**
* 생성자(에러메시지만 받을 경우 에러코드를 0을 default로 세팅)
* @param errorMsg
*/
public CustomException(String errorMsg) {
super(errorMsg);
this.errorCode = "0";
this.errorMsg = errorMsg;
}
/**
* 생성자(errorcode, errmsg를 받아 세팅, 소스코드에서 편하게 사용하기 위해
* 에러코드를 int 값으로 받으면 string으로 변환하여 저장)
* @param errorCode
* @param errorMsg
*/
public CustomException(int errorCode, String errorMsg) {
super(errorMsg);
this.errorCode = String.valueOf(errorCode);
this.errorMsg = errorMsg;
}
/**
* 생성자(에러코드, 에러메시지를 받아 세팅)
* @param errorCode
* @param errorMsg
*/
public CustomException(String errorCode, String errorMsg) {
super(errorMsg);
this.errorCode = errorCode;
this.errorMsg = errorMsg;
}
/**
* stack에서 에러코드 root cause를 찾아내는 메소드
* @param throwable
* @return
*/
private Throwable getRootCause(Throwable throwable) {
Throwable cause = throwable.getCause();
if (cause == null) {
return throwable;
}
while (true) {
if(cause.getCause() == null) {
break;
} else {
cause = cause.getCause();
}
}
return cause;
}
}

View File

@ -0,0 +1,503 @@
package com.urpsys.kccfbat.common.util;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.SimpleTimeZone;
import java.util.Vector;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;
import org.springframework.http.HttpHeaders;
import org.springframework.security.jwt.Jwt;
import org.springframework.security.jwt.JwtHelper;
import org.springframework.security.oauth2.provider.token.RemoteTokenServices;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.urpsys.kccfbat.common.exception.CustomException;
import com.urpsys.kccfbat.domain.TokenInfo;
/**
* 공통 유틸리티를 모아둔 클래스
*
* @author 나혁제
* @since 2023.02.28
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2023.02.28 나혁제 최초작성
*
* </pre>
*/
public class CommonUtil
{
/**
* nvl 메소드
* @param inputStr
* @return
*/
public static String nvl(String inputStr) {
return (inputStr != null) ? inputStr.trim() : "";
}
/**
* nvl 메소드
* @param inputStr
* @param defaultValue
* @return
*/
public static String nvl(String inputStr, String defaultValue) {
return nvl(inputStr).contentEquals("") ? defaultValue : inputStr.trim();
}
/**
* nvl 메소드
* @param inputObj
* @return
*/
public static String nvl(Object inputObj) {
return (inputObj != null) ? String.valueOf(inputObj).trim() : "";
}
/**
* long 타입의 시간을 입력받아 날짜 형태로 변환해서 리턴해주는 함수
*
* @param longTime long type 시간
* @param dateFormat 변환할 포맷
* @return 변환된 날짜 String
* @throws SystemException
*/
public static String getTimeString(long longTime, String dateFormat) throws CustomException {
SimpleDateFormat sdf = new SimpleDateFormat(dateFormat, Locale.KOREA);
if (longTime < 0)
{
return "";
}
else {
try {
return sdf.format(new Date(longTime));
} catch (Exception e) {
throw new CustomException("Date 변환 오류");
}
}
}
/**
* 현재(한국기준) 시간정보를 얻는다.<BR>
* () 입력파리미터인 format string에 "yyyyMMddhh" 셋팅하면 1998121011과 같이 Return.<BR>
* () format string에 "yyyyMMddHHmmss" 셋팅하면 19990114232121과 같이
* 0~23시간 타입으로 Return. <BR>
* String CurrentDate = CtosUtil2.getKST("yyyyMMddHH");<BR>
* @param format 얻고자하는 현재시간의 Type
* @return str 현재 한국 시간.
*/
public static String getKST(String format)
{
//1hour(ms) = 60s * 60m * 1000ms
int millisPerHour = 60 * 60 * 1000;
SimpleDateFormat fmt= new SimpleDateFormat(format);
SimpleTimeZone timeZone = new SimpleTimeZone(9*millisPerHour,"KST");
fmt.setTimeZone(timeZone);
long time=System.currentTimeMillis();
String str=fmt.format(new java.util.Date(time));
return str;
}
/**
* 입력한 날짜 기준으로 몇일 , (주의)입력날짜는 구분자가 없는 string형
*
* @param date
* string date (19991002)
* @param Day
* 기준이 되는 시간
* @return String
*/
public static String getDatewithSpan(String date, long Day)
{
/*
* int millisPerHour = 60 * 60 * 1000; SimpleDateFormat fmt= new
* SimpleDateFormat("yyyy/MM/dd"); SimpleTimeZone timeZone = new
* SimpleTimeZone(9*millisPerHour,"KST"); fmt.setTimeZone(timeZone);
*
* int year = Integer.valueOf(date.substring(0,4)).intValue(); int month
* = Integer.valueOf(date.substring(4,6)).intValue(); int day =
* Integer.valueOf(date.substring(6,8)).intValue();
*
* java.util.Calendar aDay = Calendar.getInstance();
* aDay.set(year+1900,month,day); java.util.Calendar bDay
* =Calendar.getInstance(); bDay.set(1970+1900,1,1); java.util.Date cDay
* = new java.util.Date((aDay.getTime()).getTime() -
* (bDay.getTime()).getTime() + ((Day+1)*86400000) );
*
* return fmt.format(cDay);
*/
// 2006-09-04 7:03오후 오동원수정
String vFORMAT = "yyyy/MM/dd";
return getDatewithSpan(date, Day, "D", vFORMAT);
}
/**
* 입력한 날짜 기준으로 (,시간,) , (주의)입력날짜는 구분자가 없는 string형<br>
*
* @param date
* string date (20000315/2000031509/200003150915)
* @param unit
* long unit: (,시간,) , (,시간,)
* @param type
* String type: D:Day H:Hour M:Minute
* @return String 계산된 문자열의 .
*/
public static String getDatewithSpan(String date, long unit, String type, String strFormatType)
{
/*
* String formatType = strFormatType; int ihour = 0; int itime = 0;
*
* long dhm = 24 * 60 * 60 * 1000;
*
* if (type.equals("D")) { dhm =dhm + unit * 24 * 60 * 60 * 1000; } else
* if (type.equals("H")){ dhm =dhm + unit * 60 * 60 * 1000; } else if
* (type.equals("M")){ dhm =dhm + unit * 60 * 1000; } else{ return type
* + "은 부적절한 Type값입니다"; }
*
* switch (date.length()){ case (8): if (type.equals("H") ||
* type.equals("M")) { return "HM-ERROR"; }
*
* break; case (10): if (type.equals("M")) { return "M-ERROR"; }
*
* ihour = Integer.valueOf(date.substring(8,10)).intValue(); break; case
* (12):
*
* ihour = Integer.valueOf(date.substring(8,10)).intValue(); itime =
* Integer.valueOf(date.substring(10,12)).intValue(); break; default:
* return "date Length Error"; }
*
* int millisPerHour = 60 * 60 * 1000; SimpleDateFormat fmt= new
* SimpleDateFormat(formatType); SimpleTimeZone timeZone = new
* SimpleTimeZone(9*millisPerHour,"KST"); fmt.setTimeZone(timeZone);
*
* int iyear = Integer.valueOf(date.substring(0,4)).intValue(); int
* imonth = Integer.valueOf(date.substring(4,6)).intValue(); int iday =
* Integer.valueOf(date.substring(6,8)).intValue(); java.util.Calendar
* aDay = Calendar.getInstance();
* aDay.set(iyear+1900,imonth,iday,ihour,itime); java.util.Calendar bDay
* = Calendar.getInstance(); bDay.set(1970+1900,1,1,9,0); java.util.Date
* cDay = new java.util.Date((aDay.getTime()).getTime() -
* (bDay.getTime()).getTime() + dhm); return fmt.format(cDay);
*/
// 2006-09-04 7:03오후 오동원수정
String formatType = strFormatType;
int ihour = 0;
int itime = 0;
if(!(type.equals("D") || type.equals("H") || type.equals("M")))
{
return type + "은 부적절한 Type값입니다";
}
switch(date.length())
{
case (8):
if(type.equals("H") || type.equals("M"))
{
return "HM-ERROR";
}
break;
case (10):
if(type.equals("M"))
{
return "M-ERROR";
}
ihour = Integer.parseInt(date.substring(8, 10));
// ihour = Integer.valueOf(date.substring(8, 10)).intValue();
break;
case (12):
ihour = Integer.parseInt(date.substring(8, 10));
itime = Integer.parseInt(date.substring(10, 12));
// ihour = Integer.valueOf(date.substring(8, 10)).intValue();
// itime = Integer.valueOf(date.substring(10, 12)).intValue();
break;
default:
return "date Length Error";
}
int iyear = Integer.parseInt(date.substring(0, 4));
int imonth = Integer.parseInt(date.substring(4, 6));
int iday = Integer.parseInt(date.substring(6, 8));
/*
int iyear = Integer.valueOf(date.substring(0, 4)).intValue();
int imonth = Integer.valueOf(date.substring(4, 6)).intValue();
int iday = Integer.valueOf(date.substring(6, 8)).intValue();
*/
int imonth1 = imonth - 1; // 달은 0달부터 시작한다.
java.util.Calendar zDay = Calendar.getInstance();
zDay.set(iyear, imonth1, iday, ihour, itime);
if(type.equals("D"))
{
zDay.add(Calendar.DATE, (int) unit);
}
else if(type.equals("H"))
{
zDay.add(Calendar.HOUR_OF_DAY, (int) unit);
}
else if(type.equals("M"))
{
zDay.add(Calendar.MINUTE, (int) unit);
}
else
{
return type + "은 부적절한 Type값입니다";
}
java.util.Date z1Day = zDay.getTime();
java.text.SimpleDateFormat fmt2 = new java.text.SimpleDateFormat(formatType);
return fmt2.format(z1Day);
}
/**
* 현재 시간을 기준으로 일후 시간 시간의 형태는 (yyyy/mm/dd)
*
* @param day
* 더하려는 날짜
* @return str 현재 시간에 입력 시간을 더한 DATE형 시간
*/
public static String getDatewithSpan(long day)
{
/*
* int millisPerHour = 60 * 60 * 1000; SimpleDateFormat fmt= new
* SimpleDateFormat("yyyy/MM/dd"); SimpleTimeZone timeZone = new
* SimpleTimeZone(9*millisPerHour,"KST"); fmt.setTimeZone(timeZone);
*
* long time = System.currentTimeMillis(); long span = ( 60 * 60 * 1000
* * 24 ) * day; //하루에 대한 millisecond... long time2 = time + span;
* String str=fmt.format(new java.util.Date(time2));
*
* return str;
*/
String strSYSDATE = CommonUtil.getKST("yyyyMMddHH"); // 지금 시간
String vFORMAT = "yyyy/MM/dd";
return getDatewithSpan(strSYSDATE, day, "D", vFORMAT);
}
public static long stol(String str)
{
if(str == null ) return 0;
return (Long.valueOf(str).longValue());
}
/**
문자열을 특정 문자열을 변환시킨다.
@version 1.0
@author Yoon Su-wan
@since JDK1.0
@param targeter 대상문자열
@param target_str 변환될 대상문자열
@param replace_str 변환될 문자열
@return target_str이 replace_str로 변환된 문자열
*/
public static String getReplacedString(String targeter, String target_str, String replace_str)
{
if( targeter == null
|| target_str == null
|| replace_str == null )
return "debug : parameter value is null";
if(target_str.length() == 0)
return targeter;
StringBuffer str = new StringBuffer();
int start_ptr = 0;
int current_ptr = 0;
int increment_size = replace_str.length();
if(increment_size == 0 ) increment_size = 1;
while((current_ptr = targeter.indexOf(target_str, start_ptr)) != -1)
{
str.append(targeter.substring(start_ptr, current_ptr));
str.append(replace_str);
start_ptr = current_ptr + increment_size;
if(start_ptr >= targeter.length())
break;
}//end while
if(start_ptr == 0)
return targeter;
if(start_ptr < targeter.length())
str.append(targeter.substring(start_ptr));
return str.toString();
}//getReplacedString(String targeter, String target_str, String replace_str)
/**
받은메세지에서 v_s1값을 찾아서 v_s2로 대치한다.
@version 1.0
@author Yoon Su-wan
@since JDK1.0
@param v_msg 대상문자열
@param v_s1 변환될 대상문자열
@param v_s2 변환될 문자열
@return v_s1이 v_s2 변환된 문자열
*/
public static String getReplacedString2(String v_msg, String v_s1, String v_s2)
{
int idx = v_msg.indexOf(v_s1);
if (idx == -1) return v_msg;
else
{
try
{
return v_msg.substring(0, idx) + v_s2 + v_msg.substring(idx+2);
} catch (Exception e)
{
return v_msg.substring(0, idx) + v_s2;
}
}
}
public static String getReplacedString3(String sStr, String n1, String n2)
{
int iTmp = 0;
if (sStr == null) return "";
String sTmp = sStr;
StringBuffer sbSave = new StringBuffer();
sbSave.append("");
while (sTmp.indexOf(n1) > -1)
{
iTmp = sTmp.indexOf(n1);
sbSave.append(sTmp.substring(0,iTmp));
sbSave.append(n2);
sTmp = sTmp.substring(iTmp + n1.length());
}
sbSave.append(sTmp);
return sbSave.toString();
}
public static Vector arrToDouVector(String strArray, String strDelimt)
{
String[] stArray = strArray.split(strDelimt);
double[] dArray = Arrays.stream(stArray).mapToDouble(Double::parseDouble).toArray();
Vector vReturn = new Vector();
if(dArray==null) return vReturn;
for(double dTemp: dArray)
{
vReturn.add(dTemp);
}
return vReturn;
}
public static String arrListToString(List list)
{
String strReturn="";
if(list == null ) return "";
for(int i=0; i<list.size(); i++)
{
String strTemp = list.get(i)+"";
// System.out.println("한번 봅시다=>"+strTemp);
// double dou = Double.parseDouble(strTemp);
// strReturn = strReturn+","+dou;
strReturn = strReturn+","+strTemp;
}
strReturn = strReturn.substring(1);
return strReturn;
}
/**
Map 데이터를 JSONObject로 변환.
@version 1.0
@author Yoon Su-wan
@since JDK1.0
@param v_msg Map
@return JSONObject
*/
public static JSONObject getJsonFromMap(Map<String, Object> map) throws JSONException
{
JSONObject jsonData = new JSONObject();
for (String key : map.keySet())
{
Object value = map.get(key);
if (value instanceof Map<?, ?>)
{
value = getJsonFromMap((Map<String, Object>) value);
}
jsonData.put(key, value);
}
return jsonData;
}
public static TokenInfo getAccessTokenInfo(HttpServletRequest request)
{
TokenInfo tokenInfo = null;
String authorization = request.getHeader(HttpHeaders.AUTHORIZATION);
RemoteTokenServices tokenServices = new RemoteTokenServices();
if(StringUtils.startsWithIgnoreCase(authorization, "Bearer"))
{
/*
* FieldNamingPolicy 옵션
* IDENTITY : 변경 없음
* LOWER_CASE_WITH_DASHES : '-' 붙이기
* LOWER_CASE_WITH_DOTS : '.' 붙이기
* LOWER_CASE_WITH_UNDERSCORES : '_' 붙이기
* UPPER_CAMEL_CASE : 첫문자 대문자로
* UPPER_CAMEL_CASE_WITH_SPACES : 첫문자 대문자 + ' ' 공택붙이기
*
*/
String strTocken = "";
strTocken = StringUtils.replace(authorization, "Bearer ","");
strTocken = StringUtils.replace(authorization, "bearer ","");
Jwt jwt = JwtHelper.decode(strTocken);
// Jwt jwt = JwtHelper.decode(StringUtils.replace(authorization, "Bearer ",""));
// Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).create(); // snakecase to camelcase
Gson gson = new GsonBuilder().setFieldNamingPolicy(FieldNamingPolicy.IDENTITY).create(); // snakecase to camelcase
tokenInfo = gson.fromJson(jwt.getClaims(), TokenInfo.class);
}
return tokenInfo;
}
}

View File

@ -0,0 +1,76 @@
package com.urpsys.kccfbat.common.util;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;
import io.undertow.util.DateUtils;
/**
* 통합자료관리시스펨 공통 유틸리티를 모아둔 클래스
*
* @author 나혁제
* @since 2026.03.03
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2026.03.03 나혁제 최초작성
*
* </pre>
*/
public class CommonUtils
{
/**
* <PRE>
* - PK로 사용 가능한 유니크 생성
* - UUID 32byte + prefix 3byte = 35byte
* </PRE>
*
* @param prefix 생성된 UUID을 구분해줄수 있는 업무코드
* @return 인자값으로 입력된 prefix와 UUID를 합친 문자열 ex)
* LR-356015096E2542779E11C946DB93B952
*/
public static String getUUID(String prefix)
{
return prefix.toUpperCase() + "-" + UUID.randomUUID().toString().toUpperCase().replaceAll("-", "");
}
public static String getUUID()
{
return UUID.randomUUID().toString().toUpperCase().replaceAll("-", "");
}
public static String getFileMask()
{
return getSysDate("yyyyMMddHHmmss") + CommonUtils.getUUID();
}
/**
* 날짜 입력양식을 전달받아 현재 날짜를 반환.
* @param pattern 입력 양식.
* @return String 날짜 입력 양식.
*/
public static String getSysDate(String pattern)
{
return getDateString(new Date(), pattern);
}
/**
* Date 객체와 입력양식을 전달받아 날짜를 반환.
* @param date Date 객체.
* @param pattern 입력 양식.
* @return String 날짜.
*/
public static String getDateString(Date date, String pattern)
{
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return sdf.format(date);
}
}

View File

@ -0,0 +1,113 @@
package com.urpsys.kccfbat.common.util;
import java.sql.Connection;
import javax.sql.DataSource;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.springframework.core.env.Environment;
import org.springframework.core.io.Resource;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import com.urpsys.kccfbat.common.crypto.Aes256Cipher;
import com.urpsys.kccfbat.common.exception.CustomException;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
/**
* Datasource 생성하는 유틸리티
*
* @author 나혁제
* @since 2023.02.28
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2023.02.28 나혁제 최초작성
*
* </pre>
*/
public class DataSourceUtil
{
/**
* 데이터 소스 만드는 메소드
* @param dataSourceName
* @param env
* @param cipher
* @return
*/
public static DataSource createDataSource(String dataSourceName, Environment env, Aes256Cipher cipher)
{
HikariConfig config = new HikariConfig();
config.setDriverClassName (env.getProperty(dataSourceName + ".driverClassName" ));
config.setJdbcUrl (env.getProperty(dataSourceName + ".jdbcUrl" ));
config.setUsername (cipher.decrypt(env.getProperty(dataSourceName + ".username")));
config.setPassword (cipher.decrypt(env.getProperty(dataSourceName + ".password")));
config.setAutoCommit(false);
config.setMaximumPoolSize (Integer.parseInt(env.getProperty(dataSourceName + ".maximumPoolSize" )));
config.setMinimumIdle (Integer.parseInt(env.getProperty(dataSourceName + ".minimumIdle" )));
config.setConnectionTimeout (Long.parseLong (env.getProperty(dataSourceName + ".connectionTimeout" )));
config.setIdleTimeout (Long.parseLong (env.getProperty(dataSourceName + ".idleTimeout" )));
config.addDataSourceProperty("cachePrepStmts" , "true");
config.addDataSourceProperty("prepStmtCacheSize" , "250");
config.addDataSourceProperty("prepStmtCacheSqlLimit" , "2048");
return new HikariDataSource(config);
}
/**
* SqlSessionFactory 만드는 메소드
* @param dataSource
* @param configLocation
* @param mapperLocation
* @return
* @throws CustomException
*/
public static SqlSessionFactory createSqlSessionFactory(DataSource dataSource, Resource configLocation,
Resource[] mapperLocation) throws CustomException
{
SqlSessionFactory sqlSessionFactory;
try {
SqlSessionFactoryBean sessionFactoryBean = new SqlSessionFactoryBean();
sessionFactoryBean.setDataSource(dataSource);
sessionFactoryBean.setConfigLocation(configLocation);
sessionFactoryBean.setMapperLocations(mapperLocation);
sqlSessionFactory = sessionFactoryBean.getObject();
}
catch (Exception ex)
{
throw new CustomException(ex.getMessage());
}
return sqlSessionFactory;
}
/**
* 트랜잭션 처리 메소드
* @param dataSource
* @return
*/
public static DataSourceTransactionManager createTxManager(DataSource dataSource)
{
DataSourceTransactionManager txManager = new DataSourceTransactionManager(dataSource);
txManager.setGlobalRollbackOnParticipationFailure(false);
return txManager;
}
//end method
}

View File

@ -0,0 +1,222 @@
package com.urpsys.kccfbat.common.util;
import java.util.Date;
import org.springframework.http.ResponseEntity;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
/**
* Result Data 처리을 하는 유틸리티
*
* @author 나혁제
* @since 2023.02.28
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2023.02.28 나혁제 최초작성
*
* </pre>
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ResultData
{
private Object data;
private Integer status = 200;
private Integer totalCount;
private String code = "OK";
private String message = "Success";
private Date timestamp = new Date();
/**
*
*/
public ResultData()
{
}
/**
* @param messageOrCode
*/
public ResultData(Object data)
{
this.data = data;
}
/**
* @param messageOrCode
*/
public ResultData(Object data, String code)
{
this.data = data;
this.code = code;
this.message = "";
// this.message = MsgUtil.getMessage(code);
}
/**
* Method Name : setCodeAndMessage
* Description :
*
* @param messageOrCode 지정된 파라미터 값으로 서비스 호출시 사용
* @param params 지정된 파라미터 값으로 서비스 호출시 사용
* @return ResultData
*/
public void setCodeAndMessage(String code, Object... params)
{
this.setCode(code);
this.setMessage("");
// this.setMessage(MsgUtil.getMessage(code, params));
}
/**
* Method Name : ok
* Description :
*
* @param messageOrCode 지정된 파라미터 값으로 서비스 호출시 사용
* @param params 지정된 파라미터 값으로 서비스 호출시 사용
* @return ResultData
*/
public static ResponseEntity<ResultData> ok(Object data)
{
var resultData = new ResultData();
resultData.setData(data);
return ResponseEntity.ok(resultData);
}
/**
* Method Name : ok
* Description :
*
* @param messageOrCode 지정된 파라미터 값으로 서비스 호출시 사용
* @param params 지정된 파라미터 값으로 서비스 호출시 사용
* @return ResultData
*/
public static ResponseEntity<ResultData> ok(ResultData resultData)
{
return ResponseEntity.ok(resultData);
}
/**
* Method Name : ok
* Description :
*
* @param messageOrCode 지정된 파라미터 값으로 서비스 호출시 사용
* @param params 지정된 파라미터 값으로 서비스 호출시 사용
* @return ResultData
*/
public static ResponseEntity<ResultData> ok(int totalCount, Object data)
{
var resultData = new ResultData();
resultData.setData(data);
resultData.setTotalCount(totalCount);
return ResponseEntity.ok(resultData);
}
/**
* Method Name : ok
* Description :
*
* @param messageOrCode 지정된 파라미터 값으로 서비스 호출시 사용
* @param params 지정된 파라미터 값으로 서비스 호출시 사용
* @return ResultData
*/
public static ResponseEntity<ResultData> ok(Object data, String code)
{
var resultData = new ResultData();
resultData.setData(data);
resultData.setCode(code);
resultData.setMessage("");
// resultData.setMessage(MsgUtil.getMessage(code));
return ResponseEntity.ok(resultData);
}
/**
* Method Name : ok
* Description :
*
* @param messageOrCode 지정된 파라미터 값으로 서비스 호출시 사용
* @param params 지정된 파라미터 값으로 서비스 호출시 사용
* @return ResultData
*/
public static ResponseEntity<ResultData> ok(int totalCount, Object data, String code)
{
var resultData = new ResultData();
resultData.setData(data);
resultData.setCode(code);
resultData.setTotalCount(totalCount);
resultData.setMessage("");
// resultData.setMessage(MsgUtil.getMessage(code));
return ResponseEntity.ok(resultData);
}
/**
* Method Name : ok
* Description :
*
* @param messageOrCode 지정된 파라미터 값으로 서비스 호출시 사용
* @param params 지정된 파라미터 값으로 서비스 호출시 사용
* @return ResultData
*/
public static ResponseEntity<ResultData> ok(Object data, String code, Object... params)
{
var resultData = new ResultData();
resultData.setData(data);
resultData.setCode(code);
resultData.setMessage("");
// resultData.setMessage(MsgUtil.getMessage(code, params));
return ResponseEntity.ok(resultData);
}
/**
* Method Name : okMessage
* Description :
*
* @param messageOrCode 지정된 파라미터 값으로 서비스 호출시 사용
* @param params 지정된 파라미터 값으로 서비스 호출시 사용
* @return ResultData
*/
public static ResponseEntity<ResultData> okMessage(String code)
{
var resultData = new ResultData();
resultData.setCode(code);
resultData.setMessage("");
// resultData.setMessage(MsgUtil.getMessage(code));
return ResponseEntity.ok(resultData);
}
/**
* Method Name : okMessage
* Description :
*
* @param messageOrCode 지정된 파라미터 값으로 서비스 호출시 사용
* @param params 지정된 파라미터 값으로 서비스 호출시 사용
* @return ResultData
*/
public static ResponseEntity<ResultData> okMessage(String code, Object... params)
{
var resultData = new ResultData();
resultData.setCode(code);
resultData.setMessage("");
// resultData.setMessage(MsgUtil.getMessage(code, params));
return ResponseEntity.ok(resultData);
}
}

View File

@ -0,0 +1,38 @@
package com.urpsys.kccfbat.config;
import java.io.IOException;
import java.security.InvalidKeyException;
import org.apache.commons.codec.DecoderException;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.urpsys.kccfbat.common.crypto.Aes256Cipher;
/**
* 암호화 유틸리티를 등록하는 클래스
*
* @author 나혁제
* @since 2023.02.28
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2023.02.28 나혁제 최초작성
*
* </pre>
*/
@Configuration
public class EncryptConfig
{
@Bean(name="aes256Cipher")
public Aes256Cipher aes256Cipher() throws InvalidKeyException, IOException, DecoderException
{
return new Aes256Cipher();
}
}

View File

@ -0,0 +1,166 @@
package com.urpsys.kccfbat.config;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpMethod;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
import org.springframework.security.oauth2.provider.token.TokenStore;
import org.springframework.security.oauth2.provider.token.store.JwtAccessTokenConverter;
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
import com.google.gson.Gson;
import kong.unirest.JsonNode;
import kong.unirest.Unirest;
import lombok.extern.slf4j.Slf4j;
import com.urpsys.kccfbat.common.exception.CustomException;
import com.urpsys.kccfbat.domain.CommonVO;
import com.urpsys.kccfbat.domain.JWTKey;
import com.urpsys.kccfbat.service.CommonService;
/**
* Resource 서버 기본세팅
*
* @author 나혁제
* @since 2023.02.28
* @version 1.0.0
* @see
* @comment :
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2023.02.28 나혁제 최초작성
*
* </pre>
*/
@Slf4j
@Configuration
public class Oauth2ResourceConfig extends ResourceServerConfigurerAdapter
{
@Autowired
CommonService commonService; // 공통 서비스
@Override
public void configure(ResourceServerSecurityConfigurer resources) throws Exception
{
resources.resourceId("event"); // 최소한 리소스ID 정도는 설정 필요
}
@Value("${spring.security.oauth2.resourceserver.jwt.jwk-set-uri}")
private String publicKeyUri; // key 정보를 받아오기 위한 인증서버 URL 선언
@Override
public void configure(HttpSecurity http) throws Exception
{
http.authorizeRequests().mvcMatchers("/test/**" ).permitAll(); // test API
http.authorizeRequests().mvcMatchers("/api/**" ).permitAll(); // test API
http.authorizeRequests().mvcMatchers("/server/**" ).permitAll(); // test API
http.authorizeRequests().mvcMatchers("/swagger-resources/**" ).permitAll(); // api 문서 관련
http.authorizeRequests().mvcMatchers("/swagger-ui**" ).permitAll(); // api 문서 관련
http.authorizeRequests().mvcMatchers("/swagger-ui/**" ).permitAll(); // api 문서 관련
http.authorizeRequests().mvcMatchers("/webjars/**" ).permitAll(); // api 문서 관련
http.authorizeRequests().mvcMatchers("/v2/**" ).permitAll(); // api 문서 관련
http.authorizeRequests().mvcMatchers("/swagger/**" ).permitAll(); // api 문서 관련
http.authorizeRequests().anyRequest().authenticated();
}
@Bean
public TokenStore tokenStore()
{
log.info(">>>>>>>>>> Oauth2ResourceConfig tokenStore <<<<<<<<<<");
log.info("<<<<<<<<<< Oauth2ResourceConfig tokenStore >>>>>>>>>>");
return new JwtTokenStore(jwtAccessTokenConverter());
}
@Bean
public JwtAccessTokenConverter jwtAccessTokenConverter()
{
log.info(">>>>>>>>>> Oauth2ResourceConfig jwtAccessTokenConverter <<<<<<<<<<");
try
{
/*** * 직접 oauth 서버를 호출하여 공개키 읽어서 jwt 디코드 키 등록 */
JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
// 보안키 획득
String strPrivKey = getPublicKeyValue(publicKeyUri);
//
if(strPrivKey==null || strPrivKey.equals(""))
{
throw new CustomException("보안키 획득 실패1");
}
converter.setVerifierKey(strPrivKey);
log.info("<<<<<<<<<< Oauth2ResourceConfig jwtAccessTokenConverter >>>>>>>>>>");
return converter;
}
catch (Exception e)
{
log.info("보안키 획득 실패2");
log.info("<<<<<<<<<< Oauth2ResourceConfig jwtAccessTokenConverter >>>>>>>>>>");
return new JwtAccessTokenConverter();
}
}
private String getPublicKeyValue(String uriKey)
{
log.info(">>>>>>>>>> Oauth2ResourceConfig getPublicKeyValue <<<<<<<<<<");
String strReturn = "";
JsonNode response = null;
try
{
response = Unirest.get(uriKey)
.asJson().getBody();
strReturn = response.toString();
}
catch(Exception e)
{
return strReturn;
}
if(StringUtils.isEmpty(strReturn))
{
strReturn ="";
}
else
{
strReturn =new Gson().fromJson(response.toString(), JWTKey.class).getValue();;
}
log.info("<<<<<<<<<< Oauth2ResourceConfig getPublicKeyValue : {} >>>>>>>>>>", strReturn);
return strReturn;
}
}

View File

@ -0,0 +1,124 @@
package com.urpsys.kccfbat.config;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpHeaders;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.AuthorizationScope;
import springfox.documentation.service.GrantType;
import springfox.documentation.service.OAuth;
import springfox.documentation.service.Parameter;
import springfox.documentation.service.ResourceOwnerPasswordCredentialsGrant;
import springfox.documentation.service.SecurityReference;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* API 문서 처리 config 클래스
*
* @author 나혁제
* @since 2023.07.31
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2023.07.31. 나혁제 최초작성
*
* </pre>
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig
{
private static final String API_NAME = "uWorks Test API";
private static final String API_VERSION = "0.0.1";
private static final String API_DESCRIPTION = "uWorks Test API 명세서";
@Bean
public Docket api()
{
Parameter parameterBuilder = new ParameterBuilder()
.name(HttpHeaders.AUTHORIZATION)
.description("Access Tocken")
.modelRef(new ModelRef("string"))
.parameterType("header")
.required(false)
.build();
List<Parameter> globalParamters = new ArrayList<>();
globalParamters.add(parameterBuilder);
return new Docket(DocumentationType.SWAGGER_2)
.globalOperationParameters(globalParamters)
.apiInfo(apiInfo())
// .ignoredParameterTypes(AuthPrincipal.class)
.select()
.apis(RequestHandlerSelectors.basePackage("com.urpsys.baseapi"))
.paths(PathSelectors.any())
.build()
.securityContexts(Collections.singletonList(securityContext()))
.securitySchemes(Arrays.asList(securitySchema()))
;
}
public ApiInfo apiInfo()
{
return new ApiInfoBuilder()
.title(API_NAME)
.version(API_VERSION)
.description(API_DESCRIPTION)
.build();
}
private SecurityContext securityContext()
{
return SecurityContext.builder()
.securityReferences(defaultAuth())
.build();
}
private List<SecurityReference> defaultAuth()
{
final AuthorizationScope[] authorizationScopes = new AuthorizationScope[]
{
new AuthorizationScope("read", "read all"),
new AuthorizationScope("write", "write all")
};
return Collections.singletonList(new SecurityReference("oauth2", authorizationScopes));
}
private OAuth securitySchema()
{
final List<AuthorizationScope> authorizationScopeList = new ArrayList<>(2);
authorizationScopeList.add(new AuthorizationScope("read", "read all"));
authorizationScopeList.add(new AuthorizationScope("write", "access all"));
final List<GrantType> grantTypes = new ArrayList<>(1);
// 토큰 end point (http://localhost:3000/oauth/token)
grantTypes.add(new ResourceOwnerPasswordCredentialsGrant("http://localhost:9011/oauth/token"));
return new OAuth("oauth2", authorizationScopeList, grantTypes);
}
}

View File

@ -0,0 +1,112 @@
package com.urpsys.kccfbat.config;
import java.io.IOException;
import java.sql.Connection;
import javax.sql.DataSource;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.urpsys.kccfbat.common.crypto.Aes256Cipher;
import com.urpsys.kccfbat.common.exception.CustomException;
import com.urpsys.kccfbat.common.util.DataSourceUtil;
/**
* iams(통합자료관리시스템) db config 클래스
*
* @author 나혁제
* @since 2026.02.24
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2026.02.24 나혁제 최초작성
*
* </pre>
*/
@Configuration
@EnableTransactionManagement
@MapperScan(value="com.urpsys.kccfbat.iams.dao", sqlSessionFactoryRef="iamsSqlSessionFactory")
public class iamsDbConfig
{
@Autowired
private Environment env;
@Autowired
private Aes256Cipher aes256Cipher;
/**
* 데이터소스 등록하는 메소드
* @return
*/
@Bean(name="iamsDataSource")
public DataSource iamsDataSource()
{
return new LazyConnectionDataSourceProxy(DataSourceUtil.createDataSource("iamsdb", env, aes256Cipher));
}
/**
* sqlsessionfactory 등록하는 메소드
*
* @param dataSource
* @param context
* @return
* @throws SchedulerException
* @throws IOException
*/
@Bean(name="iamsSqlSessionFactory")
public SqlSessionFactory iamsSqlSessionFactory( @Qualifier("iamsDataSource") DataSource dataSource
, ApplicationContext context)
throws CustomException, IOException
{
SqlSessionFactory sqlSessionFactory = DataSourceUtil.createSqlSessionFactory( dataSource
, context.getResource ("classpath:mapper/iamsdb/config/MybatisIamsConfig.xml")
, context.getResources("classpath:mapper/iamsdb/sqlmap/**/*Mapper*.xml")
);
sqlSessionFactory.getConfiguration().setDefaultExecutorType(ExecutorType.SIMPLE);
return sqlSessionFactory;
}
/**
* sqlsessiontemplate 등록하는 메소드
* @param primarySqlSessionFactory
* @return
*/
@Bean("iamsSqlSessionTemplate")
public SqlSessionTemplate mainSqlSessionTemplate(@Qualifier("iamsSqlSessionFactory") SqlSessionFactory iamsSqlSessionFactory)
{
return new SqlSessionTemplate(iamsSqlSessionFactory);
}
/**
* 트랜잭션 매니저 등록하는 메소드
* @param dataSource
* @return
*/
@Bean(name="iamsTxManager")
public PlatformTransactionManager primaryTxManager(@Qualifier("iamsDataSource") DataSource dataSource)
{
return DataSourceUtil.createTxManager(dataSource);
}
}

View File

@ -0,0 +1,112 @@
package com.urpsys.kccfbat.config;
import java.io.IOException;
import java.sql.Connection;
import javax.sql.DataSource;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import org.springframework.jdbc.datasource.LazyConnectionDataSourceProxy;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.urpsys.kccfbat.common.crypto.Aes256Cipher;
import com.urpsys.kccfbat.common.exception.CustomException;
import com.urpsys.kccfbat.common.util.DataSourceUtil;
/**
* ncms(자산관리시스템) db config 클래스
*
* @author 나혁제
* @since 2026.02.24
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2026.02.24 나혁제 최초작성
*
* </pre>
*/
@Configuration
@EnableTransactionManagement
@MapperScan(value="com.urpsys.kccfbat.ncms.dao", sqlSessionFactoryRef="ncmsSqlSessionFactory")
public class ncmsDbConfig
{
@Autowired
private Environment env;
@Autowired
private Aes256Cipher aes256Cipher;
/**
* 데이터소스 등록하는 메소드
* @return
*/
@Bean(name="ncmsDataSource")
public DataSource iamsDataSource()
{
return new LazyConnectionDataSourceProxy(DataSourceUtil.createDataSource("ncmsdb", env, aes256Cipher));
}
/**
* sqlsessionfactory 등록하는 메소드
*
* @param dataSource
* @param context
* @return
* @throws SchedulerException
* @throws IOException
*/
@Bean(name="ncmsSqlSessionFactory")
public SqlSessionFactory ncmsSqlSessionFactory( @Qualifier("ncmsDataSource") DataSource dataSource
, ApplicationContext context)
throws CustomException, IOException
{
SqlSessionFactory sqlSessionFactory = DataSourceUtil.createSqlSessionFactory( dataSource
, context.getResource ("classpath:mapper/ncmsdb/config/MybatisNcmsConfig.xml")
, context.getResources("classpath:mapper/ncmsdb/sqlmap/**/*Mapper*.xml")
);
sqlSessionFactory.getConfiguration().setDefaultExecutorType(ExecutorType.SIMPLE);
return sqlSessionFactory;
}
/**
* sqlsessiontemplate 등록하는 메소드
* @param primarySqlSessionFactory
* @return
*/
@Bean("ncmsSqlSessionTemplate")
public SqlSessionTemplate mainSqlSessionTemplate(@Qualifier("ncmsSqlSessionFactory") SqlSessionFactory ncmsSqlSessionFactory)
{
return new SqlSessionTemplate(ncmsSqlSessionFactory);
}
/**
* 트랜잭션 매니저 등록하는 메소드
* @param dataSource
* @return
*/
@Bean(name="ncmsTxManager")
public PlatformTransactionManager ncmsTxManager(@Qualifier("ncmsDataSource") DataSource dataSource)
{
return DataSourceUtil.createTxManager(dataSource);
}
}

View File

@ -0,0 +1,52 @@
package com.urpsys.kccfbat.domain;
public class CommonVO
{
private String val1 ; // test1
private String val2 ; // test1
private String val3 ; // test1
private String val4 ; // test1
private String val5 ; // test1
public String getVal1() {
return val1;
}
public void setVal1(String val1) {
this.val1 = val1;
}
public String getVal2() {
return val2;
}
public void setVal2(String val2) {
this.val2 = val2;
}
public String getVal3() {
return val3;
}
public void setVal3(String val3) {
this.val3 = val3;
}
public String getVal4() {
return val4;
}
public void setVal4(String val4) {
this.val4 = val4;
}
public String getVal5() {
return val5;
}
public void setVal5(String val5) {
this.val5 = val5;
}
}

View File

@ -0,0 +1,24 @@
package com.urpsys.kccfbat.domain;
import org.springframework.util.StringUtils;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Data
public class JWTKey
{
String alg = "";
String value = "";
public String getValue()
{
if (!StringUtils.isEmpty(value))
{
return value;
}
return "";
}
}

View File

@ -0,0 +1,46 @@
package com.urpsys.kccfbat.domain;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@Data
public class TokenInfo
{
private String userName;
private String clientId;
private String strMEM_ID;
private String strPWD;
private String strPWD_HINT;
private String strPWD_RANS;
private String strRRNO;
private String strMEM_NM;
private String strZIP_NO;
private String strADDR;
private String strREGN_NO;
private String strMEM_STACD;
private String strADDR2;
private String strEND_TELNO;
private String strMOVE_TELNO;
private String strGRP_ID;
private String strMEM_FAX_NO;
private String strMEM_EML_ADDR;
private String strMDL_TELNO;
private String strJOIN_DTM;
private String strSEX_CD;
private String strESNTL_ID;
private String strLOCK_AT;
private String strLOCK_NCNT;
private String strLAST_CHG_DTM;
private String strLAST_PWD_CHG_DTM;
private String userSe;
private String orgnztId;
private List<String> authorities;
}

View File

@ -0,0 +1,49 @@
package com.urpsys.kccfbat.iams.dao;
import java.util.LinkedHashMap;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import com.urpsys.kccfbat.domain.CommonVO;
/**
* 자산관리시스템에 대한 DAO 클래스를 정의
*
* @author urp 인프라본부 나혁제
* @since 2026.02.25
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2026.02.25 나혁제 최초작성
*
* </pre>
*/
@Mapper
@Repository
public interface IamsDataDao
{
// 기존이관자료 여부 확인
public String selectExistMaster(String strIn) throws Exception;
// 자료 마스터 테이블 입력처리
public int insertRgMaster(LinkedHashMap<String, Object> inMap) throws Exception;
// file 정보 입력처리
public int insertJattchfile(LinkedHashMap<String, Object> inMap) throws Exception;
// uac 정보 입력처리
public int insertUareMaster(LinkedHashMap<String, Object> inMap) throws Exception;
// 자료건 정보 입력처리
public int insertUacRecord(LinkedHashMap<String, Object> inMap) throws Exception;
}

View File

@ -0,0 +1,18 @@
package com.urpsys.kccfbat.ncms.dao;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import com.urpsys.kccfbat.domain.CommonVO;
@Mapper
@Repository
public interface CommonDao
{
public String selectTest1(String strVal1); // TestCode1
public CommonVO selectTest2(String strVal1); // TestCode2
}

View File

@ -0,0 +1,57 @@
package com.urpsys.kccfbat.ncms.dao;
import java.util.LinkedHashMap;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import com.urpsys.kccfbat.domain.CommonVO;
/**
* 자산관리시스템에 대한 DAO 클래스를 정의
*
* @author urp 인프라본부 나혁제
* @since 2026.02.25
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2026.02.25 나혁제 최초작성
*
* </pre>
*/
@Mapper
@Repository
public interface NcmsDataDao
{
// 이관대상 멀티미디어 자산 조회
public List<LinkedHashMap<String, Object>> selectMultimediaAssets() throws Exception;
// culter_resource 추출
public LinkedHashMap<String, Object> selectCulterResource(String strIn) throws Exception;
// media 추출
public List<LinkedHashMap<String, Object>> selectMedia(String strIn) throws Exception;
// 유형값 찾기
public String selectTypeDivCd(int iIn) throws Exception;
// 관리부서 찾기
public String selectMngOrgCd(int iIn) throws Exception;
// 관리부서명 찾기
public String selectMngOrgNm(int iIn) throws Exception;
// 결과값 반경
public int updateResultMultimediaAssets(LinkedHashMap<String, Object> inMap) throws Exception;
}

View File

@ -0,0 +1,60 @@
package com.urpsys.kccfbat;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import com.urpsys.kccfbat.common.util.CommonUtil;
/**
* Resource 서버 기본 실행 클래스1
*
* @author 나혁제
* @since 2026.02.24
* @version 1.0.0
* @see
*
* <pre>
*
* << 개정이력(Modification information) >>
*
* 수정일 수정자 수정내용
* ----------- --------- ------------------------
* 2026.02.24 나혁제 최초작성
*
* </pre>
*/
@SpringBootApplication
@EnableScheduling
@ComponentScan(basePackages = {"com.urpsys.kccfbat"})
public class ncmsToIamsDataTransApplication
{
public static void main(String[] args)
{
String activeProfile = (CommonUtil.nvl(System.getProperty("spring.profiles.active")));
if(activeProfile.equals("local"))
{
System.out.println("################################################");
System.out.println("############# local Env ########################");
System.out.println("################################################");
}
else if(activeProfile.equals("ncms_server"))
{
System.out.println("################################################");
System.out.println("############# ncms_server Env ##################");
System.out.println("################################################");
}
else
{
System.out.println("################################################");
System.out.println("############# No Define ########################");
System.out.println("################################################");
}
SpringApplication.run(ncmsToIamsDataTransApplication.class, args);
}
}

View File

@ -0,0 +1,70 @@
package com.urpsys.kccfbat.scheduler;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.urpsys.kccfbat.ncms.dao.NcmsDataDao;
import com.urpsys.kccfbat.service.NcmsDataService;
import com.urpsys.kccfbat.service.NcmsToIamsDataTransService;
import lombok.extern.slf4j.Slf4j;
/**
* 자료이관처리 스케쥴러 클래스
* @author urp 인프라본부 나혁제
* @since 2026.02.25
* @version 1.0
* @see
*
* <pre>
* << 개정이력(Modification Information) >>
*
* 수정일 수정자 수정내용
* ---------- -------- ---------------------------
* 2026.02.25 나혁제 최초 생성
*
* </pre>
*
*/
@Slf4j
@Component
public class ConsoleScheduler
{
@Autowired
NcmsToIamsDataTransService ncmsToIamsDataTransService;
NcmsDataService ncmsDataService;
@Scheduled(cron = "1 * * * * *")
public void NcmsToIamsDataTranMain ()
{
log.info(">>>>>>>>>>>>>>> NcmsToIamsDataTranMain <<<<<<<<<<<<<<<");
// ams => 통합자료관리 시스템 데이터이관
try
{
ncmsToIamsDataTransService.processNcmsToIamsDataTrans();
}
catch(Exception e)
{
e.printStackTrace();
log.error("데이터 이관중 오류 발생[{}] ", e);
}
log.info("<<<<<<<<<<<<<<< NcmsToIamsDataTranMain >>>>>>>>>>>>>>>");
}
}

View File

@ -0,0 +1,35 @@
package com.urpsys.kccfbat.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.urpsys.kccfbat.domain.CommonVO;
import com.urpsys.kccfbat.ncms.dao.CommonDao;
@Service
@Transactional
public class CommonService
{
@Autowired
CommonDao commonDao;
// TestCode1
public String selectTest1(String strVal1)
{
return commonDao.selectTest1(strVal1);
}
// TestCode2
public CommonVO selectTest2(String strVal1)
{
return commonDao.selectTest2(strVal1);
}
}

View File

@ -0,0 +1,92 @@
package com.urpsys.kccfbat.service;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.LinkedHashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.urpsys.kccfbat.iams.dao.IamsDataDao;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Service
public class IamsDataService
{
@Autowired
IamsDataDao iamsDataDao;
@Value("${file.fileCpYn}")
private String strFileCpYn; // 파일처리여부
// 멀티미디어 자산 조회
public String selectExistMaster(String strIn) throws Exception
{
return iamsDataDao.selectExistMaster(strIn);
}
@Transactional(value = "iamsTxManager")
public int processIams( LinkedHashMap<String, Object> inRgMaster
, LinkedHashMap<String, Object> inUacRecord
, List<LinkedHashMap<String, Object>> inJFile
, List<LinkedHashMap<String, Object>> inUareMaster
) throws Exception
{
// 파일처리 부터 먼저 시작
// 1. 원본 File, 복사할 File 준비
for( LinkedHashMap<String, Object> mapUare : inUareMaster)
{
log.info(" ncms_full_file_path [{}]", mapUare.get("ncms_full_file_path"));
log.info(" iams_full_file_path [{}]", mapUare.get("iams_full_file_path"));
if(strFileCpYn.equals("Y"))
{
File file = new File((String)mapUare.get("ncms_full_file_path"));
File newFile = new File((String)mapUare.get("iams_full_file_path"));
Files.copy(file.toPath(), newFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
}
}
int iRgRet = iamsDataDao.insertRgMaster (inRgMaster );
int iRgRet2 = iamsDataDao.insertUacRecord(inUacRecord);
for( LinkedHashMap<String, Object> mapUare : inUareMaster)
{
log.info(" f_id [{}]", mapUare.get("f_id"));
log.info(" length [{}]", mapUare.get("length"));
log.info(" ncms_full_file_path [{}]", mapUare.get("ncms_full_file_path"));
log.info(" iams_full_file_path [{}]", mapUare.get("iams_full_file_path"));
}
// j_attachfile 처리
for(LinkedHashMap<String, Object> inMap : inJFile)
{
int iJFRet = iamsDataDao.insertJattchfile(inMap);
}
// uare_master 처리
for(LinkedHashMap<String, Object> inMap : inUareMaster)
{
int iJFRet = iamsDataDao.insertUareMaster(inMap);
}
return iRgRet;
}
// 자료 마스터 테이블 입력처리
public int insertRgMaster(LinkedHashMap<String, Object> inMap) throws Exception
{
return iamsDataDao.insertRgMaster(inMap);
}
}

View File

@ -0,0 +1,67 @@
package com.urpsys.kccfbat.service;
import java.util.LinkedHashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.urpsys.kccfbat.ncms.dao.NcmsDataDao;
@Service
@Transactional(value = "ncmsTxManager")
public class NcmsDataService
{
@Autowired
NcmsDataDao ncmsDataDao;
// 멀티미디어 자산 조회
public List<LinkedHashMap<String, Object>> selectMultimediaAssets() throws Exception
{
return ncmsDataDao.selectMultimediaAssets();
}
// culter_resource 추출
public LinkedHashMap<String, Object> selectCulterResource(String strIn) throws Exception
{
return ncmsDataDao.selectCulterResource(strIn);
}
// media 추출
public List<LinkedHashMap<String, Object>> selectMedia(String strIn) throws Exception
{
return ncmsDataDao.selectMedia(strIn);
}
// 유형값 찾기
public String selectTypeDivCd(int iIn) throws Exception
{
return ncmsDataDao.selectTypeDivCd(iIn);
}
// 관리부서 찾기
public String selectMngOrgCd(int iIn) throws Exception
{
return ncmsDataDao.selectMngOrgCd(iIn);
}
// 관리부서 찾기
public String selectMngOrgNm(int iIn) throws Exception
{
return ncmsDataDao.selectMngOrgNm(iIn);
}
// 결과값 반경
public int updateResultMultimediaAssets(LinkedHashMap<String, Object> inMap) throws Exception
{
return ncmsDataDao.updateResultMultimediaAssets(inMap);
}
}

View File

@ -0,0 +1,558 @@
package com.urpsys.kccfbat.service;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.urpsys.kccfbat.common.util.CommonUtil;
import com.urpsys.kccfbat.common.util.CommonUtils;
import com.urpsys.kccfbat.ncms.dao.NcmsDataDao;
import com.urpsys.kccfbat.scheduler.ConsoleScheduler;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Service
public class NcmsToIamsDataTransService
{
@Autowired
NcmsDataService ncmsDataService;
@Autowired
IamsDataService iamsDataService;
@Value("${file.ncms.basefolder}")
private String strNcmsBaseFolder; // ncms base folder
@Value("${file.iams.basefolder}")
private String strIcmsBaseFolder; // icms base folder
@Value("${file.fileCpYn}")
private String strFileCpYn; // icms base folder
// 데이터 이관작업
public void processNcmsToIamsDataTrans() throws Exception
{
log.info(" >>>>> processNcmsToIamsDataTrans <<<<< ");
int iNcmsTransAllCnt = 0; // 이관대상 전체 건수
int iNcmsTransSkipCnt = 0; // 이관대상 Skip 대상 건수
// 이관대상 데이터 추출
List<LinkedHashMap<String, Object>> nCmsList = ncmsDataService.selectMultimediaAssets();
// 이관대상이 없는 경우
if(nCmsList == null || nCmsList.size()==0) return;
iNcmsTransAllCnt += nCmsList.size();
for(LinkedHashMap<String, Object> ncmsDataMap : nCmsList )
{
LinkedHashMap<String, Object> inMultiResultMap = new LinkedHashMap<String, Object>();
String strMultiId = ncmsDataMap.get("id")+"";
// 이관완료여부 체크
String strRgYn = iamsDataService.selectExistMaster(strMultiId);
log.info(" 기존이관여부 확인 [{}] ", strRgYn);
// 이관자료가 있는경우 Skip
if(strRgYn.equals("Y"))
{
inMultiResultMap.put("iams_tran_yn" , "Y");
inMultiResultMap.put("iams_tran_remark" , "이미 이관처리 완료된 자료");
inMultiResultMap.put("id" , strMultiId );
ncmsDataService.updateResultMultimediaAssets(inMultiResultMap);
continue;
}
String strCulterResourceId = ncmsDataMap.get("culture_resource_id")+"";
LinkedHashMap<String, Object> mapCulterResources = ncmsDataService.selectCulterResource(strCulterResourceId);
List<LinkedHashMap<String, Object>> listMedia = ncmsDataService.selectMedia(strMultiId);
// 기초자료가 없는경우 Skip
if(mapCulterResources == null || mapCulterResources.get("id") == null || mapCulterResources.get("id").equals(""))
{
inMultiResultMap.put("iams_tran_yn" , "Y");
inMultiResultMap.put("iams_tran_remark" , "CulterResources 자료없음");
inMultiResultMap.put("id" , strMultiId );
ncmsDataService.updateResultMultimediaAssets(inMultiResultMap);
continue;
}
LinkedHashMap<String, Object> inRgMaster = new LinkedHashMap<String, Object>(); // 자료 마스터 정보
LinkedHashMap<String, Object> inUacRecord = new LinkedHashMap<String, Object>(); // 자료 정보
List<LinkedHashMap<String, Object>> inJFile = new ArrayList(); // 파일정보
List<LinkedHashMap<String, Object>> inUareMaster = new ArrayList(); // 클라우드 파일정보
// ncmsDataMap : multimedia_assets
// mapCulterResources : culter_resources
String strMasterId = CommonUtils.getUUID("UR");
String keyword = CommonUtil.nvl(mapCulterResources.get("keywords"));
keyword = keyword.replaceAll("\"", "");
keyword = keyword.replaceAll("\\[", "");
keyword = keyword.replaceAll("\\]", "");
String creat_yyyy="";
if( isLong(CommonUtil.nvl(mapCulterResources.get("genyear"))) )
{
creat_yyyy = CommonUtil.nvl(mapCulterResources.get("genyear"))+"0101";
}
int iCouncilId = Long.valueOf((long)mapCulterResources.get("council_id")).intValue();
String type_div_cd = ncmsDataService.selectTypeDivCd((int)ncmsDataMap.get("major_category_id"));
// iams rg_master 세팅
inRgMaster.put("master_id" , strMasterId );
inRgMaster.put("use_flag" , "Y" );
inRgMaster.put("set_id" , CommonUtils.getUUID("SE") );
inRgMaster.put("reg_status" , "REG_ING" );
inRgMaster.put("title" , (String)ncmsDataMap.get("title") );
inRgMaster.put("keyword" , keyword );
inRgMaster.put("type_div_cd" , type_div_cd );
inRgMaster.put("erecord_flag" , "2" );
inRgMaster.put("org_nm" , (String)ncmsDataMap.get("publisher") );
inRgMaster.put("creat_yyyy" , creat_yyyy );
inRgMaster.put("presv_term_cd" , "10" );
inRgMaster.put("expt_disuse_yyyy" , "2031" );
inRgMaster.put("oper_read_range_cd" , "01" );
inRgMaster.put("open_div_cd" , "1" );
inRgMaster.put("reg_id" , "U1000000000" );
inRgMaster.put("mod_id" , "U1000000000" );
inRgMaster.put("mng_org_cd" , ncmsDataService.selectMngOrgCd(iCouncilId) );
inRgMaster.put("page_cnt" , ncmsDataMap.get("total_page_count")+"" );
inRgMaster.put("series_id" , "0" );
inRgMaster.put("digital_yn" , "N" );
inRgMaster.put("oper_out_range_cd" , "01" );
inRgMaster.put("mng_org_nm" , ncmsDataService.selectMngOrgNm(iCouncilId) );
inRgMaster.put("asset_type" , "문화원소장" );
inRgMaster.put("tag" , keyword );
inRgMaster.put("management_code" , "KCCF" );
inRgMaster.put("interface_id" , (long)ncmsDataMap.get("culture_resource_id")+"" );
inRgMaster.put("set_no" , strMultiId );
inRgMaster.put("digital_read_yn" , "Y" );
inRgMaster.put("prsvn_proc_trgt_yn" , "N" );
// 자료건 정보 처리
inUacRecord.put("record_id", strMasterId);
inUacRecord.put("type_div_cd", type_div_cd);
// 파일처리
String orgThumbnail2 = CommonUtil.nvl(ncmsDataMap.get("thumbnail2"));
String orgThumbnail_manual = CommonUtil.nvl(ncmsDataMap.get("thumbnail_manual"));
String thumbnail2 = getFileName(orgThumbnail2);
String thumbnail_manual = getFileName(orgThumbnail_manual);
log.info(" orgThumbnail2 [{}]", orgThumbnail2);
log.info(" orgThumbnail_manual [{}]", orgThumbnail_manual);
log.info(" thumbnail2 [{}]", thumbnail2);
log.info(" thumbnail_manual [{}]", thumbnail_manual);
LinkedHashMap<String, Object> mapJFile = new LinkedHashMap<String, Object>();
LinkedHashMap<String, Object> mapUareMaster = new LinkedHashMap<String, Object>();
int iSeq=1;
// thumbnail_manual 파일처리
if(!orgThumbnail2.equals(""))
{
String strNcmsFileFullPath = strNcmsBaseFolder + "/" + orgThumbnail2;
String strFileMask = CommonUtils.getFileMask();
Path path = Paths.get(strNcmsFileFullPath);
long lFileSize = 0;
if(strFileCpYn.equals("Y"))
{
lFileSize = Files.size(path);
}
mapJFile = new LinkedHashMap<String, Object>();
mapJFile.put("file_mask" , strFileMask );
mapJFile.put("file_id" , strMasterId);
mapJFile.put("file_seq" , iSeq);
mapJFile.put("file_name" , thumbnail2);
mapJFile.put("file_size" , lFileSize+"");
mapJFile.put("download_count" , "0");
mapJFile.put("atch_type_cd" , "image");
mapJFile.put("digital_read_yn" , "Y");
String strCurFullTime = CommonUtil.getKST("yyyyMMddHHmmss");
String strCurDate = CommonUtil.getKST("yyyyMMdd");
String strCurTime = CommonUtil.getKST("HHmmss");
String strFid = CommonUtil.getKST("yyyy") +"-"+strMultiId+"-"+iSeq;
mapUareMaster = new LinkedHashMap<String, Object>();
mapUareMaster.put("f_id" , strFid);
mapUareMaster.put("org_name" , thumbnail2);
mapUareMaster.put("volume_id" , "VOL001");
mapUareMaster.put("v_seq" , "0000");
mapUareMaster.put("length" , lFileSize+"");
mapUareMaster.put("comp_yn" , "N");
mapUareMaster.put("encrypt_yn" , "N");
mapUareMaster.put("org_date" , strCurDate);
mapUareMaster.put("reg_date" , strCurDate);
mapUareMaster.put("reg_time" , strCurTime);
mapUareMaster.put("commit_stat" , "1");
mapUareMaster.put("session_key" , "473640583");
mapUareMaster.put("reg_user_id" , "uac");
mapUareMaster.put("file_key" , strFileMask);
mapUareMaster.put("f_group" , "1");
mapUareMaster.put("f_index" , iSeq);
mapUareMaster.put("bef_commit_stat", "0");
String strIameFileFullDir = strIcmsBaseFolder
+ "/" + strCurFullTime.substring(0,4)
+ "/" + strCurFullTime.substring(4,6)
+ "/" + strCurFullTime.substring(6,8)
+ "/" + strCurFullTime.substring(8,10)
+ "/" + "0000"
;
String strIameFileFullPath = strIameFileFullDir +"/"+strFid+"."+getFileExt(orgThumbnail2);
// 폴더생성
File file = new File(strIameFileFullDir);
Files.createDirectories(file.toPath());
mapUareMaster.put("ncms_full_file_path", strNcmsFileFullPath );
mapUareMaster.put("iams_full_file_path", strIameFileFullPath );
log.info(" lFileSize [{}]", lFileSize);
log.info(" strNcmsFileFullPath [{}]", strNcmsFileFullPath);
log.info(" strIameFileFullPath [{}]", strIameFileFullPath);
inJFile .add(mapJFile );
inUareMaster.add(mapUareMaster);
iSeq++;
}
// thumbnail_manual 파일처리
if(!orgThumbnail_manual.equals(""))
{
String strNcmsFileFullPath = strNcmsBaseFolder + "/" + orgThumbnail_manual;
String strFileMask = CommonUtils.getFileMask();
Path path = Paths.get(strNcmsFileFullPath);
long lFileSize = 0;
if(strFileCpYn.equals("Y"))
{
lFileSize = Files.size(path);
}
mapJFile = new LinkedHashMap<String, Object>();
mapJFile.put("file_mask" , strFileMask );
mapJFile.put("file_id" , strMasterId);
mapJFile.put("file_seq" , iSeq);
mapJFile.put("file_name" , thumbnail_manual);
mapJFile.put("file_size" , lFileSize+"");
mapJFile.put("download_count" , "0");
mapJFile.put("atch_type_cd" , "image");
mapJFile.put("digital_read_yn" , "Y");
String strCurFullTime = CommonUtil.getKST("yyyyMMddHHmmss");
String strCurDate = CommonUtil.getKST("yyyyMMdd");
String strCurTime = CommonUtil.getKST("HHmmss");
String strFid = CommonUtil.getKST("yyyy") +"-"+strMultiId+"-"+iSeq;
mapUareMaster = new LinkedHashMap<String, Object>();
mapUareMaster.put("f_id" , strFid);
mapUareMaster.put("org_name" , thumbnail_manual);
mapUareMaster.put("volume_id" , "VOL001");
mapUareMaster.put("v_seq" , "0000");
mapUareMaster.put("length" , lFileSize+"");
mapUareMaster.put("comp_yn" , "N");
mapUareMaster.put("encrypt_yn" , "N");
mapUareMaster.put("org_date" , strCurDate);
mapUareMaster.put("reg_date" , strCurDate);
mapUareMaster.put("reg_time" , strCurTime);
mapUareMaster.put("commit_stat" , "1");
mapUareMaster.put("session_key" , "473640583");
mapUareMaster.put("reg_user_id" , "uac");
mapUareMaster.put("file_key" , strFileMask);
mapUareMaster.put("f_group" , "1");
mapUareMaster.put("f_index" , iSeq);
mapUareMaster.put("bef_commit_stat", "0");
String strIameFileFullDir = strIcmsBaseFolder
+ "/" + strCurFullTime.substring(0,4)
+ "/" + strCurFullTime.substring(4,6)
+ "/" + strCurFullTime.substring(6,8)
+ "/" + strCurFullTime.substring(8,10)
+ "/" + "0000"
;
String strIameFileFullPath = strIameFileFullDir +"/"+strFid+"."+getFileExt(orgThumbnail_manual);
// 폴더생성
File file = new File(strIameFileFullDir);
Files.createDirectories(file.toPath());
mapUareMaster.put("ncms_full_file_path", strNcmsFileFullPath );
mapUareMaster.put("iams_full_file_path", strIameFileFullPath );
inJFile .add(mapJFile );
inUareMaster.add(mapUareMaster);
iSeq++;
}
// media 처리
for( LinkedHashMap<String, Object> mapMedia : listMedia)
{
long lCulter = (long)mapCulterResources .get("id");
long lMulti = (long)ncmsDataMap .get("id");
long iMe = (long)mapMedia .get("id");
String strNcmsFileFullPath = getFixPath(lCulter, lMulti, iMe , (String)mapMedia.get("collection_name"))+"/"+ mapMedia.get("file_name");
String strFileMask = CommonUtils.getFileMask();
Path path = Paths.get(strNcmsFileFullPath);
mapJFile = new LinkedHashMap<String, Object>();
mapJFile.put("file_mask" , strFileMask );
mapJFile.put("file_id" , strMasterId);
mapJFile.put("file_seq" , iSeq);
mapJFile.put("file_name" , (String)mapMedia.get("file_name"));
mapJFile.put("file_size" , mapMedia.get("size")+"");
mapJFile.put("download_count" , "0");
mapJFile.put("atch_type_cd" , getAtchTypeCd((String)mapMedia.get("collection_name")));
mapJFile.put("digital_read_yn" , "Y");
String strCurFullTime = CommonUtil.getKST("yyyyMMddHHmmss");
String strCurDate = CommonUtil.getKST("yyyyMMdd");
String strCurTime = CommonUtil.getKST("HHmmss");
String strFid = CommonUtil.getKST("yyyy") +"-"+strMultiId+"-"+iSeq;
mapUareMaster = new LinkedHashMap<String, Object>();
mapUareMaster.put("f_id" , strFid);
mapUareMaster.put("org_name" , (String)mapMedia.get("file_name"));
mapUareMaster.put("volume_id" , "VOL001");
mapUareMaster.put("v_seq" , "0000");
mapUareMaster.put("length" , mapMedia.get("size")+"");
mapUareMaster.put("comp_yn" , "N");
mapUareMaster.put("encrypt_yn" , "N");
mapUareMaster.put("org_date" , strCurDate);
mapUareMaster.put("reg_date" , strCurDate);
mapUareMaster.put("reg_time" , strCurTime);
mapUareMaster.put("commit_stat" , "1");
mapUareMaster.put("session_key" , "473640583");
mapUareMaster.put("reg_user_id" , "uac");
mapUareMaster.put("file_key" , strFileMask);
mapUareMaster.put("f_group" , "1");
mapUareMaster.put("f_index" , iSeq);
mapUareMaster.put("bef_commit_stat", "0");
mapUareMaster.put("repository" , "");
mapUareMaster.put("clipid" , "");
mapUareMaster.put("offset" , "0");
String strIameFileFullDir = strIcmsBaseFolder
+ "/" + strCurFullTime.substring(0,4)
+ "/" + strCurFullTime.substring(4,6)
+ "/" + strCurFullTime.substring(6,8)
+ "/" + strCurFullTime.substring(8,10)
+ "/" + "0000"
;
String strIameFileFullPath = strIameFileFullDir +"/"+strFid+"."+getFileExt((String)mapMedia.get("file_name"));
// 폴더생성
File file = new File(strIameFileFullDir);
Files.createDirectories(file.toPath());
mapUareMaster.put("ncms_full_file_path", strNcmsFileFullPath );
mapUareMaster.put("iams_full_file_path", strIameFileFullPath );
inJFile .add(mapJFile );
inUareMaster.add(mapUareMaster);
iSeq++;
}
log.info(" mapUareMaster [{}]", mapUareMaster.toString());
int iSucc = iamsDataService.processIams(inRgMaster, inUacRecord, inJFile, inUareMaster);
if(iSucc>0)
{
inMultiResultMap.put("iams_tran_yn" , "Y");
inMultiResultMap.put("iams_tran_remark" , "이관완료");
inMultiResultMap.put("id" , strMultiId );
inMultiResultMap.put("iams_tran_master_id" , strMasterId );
}
else
{
inMultiResultMap.put("iams_tran_yn" , "X" );
inMultiResultMap.put("iams_tran_remark" , "이관실패" );
inMultiResultMap.put("id" , strMultiId );;
}
ncmsDataService.updateResultMultimediaAssets(inMultiResultMap);
}
log.info(" <<<<< processNcmsToIamsDataTrans >>>>> ");
}
// 데이터 이관작업
public LinkedHashMap<String, Object> iamsDataSetting(LinkedHashMap<String, Object> ncmsDataMap ) throws Exception
{
LinkedHashMap<String, Object> returnMap = new LinkedHashMap<String, Object>();
returnMap.put("MASTER_ID", CommonUtils.getUUID("UR"));
return returnMap;
}
public String getFileName(String strOrgFileName)
{
String strReFileName ="";
int iLastIndex = strOrgFileName.lastIndexOf("/");
if(iLastIndex < 0)
{
strReFileName = strOrgFileName;
}
else
{
strReFileName = strOrgFileName.substring(iLastIndex+1);
}
return strReFileName;
}
public String getFileExt(String strOrgFileName)
{
String strReFileExt ="";
int iLastIndex = strOrgFileName.lastIndexOf(".");
if(iLastIndex < 0)
{
strReFileExt = "";
}
else
{
strReFileExt = strOrgFileName.substring(iLastIndex+1);
}
return strReFileExt;
}
public String getAtchTypeCd(String collection_name)
{
String strReAtchTypeCd = "";
if(collection_name.equals("media_images"))
{
strReAtchTypeCd = "image";
}
else if(collection_name.equals("media_videos"))
{
strReAtchTypeCd = "videos";
}
else if(collection_name.equals("media_audios"))
{
strReAtchTypeCd = "audios";
}
else if(collection_name.equals("media_pdfs"))
{
strReAtchTypeCd = "doc";
}
else if(collection_name.equals("media_3ds"))
{
strReAtchTypeCd = "3d";
}
return strReAtchTypeCd;
}
public String getFixPath(long lculterResourceId, long lMaId, long lMediaId, String collection_name)
{
long iFreFolder = lculterResourceId%250;
String strFixPath = "";
String strFullFixPath = "";
if(collection_name.equals("media_images"))
{
strFixPath = "multimedia_assets";
}
else if(collection_name.equals("media_videos"))
{
strFixPath = "videos";
}
else if(collection_name.equals("media_audios"))
{
strFixPath = "audios";
}
else if(collection_name.equals("media_pdfs"))
{
strFixPath = "pdfs";
}
else if(collection_name.equals("media_3ds"))
{
strFixPath = "3ds";
}
if(collection_name.equals("media_images"))
{
strFullFixPath = strNcmsBaseFolder
+ "/" + strFixPath
+ "/" + iFreFolder
+ "/" + lMaId
+ "/" + lMediaId
;
}
else
{
strFullFixPath = strNcmsBaseFolder
+ "/" + strFixPath
+ "/" + iFreFolder
+ "/" + lMaId
;
}
return strFullFixPath;
}
public static boolean isLong(String strValue)
{
try
{
Long.parseLong(strValue);
return true;
}
catch (NumberFormatException ex)
{
return false;
}
}
}

View File

@ -0,0 +1,67 @@
# Service port
server:
port: 9002
# JPA 설정, JSP 설정
spring:
devtools:
livereload:
enabled: true
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER
# 인증서버에서 JWT 보안키 확인
security:
oauth2:
resourceserver:
jwt:
jwk-set-uri:
http://localhost:9001/oauth/token_key
# Primary db information
ncmsdb:
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
jdbcUrl: jdbc:log4jdbc:mysql://192.168.8.138:3307/kccfnova?characterEncoding=UTF-8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true
username: yT4l55I/Xl4v8LeoTQhh1w==
password: aqmsYeReTVvoQ4r2bfAjYg==
maximumPoolSize: 35
minimumIdle: 2
connectionTimeout: 3000
idleTimeout: 300000
testOnBorrow: true
validationQuery: SELECT 1
iamsdb:
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
jdbcUrl: jdbc:log4jdbc:mysql://192.168.8.138:3307/uac_cltr_db?characterEncoding=UTF-8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true
username: kSLzt543nkDJ/ta9rnLTCA==
password: kSLzt543nkDJ/ta9rnLTCA==
maximumPoolSize: 35
minimumIdle: 2
connectionTimeout: 3000
idleTimeout: 300000
testOnBorrow: true
validationQuery: SELECT 1
# SQL Log 관련 setting
log4jdbc:
spylogdelegator:
name: net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
dump:
sql:
maxlinelength: 0
logging.level.jdbc.sqlonly: info
logging.level.jdbc.sqltiming: false
logging.level.jdbc.audit: false
logging.level.jdbc.resultset: false
logging.level.jdbc.resultsettable: info
logging.level.jdbc.connection: false
file:
ncms:
basefolder : D:/z_temp_pro/kccf_temp
iams:
basefolder : D:/z_temp_pro/kccf_temp/repo
fileCpYn : N

View File

@ -0,0 +1,67 @@
# Service port
server:
port: 9002
# JPA 설정, JSP 설정
spring:
devtools:
livereload:
enabled: true
mvc:
pathmatch:
matching-strategy: ANT_PATH_MATCHER
# 인증서버에서 JWT 보안키 확인
security:
oauth2:
resourceserver:
jwt:
jwk-set-uri:
http://localhost:9001/oauth/token_key
# Primary db information
ncmsdb:
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
jdbcUrl: jdbc:log4jdbc:mysql://127.0.0.1:3306/kccfnova?characterEncoding=UTF-8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true
username: yT4l55I/Xl4v8LeoTQhh1w==
password: aqmsYeReTVvoQ4r2bfAjYg==
maximumPoolSize: 35
minimumIdle: 2
connectionTimeout: 3000
idleTimeout: 300000
testOnBorrow: true
validationQuery: SELECT 1
iamsdb:
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
jdbcUrl: jdbc:log4jdbc:mysql://10.10.30.237:3306/uac_cltr_db?characterEncoding=UTF-8&serverTimezone=Asia/Seoul&rewriteBatchedStatements=true
username: kSLzt543nkDJ/ta9rnLTCA==
password: kSLzt543nkDJ/ta9rnLTCA==
maximumPoolSize: 35
minimumIdle: 2
connectionTimeout: 3000
idleTimeout: 300000
testOnBorrow: true
validationQuery: SELECT 1
# SQL Log 관련 setting
log4jdbc:
spylogdelegator:
name: net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
dump:
sql:
maxlinelength: 0
logging.level.jdbc.sqlonly: info
logging.level.jdbc.sqltiming: false
logging.level.jdbc.audit: false
logging.level.jdbc.resultset: false
logging.level.jdbc.resultsettable: info
logging.level.jdbc.connection: false
file:
ncms:
basefolder : /nfs_nas/minio/amsweb-opt
iams:
basefolder : /nfs_nas/uac/repo
fileCpYn : Y

View File

@ -0,0 +1,2 @@
log4jdbc.spylogdelegator.name = net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator
log4jdbc.dump.sql.maxlinelength=0

View File

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration>
<contextName>${HOSTNAME}</contextName>
<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level %logger{36} - %msg%n
</Pattern>
</encoder>
</appender>
<!--
<root level="error">
<appender-ref ref="consoleAppender" />
</root>
<logger name="TRACE_LOGGER" level="error" additivity="false">
<appender-ref ref="consoleAppender" />
</logger>
-->
<root level="info">
<appender-ref ref="consoleAppender" />
</root>
<logger name="TRACE_LOGGER" level="info" additivity="false">
<appender-ref ref="consoleAppender" />
</logger>
<!-- 일단 사용하지 않음 -->
<!--
<property name="LOG_DIR" value="/var/log/LAMP" />
<springProfile name="!local">
<appender name="rollingFileAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</encoder>
<file>${LOG_DIR}/${HOSTNAME}_server.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_DIR}/${HOSTNAME}_server.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>200MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>10</maxHistory>
</rollingPolicy>
</appender>
<appender name="asyncAppender" class="ch.qos.logback.classic.AsyncAppender">
<discardingThreshold>0</discardingThreshold>
<queueSize>10000</queueSize>
<appender-ref ref="rollingFileAppender" />
</appender>
<appender name="traceRollingFileAppend" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<Pattern>%msg%n</Pattern>
</encoder>
<file>${LOG_DIR}/${HOSTNAME}_trace.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_DIR}/${HOSTNAME}_trace.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>200MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>10</maxHistory>
</rollingPolicy>
</appender>
<appender name="traceLogAppend" class="ch.qos.logback.classic.AsyncAppender">
<discardingThreshold>0</discardingThreshold>
<queueSize>10000</queueSize>
<appender-ref ref="traceRollingFileAppend" />
</appender>
<root level="info">
<appender-ref ref="asyncAppender" />
</root>
<logger name="TRACE_LOGGER" level="info" additivity="false">
<appender-ref ref="traceLogAppend" />
</logger>
</springProfile>
-->
</Configuration>

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting name="jdbcTypeForNull" value="NULL"/>
<setting name="defaultStatementTimeout" value="1800"/>
<setting name="callSettersOnNulls" value="true"/>
<setting name="defaultFetchSize" value="1000" />
<setting name="mapUnderscoreToCamelCase" value="true"/>
</settings>
<!--
<typeAliases>
<typeAlias alias="UserVO" type="com.gdsc.ImgEd.domain.UserVO" />
<typeAlias alias="ImageInfoVO" type="com.gdsc.ImgEd.domain.ImageInfoVO" />
<typeAlias alias="ImageMetaVO" type="com.gdsc.ImgEd.domain.ImageMetaVO" />
<typeAlias alias="IspnMngInfoVO" type="com.gdsc.ImgEd.domain.IspnMngInfoVO" />
<typeAlias alias="IspnMngInfo2VO" type="com.gdsc.ImgEd.domain.IspnMngInfo2VO" />
<typeAlias alias="IspnMngInfo4VO" type="com.gdsc.ImgEd.domain.IspnMngInfo4VO" />
<typeAlias alias="IspnMngInfo5VO" type="com.gdsc.ImgEd.domain.IspnMngInfo5VO" />
</typeAliases>
-->
<typeAliases>
<!--
<typeAlias alias="CommonVO" type="com.urpsys.baseapi.domain.CommonVO" />
-->
</typeAliases>
</configuration>

View File

@ -0,0 +1,185 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.urpsys.kccfbat.iams.dao.IamsDataDao">
<select id="selectExistMaster" parameterType="String" resultType="String">
<![CDATA[
/* IcmsDataDao.selectExistMaster */
select if(count(1)>0, 'Y', 'N') as bexist
from rg_master
where set_no =#{strSetNo}
]]>
</select>
<insert id="insertRgMaster" parameterType="java.util.LinkedHashMap">
insert into rg_master
(
master_id
, use_flag
, set_id
, reg_status
, title
, keyword
, type_div_cd
, erecord_flag
, org_nm
, creat_yyyy
, presv_term_cd
, expt_disuse_yyyy
, oper_read_range_cd
, open_div_cd
, reg_id
, reg_dd
, mod_id
, mod_dd
, mng_org_cd
, page_cnt
, series_id
, digital_yn
, oper_out_range_cd
, mng_org_nm
, asset_type
, tags
, management_code
, interface_id
, set_no
, digital_read_yn
, prsvn_proc_trgt_yn
, dtls_type_div_cd
)
values
(
#{master_id }
, #{use_flag }
, #{set_id }
, #{reg_status }
, #{title }
, #{keyword }
, #{type_div_cd }
, #{erecord_flag }
, #{org_nm }
, #{creat_yyyy }
, #{presv_term_cd }
, #{expt_disuse_yyyy }
, #{oper_read_range_cd }
, #{open_div_cd }
, #{reg_id }
, sysdate()
, #{mod_id }
, sysdate()
, #{mng_org_cd }
, #{page_cnt }
, #{series_id }
, #{digital_yn }
, #{oper_out_range_cd }
, #{mng_org_nm }
, #{asset_type }
, #{tag }
, #{management_code }
, #{interface_id }
, #{set_no }
, #{digital_read_yn }
, #{prsvn_proc_trgt_yn }
, ''
)
</insert>
<insert id="insertJattchfile" parameterType="java.util.LinkedHashMap">
insert into j_attachfile
(
file_mask
, file_id
, file_seq
, file_name
, file_size
, download_count
, atch_type_cd
, digital_read_yn
)
values
(
#{file_mask }
, #{file_id }
, #{file_seq }
, #{file_name }
, #{file_size }
, #{download_count }
, #{atch_type_cd }
, #{digital_read_yn }
)
</insert>
<insert id="insertUareMaster" parameterType="java.util.LinkedHashMap">
insert into uare_master
(
f_id
, org_name
, volume_id
, v_seq
, length
, comp_yn
, encrypt_yn
, org_date
, reg_date
, reg_time
, commit_stat
, session_key
, reg_user_id
, file_key
, f_group
, f_index
, bef_commit_stat
, repository
, clipid
, offset
)
values
(
#{f_id }
, #{org_name }
, #{volume_id }
, #{v_seq }
, #{length }
, #{comp_yn }
, #{encrypt_yn }
, #{org_date }
, #{reg_date }
, #{reg_time }
, #{commit_stat }
, #{session_key }
, #{reg_user_id }
, #{file_key }
, #{f_group }
, #{f_index }
, #{bef_commit_stat }
, #{repository }
, #{clipid }
, #{offset }
)
</insert>
<insert id="insertUacRecord" parameterType="java.util.LinkedHashMap">
insert into uac_record
(
record_id
, type_div_cd
, book_spcm_cpy_yn
)
values
(
#{record_id }
, #{type_div_cd }
, 'N'
)
</insert>
</mapper>

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<settings>
<setting name="jdbcTypeForNull" value="NULL"/>
<setting name="defaultStatementTimeout" value="1800"/>
<setting name="callSettersOnNulls" value="true"/>
<setting name="defaultFetchSize" value="1000" />
<setting name="mapUnderscoreToCamelCase" value="true"/>
</settings>
<!--
<typeAliases>
<typeAlias alias="UserVO" type="com.gdsc.ImgEd.domain.UserVO" />
<typeAlias alias="ImageInfoVO" type="com.gdsc.ImgEd.domain.ImageInfoVO" />
<typeAlias alias="ImageMetaVO" type="com.gdsc.ImgEd.domain.ImageMetaVO" />
<typeAlias alias="IspnMngInfoVO" type="com.gdsc.ImgEd.domain.IspnMngInfoVO" />
<typeAlias alias="IspnMngInfo2VO" type="com.gdsc.ImgEd.domain.IspnMngInfo2VO" />
<typeAlias alias="IspnMngInfo4VO" type="com.gdsc.ImgEd.domain.IspnMngInfo4VO" />
<typeAlias alias="IspnMngInfo5VO" type="com.gdsc.ImgEd.domain.IspnMngInfo5VO" />
</typeAliases>
-->
<typeAliases>
<typeAlias alias="CommonVO" type="com.urpsys.kccfbat.domain.CommonVO" />
</typeAliases>
</configuration>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.urpsys.kccfbat.ncms.dao.CommonDao">
<select id="selectTest1" parameterType="String" resultType="String">
<![CDATA[
select '1' as val1
]]>
</select>
<select id="selectTest2" parameterType="String" resultType="CommonVO">
<![CDATA[
select 'value01' as val1
, 'value02' as val2
, 'value03' as val3
, 'value04' as val4
, 'value05' as val5
]]>
</select>
</mapper>

View File

@ -0,0 +1,243 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.urpsys.kccfbat.ncms.dao.NcmsDataDao">
<select id="selectMultimediaAssets" resultType="java.util.LinkedHashMap">
<![CDATA[
/* icmsDataDao.selectMultimediaAssets */
select
id
, culture_resource_addinfo_id
, major_category_id
, minor_category_id
, asset_type
, management_code
, content_type_id
, org_file
, reg_file
, is_series
, series_no
, is_open
, is_original_open
, closed_reason
, closed_reason_desc
, title
, subtitle
, thumbnail
, tags_old
, keywords_old
, description
, additional_desc
, province
, city
, address
, latitude
, longitude
, council_code
, published_year
, publisher
, author
, supplier
, source_category_id
, source_name
, copyright
, copyright_manage_dept
, third_party_copyright
, preservation_period
, licence_id
, website_name
, is_available_link
, link_checkup_date
, full_url
, short_url
, encoding_status
, is_cms_send
, topic_group
, deleted_at
, created_at
, updated_at
, reg_file2
, opt_file
, thumbnail2
, thumbnail_manual
, generated_at
, file_size
, volume
, total_page_count
, isbn
, width
, height
, alt
, caption
, is_use_subtitles
, org_subtitle_file
, reg_subtitle_file
, subtitle_text
, is_3d
, exif_shooting_date
, 재생시간
, codec
, is_card_news
, sort_order
, is_main_image
, asset_link
, culture_resource_id
, ocr_text_file
, ocr_split_page_num
, is_ocr_complete
, table_of_contents
, pdf_abstract
, asset_media_type_id
, province_id
, city_id
, is_used
, is_checked
, need_thumbnail_copy
, thumbnail_src
, need_asset_move
, old_id
from multimedia_assets a
where (iams_tran_yn is null or iams_tran_yn = '')
and deleted_at is null
and id ='132041'
limit 1;
]]>
</select>
<select id="selectCulterResource" parameterType="String" resultType="java.util.LinkedHashMap">
<![CDATA[
/* ncmsDataDao.selectCulterResource */
select
id
, council
, idx
, major
, minor
, title
, volume
, author
, publisher
, genyear
, amount
, province
, city
, category
, keywords
, count
, have_file
, need_digital
, `desc`
, location
, worker
, worked_at
, mh
, deleted_at
, content_user_groups
, content_user_types
, created_at
, updated_at
, scan1
, writer_select
, major_category_id
, minor_category_id
, subject_id
, child_subject_id
, council_id
, category_id
, local_culture_id
, asset_type_id
, parent_theme_id
, theme_id
, content_user_type_id
, content_user_group_id
, age_id
, chronological_start_id
, chronological_end_id
, thumbnail
, thumbnail_copyright
from culture_resources a
where a.id = #{culture_resource_id}
]]>
</select>
<select id="selectMedia" parameterType="String" resultType="java.util.LinkedHashMap">
<![CDATA[
/* ncmsDataDao.selectMedia */
select
id
, model_type
, model_id
, collection_name
, name
, file_name
, mime_type
, disk
, size
, manipulations
, custom_properties
, responsive_images
, order_column
, created_at
, updated_at
from media a
where a.model_id = #{culture_resource_id}
]]>
</select>
<select id="selectTypeDivCd" parameterType="int" resultType="String">
<![CDATA[
select case when code = 'A' then 'IT_BOOK' -- 도서간행물
when code = 'B' then 'IT_DOC' -- 문서
when code = 'C' then 'IT_PHOTO' -- 시청각물
when code = 'D' then 'IT_MAP' -- 도안
when code = 'E' then 'IT_MUSE' -- 박물
when code = 'F' then 'IT_ETC' -- 기타
when code = 'G' then 'IT_WEB' -- 웹정보자료
when code = 'H' then 'IT_TEXT' -- 원고
else 'X'
end as type_div_cd
from categories
where id = #{id}
]]>
</select>
<!-- 관리부서 찾기 -->
<select id="selectMngOrgCd" parameterType="int" resultType="String">
<![CDATA[
select a.code
from councils a
where id = #{id}
]]>
</select>
<!-- 관리부서명 찾기 -->
<select id="selectMngOrgNm" parameterType="int" resultType="String">
<![CDATA[
select a.name
from councils a
where id = #{id}
]]>
</select>
<!-- 결과값 처리 -->
<update id="updateResultMultimediaAssets" parameterType="java.util.LinkedHashMap">
/* ncmsDataDao.updateResultMultimediaAssets */
update multimedia_assets
SET iams_tran_yn = #{iams_tran_yn}
, iams_tran_dt = sysdate()
, iams_tran_remark = #{iams_tran_remark}
, iams_tran_master_id = #{iams_tran_master_id}
WHERE id = #{id}
</update>
</mapper>

View File

@ -0,0 +1 @@
aes256.key=52f48aa1c7435bc11bf909d9d7d1d5932f4bacd8184ec5c1eed6d03ee17fe126

View File

@ -0,0 +1,6 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
여기는 body test jsp

View File

@ -0,0 +1,38 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
response.setHeader("Cache-Control","no-store");
response.setHeader("Pragma","no-cache");
response.setDateHeader("Expires",0);
if (request.getProtocol().equals("HTTP/1.1")) response.setHeader("Cache-Control", "no-cache");
%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>이미지 편집 시스템</title>
<!--<meta name="viewport" content="width=device-width, initial-scale=1.0">-->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
</head>
<body>
<section class="content">
여기는 base-main.jsp
<tiles:insertAttribute name="header"/> <!-- /WEB-INF/views/common/layout/header.jsp -->
<tiles:insertAttribute name="body"/> <!-- body -->
<tiles:insertAttribute name="footer"/> <!-- /WEB-INF/views/common/layout/footer.jsp -->
</section>
</body>
</html>

View File

@ -0,0 +1,10 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<div>
<footer>
여기는 footer
</footer>
</div>
</body>
</html>

View File

@ -0,0 +1,32 @@
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>GDSC 이미지 저장 시스템</title>
<link rel="stylesheet" type="text/css" href="${ctx}/css/default.css"><!--기본-->
<link rel="stylesheet" type="text/css" href="${ctx}/css/content.css"><!-- 서브 -->
<link rel="stylesheet" type="text/css" href="${ctx}/css/colorbox.css"><!-- 레이어팝업 -->
<script type="text/javascript" charset="utf-8" src="${ctx}/js/jquery-2.2.3.min.js"></script><!-- 기본 -->
<script type="text/javascript" charset="utf-8" src="${ctx}/js/jquery.colorbox.js"></script> <!-- 레이어팝업 -->
</head>
<div id="wapper">
<header>
<div class="gnb_inner">
여기는 header jsp
</div>
</header>
</div>

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
"http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
<tiles-definitions>
<!-- main -->
<definition name="main-layout" template="/WEB-INF/jsp/tilesLayout/base-main.jsp">
<put-attribute name="header" value="/WEB-INF/jsp/tilesLayout/header.jsp" />
<put-attribute name="body" value="" />
<put-attribute name="footer" value="/WEB-INF/jsp/tilesLayout/footer.jsp" />
</definition>
<definition name="tiles/*" extends="main-layout">
<put-attribute name="body" value="/WEB-INF/jsp/{1}.jsp" />
</definition>
<definition name="tiles/*/*" extends="main-layout">
<put-attribute name="body" value="/WEB-INF/jsp/{1}/{2}.jsp" />
</definition>
<definition name="tiles/*/*/*" extends="main-layout">
<put-attribute name="body" value="/WEB-INF/jsp/{1}/{2}/{3}.jsp" />
</definition>
</tiles-definitions>