Compare commits

...

42 Commits
dev ... main

Author SHA1 Message Date
jhseo b23fc9830b style: 문구 수정 및 설정 배포 관련 내용 추가 1 day ago
Jonguk. Lim 91f758d993 Merge remote-tracking branch 'origin/main' 8 months ago
Jonguk. Lim 08289b6dd5 wiki image test 8 months ago
sjh88 815a846f60 fix: seq값 초기화 연도 수정 11 months ago
sjh88 06db2be20c style: 부과 미부과 답변 내용 수정 1 year ago
sjh88 747cf0f523 feat:장애인 의견진술 처리 시 답변 문구 수정 1 year ago
sjh88 4e6a1aa2b0 fix:
-Dashboard 심사자 이름 *로 변경
-심의 목록 차량번호 뒤 4자리 *로 변경
-관리자 사용자관리 비활성 계정 복구 및 패스워드 변경 기능 추가
2 years ago
sjh88 51b19b8235 fix: sql 파라미터 오타 수정, 심사 시작시간 update 추가 2 years ago
sjh88 8228468a10 fix: 단속내용 답변 내용 수정, 심의목록 심사기간 및 마감일시 수정 기능, 심의 처리 시 에러나면 Exception나는 부분 제거 후 log insert 처리 2 years ago
sjh88 5e5d10b993 fix: 사용자 정보 관련 PARKNOT DB 추가 처리
- 장애인,거주자 의견진술 심사 처리 시 GN_RECALL_SC 업데이트 추가 처리
2 years ago
jiho83 bc55ad973a feat : allowed-origins http: -> http:// 으로 변경 2 years ago
jiho83 ecfa8391c5 fix: 정렬순서 변경 및 거주자,장애인 의견진술 인서트 항목 추가
- ms_maincode->ms_seq 순으로 변경
- gn_recall_sc 테이블 sc_transfer, sc_state 항목 추가
2 years ago
minuk926 393a27fc4b config: docker 등 빌드 소스정리 2 years ago
minuk926 57bb57f1a8 fix: 심사자 - 심사대상 조회 SQL 반영 2 years ago
minuk926 c32119dddf fix: 강남심사 주정차(admin) 반영 2 years ago
minuk926 b70721305f Merge remote-tracking branch 'origin/main' 2 years ago
minuk926 ca5094cd59 fix: 강남심사 주정차(admin) 반영 2 years ago
jiho83 03264fd010 fix : 운영 설정 값 수정 2 years ago
jiho83 d996ea3f5f Merge remote-tracking branch 'origin/main' 2 years ago
minuk926 f712e4e812 fix: 강남심사 설정 반영 2 years ago
jiho83 6bc097560e temp : 운영 설정 및 수정 사항 메모 2 years ago
minuk926 f60207dd98 fix: 강남심사 소스 freezing 2 years ago
minuk926 deb51320db fix: 강남심사 소스 freezing 2 years ago
minuk926 6e43726c8a fix: 강남심사 소스 freezing 2 years ago
minuk926 4454856cca fix: 강남심사 소스 freezing 2 years ago
minuk926 bf753051e6 fix: 주정차 심사 반영 완료 2 years ago
minuk926 e8a3349faf fix: 주정차 심사 반영중 2 years ago
minuk926 6610489071 fix: 주정차 심사 반영중 2 years ago
minuk926 8f37a6354c fix: 주정차 심사 반영중 2 years ago
minuk926 a287392d80 fix: 주정차 심사 반영중 2 years ago
minuk926 491dfcb560 fix: 사용자관리 정보변경 비밀번호 갱신 제외 2 years ago
minuk926 795b8bae30 fix: 사용자관리 정보변경 비밀번호 갱신 제외 2 years ago
minuk926 3d6524cbc9 fix: 사용자관리 정보변경 비밀번호 갱신 제외 2 years ago
minuk926 1d5cc127c4 feat: DB 분리 적용 2 years ago
minuk926 6345c50f54 feat: DB 분리 적용 2 years ago
minuk926 cd3ce2fc34 fix: 심사결과 필드 null 처리 2 years ago
minuk926 827d7b6c45 fix: sql log format fix
CUD return int fix
     local yml fix
2 years ago
minuk926 828a7e5ccc feat: sql log format fix 2 years ago
minuk926 d47f6a54b6 config: config set 2 years ago
minuk926 f7b9b71d7f config: config set 2 years ago
minuk926 5c433c537f config: config set 2 years ago
minuk926 f9e5cb2005 config: config set 2 years ago

@ -1,22 +0,0 @@
node_modules
npm-debug.log
# .git 과 .cache 폴더를 무시
.git
.cache
# ignore all *.class files in all folders, including build root
# 모든 폴더안에 있는 모든, *.class 파일들을 무시
**/*.class
# 모든 마크다운 파일들 (md) 파일들을 무시,
# 모든 README*.md 파일 무시
*.md
IREADME*.md
.gradle
build
.idea
out
work
data

@ -1,74 +0,0 @@
name: Deploy to Amazon EC2(github -> package -> EC2 docker image)
on:
push:
branches: [ master ] # push할 때 동작할 branch를 입력해주세요.
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'debug'
tags:
description: 'Run action'
required: true
default: 'Run '
env:
#DOCKER_IMAGE: ghcr.io/{Repository author}/{Repository name} # 예를 들면, ghcr.io/dolphago/github-follow-unfollow
DOCKER_IMAGE: ghcr.io/${{ github.actor }}/xit-framework
VERSION: ${{ github.sha }}
NAME: xit-framework-bo
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@v2
- name: Set up docker buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ env.VERSION }} # runner 설정에서 읽어들일거에요.
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GIT_ACS_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
push: true #${{ github.event_name != 'pull_request' }}
tags: ${{ env.DOCKER_IMAGE }}:${{ env.VERSION }}
deploy:
needs: build
name: Deploy
runs-on: [ self-hosted, label-development ]
steps:
- name: Login to ghcr
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GIT_ACS_TOKEN }}
- name: Docker run
#docker ps -q --filter "name=xit-framework-bo" | grep -q . && docker stop xit-framework-bo && docker rm -fv xit-framework-bo
#docker run -d -p 8090:8090 --name xit-framework-bo --restart always ${{ env.DOCKER_IMAGE }}:${{ env.VERSION }}
#docker run -d -p 8090:8090 --name xit-framework-bo --restart always ${{ env.DOCKER_IMAGE }}:${{ env.VERSION }}
#docker ps -q --filter "name=xit-framework-bo" | grep -q . && docker stop xit-framework-bo && docker rm -fv xit-framework-bo
#docker stop ${{ env.NAME }} && docker rm ${{ env.NAME }} && docker rmi ${{ env.DOCKER_IMAGE }}:latest
run: |
docker run -d -p 8090:8090 --name ${{ env.NAME }} --restart always ${{ env.DOCKER_IMAGE }}:${{ env.VERSION }}
sleep 5
docker image prune -a
sleep 5

@ -1,46 +0,0 @@
FROM gradle:7-jdk8 AS build
WORKDIR /application
COPY --chown=gradle:gradle ./ ./
#COPY ./ ./
#RUN chmod +x ./gradlew
RUN gradle clean bootWar
FROM openjdk:8-jre-slim
WORKDIR /app
COPY --from=build /application/build/libs/*.war ./ROOT.war
EXPOSE 8090
#ENTRYPOINT ["java", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-Dspring.profiles.active=dev","-jar"," /app/ROOT.war"]
ENTRYPOINT ["java", "-jar", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-Dspring.profiles.active=dev", "/app/ROOT.war"]
#ENTRYPOINT ["java", "-Dspring.profiles.active=dev", "-jar", "/application/build/libs/core-0.0.1-SNAPSHOT.war"]
#FROM openjdk:8-jdk-alpine as builder
#WORKDIR application
#COPY ./ ./
#RUN chmod +x ./gradlew
##--args='--spring.profiles.active=dev'
#RUN ./gradlew clean bootWar
##CMD["./gradlew", "-Dspring.profiles.active=local", "clean", "bootWar"]
#
#EXPOSE 8090 8443
#ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=dev", "/application/build/libs/core-0.0.1-SNAPSHOT.war"]
#FROM postgres
#FROM tomcat:9.0
#ENV TZ="Asia/Seoul"
#RUN ln -fns /usr/share/zoneinfo/$TZ /etc/localtime
#RUN echo $TZ > /etc/timezone
#CMD ["/usr/local/tomcat/bin/catalina.sh", "stop"]
#CMD sleep 3
#
#RUN rm -rf /usr/local/tomcat/webapps/ROOT
#COPY --from=builder /application/build/libs/core-0.0.1-SNAPSHOT.war /usr/local/tomcat/webapps/ROOT.war
#EXPOSE 8090 8443
#CMD ["/usr/local/tomcat/bin/catalina.sh", "run"]
#FROM tomcat:9.0
#ENV TZ="Asia/Seoul"
#RUN ln -fns /usr/share/zoneinfo/$TZ /etc/localtime
#RUN echo $TZ > /etc/timezone
##RUN rm -rf /usr/local/tomcat/webapps/ROOT
#COPY repo/target/kuaa-management.war /usr/local/tomcat/webapps/ROOT.war
#EXPOSE 8009 8080 8443

148
Jenkinsfile vendored

@ -1,148 +0,0 @@
pipeline {
agent any
stages {
stage('Git Pull') {
steps {
script {
try {
//echo 'prepare'
//git branch: "master", credentialsId: "$GIT_CREDENTIALS_ID", url: 'git@github.com:minuk926/xit-framework.git/'
git branch: 'master', url: 'git@github.com:minuk926/xit-framework.git', credentialsId: 'jenkins_aws_connect_key'
sh rm -rf .git
sh 'ls -al'
env.cloneResult=true
} catch (error) {
print(error)
env.cloneResult=false
currentBuild.result = 'FAILURE'
}
}
}
}
stage('Build WAR') {
when {
expression {
return env.cloneResult ==~ /(?i)(Y|YES|T|TRUE|ON|RUN)/
}
}
steps {
script{
try {
sh """
rm -rf deploy
mkdir deploy
"""
sh "sudo sed -i \"s/module_name=.*/module_name=${env.JOB_NAME}\\:${env.BUILD_NUMBER}/g\" /var/lib/jenkins/workspace/${env.JOB_NAME}/src/main/resources/application.properties"
sh "cat /var/lib/jenkins/workspace/${env.JOB_NAME}/src/main/resources/application.properties"
sh 'gradlew clean bootWar'
sh """
cd deploy
cp /var/lib/jenkins/workspace/${env.JOB_NAME}/build/libs/*.war ./ROOT.war
"""
env.gradleBuildResult=true
} catch (error) {
print(error)
echo 'Remove Deploy Files'
sh "sudo rm -rf /var/lib/jenkins/workspace/${env.JOB_NAME}/*"
env.gradleBuildResult=false
currentBuild.result = 'FAILURE'
}
}
}
post {
success {
slackSend channel: '#pipeline-deploy', color: 'good', message: "The pipeline ${currentBuild.fullDisplayName} stage Build WAR successfully."
}
failure {
slackSend channel: '#pipeline-deploy', color: 'danger', message: "The pipeline ${currentBuild.fullDisplayName} stage Build WAR failed."
}
}
}
stage('Docker Build'){
when {
expression {
return env.mavenBuildResult ==~ /(?i)(Y|YES|T|TRUE|ON|RUN)/
}
}
steps {
script{
try {
sh"""
#!/bin/bash
cd ./deploy
cat>Dockerfile<<-EOF
FROM ${ECR_BASE_URL}:latest
ADD ${env.JOB_NAME}.jar /home/${env.JOB_NAME}.jar
CMD nohup java -jar /home/${env.JOB_NAME}.jar 1> /dev/null 2>&1
EXPOSE 9000
EOF"""
sh"""
cd ./deploy
docker rmi -f \$(docker images -q)
\$(aws ecr get-login --no-include-email --region ap-northeast-2)
docker build -t ${SERVICE_NAME.toLowerCase()} .
docker tag ${SERVICE_NAME.toLowerCase()}:latest ${ECR_TASK_URL}:ver${env.BUILD_NUMBER}
docker push ${ECR_TASK_URL}:ver${env.BUILD_NUMBER}
"""
echo 'Remove Deploy Files'
sh "sudo rm -rf /var/lib/jenkins/workspace/${env.JOB_NAME}/*"
env.dockerBuildResult=true
} catch (error) {
print(error)
echo 'Remove Deploy Files'
sh "sudo rm -rf /var/lib/jenkins/workspace/${env.JOB_NAME}/*"
env.dockerBuildResult=false
currentBuild.result = 'FAILURE'
}
}
}
post {
success {
slackSend channel: '#jenkins', color: 'good', message: "The pipeline ${currentBuild.fullDisplayName} stage Docker Build successfully."
}
failure {
slackSend channel: '#jenkins', color: 'danger', message: "The pipeline ${currentBuild.fullDisplayName} stage Docker Build failed."
}
}
}
stage('Deploy'){
when {
expression {
return env.dockerBuildResult ==~ /(?i)(Y|YES|T|TRUE|ON|RUN)/
}
}
steps {
script{
try {
withAWS(credentials:"$AWS_CREDENTIALS") {
sh "aws ecs describe-task-definition --task-definition ${TASK_DEFINITION} --region ap-northeast-2 --query \"taskDefinition.{\"family\": family, \"containerDefinitions\": containerDefinitions, \"executionRoleArn\": executionRoleArn,\"requiresCompatibilities\": requiresCompatibilities}\" --output json > task-definition.json"
def task_repository_name = sh(
script:"""
echo \"${ECR_TASK_URL}\" | awk \'{ split(\$0, arr, \"/\"); print arr[2] }\'
""",
returnStdout: true
).trim()
sh "sudo sed -i \"9s/${task_repository_name}:.*/${task_repository_name}:ver${env.BUILD_NUMBER}\\\",/g\" task-definition.json"
sh "cat task-definition.json"
sh "aws ecs register-task-definition --cli-input-json file://task-definition.json --region ap-northeast-2"
sh "aws ecs update-service --cluster ${CLUSTER_NAME} --service ${SERVICE_NAME} --task-definition ${TASK_DEFINITION} --region ap-northeast-2"
}
} catch (error) {
print(error)
echo 'Remove Deploy Files'
sh "sudo rm -rf /var/lib/jenkins/workspace/${env.JOB_NAME}/*"
currentBuild.result = 'FAILURE'
}
}
}
post {
success {
slackSend channel: '#jenkins', color: 'good', message: "The pipeline ${currentBuild.fullDisplayName} successfully."
}
failure {
slackSend channel: '#jenkins', color: 'danger', message: "The pipeline ${currentBuild.fullDisplayName} failed."
}
}
}
}
}

