first commit

This commit is contained in:
2026-02-11 12:34:31 +09:00
commit e6465021b5
26 changed files with 2236 additions and 0 deletions

3
.gitattributes vendored Normal file
View File

@@ -0,0 +1,3 @@
/gradlew text eol=lf
*.bat text eol=crlf
*.jar binary

37
.gitignore vendored Normal file
View File

@@ -0,0 +1,37 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
### VS Code ###
.vscode/

64
build.gradle Normal file
View File

@@ -0,0 +1,64 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.5.7'
id 'io.spring.dependency-management' version '1.1.7'
}
group = 'com.kri.pcsi'
version = '0.0.1-SNAPSHOT'
description = 'pcsi_send_notice'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
def giteaUser = findProperty("giteaUser") ?: ""
def giteaToken = findProperty("giteaToken") ?: ""
repositories {
mavenCentral()
maven {
name = "gitea"
url = uri("https://gitea.kric.com/api/packages/KRi/maven")
//allowInsecureProtocol = true
credentials {
username = giteaUser
password = giteaToken
}
}
}
dependencies {
implementation "com.kri.common:starter:beta.1.0.63"
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.11"
implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:3.0.5'
implementation 'com.microsoft.sqlserver:mssql-jdbc:12.8.1.jre11' // 버전은 환경 맞춰 조정
runtimeOnly "com.mysql:mysql-connector-j"
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter-test:3.0.5'
testImplementation 'org.springframework.security:spring-security-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
tasks.named('test') {
useJUnitPlatform()
}

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

251
gradlew vendored Normal file
View File

@@ -0,0 +1,251 @@
#!/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.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# 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/HEAD/platforms/jvm/plugins-application/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
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# 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="\\\"\\\""
# 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
if ! command -v java >/dev/null 2>&1
then
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
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
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
# 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"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# 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" "$@"

94
gradlew.bat vendored Normal file
View File

@@ -0,0 +1,94 @@
@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
@rem SPDX-License-Identifier: Apache-2.0
@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=.
@rem This is normally unused
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% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 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!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

1198
logs/app.log Normal file

File diff suppressed because it is too large Load Diff

1
settings.gradle Normal file
View File

@@ -0,0 +1 @@
rootProject.name = 'send_notice'

View File

@@ -0,0 +1,37 @@
package com.kri.pcsi.send_notice;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
@Slf4j
@SpringBootApplication(exclude = {
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration.class,
org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration.class
})
public class PcsiSendNoticeApplication {
public static void main(String[] args) {
SpringApplication.run(PcsiSendNoticeApplication.class, args);
}
@Bean
ApplicationRunner dsCheck(ApplicationContext ctx) {
return args -> {
String[] names = ctx.getBeanNamesForType(javax.sql.DataSource.class);
log.info("DataSource beans = {}", java.util.Arrays.toString(names));
for (String n : names) {
Object ds = ctx.getBean(n);
log.info(" - {} = {}", n, ds.getClass().getName());
if (ds instanceof com.zaxxer.hikari.HikariDataSource hk) {
log.info(" jdbcUrl=" + hk.getJdbcUrl());
log.info(" driver=" + hk.getDriverClassName());
}
}
};
}
}

View File

@@ -0,0 +1,47 @@
package com.kri.pcsi.send_notice.config;
import org.apache.ibatis.logging.stdout.StdOutImpl;
import org.apache.ibatis.session.Configuration;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import javax.sql.DataSource;
@org.springframework.context.annotation.Configuration
@MapperScan(
basePackages = "com.kri.pcsi.send_notice.mapper.cati", // SampleMapper가 있는 패키지
sqlSessionTemplateRef = "catiSqlSessionTemplate"
)
public class CatiMyBatisConfig {
@Bean(name = "catiSqlSessionFactory")
public org.apache.ibatis.session.SqlSessionFactory catiSqlSessionFactory(
@Qualifier("catiDataSource") DataSource catiDataSource,
ApplicationContext applicationContext
) throws Exception {
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
bean.setDataSource(catiDataSource);
// XML 쓰면 주석 해제 + 경로 맞추기
bean.setMapperLocations(applicationContext.getResources("classpath:/mybatis/mapper/cati/**/*.xml"));
// 공통 mybatis 설정(기존 yml 설정과 동일 효과)
Configuration mybatisConfig = new Configuration();
mybatisConfig.setMapUnderscoreToCamelCase(true);
mybatisConfig.setLogImpl(StdOutImpl.class);
bean.setConfiguration(mybatisConfig);
return bean.getObject();
}
@Bean(name = "catiSqlSessionTemplate")
public SqlSessionTemplate catiSqlSessionTemplate(
@Qualifier("catiSqlSessionFactory") org.apache.ibatis.session.SqlSessionFactory sf
) {
return new SqlSessionTemplate(sf);
}
}

View File

@@ -0,0 +1,53 @@
package com.kri.pcsi.send_notice.config;
import com.zaxxer.hikari.HikariDataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import javax.sql.DataSource;
@Configuration
public class DataSourceConfig {
// =========================
// CATI (Primary)
// =========================
@Bean(name = "catiDataSourceProperties")
@Primary
@ConfigurationProperties(prefix = "app.datasource.cati-db")
public DataSourceProperties catiDataSourceProperties() {
return new DataSourceProperties();
}
@Bean(name = "catiDataSource")
@Primary
public DataSource catiDataSource(
@Qualifier("catiDataSourceProperties") DataSourceProperties props
) {
return props.initializeDataSourceBuilder()
.type(HikariDataSource.class)
.build();
}
// =========================
// PPURIO
// =========================
@Bean(name = "ppurioDataSourceProperties")
@ConfigurationProperties(prefix = "app.datasource.ppurio-db")
public DataSourceProperties ppurioDataSourceProperties() {
return new DataSourceProperties();
}
@Bean(name = "ppurioDataSource")
public DataSource ppurioDataSource(
@Qualifier("ppurioDataSourceProperties") DataSourceProperties props
) {
return props.initializeDataSourceBuilder()
.type(HikariDataSource.class)
.build();
}
}

View File

@@ -0,0 +1,46 @@
package com.kri.pcsi.send_notice.config;
import org.apache.ibatis.logging.stdout.StdOutImpl;
import org.apache.ibatis.session.Configuration;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import javax.sql.DataSource;
@org.springframework.context.annotation.Configuration
@MapperScan(
basePackages = "com.kri.pcsi.send_notice.mapper.ppurio",
sqlSessionTemplateRef = "ppurioSqlSessionTemplate"
)
public class PpurioMyBatisConfig {
@Bean(name = "ppurioSqlSessionFactory")
public org.apache.ibatis.session.SqlSessionFactory ppurioSqlSessionFactory(
@Qualifier("ppurioDataSource") DataSource ppurioDataSource,
ApplicationContext applicationContext
) throws Exception {
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
bean.setDataSource(ppurioDataSource);
// XML 쓰면 주석 해제 + 경로 맞추기
bean.setMapperLocations(applicationContext.getResources("classpath:/mybatis/mapper/ppurio/**/*.xml"));
Configuration mybatisConfig = new Configuration();
mybatisConfig.setMapUnderscoreToCamelCase(true);
mybatisConfig.setLogImpl(StdOutImpl.class);
bean.setConfiguration(mybatisConfig);
return bean.getObject();
}
@Bean(name = "ppurioSqlSessionTemplate")
public SqlSessionTemplate ppurioSqlSessionTemplate(
@Qualifier("ppurioSqlSessionFactory") org.apache.ibatis.session.SqlSessionFactory sf
) {
return new SqlSessionTemplate(sf);
}
}

View File

@@ -0,0 +1,29 @@
package com.kri.pcsi.send_notice.config;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import javax.sql.DataSource;
@Configuration
public class TxManagerConfig {
@Bean(name = "catiTxManager")
@Primary
public PlatformTransactionManager catiTxManager(
@Qualifier("catiDataSource") DataSource catiDataSource
) {
return new DataSourceTransactionManager(catiDataSource);
}
@Bean(name = "ppurioTxManager")
public PlatformTransactionManager ppurioTxManager(
@Qualifier("ppurioDataSource") DataSource ppurioDataSource
) {
return new DataSourceTransactionManager(ppurioDataSource);
}
}

View File

@@ -0,0 +1,77 @@
package com.kri.pcsi.send_notice.entity.cati;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class TSampleEntity {
private Long id; // id (numeric(8,0), NOT NULL)
private Long telCnt; // tel_cnt (numeric(10,0), NOT NULL)
private String telLocal; // tel_local (varchar(20), NOT NULL)
private String telKuk; // tel_kuk (varchar(20), NOT NULL)
private String telNo; // tel_no (varchar(20), NOT NULL)
private String telAllno2; // tel_allno2 (varchar(20), NULL)
private String telAllno3; // tel_allno3 (varchar(20), NULL)
private String aq01; // aq01 (varchar(10), NULL)
private String aq02; // aq02 (varchar(10), NULL)
private String aq03; // aq03 (varchar(10), NULL)
private String aq04; // aq04 (varchar(10), NULL)
private String aq05; // aq05 (varchar(10), NULL)
private String aq06; // aq06 (varchar(10), NULL)
private String aq07; // aq07 (varchar(10), NULL)
private String rAq01; // r_aq01 (varchar(10), NULL)
private String rAq02; // r_aq02 (varchar(10), NULL)
private String rAq03; // r_aq03 (varchar(10), NULL)
private String rAq04; // r_aq04 (varchar(10), NULL)
private String rAq05; // r_aq05 (varchar(10), NULL)
private String rAq06; // r_aq06 (varchar(10), NULL)
private String rAq07; // r_aq07 (varchar(10), NULL)
private String telEtc1; // tel_etc1 (varchar(1500), NULL)
private String telEtc2; // tel_etc2 (varchar(1500), NULL)
private String telEtc3; // tel_etc3 (varchar(1500), NULL)
private String telEtc4; // tel_etc4 (varchar(1500), NULL)
private String telEtc5; // tel_etc5 (varchar(1500), NULL)
private String telEtc6; // tel_etc6 (varchar(1500), NULL)
private String telEtc7; // tel_etc7 (varchar(5000), NULL)
private String telEtc8; // tel_etc8 (varchar(5000), NULL)
private String telEtc9; // tel_etc9 (varchar(5000), NULL)
private String telEtc10; // tel_etc10 (varchar(5000), NULL)
private String telEtc11; // tel_etc11 (varchar(5000), NULL)
private String telEtc12; // tel_etc12 (varchar(5000), NULL)
private String telEtc13; // tel_etc13 (varchar(5000), NULL)
private String telEtc14; // tel_etc14 (varchar(5000), NULL)
private String telEtc15; // tel_etc15 (varchar(5000), NULL)
private String telEtc16; // tel_etc16 (varchar(20), NULL)
private String telEtc17; // tel_etc17 (varchar(20), NULL)
private String telEtc18; // tel_etc18 (varchar(20), NULL)
private String telEtc19; // tel_etc19 (varchar(20), NULL)
private String telEtc20; // tel_etc20 (varchar(20), NULL)
private Integer telUser; // tel_user (int, NULL)
private Integer telStat; // tel_stat (int, NULL)
private Integer telStatTmp1; // tel_stat_tmp1 (int, NULL)
private Integer telStatTmp2; // tel_stat_tmp2 (int, NULL)
private Integer telStatTmp3; // tel_stat_tmp3 (int, NULL)
private String telDate; // tel_date (varchar(10), NULL)
private String telSTime; // tel_s_time (varchar(8), NULL)
private String telETime; // tel_e_time (varchar(8), NULL)
private String prjCode; // prj_code (varchar(20), NOT NULL)
private Integer pdsCampaignId; // pds_campaign_id (int, NULL)
private String guidKey; // guid_key (uniqueidentifier, NULL)
private String resMemo; // res_memo (varchar(1000), NULL)
private String etcMemo; // etc_memo (varchar(1000), NULL)
private String telMemo; // tel_memo (varchar(30), NULL)
}

View File

@@ -0,0 +1,47 @@
package com.kri.pcsi.send_notice.entity.ppurio;
import lombok.*;
import java.time.LocalDateTime;
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BizMsgEntity {
private String cmid;
private String umid;
private Integer msgType;
private Integer status;
private String callStatus;
private LocalDateTime requestTime;
private LocalDateTime sendTime;
private LocalDateTime reportTime;
private String destPhone;
private String destName;
private String sendPhone;
private String sendName;
private String subject;
private String msgBody;
private String nationCode;
private String senderKey;
private String templateCode;
private String responseMethod;
private String timeout;
private String reType;
private String reBody;
private String rePart;
private Integer coverFlag;
private Integer smsFlag;
private Integer replyFlag;
private Integer retryCnt;
private String attachedFile;
private String vxmlFile;
private Integer usePage;
private Integer useTime;
private Integer snResult;
private String telInfo;
private String cinfo;
private String userKey;
private String adFalg;
}

View File

@@ -0,0 +1,12 @@
package com.kri.pcsi.send_notice.mapper.cati;
import com.kri.pcsi.send_notice.entity.cati.TSampleEntity;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SampleMapper {
List<TSampleEntity> selectSampleWithPrjCode(
@Param("prjCode") String prjCode
);
}

View File

@@ -0,0 +1,38 @@
package com.kri.pcsi.send_notice.scheduler;
import com.kri.pcsi.send_notice.entity.cati.TSampleEntity;
import com.kri.pcsi.send_notice.service.DbPingService;
import com.kri.pcsi.send_notice.service.TestService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import java.util.List;
@Slf4j
@Service
@RequiredArgsConstructor
public class TestScheduler {
private final DbPingService dbPingService;
private final TestService testService;
@Scheduled(fixedDelay = 60 * 1_000) // 60초마다
public void dbConnectionTest() {
boolean catiOk = dbPingService.pingCati();
boolean ppurioOk = dbPingService.pingPpurio();
log.info("DB connection test result => CATI: {}, PPURIO: {}",
catiOk ? "OK" : "FAIL",
ppurioOk ? "OK" : "FAIL"
);
}
@Scheduled(fixedDelay = 60 * 1_000) // 60초마다
public void testCatiSelect() {
List<TSampleEntity> test = testService.selectSampleWithPrjCode("1912002_08");
log.info("testCatiSelect => {}", test);
}
}

View File

@@ -0,0 +1,56 @@
package com.kri.pcsi.send_notice.service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.datasource.DataSourceUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
@Slf4j
@Service
public class DbPingService {
private final DataSource catiDataSource;
private final DataSource ppurioDataSource;
public DbPingService(
@Qualifier("catiDataSource") DataSource catiDataSource,
@Qualifier("ppurioDataSource") DataSource ppurioDataSource
) {
this.catiDataSource = catiDataSource;
this.ppurioDataSource = ppurioDataSource;
}
@Transactional(transactionManager = "catiTxManager", readOnly = true)
public boolean pingCati() {
return ping("CATI", catiDataSource);
}
@Transactional(transactionManager = "ppurioTxManager", readOnly = true)
public boolean pingPpurio() {
return ping("PPURIO", ppurioDataSource);
}
private boolean ping(String name, DataSource ds) {
Connection conn = DataSourceUtils.getConnection(ds);
try (PreparedStatement ps = conn.prepareStatement("SELECT 1");
ResultSet rs = ps.executeQuery()) {
int v = rs.next() ? rs.getInt(1) : -1;
log.info("{} ping OK: {}", name, v);
return true;
} catch (Exception e) {
log.error("{} ping FAIL", name, e);
return false;
} finally {
DataSourceUtils.releaseConnection(conn, ds);
}
}
}

View File

@@ -0,0 +1,18 @@
package com.kri.pcsi.send_notice.service;
import com.kri.pcsi.send_notice.entity.cati.TSampleEntity;
import com.kri.pcsi.send_notice.mapper.cati.SampleMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@RequiredArgsConstructor
public class TestService {
private final SampleMapper sampleMapper;
public List<TSampleEntity> selectSampleWithPrjCode(String prjCode) {
return sampleMapper.selectSampleWithPrjCode(prjCode);
}
}

View File

@@ -0,0 +1,12 @@
app:
datasource:
cati-db:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://10.10.11.6:1433;databaseName=new_cati;encrypt=false
username: sa
password: krco#51304
ppurio-db:
url: jdbc:mysql://db-md87m.vpc-cdb.ntruss.com:3306/pcsi_send_notice?characterEncoding=UTF-8
username: kri_pcsi
password: kric@5100
driver-class-name: com.mysql.cj.jdbc.Driver

View File

@@ -0,0 +1,17 @@
app:
datasource:
cati-db:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://10.10.11.6:1433;databaseName=new_cati;encrypt=false
username: sa
password: krco#51304
ppurio-db:
url: jdbc:mysql://db-md87m-kr.vpc-pub-cdb.ntruss.com:3306/pcsi_send_notice?characterEncoding=UTF-8
username: kri_pcsi
password: kric@5100
driver-class-name: com.mysql.cj.jdbc.Driver
mybatis:
configuration:
map-underscore-to-camel-case: true
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl

View File

@@ -0,0 +1,12 @@
app:
datasource:
cati-db:
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
url: jdbc:sqlserver://1.235.195.34:1433;databaseName=new_cati;encrypt=false
username: sa
password: krco#51304
ppurio-db:
url: jdbc:mysql://db-md87m.vpc-cdb.ntruss.com:3306/pcsi_send_notice?characterEncoding=UTF-8
username: kri_pcsi
password: kric@5100
driver-class-name: com.mysql.cj.jdbc.Driver

View File

@@ -0,0 +1,47 @@
server:
port: 3031
forward-headers-strategy: framework
spring:
application:
name: PCSISendNotice
profiles:
# 아무 설정 없을 때 기본으로 쓸 프로파일
default: local
logging:
file:
path: ./logs
mybatis:
type-aliases-package: com.kri.pcsi.send_notice.entity
configuration:
map-underscore-to-camel-case: true
kri:
security:
enabled: true
public-paths: # 인증 없이 열어둘 URL
- /v3/api-docs/**
- /swagger-ui.html
- /swagger-ui/**
- /ping
- /**
swagger:
enabled: true
title: "PCSI Send Notice API"
description: "인트라넷 발송 API"
version: "v1.0.0"
base-package: "com.kri.pcsi.send_notice"
common:
web:
enabled: true # 공통 Web 구성 사용 여부 (기본 true)
webmvc:
enabled: true # 공통 Webmvc 구성 사용 여부 (기본 true)
redis:
enabled: false # RedisQueueHelper 사용 시 true
scheduling:
enabled: true # @Scheduled 사용 시 true

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.kri.pcsi.send_notice.mapper.cati.SampleMapper">
<select id="selectSampleWithPrjCode" resultType="com.kri.pcsi.send_notice.entity.cati.TSampleEntity">
SELECT Top(10)
id, tel_cnt, tel_local, tel_kuk, tel_no, tel_allno2, tel_allno3
, aq01, aq02, aq03, aq04, aq05, aq06, aq07
, r_aq01, r_aq02, r_aq03, r_aq04, r_aq05, r_aq06, r_aq07
, tel_etc1, tel_etc2, tel_etc3, tel_etc4, tel_etc5, tel_etc6, tel_etc7, tel_etc8, tel_etc9, tel_etc10
, tel_etc11, tel_etc12, tel_etc13, tel_etc14, tel_etc15, tel_etc16, tel_etc17, tel_etc18, tel_etc19, tel_etc20
, tel_user, tel_stat
, tel_stat_tmp1, tel_stat_tmp2, tel_stat_tmp3
, tel_date, tel_s_time, tel_e_time
, prj_code, pds_campaign_id, guid_key
, res_memo, etc_memo, tel_memo
FROM new_cati.dbo.sample_${prjCode}
WHERE 1=1
</select>
</mapper>

View File

@@ -0,0 +1,13 @@
package com.kri.pcsi.send_notice;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class PcsiSendNoticeApplicationTests {
@Test
void contextLoads() {
}
}