@ -1,3 +1,24 @@
### Start
```text
# java, tomcat 버전
java 1.8, tomcat 9.0
#배포 시 (BackEnd)
- application.yml 에서 active: prod 로 변경해서 ROOT.war 빌드
※※※예시※※※
spring:
application:
name: xit-framework
#description: XIT api for development
profiles:
active: prod
include: oauth
- 서비스 실행 후 apache-tomcat-9 simsa 관련 서비스 찾아서 중지
- D:\tools\was\apache-tomcat-9.0.31\webapps 에 war 백업 후 신규 파일 붙여넣기
- 서비스 실행 후 apache-tomcat-9 simsa 관련 서비스 시작
```
#### CORS 에러: The request client is not a secure context and the resource is in more-private address space `local`.
```text
공인 IP대역에서 http POST 요청으로 text 타입 데이타 전송시 발생

@ -1,26 +0,0 @@
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/admin/bo # 배포 파일 도착 폴더
overwrite: yes # 안돼면, 아래 hooks BeforeInstall 추가, 파일 삭제
permissions:
- object: /
pattern: "**" # 모든 파일의 권한 설정
owner: ubuntu
group: ubuntu
# mode: 755
hooks:
# BeforeInstall: "BeforeInstallHookFunctionName"
# AfterInstall: "AfterInstallHookFunctionName"
# ApplicationStop:
# - timeout: 2
ApplicationStart: # 파일이 도착 후 실행
- location: deploy.sh
timeout: 60 # 60 안에 실행, 60 뒤엔 배포 실패로 변경
runas: ubuntu
# ValidateService: # deplo 실행 후, 빌드파일이 배포가 되었다면, 서버체크
# - location: server-check.sh
# timeout: 60

@ -241,3 +241,51 @@ test {
exclude '**/*'
//useJUnitPlatform()
}
/*
def frontendDir = "../xit-opst-fo"
sourceSets {
main {
resources {
srcDirs = ["$projectDir/src/main/resources"]
}
}
}
processResources {
dependsOn "copyReactBuildFiles"
}
task installReact(type: Exec) {
workingDir "$frontendDir"
inputs.dir "$frontendDir"
group = BasePlugin.BUILD_GROUP
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine "npm.cmd", "audit", "fix"
commandLine 'npm.cmd', 'install'
} else {
commandLine "npm", "audit", "fix"
commandLine 'npm', 'install'
}
}
task buildReact(type: Exec) {
dependsOn "installReact"
workingDir "$frontendDir"
inputs.dir "$frontendDir"
group = BasePlugin.BUILD_GROUP
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
commandLine "npm.cmd", "run-script", "build"
} else {
commandLine "npm", "run-script", "build"
}
}
task copyReactBuildFiles(type: Copy) {
dependsOn "buildReact"
from "$frontendDir/build"
into "$buildDir/resources/main/static"
}
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

@ -1,25 +0,0 @@
#!/usr/bin/env bash
REPOSITORY=/home/ubuntu/xit-framework/bo
cd $REPOSITORY
APP_NAME=xit-framework-bo
WAR_NAME=$(ls $REPOSITORY | grep '.war' | tail -n 1)
WAR_PATH=$REPOSITORY/$WAR_NAME
echo "> war 파일명: $WAR_NAME" >> /home/ubuntu/xit-framework/bo/deploy.log
echo "> war 파일명: $WAR_PATH" >> /home/ubuntu/xit-framework/bo/deploy.log
CURRENT_PID=$(pgrep -f $APP_NAME)
echo "> CURRENT_PID : $CURRENT_PID" >> /home/ubuntu/xit-framework/bo/deploy.log
if [ -z $CURRENT_PID ]
then
echo "> 종료할것 없음."
else
echo "> kill -9 $CURRENT_PID"
kill -9 $CURRENT_PID
sleep 5
fi
rm -rf work/
echo "> $WAR_PATH 배포"
nohup java -jar -Dspring.profiles.active=local $WAR_PATH > /dev/null 2> /dev/null < /dev/null &

@ -1,27 +0,0 @@
version: "3"
services:
backend:
build:
context: .
dockerfile: Dockerfile
ports:
- "8090:8090"
stdin_open: true
# volumes:
# - /app/node_modules
# - ./backend:/app
# environment:
# MYSQL_HOST: mysql
# MYSQL_USER: root
# MYSQL_ROOT_PASSWORD: johnahn777
# MYSQL_DATABASE: myapp
# MYSQL_PORT: 3306
#
#
# nginx:
# restart: always
# build:
# dockerfile: ../Dockerfile
# context: ./nginx
# ports:
# - "3000:80"

@ -5,6 +5,8 @@ package com.xit;
import com.xit.core.config.support.CustomBeanNameGenerator;
import com.xit.core.oauth2.config.properties.AppProperties;
import com.xit.core.oauth2.config.properties.CorsProperties;
import com.xit.core.oauth2.config.properties.MasterDatabaseProperties;
import com.xit.core.oauth2.config.properties.SlaveDatabaseProperties;
import com.xit.core.util.Checks;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@ -32,7 +34,9 @@ import java.io.IOException;
@ServletComponentScan
@EnableConfigurationProperties({
CorsProperties.class,
AppProperties.class
AppProperties.class,
MasterDatabaseProperties.class,
SlaveDatabaseProperties.class
})
@ComponentScan(
nameGenerator = CustomBeanNameGenerator.class,

@ -5,7 +5,6 @@ import lombok.Getter;
public class CtgyConstants {
@Getter
@AllArgsConstructor
public enum Judge {
@ -22,6 +21,18 @@ public class CtgyConstants {
RESULT_JUDGE_PRE("0", "심의전"),
RESULT_JUDGE_NON_IMPOSE("1", "미부과"),
RESULT_JUDGE_IMPOSE("2", "부과"),
RESULT_STATE_NON_IMPOSE("3", "귀하께서 거주자우선주차장 내 부정주차 단속에 대하여 이의신청서를 제출 " +
"하신 건에 대하여 강남구 주정차위반 의견진술심의위원회에서 심의한 결과 " +
"‘수용(미부과)’으로 결정되었기에 그 결과를 안내하여 드립니다."),
RESULT_STATE_IMPOSE("4", "귀하께서 거주자우선주차장 내 부정주차 단속에 대하여 이의신청서를 " +
"제출하신 건에 대하여 강남구 주정차위반 의견진술심의위원회에서 " +
"심의한 결과 ‘미수용(부과)’으로 결정되었기에 그 결과를 안내하여 드립니다."),
RESULT_STATE_DISABLED_NON_IMPOSE("3", "귀하께서 제출하신 의견진술 심의 요청에 대하여, 강남구 불법주정차 의견진술 심의위원회 심의 결과, " +
"장애인등편의증진보장에관한법률 제17조 등에 의거 단속대상이나, 금번에 한하여 「과태료 부과하지 않음」으로 결정되었습니다. " +
"이후에는 지정된 주차공간에 주차하여 원활한 교통 소통 및 시민의 안전을 위해 노력해 주시기 바랍니다."),
RESULT_STATE_DISABLED_IMPOSE("4", "귀하께서 제출하신 의견진술 심의 요청에 대하여, 강남구 불법주정차 의견진술 심의위원회 심의 결과, " +
"의견진술 내용은 이해가 되나, 보행 장애인의 안전하고 편리한 시설 이용 및 접근을 위하여 장애인등편의증진보장에관한법률 제17조 등에 의거 「과태료 부과」로 결정되었습니다. " +
"심의결과에 이의가 있으시면 과태료 고지서를 받은 날로부터 60일 이내에 이의신청[문의 : 02)3423-6426]을 하실 수 있음을 알려드립니다."),
// 데이타구분
DATAGB_RESIDENT("1", "거주자"),
DATAGB_DISABLED("2", "장애인")

@ -48,8 +48,9 @@ public class MinPasswordEncoder implements PasswordEncoder {
this.logger.warn("Empty encoded password");
return false;
}
return Objects.equals(minUserinfoDao.queryGetPasswd(rawPassword.toString()), encodedPassword);
//23.05.11 jhseo - DB 복호화 처리로 인하여 별도 암호화 하지 않고 비교 처리
// return Objects.equals(minUserinfoDao.queryGetPasswdEncode(rawPassword.toString()), encodedPassword);
return Objects.equals(rawPassword.toString(), encodedPassword);
}
/**

@ -3,6 +3,7 @@ package com.xit.biz.ctgy.auth.service.impl;
import com.xit.biz.ctgy.auth.UserMinPrincipal;
import com.xit.biz.ctgy.entity.MinUserinfo;
import com.xit.biz.ctgy.v2.repository.UserDao;
import com.xit.biz.ctgy.v2.repository.UserSubDao;
import com.xit.core.oauth2.oauth.entity.ProviderType;
import com.xit.core.oauth2.oauth.info.AbstractOAuth2UserInfo;
import com.xit.core.oauth2.oauth.info.OAuth2UserInfoFactory;
@ -22,6 +23,7 @@ import java.util.Optional;
public class CustomMinOAuth2UserService extends DefaultOAuth2UserService {
private final UserDao userDao;
private final UserSubDao userSubDao;
@Override
public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException {
@ -81,6 +83,7 @@ public class CustomMinOAuth2UserService extends DefaultOAuth2UserService {
.email(userInfo.getEmail())
.build();
userDao.insertMinUserinfo(user);
userSubDao.insertMinUserinfo(user);
return userDao.findByUseridUseAuth(userInfo.getId()).get();
}

@ -67,9 +67,13 @@ public class JudgeListDto {
private LocalDate msuIndate;
@Schema(required = true, title = "위반일자", example = " ", description = "위반일자")
private String scWdate;
private String msWdate;
@Schema(required = true, title = "위반장소", example = " ", description = "위반장소")
private String scPos;
private String msPos;
@Schema(required = true, title = "메인코드", example = " ", description = "주정차이미지코드")
private Long rcMaincode;
@Schema(required = true, title = "심사자id", example = " ", description = "심사자id")
private String msuUserid;
}

@ -0,0 +1,72 @@
package com.xit.biz.ctgy.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile;
@Schema(name = "ParkingImageDto", description = "")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class ParkingImageDto {
@Schema(title = "진술서파일1", example = " ", description = " ")
private String scFrecad1;
@Schema(title = " ", example = " ", description = " ")
private String scFrecad2;
@Schema(title = " ", example = " ", description = " ")
private String scFrecad3;
@Schema(title = " ", example = " ", description = " ")
private String scFrecad4;
@Schema(title = "첨부자료1", example = " ", description = " ")
private String scContad1;
@Schema(title = " ", example = " ", description = " ")
private String scContad2;
@Schema(title = " ", example = " ", description = " ")
private String scContad3;
@Schema(title = " ", example = " ", description = " ")
private String scContad4;
@Schema(title = " ", example = " ", description = " ")
private String scContad5;
@Schema(title = " ", example = " ", description = " ")
private String scContad6;
@Schema(title = " ", example = " ", description = " ")
private String scContad7;
@Schema(title = " ", example = " ", description = " ")
private String scContad8;
@Schema(title = "단속사진1", example = " ", description = " ")
private String scPicad1;
@Schema(title = " ", example = " ", description = " ")
private String scPicad2;
@Schema(title = " ", example = " ", description = " ")
private String scPicad3;
@Schema(title = " ", example = " ", description = " ")
private String scPicad4;
@Schema(required = false, title = "단속사진파일", example = " ", description = "단속사진파일")
private MultipartFile[] picadFiles;
@Schema(required = false, title = "진술서파일", example = " ", description = "진술서파일")
private MultipartFile[] frecadFiles;
@Schema(required = false, title = "첨부자료파일", example = " ", description = "첨부자료파일")
private MultipartFile[] contadFiles;
}

@ -28,7 +28,6 @@ import java.io.UnsupportedEncodingException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@ -45,33 +44,29 @@ public class CmmFileController {
@Value("${file.cmm.upload.root:c:/data/file/upload}")
private String rootPath;
@Value("${file.cmm.upload.path:/kangnamSIM/simUpFile/}")
private String uploadPath;
// @Value("${file.cmm.upload.path:/kangnamSIM/simUpFile/}")
// private String uploadPath;
@Value("${file.cmm.upload.simsaPath:[simUpFile_sc1]}")
private String[] judgeUploadPath;
@Value("${file.cmm.upload.url}")
private String serviceUrl;
private final ICtgyFileService ctgyFileService;
private final IResidentAndDisabledService judgeService;
@Operation(summary = "공지사항 파일 다운로드" , description = "공지사항 파일 다운로드")
@GetMapping("/download/{inCode}")
public void download(@PathVariable Long inCode, HttpServletResponse response) {
MinInfoBoard680Dto dto = ctgyFileService.findFiles(inCode);
String absFile = "";
if (Arrays.asList(env.getActiveProfiles()).contains("prod"))
absFile = dto.getInFileurl() + File.separator + dto.getInFilename();
else
absFile = rootPath + dto.getInFileurl().split(serviceUrl)[1] + File.separator + dto.getInFilename();
download(absFile, dto.getInFilename(), response);
}
// @Operation(summary = "공지사항 파일 다운로드" , description = "공지사항 파일 다운로드")
// @GetMapping("/download/{inCode}")
// public void download(@PathVariable Long inCode, HttpServletResponse response) {
//
// MinInfoBoard680Dto dto = ctgyFileService.findFiles(inCode);
//
// String absFile = "";
//
// if (Arrays.asList(env.getActiveProfiles()).contains("prod"))
// absFile = dto.getInFileurl() + File.separator + dto.getInFilename();
// else
// absFile = rootPath + dto.getInFileurl().split(serviceUrl)[1] + File.separator + dto.getInFilename();
//
// download(absFile, dto.getInFilename(), response);
// }
@Operation(summary = "거주자/장애인 심사자료 파일 다운로드" , description = "거주자/장애인 심사자료 파일 다운로드")
@GetMapping("/download/judge")
@ -87,13 +82,19 @@ public class CmmFileController {
e.printStackTrace();
}
String absFile = "";
// String absFile = "";
//
// if (Arrays.asList(env.getActiveProfiles()).contains("prod"))
// absFile = String.format("%s%s%s", "entity.getInFileurl()", File.separator, fileName);
// else
// absFile = String.format(
// "%s%s%s%s",
// rootPath,
// (CtgyConstants.Judge.DATAGB_RESIDENT.getCode().equals(scDatagb)? judgeUploadPath[0] : judgeUploadPath[1]),
// File.separator, fileName);
// TODO : 운영환경에 맞게 적용 필요
if (Arrays.asList(env.getActiveProfiles()).contains("prod"))
absFile = String.format("%s%s%s", "entity.getInFileurl()", File.separator, fileName);
else
absFile = String.format(
String absFile = String.format(
"%s%s%s%s",
rootPath,
(CtgyConstants.Judge.DATAGB_RESIDENT.getCode().equals(scDatagb)? judgeUploadPath[0] : judgeUploadPath[1]),
@ -102,6 +103,12 @@ public class CmmFileController {
download(absFile, fileName, response);
}
@Operation(summary = "주정차 심사자료 파일 다운로드" , description = "주정차 심사자료 파일 다운로드")
@GetMapping("/download/park")
public void download(@Nonnull final String absFileName, HttpServletResponse response) {
download(absFileName, absFileName.substring(absFileName.lastIndexOf("/")), response);
}
private void download(String absFile, String fileName, HttpServletResponse response) {
Path path = Paths.get(absFile);

@ -13,9 +13,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.core.io.InputStreamResource;
import org.springframework.core.io.Resource;
import org.springframework.http.*;
import org.springframework.lang.NonNull;
import org.springframework.web.bind.annotation.*;
@ -26,11 +23,9 @@ import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
@Tag(name = "CtgyFileMgtController", description = "공지사항 / 게시판 관리")
@RestController
@ -38,17 +33,12 @@ import java.util.Arrays;
@RequestMapping("/api/v2/ctgy/file")
public class CtgyFileMgtController {
private final Environment env;
@Value("${file.cmm.upload.root:c:/data/file/upload}")
@Value("${file.cmm.upload.root}")
private String rootPath;
@Value("${file.cmm.upload.path:/kangnamSIM/simUpFile/}")
@Value("${file.cmm.upload.pboard}")
private String uploadPath;
@Value("${file.cmm.upload.url}")
private String serviceUrl;
private final ICtgyFileService service;
@Operation(summary = "파일 조회", description = "등록된 파일 조회")
@ -80,12 +70,14 @@ public class CtgyFileMgtController {
MinInfoBoard680Dto dto = service.findFiles(inCode);
String absFile = "";
// String absFile = "";
//
// if (Arrays.asList(env.getActiveProfiles()).contains("local"))
// absFile = rootPath + dto.getInFileurl().split(serviceUrl)[1] + "/"+ dto.getInFilename();
// else
// absFile = dto.getInFileurl() + "/" + dto.getInFilename();
if (Arrays.asList(env.getActiveProfiles()).contains("prod"))
absFile = dto.getInFileurl() + File.separator + dto.getInFilename();
else
absFile = rootPath + dto.getInFileurl().split(serviceUrl)[1] + File.separator + dto.getInFilename();
String absFile = absFile = rootPath + uploadPath + "/" + dto.getInFilename();
Path path = Paths.get(absFile);
String contentType = null;
@ -121,49 +113,4 @@ public class CtgyFileMgtController {
throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND);
}
}
@GetMapping("/download2/{inCode}")
public ResponseEntity<Resource> download(@PathVariable Long inCode, HttpServletResponse response) {
MinInfoBoard680Dto entity = service.findFiles(inCode);
String absFile = "";
if (Arrays.asList(env.getActiveProfiles()).contains("prod"))
absFile = entity.getInFileurl() + File.separator + entity.getInFilename();
else
absFile = rootPath + entity.getInFileurl().split(serviceUrl)[1] + File.separator + entity.getInFilename();
Path path = Paths.get(absFile);
String contentType = null;
try {
contentType = Files.probeContentType(path);
} catch (IOException e) {
throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND);
}
// File file = new File(absFile);
// try {
// byte[] fileByte = FileUtils.readFileToByteArray(file);
// } catch (IOException e) {
// throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND);
// }
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_TYPE, contentType);
headers.setContentDisposition(ContentDisposition.builder("attachment")
.filename(entity.getInFilename(), StandardCharsets.UTF_8)
//.filename(URLEncoder.encode(entity.getInFilename(), "utf-8"))
.build());
headers.add(HttpHeaders.CONTENT_LENGTH, String.valueOf(entity.getInFilesize()));
Resource resource = null;
try {
resource = new InputStreamResource(Files.newInputStream(path));
} catch (IOException e) {
throw new CustomBaseException(ErrorCode.FILE_NOT_FOUND);
}
return new ResponseEntity<>(resource, headers, HttpStatus.OK);
}
}

@ -115,6 +115,27 @@ public class ParkingController {
return RestResponse.of(service.findByUserJudges());
}
@Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "주정차 단속 이미지 조회" , description = "주정차 단속 이미지 조회")
@GetMapping(value = "/judge/picad/{rcMaincode}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findPicadImageByRcMaincode(@PathVariable final Long rcMaincode) {
return RestResponse.of(service.findPicadImageByRcMaincode(rcMaincode));
}
@Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "주정차 진술서 이미지 조회" , description = "주정차 진술서 이미지 조회")
@GetMapping(value = "/judge/frecad/{rcMaincode}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findFrecadImageByRcMaincode(@PathVariable final Long rcMaincode) {
return RestResponse.of(service.findFrecadImageByRcMaincode(rcMaincode));
}
@Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "주정차 첨부자료 이미지 조회" , description = "주정차 첨부자료 이미지 조회")
@GetMapping(value = "/judge/contad/{rcMaincode}", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> findContadImageByRcMaincode(@PathVariable final Long rcMaincode) {
return RestResponse.of(service.findContadImageByRcMaincode(rcMaincode));
}
@Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "주정차 의견진술 심의 결과 저장" , description = "주정차 의견진술 심의 결과 저장")
@Parameters({

@ -1,9 +1,6 @@
package com.xit.biz.ctgy.v2.controller;
import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.JudgeStdDto;
import com.xit.biz.ctgy.dto.JudgeTargetDto;
import com.xit.biz.ctgy.dto.*;
import com.xit.biz.ctgy.v2.service.IResidentAndDisabledService;
import com.xit.core.annotation.Secured;
import com.xit.core.annotation.SecurityPolicy;
@ -180,9 +177,15 @@ public class ResidentAndDisabledController {
@Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "dashboard" , description = "dashboard")
@Parameters({
@Parameter(in = ParameterIn.QUERY, name = "accesstype", description = "사용구분(001-관리자, 002-심사자)", required = true, example = " ")
})
@GetMapping(value="/dashboard", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> getDashboard() {
return RestResponse.of(service.findDashboard());
public ResponseEntity<? extends IRestResponse> getDashboard(
@Valid
@Parameter(hidden = true)
final MinUserinfoDto dto) {
return RestResponse.of(service.findDashboard(dto));
}
//---------------------------------------------------------------------------------
// 심사자
@ -222,4 +225,15 @@ public class ResidentAndDisabledController {
service.saveJudgeResult(dto);
return RestResponse.of(HttpStatus.OK);
}
@Secured(policy = SecurityPolicy.TOKEN)
@Operation(summary = "관리자 심사 기간 및 마감일시 처리" , description = "관리자 심사 기간 및 마감일시 처리")
@PostMapping(value="/admin/date", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<? extends IRestResponse> saveDateStds(
@Valid
@RequestBody
final JudgeDetailDto dto) {
service.saveDateStds(dto);
return RestResponse.of(HttpStatus.OK);
}
}

@ -2,6 +2,7 @@ package com.xit.biz.ctgy.v2.repository;
import com.xit.biz.ctgy.dto.BoardDto;
import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.oauth2.config.properties.MasterDatabaseProperties;
import com.xit.core.support.sql.parser.QueryGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
@ -16,6 +17,10 @@ import java.util.*;
public class BoardDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "board";
public BoardDao(MasterDatabaseProperties databaseProperties) {
super(databaseProperties);
}
public Page<BoardDto> findAll(@NotNull final BoardDto dto, @NotNull final Pageable pageable) {
final String cntSql = getSql("selectBoardListCnt", dto, pageable);
final String listSql = getSql("selectBoardList", dto, pageable);

@ -3,6 +3,7 @@ package com.xit.biz.ctgy.v2.repository;
import com.xit.biz.cmm.dto.ComboCodeDto;
import com.xit.biz.ctgy.dto.MinUserinfoDto;
import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.oauth2.config.properties.MasterDatabaseProperties;
import com.xit.core.support.sql.parser.QueryGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;
@ -16,6 +17,10 @@ import java.util.Optional;
public class CmmCodeDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "cmmCode";
public CmmCodeDao(MasterDatabaseProperties databaseProperties) {
super(databaseProperties);
}
public List<ComboCodeDto> queryComboCodeClass(@NotNull final String codeGrpId, @NotNull final String codeLcd, @NotNull final String codeMcd) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectComboCodes")
.setParameter("codeGrpId", codeGrpId)

@ -2,21 +2,32 @@ package com.xit.biz.ctgy.v2.repository;
import com.xit.biz.ctgy.dto.*;
import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.exception.CustomBaseException;
import com.xit.core.oauth2.config.properties.MasterDatabaseProperties;
import com.xit.core.oauth2.utils.HeaderUtil;
import com.xit.core.support.sql.parser.QueryGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@Repository
@Slf4j
public class ParkingDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "parking";
public ParkingDao(MasterDatabaseProperties masterDatabaseProperties) {
super(masterDatabaseProperties);
}
public Page<JudgeListDto> findParkings(@NotNull final JudgeListDto dto, @NotNull final Pageable pageable) {
final String cntSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectParkingListCnt")
.setParameter("msYear", dto.getMsYear())
@ -96,6 +107,26 @@ public class ParkingDao extends BaseMpowerDaoSupport {
}
public void updateMsResult(@NotNull final Long msMaincode, @NotNull final String msSeq, @NotNull final String msResult) {
final String mainCodeSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectRcMaincode")
.setParameter("msMaincode", msMaincode)
.getQueryString();
selectOneColumn(mainCodeSql);
final List<String> inParams = Arrays.asList("11680", "11", selectOneColumn(mainCodeSql), String.valueOf(msSeq), msResult);
final List<String> outParams = Arrays.asList("result", "message");
final String spSql = "SIMSA_EDIT_RESULT(?,?,?,?,?,?,?)";
Map<String,Object> rslt = executeSp(spSql, inParams, outParams);
if(!"1".equals(rslt.get("result"))){
log.error("{}", rslt);
//throw new CustomBaseException(String.valueOf(rslt.get("message")));
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertErrorLog")
.setParameter("msMaincode", msMaincode)
.setParameter("msSeq", msSeq)
.setParameter("message", String.valueOf(rslt.get("message")))
.getQueryString();
update(sql);
}
/*
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateJudegResult")
.setParameter("msMaincode", msMaincode)
.setParameter("msSeq", msSeq)
@ -103,6 +134,7 @@ public class ParkingDao extends BaseMpowerDaoSupport {
.getQueryString();
update(sql);
*/
}
public List<ParkingTargetDto> findParkingJudgeTargets(@NotNull final ParkingTargetDto dto) {
@ -184,28 +216,59 @@ public class ParkingDao extends BaseMpowerDaoSupport {
delete(sql);
}
public List<DashboardJudgeListDto> findDashboardJudgeList() {
public List<DashboardJudgeListDto> findDashboardJudgeList(MinUserinfoDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectDashboardJudgeList")
.setParameter("accesstype", dto.getAccesstype())
.getQueryString();
final String fieldStrs = "msEdate, msuTeam, name, jcnt, tcnt";
return selectList(DashboardJudgeListDto.class, sql, fieldStrs);
}
//---------------------------------------------------------------------------------
// 심사자
//---------------------------------------------------------------------------------
public List<JudgeListDto> findByUserJudges() {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectByUserJudgeList")
.setParameter("msuUserid", HeaderUtil.getUserId())
.getQueryString();
final String fieldStrs = "msMaincode, msSeq, msCarnum, msResult, msYear, msChasu, msSdate, msStartsi, msEdate, msCdate, " +
"msClosesi, msDatgb, msuCode, msuResult, msuReason, scWdate, scPos";
"msClosesi, msDatagb, msuCode, msuResult, msuReason, msWdate, msPos, rcMaincode, msuUserid";
return selectList(JudgeListDto.class, sql, fieldStrs);
}
public void updateMsuResonAndMsuResultByMsuCode(@NotNull final Long msuCode, @NotNull final String msuResult, @NotNull final String msuReason, @NotNull final LocalDate msuIndate) {
public void updateMsuResonAndMsuResultByMsuCode(@NotNull final JudgeListDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMsuResonAndMsuResultByMsuCode")
.setParameter("msuCode", msuCode)
.setParameter("msuResult", msuResult)
.setParameter("msuReason", msuReason)
.setParameter("msuIndate", msuIndate)
.setParameter("msuCode", dto.getMsuCode())
.setParameter("msuUserid", dto.getMsuUserid())
.setParameter("msuResult", dto.getMsuResult())
.setParameter("msuReason", dto.getMsuReason())
.setParameter("msuIndate", LocalDate.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))))
.getQueryString();
update(sql);
}
public List<Map<String,Object>> findPicadImageByRcMaincode(@NotNull final Long rcMaincode) {
return getParkingJudgeImgList(String.valueOf(rcMaincode), "picad");
}
public List<Map<String, Object>> findFrecadImageByRcMaincode(@NotNull final Long rcMaincode) {
return getParkingJudgeImgList(String.valueOf(rcMaincode), "frecad");
}
public List<Map<String, Object>> findContadImageByRcMaincode(@NotNull final Long rcMaincode) {
return getParkingJudgeImgList(String.valueOf(rcMaincode), "contad");
}
public void updateDateByMsuYear(@NotNull final JudgeDetailDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateDateByMsuYear")
.setParameter("msYear", dto.getMsYear())
.setParameter("msChasu", dto.getMsChasu())
.setParameter("msSdate", dto.getMsSdate())
.setParameter("msStartsi", dto.getMsStartsi())
.setParameter("msEdate", dto.getMsEdate())
.setParameter("msCdate", dto.getMsCdate())
.setParameter("msClosesi", dto.getMsClosesi())
.getQueryString();
update(sql);
}

@ -2,6 +2,7 @@ package com.xit.biz.ctgy.v2.repository;
import com.xit.biz.ctgy.dto.MinInfoBoard680Dto;
import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.oauth2.config.properties.MasterDatabaseProperties;
import com.xit.core.support.sql.parser.QueryGenerator;
import com.xit.core.util.Checks;
import lombok.extern.slf4j.Slf4j;
@ -18,6 +19,10 @@ import java.util.List;
public class PublicBoardDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "pboard";
public PublicBoardDao(MasterDatabaseProperties databaseProperties) {
super(databaseProperties);
}
private static final String fieldStrs = "inCode, inBgubun, inContentno, inContents, inDept, inEtc, inFilename, inFilesize, inFileurl, inHit, inNalja, inName, inTime, inTitle";
public Page<MinInfoBoard680Dto> findAll(@NotNull final MinInfoBoard680Dto dto, @NotNull final Pageable pageable) {

@ -1,11 +1,9 @@
package com.xit.biz.ctgy.v2.repository;
import com.xit.biz.ctgy.dto.DashboardJudgeListDto;
import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.JudgeTargetDto;
import com.xit.biz.ctgy.dto.MinSimsaUser680ScDto;
import com.xit.biz.ctgy.dto.*;
import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.oauth2.config.properties.MasterDatabaseProperties;
import com.xit.core.oauth2.config.properties.SlaveDatabaseProperties;
import com.xit.core.oauth2.utils.HeaderUtil;
import com.xit.core.support.sql.parser.QueryGenerator;
import org.springframework.data.domain.Page;
@ -14,6 +12,8 @@ import org.springframework.stereotype.Repository;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Map;
@ -22,6 +22,10 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "residentAndDisabled";
public ResidentAndDisabledDao(SlaveDatabaseProperties databaseProperties) {
super(databaseProperties);
}
public Page<GnRecallScDto> findJudgeDatas(@NotNull final String scDatagb, @NotNull final Pageable pageable) {
final String cntSql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeDataListCnt")
.setParameter("scDatagb", scDatagb)
@ -160,6 +164,17 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
update(sql);
}
public void updateState(@NotNull final Long scCode, @NotNull final String scSeq, @NotNull final String scState, @NotNull final String scAnswer) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateState")
.setParameter("scCode", scCode)
.setParameter("scSeq", scSeq)
.setParameter("scState", scState)
.setParameter("scAnswer", scAnswer)
.getQueryString();
update(sql);
}
public List<JudgeTargetDto> findJudgeTargets(@NotNull final JudgeTargetDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectJudgeTarget")
.setParameter("scDatagb", dto.getScDatagb())
@ -277,13 +292,15 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
.setParameter("scContad6", dto.getScContad6())
.setParameter("scContad7", dto.getScContad7())
.setParameter("scContad8", dto.getScContad8())
.setParameter("scAnswer", dto.getScAnswer())
.getQueryString();
}
public List<DashboardJudgeListDto> findDashboardJudgeList(@NotNull final String msDatagb) {
public List<DashboardJudgeListDto> findDashboardJudgeList(@NotNull final String msDatagb, MinUserinfoDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectDashboardJudgeList")
.setParameter("msDatagb", msDatagb)
.setParameter("accesstype", dto.getAccesstype())
.getQueryString();
final String fieldStrs = "msEdate, msuTeam, name, jcnt, tcnt";
return selectList(DashboardJudgeListDto.class, sql, fieldStrs);
@ -291,23 +308,40 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport {
//---------------------------------------------------------------------------------
// 심사자
//---------------------------------------------------------------------------------
public List<JudgeListDto> findByUserJudges(@NotNull final JudgeListDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectByUserJudgeList")
.setParameter("msDatagb", dto.getMsDatagb())
.setParameter("msuUserid", HeaderUtil.getUserId())
.getQueryString();
final String fieldStrs = "msMaincode, msSeq, msCarnum, msResult, msYear, msChasu, msSdate, msStartsi, msEdate, msCdate, " +
"msClosesi, msDatgb, msuCode, msuResult, msuReason, scWdate, scPos";
"msClosesi, msDatagb, msuCode, msuResult, msuReason, msWdate, msPos, msuUserid";
return selectList(JudgeListDto.class, sql, fieldStrs);
}
public void updateMsuResonAndMsuResultByMsuCode(@NotNull final Long msuCode, @NotNull final String msuResult, @NotNull final String msuReason, @NotNull final LocalDate msuIndate) {
public void updateMsuResonAndMsuResultByMsuCode(@NotNull final JudgeListDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMsuResonAndMsuResultByMsuCode")
.setParameter("msuCode", msuCode)
.setParameter("msuResult", msuResult)
.setParameter("msuReason", msuReason)
.setParameter("msuIndate", msuIndate)
.setParameter("msuCode", dto.getMsuCode())
.setParameter("msuUserid", dto.getMsuUserid())
.setParameter("msuResult", dto.getMsuResult())
.setParameter("msuReason", dto.getMsuReason())
.setParameter("msuIndate", LocalDate.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))))
.getQueryString();
update(sql);
}
public void updateDateByMsuYear(@NotNull final JudgeDetailDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateDateByMsuYear")
.setParameter("msDatagb", dto.getMsDatagb())
.setParameter("msYear", dto.getMsYear())
.setParameter("msChasu", dto.getMsChasu())
.setParameter("msSdate", dto.getMsSdate())
.setParameter("msStartsi", dto.getMsStartsi())
.setParameter("msEdate", dto.getMsEdate())
.setParameter("msCdate", dto.getMsCdate())
.setParameter("msClosesi", dto.getMsClosesi())
.getQueryString();
update(sql);
}

@ -3,6 +3,8 @@ package com.xit.biz.ctgy.v2.repository;
import com.xit.biz.ctgy.dto.MinUserinfoDto;
import com.xit.biz.ctgy.entity.MinUserinfo;
import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.oauth2.config.properties.IDatabaseProperties;
import com.xit.core.oauth2.config.properties.MasterDatabaseProperties;
import com.xit.core.support.sql.parser.QueryGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
@ -18,6 +20,10 @@ import java.util.Optional;
public class UserDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "user";
public UserDao(MasterDatabaseProperties databaseProperties) {
super(databaseProperties);
}
public Optional<MinUserinfoDto> findByUserid(@NotNull final String userid){
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectUserInfo")
.setParameter("userid", userid)
@ -41,7 +47,6 @@ public class UserDao extends BaseMpowerDaoSupport {
return selectOneColumn(sql);
}
//@Query(value = "SELECT ECL_DECRYPT(MU.passwd) AS passwd FROM min_userinfo MU WHERE MU.userid = ?1", nativeQuery = true)
public String queryGetPasswd(@NotNull final String userid){
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "selectPasswdDec")
.setParameter("userid", userid)
@ -49,10 +54,6 @@ public class UserDao extends BaseMpowerDaoSupport {
return selectOneColumn(sql);
}
// public MinUserinfo findMinUserinfoByUserid(@NotNull final String userid){
// return null;
// }
//-------------------------------------------------------------------------
// 주정차위반 심사대상 등록 - 등록 대상 심사자 조회
//-------------------------------------------------------------------------

@ -0,0 +1,93 @@
package com.xit.biz.ctgy.v2.repository;
import com.xit.biz.ctgy.dto.MinUserinfoDto;
import com.xit.biz.ctgy.entity.MinUserinfo;
import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.oauth2.config.properties.SlaveDatabaseProperties;
import com.xit.core.support.sql.parser.QueryGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Optional;
@Repository
@Slf4j
public class UserSubDao extends BaseMpowerDaoSupport {
private static final String NAME_SPACE = "userSub";
public UserSubDao(SlaveDatabaseProperties databaseProperties) {
super(databaseProperties);
}
public void insertMinUserinfoDto(@NotNull final MinUserinfoDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertMinUserinfo")
.setParameter("userid", dto.getUserid())
.setParameter("accesstype", dto.getAccesstype())
.setParameter("email", dto.getEmail())
.setParameter("isenable", dto.getIsenable())
.setParameter("mphone", dto.getMphone())
.setParameter("name", dto.getName())
.setParameter("passwd", dto.getPasswd())
.setParameter("regdate", dto.getRegdate())
.setParameter("team", dto.getTeam())
.setParameter("gu", dto.getGu())
.getQueryString();
insert(sql);
}
public void updateMinUserinfoDto(MinUserinfoDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMinUserinfo")
.setParameter("userid", dto.getUserid())
.setParameter("accesstype", dto.getAccesstype())
.setParameter("email", dto.getEmail())
.setParameter("mphone", dto.getMphone())
.setParameter("name", dto.getName())
.setParameter("passwd", dto.getPasswd())
.setParameter("team", dto.getTeam())
.getQueryString();
update(sql);
}
public void insertMinUserinfo(@NotNull final MinUserinfo dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertMinUserinfo")
.setParameter("userid", dto.getUserid())
.setParameter("accesstype", dto.getAccesstype())
.setParameter("email", dto.getEmail())
.setParameter("isenable", dto.getIsenable())
.setParameter("mphone", dto.getMphone())
.setParameter("name", dto.getName())
.setParameter("passwd", dto.getPasswd())
.setParameter("regdate", dto.getRegdate())
.setParameter("team", dto.getTeam())
.setParameter("gu", dto.getGu())
.getQueryString();
insert(sql);
}
public void updateMinUserinfo(MinUserinfo dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMinUserinfo")
.setParameter("userid", dto.getUserid())
.setParameter("accesstype", dto.getAccesstype())
.setParameter("email", dto.getEmail())
.setParameter("mphone", dto.getMphone())
.setParameter("name", dto.getName())
.setParameter("passwd", dto.getPasswd())
.setParameter("team", dto.getTeam())
.getQueryString();
update(sql);
}
public void removeMinUserinfo(@NotNull final MinUserinfoDto dto) {
final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateMinUserinfoIsenable")
.setParameter("userid", dto.getUserid())
.setParameter("isenable", dto.getIsenable())
.getQueryString();
update(sql);
}
}

@ -1,10 +1,12 @@
package com.xit.biz.ctgy.v2.service;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.ParkingImageDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Map;
@ -34,4 +36,8 @@ public interface IParkingService {
void saveJudgeResult(JudgeListDto dto);
List<Map<String,Object>> findPicadImageByRcMaincode(@NotNull final Long rcMaincode);
List<Map<String,Object>> findFrecadImageByRcMaincode(@NotNull final Long rcMaincode);
List<Map<String,Object>> findContadImageByRcMaincode(@NotNull final Long rcMaincode);
}

@ -1,9 +1,6 @@
package com.xit.biz.ctgy.v2.service;
import com.xit.biz.ctgy.dto.GnRecallScDto;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.JudgeStdDto;
import com.xit.biz.ctgy.dto.JudgeTargetDto;
import com.xit.biz.ctgy.dto.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
@ -80,7 +77,7 @@ public interface IResidentAndDisabledService {
void saveJudgeStds(final JudgeStdDto dto);
Map<String,Object> findDashboard();
Map<String,Object> findDashboard(MinUserinfoDto dto);
//---------------------------------------------------------------------------------
// 심사자
@ -89,4 +86,6 @@ public interface IResidentAndDisabledService {
void saveJudgeResult(JudgeListDto dto);
void saveDateStds(final JudgeDetailDto dto);
}

@ -29,7 +29,7 @@ public class CtgyFileService implements ICtgyFileService {
@Value("${file.cmm.upload.root:c:/data/file/upload}")
private String rootPath;
@Value("${file.cmm.upload.path:/kangnamSIM/simUpFile/}")
@Value("${file.cmm.upload.pboard}")
private String uploadPath;
@Value("${file.cmm.upload.url}")

@ -2,6 +2,7 @@ package com.xit.biz.ctgy.v2.service.impl;
import com.xit.biz.ctgy.dto.MinUserinfoDto;
import com.xit.biz.ctgy.v2.repository.UserDao;
import com.xit.biz.ctgy.v2.repository.UserSubDao;
import com.xit.biz.ctgy.v2.service.IMinUserService;
import com.xit.core.constant.ErrorCode;
import com.xit.core.exception.CustomBaseException;
@ -21,6 +22,7 @@ public class MinUserService implements IMinUserService {
private final PasswordEncoder passwordEncoder;
private final UserDao userDao;
private final UserSubDao userSubDao;
//@Transactional(readOnly = true)
public Page<MinUserinfoDto> findMinUsers(final MinUserinfoDto dto, Pageable pageable) {
@ -49,17 +51,23 @@ public class MinUserService implements IMinUserService {
if(opUser.isPresent() && !Checks.isEmpty(opUser.get().getUserid())) throw new CustomBaseException(ErrorCode.MEMBER_EXISTS);
dto.setSaveInit();
userDao.insertMinUserinfoDto(dto);
userSubDao.insertMinUserinfoDto(dto);
}else{
// 비밀번호가 다른 경우
//if(!savedDto.get().getPasswd().equals(encPasswd)) dto.setPasswd(encPasswd);
userDao.updateMinUserinfoDto(dto);
userSubDao.updateMinUserinfoDto(dto);
}
}
@Override
//@Transactional
public void removeMinUser(MinUserinfoDto dto) {
if("0".equals(dto.getIsenable()))
dto.setIsenable("1");
else
dto.setIsenable("0");
userDao.removeMinUserinfo(dto);
userSubDao.removeMinUserinfo(dto);
}
}

@ -1,10 +1,7 @@
package com.xit.biz.ctgy.v2.service.impl;
import com.xit.biz.ctgy.CtgyConstants;
import com.xit.biz.ctgy.dto.JudgeListDto;
import com.xit.biz.ctgy.dto.MinSimsaUser680Dto;
import com.xit.biz.ctgy.dto.MinUserinfoDto;
import com.xit.biz.ctgy.dto.ParkingTargetDto;
import com.xit.biz.ctgy.dto.*;
import com.xit.biz.ctgy.v2.repository.ParkingDao;
import com.xit.biz.ctgy.v2.repository.UserDao;
import com.xit.biz.ctgy.v2.service.IParkingService;
@ -15,11 +12,8 @@ import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import javax.validation.constraints.NotNull;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -177,9 +171,21 @@ public class ParkingService implements IParkingService {
@Override
//@Transactional
public void saveJudgeResult(JudgeListDto dto){
parkingDao.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(),
dto.getMsuResult(),
dto.getMsuReason(),
LocalDate.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))));
parkingDao.updateMsuResonAndMsuResultByMsuCode(dto);
}
@Override
public List<Map<String,Object>> findPicadImageByRcMaincode(@NotNull final Long rcMaincode) {
return parkingDao.findPicadImageByRcMaincode(rcMaincode);
}
@Override
public List<Map<String, Object>> findFrecadImageByRcMaincode(@NotNull final Long rcMaincode) {
return parkingDao.findFrecadImageByRcMaincode(rcMaincode);
}
@Override
public List<Map<String, Object>> findContadImageByRcMaincode(@NotNull final Long rcMaincode) {
return parkingDao.findContadImageByRcMaincode(rcMaincode);
}
}

@ -271,18 +271,38 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
if(cnt >= stdCnt) msResult = CtgyConstants.Judge.RESULT_JUDGE_IMPOSE.getCode();
residentAndDisabledDao.updateMsResult(msMaincode, msSeq, msResult);
String scState = "";
String scAnswer = "";
if("1".equals(msResult)){
if("2".equals(dto.getDataGb())){
scState = CtgyConstants.Judge.RESULT_STATE_DISABLED_NON_IMPOSE.getCode();
scAnswer = CtgyConstants.Judge.RESULT_STATE_DISABLED_NON_IMPOSE.getDesc();
}else{
scState = CtgyConstants.Judge.RESULT_STATE_NON_IMPOSE.getCode();
scAnswer = CtgyConstants.Judge.RESULT_STATE_NON_IMPOSE.getDesc();
}
}else if("2".equals(msResult)){
if("2".equals(dto.getDataGb())){
scState = CtgyConstants.Judge.RESULT_STATE_DISABLED_IMPOSE.getCode();
scAnswer = CtgyConstants.Judge.RESULT_STATE_DISABLED_IMPOSE.getDesc();
}else{
scState = CtgyConstants.Judge.RESULT_STATE_IMPOSE.getCode();
scAnswer = CtgyConstants.Judge.RESULT_STATE_IMPOSE.getDesc();
}
}
residentAndDisabledDao.updateState(msMaincode, msSeq, scState, scAnswer);
}
});
}
//@Transactional(readOnly = true)
public Map<String,Object> findDashboard(){
public Map<String,Object> findDashboard(MinUserinfoDto dto){
Map<String, Object> resultMap = new HashMap<>();
resultMap.put("pBoardList", publicBoardDao.findAll(new MinInfoBoard680Dto(), PageRequest.of(0, 7)));
resultMap.put("parkJudgeList", parkingDao.findDashboardJudgeList());
resultMap.put("residentJudgeList", residentAndDisabledDao.findDashboardJudgeList(CtgyConstants.Judge.DATAGB_RESIDENT.getCode()));
resultMap.put("disabledJudgeList", residentAndDisabledDao.findDashboardJudgeList(CtgyConstants.Judge.DATAGB_DISABLED.getCode()));
resultMap.put("parkJudgeList", parkingDao.findDashboardJudgeList(dto));
resultMap.put("residentJudgeList", residentAndDisabledDao.findDashboardJudgeList(CtgyConstants.Judge.DATAGB_RESIDENT.getCode(), dto));
resultMap.put("disabledJudgeList", residentAndDisabledDao.findDashboardJudgeList(CtgyConstants.Judge.DATAGB_DISABLED.getCode(), dto));
return resultMap;
}
@ -320,9 +340,16 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService {
@Override
//@Transactional
public void saveJudgeResult(JudgeListDto dto){
residentAndDisabledDao.updateMsuResonAndMsuResultByMsuCode(dto.getMsuCode(),
dto.getMsuResult(),
dto.getMsuReason(),
LocalDate.parse(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))));
residentAndDisabledDao.updateMsuResonAndMsuResultByMsuCode(dto);
}
@Override
//@Transactional
public void saveDateStds(JudgeDetailDto dto){
if (Checks.isEmpty(dto.getMsDatagb())) {
parkingDao.updateDateByMsuYear(dto);
}else{
residentAndDisabledDao.updateDateByMsuYear(dto);
}
}
}

@ -1,8 +1,10 @@
package com.xit.core.config;
import com.xit.core.constant.XitConstants;
import com.xit.core.oauth2.config.properties.CorsProperties;
import com.xit.core.oauth2.oauth.AuthInterceptor;
import com.xit.core.support.RestTemplateLoggingRequestInterceptor;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
@ -51,8 +53,7 @@ import java.util.concurrent.TimeUnit;
@Slf4j
@Configuration
@EnableSpringDataWebSupport
//@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class, HibernateJpaAutoConfiguration.class})
//@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
@RequiredArgsConstructor
public class WebCommonConfig extends AsyncConfigurerSupport implements WebMvcConfigurer {
private static final String[] EXCLUDE_LOCALE_CHANGE_LIST = {
"/resources/**",
@ -74,6 +75,8 @@ public class WebCommonConfig extends AsyncConfigurerSupport implements WebMvcCon
@Value("${xit.locale}")
private String locale;
private final CorsProperties corsProperties;
//---------------------------------------------------------------------------
// Locale Resolver Setting : Cookie
//---------------------------------------------------------------------------
@ -168,19 +171,19 @@ public class WebCommonConfig extends AsyncConfigurerSupport implements WebMvcCon
//---------------------------------------------------------------------------
// /**
// * CORS 설정
// * TODO :: SecurityConfig#corsConfigurationSource 설정이 안돼는 경우 적용
// * @param registry CorsRegistry
// *
// * @see SecurityConfig#corsConfigurationSource()
// */
/**
* CORS
* TODO :: SecurityConfig#corsConfigurationSource
* @param registry CorsRegistry
*
* @see SecurityConfig#corsConfigurationSource()
*/
// @Override
// public void addCorsMappings(CorsRegistry registry) {
// registry.addMapping("/**")
// .allowedOrigins("")
// .allowedMethods("GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS")
// .allowedHeaders("*")
// .allowedOrigins(corsProperties.getAllowedOrigins())
// .allowedMethods(corsProperties.getAllowedMethods())
// .allowedHeaders(corsProperties.getAllowedHeaders())
// .allowCredentials(true)
// .maxAge(3600);
// }

@ -31,7 +31,7 @@ import java.util.Objects;
@Slf4j
public class LoggerAspect {
// respons 출력 여부
@Value("${api.reponse.logging}")
@Value("${api.response.logging}")
private boolean isResLogging;
@Pointcut("execution(* com.xit..*Controller.*(..))") // 이런 패턴이 실행될 경우 수행

@ -4,6 +4,10 @@ import com.plf.client.Client;
import com.xit.biz.cmm.dto.ComboCodeDto;
import com.xit.core.constant.ErrorCode;
import com.xit.core.exception.MpowerException;
import com.xit.core.oauth2.config.properties.IDatabaseProperties;
import com.xit.core.util.Checks;
import com.xit.core.util.CommUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
@ -11,6 +15,7 @@ import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
@ -20,15 +25,23 @@ import java.time.format.DateTimeFormatter;
import java.util.*;
@Slf4j
@RequiredArgsConstructor
public abstract class BaseMpowerDaoSupport {
@Value("${mpower.dbName}")
private String dbName;
private String hostip = "127.0.0.1";
private int port = 9999;
private final IDatabaseProperties databaseProperties;
public void setDbName(String dbName){
this.dbName = dbName;
}
@Value("${mpower.file.hostIp}")
private String fileHostIp;
@Value("${mpower.file.port}")
private int fileHostPort;
@Value("${mpower.file.serviceName}")
private String fileServiceName;
// 주정차이미지경로
@Value("${mpower.file.parkingImagePath}")
private String parkingImagePath;
@Value("${mpower.file.savedImgPath}")
private String savedImgPath;
public <T> T selectOne(Class<T> type, String sql, String fields){
Objects.requireNonNull(type, "Class cannot be null");
@ -235,8 +248,10 @@ public abstract class BaseMpowerDaoSupport {
if(row > 1) throw new MpowerException("조회된 데이타가 단일행이 아닙니다");
map = new HashMap<>();
List<String> fields = getFeilds(fieldStr);
String value = null;
for (int j = 0; j < fields.size(); j++) {
map.put(fields.get(j), client.getString("list1", 0, j));
value = client.getString("list1", 0, j);
map.put(fields.get(j), " ".equals(value)? "" : value);
}
}else{
throw new MpowerException("SQL 오류::"+result);
@ -252,6 +267,46 @@ public abstract class BaseMpowerDaoSupport {
}
}
/**
*
* @param sql
* @param inParams
* @param outParams result, message...
*/
public Map<String, Object> executeSp(String sql, List<String> inParams, List<String> outParams){
Objects.requireNonNull(sql, "SQL cannot be null");
Map<String,Object> map = new HashMap<>();
Client client = null;
try {
client = getConnection();
client.setInput("SQLXML", getSpQueryXml(sql, inParams, outParams));
client.Request();
//map.put("result", client.getString("result", 0, 0));
String result = client.getString("result", 0, 0);
if(result.equals("true")) {
for (int i = 0; i < client.getMaxCol("list1"); i++) {
map.put(outParams.get(i), client.getString("list1", 0, i));
}
}else{
map.put(outParams.get(0), "-9999");
map.put(outParams.get(1), result);
}
return map;
}catch (MpowerException e){
throw e;
}catch (Exception e){
throw new MpowerException(ErrorCode.MPOWER_ERROR);
} finally {
disConnection(client);
}
}
public List<Map<String, Object>> selectMapList(String sql, String fieldStr){
Objects.requireNonNull(sql, "SQL cannot be null");
List<Map<String,Object>> list = new ArrayList<>();
@ -267,12 +322,14 @@ public abstract class BaseMpowerDaoSupport {
if (result.equals("true")){
row = client.getMaxRow("list1");
List<String> fields = getFeilds(fieldStr);
String value = null;
for(int i = 0; i < row; i++) {
Map<String, Object> map = new HashMap<>();
for (int j = 0; j < fields.size(); j++) {
map.put(fields.get(j), client.getString("list1", i, j));
value = client.getString("list1", i, j);
map.put(fields.get(j), " ".equals(value)? "" : value);
}
list.add(map);
}
@ -330,11 +387,12 @@ public abstract class BaseMpowerDaoSupport {
}
private String getQueryXml(String syntax, String sql){
log.info(sql);
log.info("\n{}",sql);
return String.format(
"%s%s%s%s%s%s%s",
"<?xml version='1.0' encoding='euc-kr'?>\n<QUERYS DBNAME='",
dbName,
//CtgyConstants.DB_MASTER.equals(dbTarget)? masterDatabaseProperties.getDbName() : slaveDatabaseProperties.getDbName(),
databaseProperties.getDbName(),
"' DEBUG='true'>\n<QUERY TYPE='",
syntax,
"' BATCH='false'>\n<SQL><![CDATA[\n",
@ -342,10 +400,44 @@ public abstract class BaseMpowerDaoSupport {
"\n]]></SQL></QUERY></QUERYS>");
}
private String getSpQueryXml(String sql, List<String> inParams, List<String> outParams){
log.info("\n{}",sql);
String str = String.format(
"%s%s%s%s%s%s%s",
"<?xml version='1.0' encoding='euc-kr'?>\n<QUERYS DBNAME='",
databaseProperties.getDbName(),
"' DEBUG='true'>\n<QUERY TYPE='spcall' BATCH='false'>\n<SQL><![CDATA[\n",
sql,
"\n]]></SQL>",
setSpParam(inParams, outParams),
"\n</QUERY></QUERYS>");
log.info(str);
return str;
}
private String setSpParam(List<String> inParams, List<String> outParams){
StringBuilder sb = new StringBuilder();
sb.append("<PARAMS>");
inParams.forEach((s) -> {
sb.append("\n<PARAM><![CDATA[");
sb.append("I:").append(s);
sb.append("]]></PARAM>");
});
outParams.forEach((s) -> {
sb.append("\n<PARAM><![CDATA[");
sb.append("O:").append(s);
sb.append("]]></PARAM>");
});
sb.append("\n</PARAMS>");
return sb.toString();
}
private Client getConnection(){
Client mpowerClient = new Client(hostip, port);
mpowerClient.setCryptEnable(false);
Client mpowerClient = null;
try {
mpowerClient = new Client(databaseProperties.getHostIp(), databaseProperties.getPort());
mpowerClient.setCryptEnable(false);
mpowerClient.getConnection("MPowerXmlToQuery.xmlQuery1");
} catch (Exception e) {
throw new MpowerException(ErrorCode.MPOWER_CONNECT_ERROR);
@ -365,6 +457,7 @@ public abstract class BaseMpowerDaoSupport {
Objects.requireNonNull(sql, "SQL cannot be null");
Client client = null;
int rtn = 0;
try {
client = getConnection();
client.setInput("SQLXML", getQueryXml(syntax, sql));
@ -373,11 +466,11 @@ public abstract class BaseMpowerDaoSupport {
String result = client.getString("result", 0, 0);
if (result.equals("true")){
System.out.println("<<<<<<<<<<<<===========#$#$#$$##$#$$#$#$$$$$$$====>>>>>>>>>");
rtn = 1;
}else{
throw new MpowerException("SQL 오류::"+result);
}
return 1;
return rtn;
}catch (MpowerException e){
throw e;
@ -397,6 +490,7 @@ public abstract class BaseMpowerDaoSupport {
throw new MpowerException("DB Result 객체 오류");
}
Field[] clsFields = type.getDeclaredFields();
String value = null;
for (int j = 0; j < fields.size(); j++) {
for (Field fd : clsFields) {
@ -406,7 +500,7 @@ public abstract class BaseMpowerDaoSupport {
if (fields.get(j).equals(fd.getName())) {
//log.info("===>>>{}::{}", fd.getName(), client.getString("list1", row, j));
// null 인 경우 => " " 으로 mpower에서 전환되고 있다
String value = client.getString("list1", row, j);
value = client.getString("list1", row, j);
if(" ".equals(value)) value = "";
if (fd.getType() == Integer.class || fd.getType() == Integer.TYPE){
@ -446,54 +540,216 @@ public abstract class BaseMpowerDaoSupport {
for(String s : strs) list.add(s.trim());
return list;
}
}
/*
public List<Map<String,Object>> getParkingJudgeImgList(String photocode, String imgDiv){
List<Map<String,Object>> list = new ArrayList<>();
Client client = new Client(fileHostIp, fileHostPort);
String filePath = getAbsImgPath(photocode);
String svrImgPath = parkingImagePath + filePath; //터널링에 저장된 단속사진 경로
String svrSavedPhotoPath = savedImgPath + "/" + filePath;
log.info("Mpower 이미지경로:::::" + svrImgPath);
log.info("서버 download file path :::::" + svrSavedPhotoPath);
//첨부파일 터널링 서버로 복사
public void fnFileUpload(String tmpFileLocation,String realRcRilenm){
String fph = tunullingFile; //터널링에 복사되는 파일경로
try{
Client mp = new Client("127.0.0.1", 2500);
mp.getConnection("XitFile.XitUpload");
mp.setInput("dir",tunullingFile);
mp.setInput("upfile1",tmpFileLocation+realRcRilenm,true);
mp.Request();
}catch(Exception e){
e.printStackTrace();
client.getConnection(fileServiceName);
String mpowerFilePre = String.format("%s%s%s", svrImgPath, "picad".equals(imgDiv)? "/P" : "/R", CommUtil.lpad(photocode, '0', 10));
List<String> fileNames = Arrays.asList("A.jpg", "B.jpg", "C.jpg", "D.jpg", "E.jpg", "F.jpg", "G.jpg", "H.jpg", "I.jpg", "J.jpg", "K.jpg", "L.jpg", "M.jpg");
int index = 1;
if("picad".equals(imgDiv)){
// A, B, C, D
for(int idx = 0; idx <=3; idx++) client.setInput("dnfile"+index++,mpowerFilePre + fileNames.get(idx));
}else if("frecad".equals(imgDiv)) {
index = 1;
// A, B, C, D
for (int idx = 0; idx <= 3; idx++) client.setInput("dnfile" + index++, mpowerFilePre + fileNames.get(idx));
}else {
index = 1;
// F, G, H, I
for (int idx = 5; idx <= 8; idx++) client.setInput("dnfile" + index++, mpowerFilePre + fileNames.get(idx));
}
//logger.debug(fph);
client.Request();
String result = client.getString("result", 0, 0);
File file = new File(svrSavedPhotoPath);
if (result.equals("true")){
fileDownAndSet(list, client, svrSavedPhotoPath, file);
}else{
throw new MpowerException("MPower File download error::"+result);
}
//-----------------------------------------------------------------
// 단속사진 return
//-----------------------------------------------------------------
if("picad".equals(imgDiv)) return list;
//터널링에서 웹서버로 첨부파일 복사
public static void fnDownFile(String fileName,String sessionId){
String serviceName = "XitFile.XitDownload";
String fph = MpowerUtil.class.getResource("").getPath();
fph = fph.replace("WEB-INF/classes/xit/cmmn/utill/", "vioPhoto/"+sessionId+"/"); //웹서버 저장 위치
String fphs = fph.substring(0,1);
if(fphs.equals("/")){
fph = fph.substring(1);
disConnection(client);
client.getConnection(fileServiceName);
//-----------------------------------------------------------------
// 진술서 return
//-----------------------------------------------------------------
if("frecad".equals(imgDiv)) {
// E
client.setInput("dnfile1", mpowerFilePre + "E.jpg");
client.Request();
result = client.getString("result", 0, 0);
if (result.equals("true")) {
if (Checks.isNotEmpty(client.getFileName("imageA"))) {
if (!file.exists()) file.mkdirs();
if(!new File(svrSavedPhotoPath + "/" + client.getFileName("imageA")).exists()){
log.info("file download ::: {}", svrSavedPhotoPath + "/" + client.getFileName("imageA"));
client.savefile("imageA", svrSavedPhotoPath);
}
setFileInfo(list, client.getFileName("imageA"), svrSavedPhotoPath);
}
}
return list;
}
String tmpTunullingFile = tunullingFile; //터널링에 저장된 단속사진 경로
try{
Client mp = new Client("127.0.0.1", 2500);
mp.getConnection("XitFile.XitDownload");
mp.setInput("dnfile1",tmpTunullingFile+ fileName); //터널링에 실질 존재하는 경로,파일명
mp.Request();
String result = mp.getString("result", 0, 0);
disConnection(client);
client.getConnection(fileServiceName);
//-----------------------------------------------------------------
// 참고자료 return
//-----------------------------------------------------------------
index = 1;
// J, K, L, M
for (int idx = 9; idx <= 12; idx++) client.setInput("dnfile" + index++, mpowerFilePre + fileNames.get(idx));
client.Request();
result = client.getString("result", 0, 0);
if (result.equals("true")){
fileDownAndSet(list, client, svrSavedPhotoPath, file);
}else{
throw new MpowerException("MPower File download error::"+result);
}
disConnection(client);
client.getConnection(fileServiceName);
client.setInput("dnfile1", mpowerFilePre + "N.jpg");
client.setInput("dnfile2", mpowerFilePre + "O.jpg");
client.Request();
result = client.getString("result", 0, 0);
if (result.equals("true")){
mp.getFileName("imageA");
mp.savefile("imageA", fph);
if(Checks.isNotEmpty(client.getFileName("imageA"))){
if(!file.exists()) file.mkdirs();
if(!new File(svrSavedPhotoPath + "/" + client.getFileName("imageA")).exists()){
log.info("file download ::: {}", svrSavedPhotoPath + "/" + client.getFileName("imageA"));
client.savefile("imageA", svrSavedPhotoPath);
}
setFileInfo(list, client.getFileName("imageA"), svrSavedPhotoPath);
}
if(Checks.isNotEmpty(client.getFileName("imageB"))){
if(!file.exists()) file.mkdirs();
if(!new File(svrSavedPhotoPath + "/" + client.getFileName("imageB")).exists()){
log.info("file download ::: {}", svrSavedPhotoPath + "/" + client.getFileName("imageB"));
client.savefile("imageB", svrSavedPhotoPath);
}
setFileInfo(list, client.getFileName("imageB"), svrSavedPhotoPath);
}
}else{
throw new MpowerException("MPower File download error::"+result);
}
client = null;
return list;
}catch(Exception e){
e.printStackTrace();
throw new MpowerException("MPower File download error::"+e.getLocalizedMessage());
}
//logger.debug("웹서버 저장되는 첨부파일 위치:"+fph);
System.out.println("웹서버 저장되는 첨부파일 위치:"+fph);
}
private void fileDownAndSet(List<Map<String, Object>> list, Client client, String svrSavedPhotoPath, File file) throws IOException {
*/
if(Checks.isNotEmpty(client.getFileName("imageA"))){
if(!file.exists()) file.mkdirs();
if(!new File(svrSavedPhotoPath + "/" + client.getFileName("imageA")).exists()){
log.info("file download ::: {}", svrSavedPhotoPath + "/" + client.getFileName("imageA"));
client.savefile("imageA", svrSavedPhotoPath);
}
setFileInfo(list, client.getFileName("imageA"), svrSavedPhotoPath);
}
if(Checks.isNotEmpty(client.getFileName("imageB"))){
if(!file.exists()) file.mkdirs();
if(!new File(svrSavedPhotoPath + "/" + client.getFileName("imageB")).exists()){
log.info("file download ::: {}", svrSavedPhotoPath + "/" + client.getFileName("imageB"));
client.savefile("imageB", svrSavedPhotoPath);
}
setFileInfo(list, client.getFileName("imageB"), svrSavedPhotoPath);
}
if(Checks.isNotEmpty(client.getFileName("imageC"))){
if(!file.exists()) file.mkdirs();
if(!new File(svrSavedPhotoPath + "/" + client.getFileName("imageC")).exists()){
log.info("file download ::: {}", svrSavedPhotoPath + "/" + client.getFileName("imageC"));
client.savefile("imageC", svrSavedPhotoPath);
}
setFileInfo(list, client.getFileName("imageC"), svrSavedPhotoPath);
}
if(Checks.isNotEmpty(client.getFileName("imageD"))){
if(!file.exists()) file.mkdirs();
if(!new File(svrSavedPhotoPath + "/" + client.getFileName("imageD")).exists()){
log.info("file download ::: {}", svrSavedPhotoPath + "/" + client.getFileName("imageD"));
client.savefile("imageD", svrSavedPhotoPath);
}
setFileInfo(list, client.getFileName("imageD"), svrSavedPhotoPath);
}
}
private void setFileInfo(List<Map<String, Object>> list, String imgName, String strpath) {
Map<String, Object> map = new HashMap<>();
map.put("imgName", imgName);
map.put("url", strpath + "/" + imgName);
list.add(map);
}
private void setNoFileInfo(List<Map<String, Object>> list) {
Map<String, Object> map = new HashMap<>();
map.put("imgName", "");
map.put("url", "/images/noFile.png");
list.add(map);
}
public String getAbsImgPath(String code){
code = Checks.checkEmptyVal(code,"0");
double intCode = Double.parseDouble(code);
return getImgPath(intCode, "00001", 10000) + "/"
+ getImgPath(Double.parseDouble(code.substring(code.length()-4, code.length())), "0001", 1000) + "/"
+ getImgPath(Double.parseDouble(code.substring(code.length()-3, code.length())), "001", 100);
}
private String getImgPath(double intCode, String baseDir, int baseValue){
if(intCode <= baseValue) return baseDir;
int tmpL = (int)intCode/baseValue; //나눈값
double dtmpL = intCode/baseValue; //나눈값
String tmpS = String.valueOf(dtmpL);
tmpS = tmpS.substring(tmpS.indexOf(".")+1);
int tmpM = Integer.parseInt(tmpS);
if(tmpM > 0) tmpL = tmpL+1;
StringBuilder stmpL = new StringBuilder(String.valueOf(tmpL));
int tmpCnt = baseDir.length() - stmpL.length();
for(int i = 0; i < tmpCnt; i++) stmpL.insert(0, "0");
return stmpL.toString();
}
}

@ -2,6 +2,7 @@ package com.xit.core.oauth2.api.dao;
import com.xit.core.config.database.BaseMpowerDaoSupport;
import com.xit.core.oauth2.api.entity.RefreshToken;
import com.xit.core.oauth2.config.properties.MasterDatabaseProperties;
import com.xit.core.support.sql.parser.QueryGenerator;
import org.springframework.stereotype.Repository;
@ -9,6 +10,11 @@ import java.util.Optional;
@Repository
public class RefreshTokenDao extends BaseMpowerDaoSupport {
public RefreshTokenDao(MasterDatabaseProperties databaseProperties) {
super(databaseProperties);
}
public RefreshToken findByKey(String key){
String sql = QueryGenerator.createNamedQuery("refreshToken", "selectRefreshToken")
.setParameter("key", key)

@ -0,0 +1,7 @@
package com.xit.core.oauth2.config.properties;
public interface IDatabaseProperties {
String getHostIp();
String getDbName();
int getPort();
}

@ -0,0 +1,14 @@
package com.xit.core.oauth2.config.properties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
@Getter
@Setter
@ConfigurationProperties(prefix = "mpower.master")
public class MasterDatabaseProperties implements IDatabaseProperties{
private String hostIp;
private int port;
private String dbName;
}

@ -0,0 +1,14 @@
package com.xit.core.oauth2.config.properties;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
@Getter
@Setter
@ConfigurationProperties(prefix = "mpower.slave")
public class SlaveDatabaseProperties implements IDatabaseProperties{
private String hostIp;
private int port;
private String dbName;
}

@ -123,9 +123,10 @@ public class BasicSqlQuery implements SqlQuery {
@Override
public String getQueryString() {
SqlNode rootSqlNode = SimpleSqlNodeFactory.getSqlNode(element, parameterMap);
return rootSqlNode.getFullText().trim()
.replaceAll(System.lineSeparator(), " ")
.replaceAll(" +", " ");
return rootSqlNode.getFullText();
// return rootSqlNode.getFullText().trim()
// .replaceAll(System.lineSeparator(), " ")
// .replaceAll(" +", " ");
}
private String prevProcessValue(String value) {

@ -12,6 +12,9 @@ import java.io.IOException;
import java.util.Objects;
import java.util.Properties;
/**
* .yaml @PeopertySource annotaion (.property )
*/
public class YamlPropertySourceFactory implements PropertySourceFactory {
@Override
public PropertySource<?> createPropertySource(@Nullable String name, EncodedResource resource) throws IOException {

@ -13,8 +13,6 @@ spring:
init:
mode: always
platform: oracle
#schema-locations: classpath:/data/h2/schema.sql
#data-locations: classpath:/data/h2/data.sql
# ==================================================================================================================
# logging lib setting
@ -37,3 +35,47 @@ logging:
springdoc:
api-docs:
enabled: true
# ==================================================================================================================
# project config
# ==================================================================================================================
cors:
allowed-origins: https://fonts.gstatic.com,http://localhost,http://211.119.124.107
# api response logging 여부
api:
response:
logging: false
file:
cmm:
upload:
root: d:/data/file/upload
# root: /Users/minuk/data/file/upload
# 공지사항
pboard: /simUpFile #/kangnamSIM/simUpFile
simsaPath: /simUpFile_sc1, /simUpFile_sc2 # 거주자 simUpFile_sc1, 장애인 simUpFile_sc2
url: http://traffic.gangnam.go.kr
allow:
ext:
max:
size: 10000000
mpower:
master:
hostIp: 127.0.0.1
port: 9999
dbName: gn
slave:
hostIp: 127.0.0.1
port: 9999
dbName: gn_seconddb
file:
hostIp: 127.0.0.1
port: 9999
serviceName: XitFile.XitDownload
# 주정차이미지경로-mpower
parkingImagePath: C:/NewTraffic_Photo/JUCHA_PHOTO/
# 주정차이미지 다운로드 저장 경로
savedImgPath: D:/data/file/juchaPhoto

@ -2,72 +2,35 @@ server:
port: 8090
spring:
output:
ansi:
enabled: always # always / detect / never
config:
activate:
on-profile: local
sql:
init:
mode: always
platform: h2 #postgres
platform: oracle
#schema-locations: classpath:/data/h2/schema.sql
#data-locations:
# - classpath:/data/h2/TRAFFIC_MIN_USERINFO.sql
# - classpath:/data/h2/TRAFFIC_MIN_SIMSA_USER680.sql
# ==================================================================================================================
# database setting
# logging lib setting
# ==================================================================================================================
datasource:
# driver-class-name: org.postgresql.Driver #org.h2.Driver
# url: jdbc:postgresql://localhost:5432/bustms
# username: traffic
# password: xhdgkq0
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:xitdb;MODE=Oracle;DATABASE_TO_LOWER=TRUE;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
username: sa
password: ''
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
read-only: false
# ==================================================================================================================
# JPA setting
# ==================================================================================================================
jpa:
database-platform: org.hibernate.dialect.PostgreSQLDialect
#show-sql: false
properties:
hibernate:
hbm2ddl:
# create / create-drop / update / validate / none
auto: create-drop
h2:
console:
enabled: true
path: /h2-console
# ==================================================================================================================
# JPA logging lib setting
# ==================================================================================================================
decorator:
datasource:
p6spy:
enable-logging: true
logging:
level:
# spring.mvc.log-request-details=debug 활성화
web: debug
root: info
# hibernate sql log 출력시 변수 바인딩
org:
#hibernate:
#type: trace
springframework:
transaction:
interceptor: TRACE
orm:
jpa: TRACE
# ==================================================================================================================
# Spring-doc 활성
@ -75,3 +38,46 @@ logging:
springdoc:
api-docs:
enabled: true
# ==================================================================================================================
# project config
# ==================================================================================================================
cors:
allowed-origins: https://fonts.gstatic.com,http://localhost:3000
# api response logging 여부
api:
response:
logging: true
file:
cmm:
upload:
root: d:/data/file/upload
# root: /Users/minuk/data/file/upload
# 공지사항
pboard: /simUpFile #/kangnamSIM/simUpFile
simsaPath: /simUpFile_sc1, /simUpFile_sc2 # 거주자 simUpFile_sc1, 장애인 simUpFile_sc2
url: http://traffic.gangnam.go.kr
allow:
ext:
max:
size: 10000000
mpower:
master:
hostIp: 127.0.0.1
port: 9999
dbName: gn
slave:
hostIp: 127.0.0.1
port: 9999
dbName: gn_seconddb
file:
hostIp: 127.0.0.1
port: 9999
serviceName: XitFile.XitDownload
# 주정차이미지경로-mpower
parkingImagePath: C:/NewTraffic_Photo/JUCHA_PHOTO/
# 주정차이미지 다운로드 저장 경로
savedImgPath: D:/data/file/juchaPhoto

@ -66,14 +66,6 @@ spring:
tokenUri: https://graph.facebook.com/v3.0/oauth/access_token
userInfoUri: https://graph.facebook.com/v3.0/me?fields=id,first_name,middle_name,last_name,name,email,verified,is_verified,picture.width(250).height(250)
# Spring Security cors 설정 :: CorsConfiguration 설정 값
cors:
allowed-origins: http://localhost:3000,http://localhost,http://211.119.124.107
allowed-methods: GET,POST,PUT,DELETE,OPTIONS
allowed-headers: '*'
max-age: 3600
# HS512 알고리즘을 사용할 것이기 때문에 512bit, 즉 64byte 이상의 secret key를 사용해야 한다.
# Base64.getEncoder().withoutPadding().encodeToString(orgString.getBytes())
# new String(Base64.getDecoder().decode(encodedString))

@ -0,0 +1,77 @@
server:
port: 8090
spring:
config:
activate:
on-profile: prod
sql:
init:
mode: always
# ==================================================================================================================
# logging lib setting
# ==================================================================================================================
logging:
level:
root: INFO
# spring.mvc.log-request-details=debug 활성화
web: debug
org:
springframework:
transaction:
interceptor: TRACE
orm:
jpa: TRACE
# ==================================================================================================================
# Spring-doc 활성
# ==================================================================================================================
springdoc:
api-docs:
enabled: true
# ==================================================================================================================
# project config
# ==================================================================================================================
cors:
allowed-origins: https://fonts.gstatic.com,http://localhost,http://211.35.57.20:3000
# api response logging 여부
api:
response:
logging: false
file:
cmm:
upload:
root: d:/
# root: /Users/minuk/data/file/upload
# 공지사항
pboard: /simUpFile #/kangnamSIM/simUpFile
simsaPath: /simUpFile_sc1, /simUpFile_sc2 # 거주자 simUpFile_sc1, 장애인 simUpFile_sc2
url: http://traffic.gangnam.go.kr
allow:
ext:
max:
size: 10000000
mpower:
master:
hostIp: 127.0.0.1
port: 2500
dbName: default
slave:
hostIp: 127.0.0.1
port: 2500
dbName: gn_seconddb
file:
hostIp: 127.0.0.1
port: 2500
serviceName: XitFile.XitDownload
# 주정차이미지경로-mpower
parkingImagePath: D:/jucha_ftp/JUCHA_PHOTO/
# 주정차이미지 다운로드 저장 경로
savedImgPath: D:/data/file/juchaPhoto

@ -1,51 +0,0 @@
server:
port: 18080
spring:
config:
activate:
on-profile: test
sql:
init:
mode: always
platform: h2
datasource:
driver-class-name: org.h2.Driver
url: jdbc:h2:mem:xitdb;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE
username: sa
password: ''
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
jpa:
database-platform: org.hibernate.dialect.H2Dialect
show-sql: false
properties:
hibernate:
format_sql: true
use_sql_comments: false
hbm2ddl:
auto: create-drop
decorator:
datasource:
p6spy:
enable-logging: true
logging:
level:
root: info
org:
hibernate:
type: trace
springframework:
web:
filter: error
springdoc:
api-docs:
enabled: false

@ -2,10 +2,8 @@ spring:
application:
name: xit-framework
#description: XIT api for development
config:
import: classpath:config/conf.yml
profiles:
active: dev
active: prod
include: oauth
main:
# bean name 중복 허용 - junit 사용시 true??
@ -132,3 +130,24 @@ server:
enabled: true
tomcat:
basedir: .
# ==================================================================================================================
# project config
# ==================================================================================================================
# Spring Security cors 설정 :: CorsConfiguration 설정 값
cors:
allowed-origins: https://fonts.gstatic.com,http://localhost:3000,http://localhost,http://211.119.124.107,http://211.119.124.107:3000
allowed-methods: GET,POST,PUT,DELETE,OPTIONS
allowed-headers: '*'
max-age: 3600
xit:
api:
url: 'http://localhost:${server.port}'
version: '@project.version@'
# Authentification 저장 위치 : header / cookie / token
auth:
save:
type: header
# locale : ko / en
locale: ko

@ -1,33 +0,0 @@
xit:
api:
url: 'http://localhost:${server.port}'
version: '@project.version@'
# Authentification 저장 위치 : header / cookie / token
auth:
save:
type: header
# locale : ko / en
locale: ko
# api response logging 여부
api:
reponse:
logging: true
file:
cmm:
upload:
root: c:/data/file/upload
# root: /Users/minuk/data/file/upload
# 공지사항
path: /kangnamSIM/simUpFile
publicPath: /simUpFile #/kangnamSIM/simUpFile
simsaPath: /simUpFile_sc1, /simUpFile_sc2 # 거주자 simUpFile_sc1, 장애인 simUpFile_sc2
url: http://traffic.gangnam.go.kr
allow:
ext:
max:
size: 10000000
mpower:
dbName: gn

@ -0,0 +1,8 @@
사진경로 : D:/jucha_ftp/JUCHA_PHOTO/
주정차심의대상목록
조건 추가 필요
AND MS_CDATE>=SYSDATE
주정차 관리자 심의 결과 저장 시 프로시저 호출
SIMSA_EDIT_RESULT

@ -4,12 +4,14 @@
<springProfile name="local">
<!-- <property name="LOG_PATH" value="/data/xit/logs"/>-->
<property name="LOG_PATH" value="/Users/minuk/data/xit/logs"/>
<property name="LOG_PATH" value="d:/data/xit/logs"/>
<!-- <property name="LOG_PATH" value="/Users/minuk/data/xit/logs"/>-->
</springProfile>
<springProfile name="dev,prod">
<!-- <property name="LOG_PATH" value="/data/xit/logs"/>-->
<property name="LOG_PATH" value="/Users/minuk/data/xit/logs"/>
<springProfile name="dev">
<property name="LOG_PATH" value="d:/data/xit/logs"/>
</springProfile>
<springProfile name="prod">
<property name="LOG_PATH" value="d:/data/xit/logs"/>
</springProfile>
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>

@ -4,7 +4,7 @@
<native-query id="selectUserInfo">
/* minuserinfo-mapper|selectUserInfo|julim */
SELECT userid,
passwd,
TRAFFIC.ECL_DECRYPT(passwd) AS passwd,
name,
regnum,
mphone,
@ -38,7 +38,7 @@
, gu
, isenable
, mphone
, passwd
, TRAFFIC.ECL_DECRYPT(passwd) AS passwd
, regdate
, regnum
, team
@ -57,7 +57,7 @@
, isenable
, mphone
, name
, passwd
, TRAFFIC.ECL_DECRYPT(passwd) AS passwd
, regdate
, regnum
, team
@ -133,12 +133,12 @@
<native-query id="updateMinUserinfo">
/* minuserinfo-mapper|updateMinUserinfo|julim */
UPDATE min_userinfo
SET passwd = #{passwd}
, accesstype = #{accesstype}
SET accesstype = #{accesstype}
, team = #{team}
, name = #{name}
, mphone = #{mphone}
, email = #{email}
, passwd = #{passwd}
WHERE userid= #{userid}
</native-query>

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings namespace="userSub">
<native-query id="insertMinUserinfo">
/* minusersubinfo-mapper|insertMinUserinfo|julim */
INSERT
INTO min_userinfo (
userid
, accesstype
, email
, gu
, isenable
, mphone
, name
, passwd
, regdate
, team
) VALUES (
#{userid}
, #{accesstype}
, #{email}
, #{gu}
, #{isenable}
, #{mphone}
, #{name}
, #{passwd}
, #{regdate}
, #{team}
)
</native-query>
<native-query id="updateMinUserinfo">
/* minusersubinfo-mapper|updateMinUserinfo|julim */
UPDATE min_userinfo
SET accesstype = #{accesstype}
, team = #{team}
, name = #{name}
, mphone = #{mphone}
, email = #{email}
, passwd = #{passwd}
WHERE userid= #{userid}
</native-query>
<native-query id="updateMinUserinfoIsenable">
/* minusersubinfo-mapper|updateMinUserinfoIsenable|julim */
UPDATE min_userinfo
SET isenable = #{isenable}
WHERE userid= #{userid}
</native-query>
</entity-mappings>

@ -232,7 +232,7 @@
AND MSU.msu_team = #{msuTeam}
</if>
GROUP BY MS.ms_maincode, MS.ms_seq, MS.ms_carnum
ORDER BY MS.ms_maincode, MS.ms_seq, MS.ms_carnum
ORDER BY MS.ms_seq, MS.ms_maincode, MS.ms_carnum
</native-query>
<native-query id="selectParkingJudgeResultList">
@ -241,19 +241,19 @@
, MS.ms_seq AS msSeq
, MS.ms_carnum AS msCarnum
, MU.name
, MS.ms_result AS msResult
, DECODE(MS.ms_result, '1', '1', '2', '2', '0') AS msResult
, (SELECT code_nm
FROM tb_cmm_code_s
WHERE code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RESULT'
AND code_cd = MS.ms_result) as msResultNm
AND code_cd = DECODE(MS.ms_result, '1', '1', '2', '2', '0')) as msResultNm
, (SELECT code_nm
FROM tb_cmm_code_s
WHERE code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RESULT'
AND code_cd = MSU.msu_result) as msuResult
AND code_cd = DECODE(MSU.msu_result, '1', '1', '2', '2', '0')) as msuResult
FROM min_simsa680 MS
, min_simsa_user680 MSU
, min_userinfo MU
@ -267,7 +267,7 @@
AND MSU.msu_team = #{msuTeam}
</if>
AND MSU.msu_userid = MU.userid
ORDER BY MSU.msu_userid, MU.name, MS.ms_maincode, MS.ms_seq, MS.ms_carnum
ORDER BY MSU.msu_userid, MU.name, MS.ms_seq, MS.ms_maincode, MS.ms_carnum
</native-query>
<native-query id="selectJudegStdCount">
@ -322,16 +322,12 @@
ORDER BY TR.rc_seq
</native-query>
<native-query id="selectDashboardJudgeList">
/* parking-mapper|selectDashboardJudgeList|julim */
SELECT MS.ms_edate
, MSU.msu_team
, MU.name
, SUM(DECODE(MSU.msu_result, 0, 0, 1)) jcnt
, DECODE(#{accesstype}, '001', MU.name, '002', REGEXP_REPLACE(MU.name, '.', '*', 2)) name
, SUM(DECODE(MSU.msu_result, '1', 1, '2', 1, 0)) jcnt
, COUNT(*) tcnt
FROM min_simsa680 MS
, min_simsa_user680 MSU
@ -339,11 +335,11 @@
, (SELECT *
FROM (SELECT ms_edate
FROM min_simsa680
WHERE ms_result = '0'
WHERE DECODE(ms_result, '1', '1', '2', '2', '0') = '0'
ORDER BY ms_edate DESC)
WHERE ROWNUM = 1) T
WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_result = '0'
AND DECODE(MS.ms_result, '1', '1', '2', '2', '0') = '0'
AND MSU.msu_userid = MU.userid
AND MS.ms_edate = T.ms_edate
GROUP BY MS.ms_edate, MSU.msu_team, MU.name
@ -354,8 +350,8 @@
/* parking-mapper|selectByUserJudgeList|julim */
SELECT MS.ms_maincode
, MS.ms_seq
, MS.ms_carnum
, MS.ms_result
, REGEXP_REPLACE(MS.ms_carnum, '.', '*', 4) as ms_carnum
, DECODE(MS.ms_result, '1', '1', '2', '2', '0') as msResult
, MS.ms_year
, MS.ms_chasu
, MS.ms_sdate
@ -365,16 +361,19 @@
, MS.ms_closesi
, '' as ms_datagb
, MSU.msu_code
, MSU.msu_result
, DECODE(MSU.msu_result, '1', '1', '2', '2', '0') as msuResult
, MSU.msu_reason
, TM.mm_wdate as scWdate
, MS.ms_wdate
, MS.ms_pos
, TR.rc_maincode
, MSU.msu_userid
FROM min_simsa680 MS
, min_simsa_user680 MSU
, tf680_recall TR
, tf680_main TM
WHERE MS.ms_maincode = MSU.msu_maincode
AND DECODE(MS.ms_result, '1', '1', '2', '2', '0') = '0'
AND MS.ms_cdate &gt;= TO_CHAR(SYSDATE, 'YYYY-mm-dd')
AND MS.ms_maincode = TR.rc_code
AND TR.rc_maincode = TM.mm_code
AND MSU.msu_userid = #{msuUserid}
ORDER BY MS.ms_sdate, MS.ms_edate, MS.ms_seq
</native-query>
@ -386,6 +385,40 @@
, msu_result = #{msuResult}
, msu_indate = #{msuIndate}
WHERE msu_code = #{msuCode}
AND msu_userid = #{msuUserid}
</native-query>
<native-query id="selectRcMaincode">
/* parking-mapper|selectRcMaincode|julim */
SELECT rc_maincode
FROM tf680_recall
WHERE rc_code = #{msMaincode}
</native-query>
<native-query id="updateDateByMsuYear">
/* parking-mapper|updateDateByMsuYear|jhseo */
UPDATE min_simsa680
SET ms_sdate = #{msSdate}
, ms_startsi = #{msStartsi}
, ms_edate = #{msEdate}
, ms_cdate = #{msCdate}
, ms_closesi = #{msClosesi}
WHERE ms_year = #{msYear}
AND ms_chasu = #{msChasu}
</native-query>
<native-query id="insertErrorLog">
/* minuserinfo-mapper|insertErrorLog|jhseo */
INSERT
INTO min_simsa680_log (
ms_maincode,
ms_seq,
message
) VALUES (
#{msMaincode},
#{msSeq},
#{message}
)
</native-query>
</entity-mappings>

@ -146,8 +146,8 @@
sc_wdate,
sc_jbtime,
sc_pos,
sc_zipcode1,
sc_zipcode2,
zipcode1,
zipcode2,
sc_juso,
sc_bunji,
sc_frecad1,
@ -165,10 +165,12 @@
sc_contad5,
sc_contad6,
sc_contad7,
sc_contad8
sc_contad8,
sc_transfer,
sc_state
) VALUES (
gn_recall_sc_seq.NEXTVAL,
(SELECT RPAD(NVL(MAX(e.sc_seq), '2022'), 10, '0') + 1
(SELECT RPAD(NVL(MAX(e.sc_seq), #{curYear}), 10, '0') + 1
FROM gn_recall_sc e
WHERE e.sc_datagb = #{scDatagb}
AND e.sc_seq LIKE #{curYear} ||'%'),
@ -182,8 +184,8 @@
#{scWdate},
#{scJbtime},
#{scPos},
#{scZipcode1},
#{scZipcode2},
#{zipcode1},
#{zipcode2},
#{scJuso},
#{scBunji},
#{scFrecad1},
@ -201,7 +203,9 @@
#{scContad5},
#{scContad6},
#{scContad7},
#{scContad8}
#{scContad8},
'1',
'1'
)
</native-query>
@ -238,6 +242,7 @@
, sc_contad6 = NVL(#{scContad6}, sc_contad6)
, sc_contad7 = NVL(#{scContad7}, sc_contad7)
, sc_contad8 = NVL(#{scContad8}, sc_contad8)
, sc_answer = NVL(#{scAnswer}, sc_answer)
WHERE sc_code = #{scCode}
</native-query>
@ -381,6 +386,15 @@
WHERE sc_code = #{scCode}
</native-query>
<native-query id="updateState">
/* residentAndDisabled-mapper|updateState|jhseo */
UPDATE gn_recall_sc
SET sc_state = #{scState},
sc_answer = #{scAnswer}
WHERE sc_code = #{scCode}
AND sc_seq = #{scSeq}
</native-query>
<native-query id="insertJudgeUser">
/* minuserinfo-mapper|insertJudgeUser|julim */
INSERT
@ -449,7 +463,7 @@
, 0 as seo
, SUM(DECODE(MSU.MSU_RESULT, '1', 1, 0)) as mibu
, SUM(DECODE(MSU.MSU_RESULT, '1', 1, '2', 1, 0)) as tot
, name
, MU.name
FROM min_simsa680_sc MS
, min_simsa_user680_sc MSU
, min_userinfo MU
@ -482,7 +496,7 @@
AND MSU.msu_team = #{msuTeam}
</if>
GROUP BY MS.ms_maincode, MS.ms_seq, MS.ms_carnum
ORDER BY MS.ms_maincode, MS.ms_seq, MS.ms_carnum
ORDER BY MS.ms_seq, MS.ms_maincode, MS.ms_carnum
</native-query>
<native-query id="selectJudgeResultList">
@ -491,19 +505,19 @@
, MS.ms_seq AS msSeq
, MS.ms_carnum AS msCarnum
, MU.name
, MS.ms_result AS msResult
, DECODE(MS.ms_result, '1', '1', '2', '2', '0') AS msResult
, (SELECT code_nm
FROM tb_cmm_code_s
WHERE code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RESULT'
AND code_cd = MS.ms_result) as msResultNm
AND code_cd = DECODE(MS.ms_result, '1', '1', '2', '2', '0')) as msResultNm
, (SELECT code_nm
FROM tb_cmm_code_s
WHERE code_grp_id = 'TRAFFIC'
AND code_lcd = 'GANGNAM_SIMSA'
AND code_mcd = 'RESULT'
AND code_cd = MSU.msu_result) as msuResult
AND code_cd = DECODE(MSU.msu_result, '1', '1', '2', '2', '0')) as msuResult
FROM min_simsa680_sc MS
, min_simsa_user680_sc MSU
, min_userinfo MU
@ -518,7 +532,7 @@
AND MSU.msu_team = #{msuTeam}
</if>
AND MSU.msu_userid = MU.userid
ORDER BY MSU.msu_userid, MU.name, MS.ms_maincode, MS.ms_seq, MS.ms_carnum
ORDER BY MSU.msu_userid, MU.name, MS.ms_seq, MS.ms_maincode, MS.ms_carnum
</native-query>
<native-query id="selectJudegStdCount">
@ -567,28 +581,12 @@
ORDER BY GRC.sc_seq
</native-query>
<native-query id="selectDashboardJudgeList">
/* residentAndDisabled-mapper|selectDashboardJudgeList|julim */
SELECT MS.ms_edate
, MSU.msu_team
, MU.name
, SUM(DECODE(MSU.msu_result, 0, 0, 1)) jcnt
, DECODE(#{accesstype}, '001', MU.name, '002', REGEXP_REPLACE(MU.name, '.', '*', 2)) name
, SUM(DECODE(MSU.msu_result, '1', 1, '2', 1, 0)) jcnt
, COUNT(*) tcnt
FROM min_simsa680_sc MS
, min_simsa_user680_sc MSU
@ -597,11 +595,11 @@
FROM (SELECT ms_edate
FROM min_simsa680_sc
WHERE ms_datagb = #{msDatagb}
AND ms_result = '0'
AND DECODE(ms_result, '1', '1', '2', '2', '0') = '0'
ORDER BY ms_edate DESC)
WHERE ROWNUM = 1) T
WHERE MS.ms_datagb = #{msDatagb}
AND MS.ms_result = '0'
AND DECODE(MS.ms_result, '1', '1', '2', '2', '0') = '0'
AND MS.ms_maincode = MSU.msu_maincode
AND MSU.msu_userid = MU.userid
AND MS.ms_edate = T.ms_edate
@ -613,8 +611,8 @@
/* residentAndDisabled-mapper|selectByUserJudgeList|julim */
SELECT MS.ms_maincode
, MS.ms_seq
, MS.ms_carnum
, MS.ms_result
, REGEXP_REPLACE(MS.ms_carnum, '.', '*', 4) as ms_carnum
, DECODE(MS.ms_result, '1', '1', '2', '2', '0') as msResult
, MS.ms_year
, MS.ms_chasu
, MS.ms_sdate
@ -624,16 +622,19 @@
, MS.ms_closesi
, MS.ms_datagb
, MSU.msu_code
, MSU.msu_result
, DECODE(MSU.msu_result, '1', '1', '2', '2', '0') as msuResult
, MSU.msu_reason
, GR.sc_wdate
, GR.sc_pos
, GR.sc_wdate as msWdate
, GR.sc_pos as msPos
, MSU.msu_userid
FROM min_simsa680_sc MS
, min_simsa_user680_sc MSU
, gn_recall_sc GR
WHERE MS.ms_maincode = MSU.msu_maincode
AND MS.ms_maincode = GR.sc_code
AND DECODE(MS.ms_result, '1', '1', '2', '2', '0') = '0'
AND MS.ms_cdate &gt;= TO_CHAR(SYSDATE, 'YYYY-mm-dd')
AND MSU.msu_userid = #{msuUserid}
AND MS.ms_maincode = GR.sc_code
<if test="msDatagb != null and msDatagb != ''">
AND MS.ms_datagb = #{msDatagb}
</if>
@ -647,7 +648,20 @@
, msu_result = #{msuResult}
, msu_indate = #{msuIndate}
WHERE msu_code = #{msuCode}
AND msu_userid = #{msuUserid}
</native-query>
<native-query id="updateDateByMsuYear">
/* residentAndDisabled-mapper|updateDateByMsuYear|jhseo */
UPDATE min_simsa680_sc
SET ms_sdate = #{msSdate}
, ms_startsi = #{msStartsi}
, ms_edate = #{msEdate}
, ms_cdate = #{msCdate}
, ms_closesi = #{msClosesi}
WHERE ms_year = #{msYear}
AND ms_chasu = #{msChasu}
AND ms_datagb = #{msDatagb}
</native-query>
</entity-mappings>

@ -14,7 +14,7 @@ import org.springframework.test.context.junit4.SpringRunner;
//@DataJpaTest
@ContextConfiguration(classes = Application.class)
@ExtendWith(SpringExtension.class)
@ActiveProfiles({"dev"})
//@ActiveProfiles({"dev"})
public class ApplicationTest {
@Test

Loading…
Cancel
Save