Commit 3c0fe097 by xieshaohua

ngdb改造初始化

parent 642fa0ce
/target/ HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar !.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### STS ### ### STS ###
.apt_generated .apt_generated
...@@ -18,8 +21,11 @@ ...@@ -18,8 +21,11 @@
### NetBeans ### ### NetBeans ###
/nbproject/private/ /nbproject/private/
/build/
/nbbuild/ /nbbuild/
/dist/ /dist/
/nbdist/ /nbdist/
/.nb-gradle/ /.nb-gradle/
\ No newline at end of file build/
### VS Code ###
.vscode/
FROM hub.sofadev.res.aliyun-test.sdebank.com/library/openjdk:8-jdk-alpine-base
WORKDIR /home/admin
COPY ./tag-runtime/target/tag-runtime-2.0.1-SNAPSHOT.jar .
COPY ./start.sh .
RUN sed -i 's/\r//' ./start.sh
ENTRYPOINT [ "/bin/sh", "/home/admin/start.sh", "start" ]
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ]; then
if [ -f /etc/mavenrc ]; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ]; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false
darwin=false
mingw=false
case "$(uname)" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true ;;
Darwin*)
darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="$(/usr/libexec/java_home)"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ]; then
if [ -r /etc/gentoo-release ]; then
JAVA_HOME=$(java-config --jre-home)
fi
fi
if [ -z "$M2_HOME" ]; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ]; do
ls=$(ls -ld "$PRG")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' >/dev/null; then
PRG="$link"
else
PRG="$(dirname "$PRG")/$link"
fi
done
saveddir=$(pwd)
M2_HOME=$(dirname "$PRG")/..
# make it fully qualified
M2_HOME=$(cd "$M2_HOME" && pwd)
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=$(cygpath --unix "$M2_HOME")
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw; then
[ -n "$M2_HOME" ] &&
M2_HOME="$( (
cd "$M2_HOME"
pwd
))"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="$( (
cd "$JAVA_HOME"
pwd
))"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="$(which javac)"
if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=$(which readlink)
if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then
if $darwin; then
javaHome="$(dirname \"$javaExecutable\")"
javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac"
else
javaExecutable="$(readlink -f \"$javaExecutable\")"
fi
javaHome="$(dirname \"$javaExecutable\")"
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ]; then
if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="$(which java)"
fi
fi
if [ ! -x "$JAVACMD" ]; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]; then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ]; do
if [ -d "$wdir"/.mvn ]; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=$(
cd "$wdir/.."
pwd
)
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' <"$1")"
fi
}
BASE_DIR=$(find_maven_basedir "$(pwd)")
if [ -z "$BASE_DIR" ]; then
exit 1
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
fi
while IFS="=" read key value; do
case "$key" in wrapperUrl)
jarUrl="$value"
break
;;
esac
done <"$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
fi
if command -v wget >/dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl >/dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=$(cygpath --path --windows "$javaClass")
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=$(cygpath --path --windows "$M2_HOME")
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven2 Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.keymobile</groupId> <parent>
<artifactId>tagManager</artifactId> <groupId>com.keymobile.sdrcb</groupId>
<version>1.0.2-SNAPSHOT</version> <artifactId>ngdb-starter</artifactId>
<packaging>jar</packaging> <version>1.0.0-SNAPSHOT</version>
</parent>
<name>tagManager</name>
<description>tagManager</description> <groupId>com.keymobile</groupId>
<artifactId>tag-manager</artifactId>
<parent> <version>2.0.1-SNAPSHOT</version>
<groupId>org.springframework.boot</groupId> <packaging>pom</packaging>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version> <modules>
<relativePath /> <!-- lookup parent from repository --> <module>tag-facade</module>
</parent> <module>tag-service</module>
<module>tag-runtime</module>
<properties> </modules>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <dependencies>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<docker.image.prefix>springio</docker.image.prefix>
<druid.version>1.0.29</druid.version>
<fastjson.version>1.2.70</fastjson.version>
<spring-cloud.version>Finchley.RELEASE</spring-cloud.version>
<easypoi.version>4.1.3</easypoi.version>
<spring.version>5.0.19.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-client</artifactId>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.46</version>
</dependency>
<!-- 引入easypoi -->
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>${easypoi.version}</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-web</artifactId>
<version>${easypoi.version}</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId>
<version>${easypoi.version}</version>
</dependency>
<!-- 引入easypoi -->
<dependency>
<groupId>auth</groupId>
<artifactId>auth-common</artifactId>
<scope>system</scope>
<systemPath>${project.basedir}/lib/auth-common-1.0.2-SNAPSHOT.jar</systemPath>
<version>1.0.2</version>
</dependency>
<!-- cas相关 -->
<dependency>
<groupId>com.kakawait</groupId>
<artifactId>cas-security-spring-boot-starter</artifactId>
<version>1.0.0-beta-1</version>
</dependency>
<!-- gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-oauth2</artifactId>
</dependency>
<dependency> <dependency>
<groupId>commons-logging</groupId> <groupId>com.google.guava</groupId>
<artifactId>commons-logging</artifactId> <artifactId>guava</artifactId>
<version>1.1.3</version> <version>20.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
<repositories>
<dependencyManagement> <repository>
<dependencies> <id>nexus</id>
<dependency> <url>http://139.198.127.28:18081/repository/maven-public/</url>
<groupId>org.springframework.cloud</groupId> <name>keymobile</name>
<artifactId>spring-cloud-dependencies</artifactId> <snapshots>
<version>${spring-cloud.version}</version> <enabled>true</enabled>
<type>pom</type> </snapshots>
<scope>import</scope> </repository>
</dependency> </repositories>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-bom</artifactId>
<version>${spring-security.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<resources>
<resource>
<directory>lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>*.yml</include>
<include>**/*.xml</include>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</project> </project>
readme
\ No newline at end of file
<settings>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://mgr-00:8081/repository/maven-public/</url>
</mirror>
</mirrors>
<servers>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>dataSharing</password>
</server>
<server>
<id>nexus-releases</id>
<username>admin</username>
<password>dataSharing</password>
</server>
</servers>
</settings>
\ No newline at end of file
package com.keymobile.tagmanager;
import org.jasypt.encryption.StringEncryptor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
import com.keymobile.auth.common.security.ApplicationHelper;
import com.ulisesbocchio.jasyptspringboot.environment.StandardEncryptableEnvironment;
@EnableFeignClients
@SpringBootApplication
@EnableCaching
@EnableAsync
public class TagManagerApplication {
public static void main(String[] args) {
System.setProperty("es.set.netty.runtime.available.processors", "false");
// SpringApplication.run(TagManagerApplication.class, args);
new SpringApplicationBuilder()
.environment(StandardEncryptableEnvironment.builder().encryptor(stringEncryptor()).build())
.sources(TagManagerApplication.class).run(args);
}
private static StringEncryptor stringEncryptor() {
return new StringEncryptor() {
@Override
public String encrypt(String s) {
return ApplicationHelper.getEncryptor().encrypt(s);
}
@Override
public String decrypt(String s) {
return ApplicationHelper.getEncryptor().decrypt(s);
}
};
}
}
package com.keymobile.tagmanager.logging;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;
import org.slf4j.MDC;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import javax.servlet.*;
import java.io.IOException;
@Component
public class MdcLogEnhancerFilter implements Filter {
@Override
public void destroy() {
}
@Override
public void init(FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException
{
MDC.put("user", getUser());
MDC.put("session", getSession());
filterChain.doFilter(servletRequest, servletResponse);
}
private String getUser() {
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
String userName = "NO_USER";
if (auth != null) {
userName = auth.getName();
}
return userName;
}
private String getSession() {
RequestAttributes attrs = RequestContextHolder.getRequestAttributes();
String session = "NO_SESSION";
if (attrs != null) {
session = attrs.getSessionId();
}
return session;
}
}
mongodb:
database: tagManagerCGN
uri: dev-vm-00:27017
username: root
password: dataPlatform
maxConnectionIdleTime: 120000
eureka:
client:
registryFetchIntervalSeconds: 5
region: default
serviceUrl:
defaultZone: http://dev-vm-22:8081/eureka/
instance:
prefer-ip-address: false
hostname: dev-vm-22
spring:
application:
name: tagManager
session:
store-type: redis
redis:
namespace: cgn2
redis:
host: dev-vm-00
port: 6379
datasource:
url: jdbc:mysql://dev-vm-00:3306/cgn2?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
username: test
password: test
hikari:
maximum-pool-size: 3
server:
port: 8099
#security permit true :permitAll ;flase:authenticated
security:
authUser: root
authPwd: pwd
permit: false
feign:
client:
config:
default:
ReadTimeout: 30000
ConnectTimeout: 30000
mongodb:
database: dataCatalogTest
uri: 192.168.0.192:27017
username: root
password: dataPlatform
maxConnectionIdleTime: 120000
essearch:
host: localhost
port: 9300
cluster: dataSharing
eureka:
client:
registryFetchIntervalSeconds: 5
region: default
serviceUrl:
defaultZone: http://139.198.126.96:8081/eureka/
enabled: true
instance:
prefer-ip-address: false
hostname: 127.0.0.1
spring:
application:
name: dataCatalog1
session:
store-type: redis
redis:
namespace: dataplatformdev
redis:
sentinel:
master: master-1
nodes: 127.0.0.1:63791,127.0.0.1:63792,127.0.0.1:63793
password: zombie
datasource:
url: jdbc:mysql://localhost:3306/test?autoReconnect=true&useUnicode=yes&characterEncoding=UTF-8
username: root
password: dataSharing
rabbitmq:
host: 127.0.0.1
port: 5672
username: guest
password: guest
virtualHost: dams
exchange: metadata-exchange
dataCatalogQueue: dataCatalog-mdqueue
sqlEngineExchange: sqlEngine-exchange
sqlEngineQueue: sqlEngine-queue
labelQueue: label-queue
sampleQueue: sample-queueTest
server:
port: 8079
logging:
level:
org:
springframework:
security: info
#security permit true :permitAll ;flase:authenticated
security:
authUser: root
authPwd: pwd
permit: false
hikari:
maximum-pool-size: 5
feign:
client:
config:
default:
connectTimeout: 40000
ReadTimeout: 40000
tableModel:
openCache: true
auditKey: audit
sampleQueueSize: 3
\ No newline at end of file
mongodb:
database: tagManagerCGN_dev
uri: dev-vm-00:27017
username: root
password: dataPlatform
maxConnectionIdleTime: 120000
eureka:
client:
registryFetchIntervalSeconds: 5
region: default
serviceUrl:
defaultZone: http://dev-vm-22:8081/eureka/
instance:
prefer-ip-address: true
hostname: 192.168.0.215
spring:
application:
name: tagManager
session:
store-type: redis
redis:
namespace: cgn2
redis:
host: dev-vm-00
port: 6379
datasource:
url: jdbc:mysql://dev-vm-00:3306/cgn2_dev?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
username: test
password: test
hikari:
maximum-pool-size: 3
server:
port: 8072
#security permit true :permitAll ;flase:authenticated
security:
authUser: root
authPwd: pwd
permit: false
feign:
client:
config:
default:
ReadTimeout: 30000
ConnectTimeout: 30000
jasypt.encryptor.algorithm=PBEWithMD5AndDES
jasypt.encryptor.iv-generator-classname=org.jasypt.iv.NoIvGenerator
\ No newline at end of file
spring:
profiles:
active: ${spring.profiles.active:test}
\ No newline at end of file
#!/bin/sh
WORK_DIR=/home/admin
JAR_NAME=`ls ${WORK_DIR} | grep jar`
JVM_WORK_DIR=${WORK_DIR}/logs/jvm-logs
mkdir -p ${JVM_WORK_DIR}
MEM_OPTS="${MEM_OPTS} -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m"
MEM_OPTS="${MEM_OPTS} -XX:+AlwaysPreTouch"
OPTIMIZE_OPTS="-XX:AutoBoxCacheMax=20000 -Djava.security.egd=file:/dev/./urandom"
JMX_OPTS="-Dcom.sun.management.jmxremote.port=9981 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
SHOOTING_OPTS="-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${JVM_WORK_DIR}/"
SOFA_OPTS="-DSOFA_CAFE_CELL_NAME=${SOFA_CAFE_CELL_NAME} -DSOFA_CAFE_CLUSTER_NAME=${SOFA_CAFE_CLUSTER_NAME}"
if [ -z "${SOFA_CAFE_AVAILABILITY_ZONE}" ]; then
if [ "${SOFA_CAFE_CELL_NAME}" == "CellA" ]; then
echo "excepted value \${SOFA_CAFE_CELL_NAME}:${SOFA_CAFE_CELL_NAME}"
SOFA_OPTS="${SOFA_OPTS} -Dcom.alipay.ldc.datacenter=default -Dcom.alipay.ldc.zone=CellA"
elif [ "${SOFA_CAFE_CELL_NAME}" == "CellB" ]; then
echo "excepted value \${SOFA_CAFE_CELL_NAME}:${SOFA_CAFE_CELL_NAME}"
SOFA_OPTS="${SOFA_OPTS} -Dcom.alipay.ldc.datacenter=defaultB -Dcom.alipay.ldc.zone=CellB"
else
echo "unExcepted value \${SOFA_CAFE_CELL_NAME}:${SOFA_CAFE_CELL_NAME}"
fi
else
echo "default value \${SOFA_CAFE_CELL_NAME}:${SOFA_CAFE_CELL_NAME} and \${SOFA_CAFE_AVAILABILITY_ZONE}:${SOFA_CAFE_AVAILABILITY_ZONE}"
SOFA_OPTS="${SOFA_OPTS} -Dcom.alipay.ldc.datacenter=${SOFA_CAFE_CELL_NAME} -Dcom.alipay.ldc.zone=${SOFA_CAFE_AVAILABILITY_ZONE}"
fi
JVM="-server ${MEM_OPTS} ${OPTIMIZE_OPTS} ${JMX_OPTS} ${SHOOTING_OPTS} ${SOFA_OPTS}"
cd ${WORK_DIR}
start(){
java $JVM -jar $JAR_NAME >> ./logs/tag.out
if [ $? -eq 0 ]; then
echo "${JAR_NAME} is started success !"
else
echo "${JAR_NAME} is started failed !"
fi
}
case "$1" in
start)
start
;;
*)
esac
exit $?
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.keymobile</groupId>
<artifactId>tag-manager</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tag-facade</artifactId>
<dependencies>
</dependencies>
</project>
\ No newline at end of file
package com.keymobile.tagmanager.facade.response;
import java.io.Serializable;
/**
* 统一结果对象
* @param <T>
*/
public class Result<T> implements Serializable {
private static final String DEFAULT_UNAUTHORIZED_MESSAGE = "Need authorized";
private static final String DEFAULT_METHOD_NOT_ALLOWED_MESSAGE = "Request method incorrect";
/**
* 结果编码
*/
private int code;
/**
* 结果消息内容
*/
private String msg;
/**
* 结果数据对象
*/
private T data;
public Result(T data) {
this(ResultCodeEnum.SUCCESS_200, data);
}
public Result(ResultCodeEnum codeEnum) {
this(codeEnum.getCode(), codeEnum.getMsg(), null);
}
public Result(ResultCodeEnum codeEnum, T data) {
this(codeEnum.getCode(), codeEnum.getMsg(), data);
}
public Result(ResultCodeEnum codeEnum, String msg, T data) {
this(codeEnum.getCode(), msg, data);
}
public Result(int code, String msg, T data) {
this.code = code;
this.msg = msg;
this.data = data;
}
public Integer getCode() {
return code;
}
public String getMsg() {
return msg;
}
public T getData() {
return data;
}
public boolean isSuccess() {
return this.code == ResultCodeEnum.SUCCESS_200.getCode();
}
@Override
public String toString() {
return "Result{" +
"code=" + code +
", msg='" + msg + '\'' +
", data=" + data +
'}';
}
public static <T> Result<T> genOkResult() {
return new Result<T>(ResultCodeEnum.SUCCESS_200, null);
}
public static Result genOkResult(final Object data) {
return new Result<Object>(ResultCodeEnum.SUCCESS_200, data);
}
public static Result genFailedResult(final String msg) {
return new Result<Object>(ResultCodeEnum.OPERATION_FAIL, msg, msg);
}
public static Result genOteherCodeOkResult(final Object data,ResultCodeEnum resultCodeEnum) {
return new Result<Object>(resultCodeEnum, data);
}
public static Result genOteherCodeFailResult(ResultCodeEnum resultCodeEnum, final String msg) {
return new Result<Object>(resultCodeEnum, msg, null);
}
public static Result genMethodErrorResult() {
return new Result<Object>(ResultCodeEnum.METHOD_NOT_ALLOWED, DEFAULT_METHOD_NOT_ALLOWED_MESSAGE);
}
public static Result genUnauthorizedResult() {
return new Result<Object>(ResultCodeEnum.UNAUTHORIZED, DEFAULT_UNAUTHORIZED_MESSAGE);
}
public static Result genUnauthorizedResult(final String msg) {
return new Result<Object>(ResultCodeEnum.UNAUTHORIZED, msg);
}
}
package com.keymobile.tagmanager.facade.response;
/**
* 返回结果编码枚举定义
*/
public enum ResultCodeEnum {
// 响应码定义
// ====== 通用状态码 ======
// 正常
SUCCESS(0, "OK"),
// 系统异常
EXCEPTION(-1, "System Exception"),
// 连接失败
CONN_ERR(-2, "Connection Error Or Timeout"),
// 参数缺失
PARAM_EMPTY(-3, "Param Is Null Or Empty"),
// 参数异常
PARAM_ILLEGAL(-4, "Param Illegal"),
// 操作失败
OPERATION_FAIL(-5, "Operation Fail"),
// 参数验证
NOT_NULL(-5, "%s 不能为null value:null"),
INVALID_TYPE(-5, "%s 参数类型不正确 value:%s"),
INVALID_PARAM(-5, "%s 参数不正确 value:%s"),
INVALID_BODY_PARAM(-5, "请求体不正确:%s"),
VALIDATE_ERROR_CODE(-6, "验证错误"),
BASE_ERROR_CODE(-7, "基础错误"),
OCCUPATION_CLOSED(10001,"所查占用已被临时关闭"),
SUCCESS_200(200, "ok"),
REQUEST_ERROR(400, "Param Error"),
UNAUTHORIZED(401, "Unauthorized"),
METHOD_NOT_ALLOWED(405, "Method Not Allowed"),
NOT_FOUND(404, "404 Not Found"),
DATA_ERR(420, "data err"),
SYSTEM_ERROR(500, "System Error");
private final int code;
private final String msg;
ResultCodeEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
public String formatMsg(Object...args) {
return String.format(msg, args);
}
@Override
public String toString() {
return "ResultCodeEnum{" +
"code=" + code +
", msg='" + msg + '\'' +
'}';
}
}
package com.keymobile.tagmanager.facade.service;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import java.util.Map;
/**
* Excel文件处理 ngdb SVC
* @author xiesh
* @version 1.0.0
* @date 2022/04/21
*/
@Path("excel")
public interface ExcelParserSVC {
/**
* 解析Excel文件
*
* @param requestMap
* @return
*/
@POST
@Path("parseExcel")
@Produces("application/json")
Map<String, Object> parseExcel(Map<String, Object> requestMap) throws Exception;
/**
* 解析系统Excel文件
*
* @param requestMap
* @return
*/
@POST
@Path("parseSysExcel")
@Produces("application/json")
Map<String, Object> parseSysExcel(Map<String, Object> requestMap) throws Exception;
/**
* 系统导出(系统id传参样式:4,9,10,23)
*
* @param requestMap
* @return
*/
@POST
@Path("exportSystemExcel")
@Produces("application/json")
Map<String, Object> exportSystemExcel(Map<String, Object> requestMap) throws Exception;
}
package com.keymobile.tagmanager.facade.service;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import java.util.Map;
/**
* 模拟数据 ngdb SVC
* @author xiesh
* @version 1.0.0
* @date 2022/04/21
*/
@Path("mock")
public interface MockSVC {
/**
* 返回组织树
*
* @param requestMap
* @return
*/
@POST
@Path("queryOrgAsTree")
@Produces("application/json")
Map<String, Object> queryOrgAsTree(Map<String, Object> requestMap) throws Exception;
}
package com.keymobile.tagmanager.facade.service;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import java.util.Map;
/**
* 标签文件 ngdb SVC
* @author xiesh
* @version 1.0.0
* @date 2022/04/21
*/
@Path("file")
public interface TagFileSVC {
/**
* 导入标签元数据
*
* @param requestMap
* @return
*/
@POST
@Path("importTagMeta")
@Produces("application/json")
Map<String, Object> importTagMeta(Map<String, Object> requestMap) throws Exception;
/**
* 导出标签元数据excel文件
*
* @param requestMap
* @return
*/
@POST
@Path("exportTagMeta")
@Produces("application/json")
Map<String, Object> exportTagMeta(Map<String, Object> requestMap);
/**
* 导出标签excel文件
*
* @param requestMap
* @return
*/
@POST
@Path("exportTag")
@Produces("application/json")
Map<String, Object> exportTag(Map<String, Object> requestMap);
/**
* 导入标签
*
* @param requestMap
* @return
*/
@POST
@Path("importTag")
@Produces("application/json")
Map<String, Object> importTag(Map<String, Object> requestMap);
/**
* 分页获取导入日志
*
* @param requestMap
* @return
*/
@POST
@Path("listImportTagLogByPage")
@Produces("application/json")
Map<String, Object> listImportTagLogByPage(Map<String, Object> requestMap);
/**
* 撤销导入
*
* @param requestMap
* @return
*/
@POST
@Path("undoImportTag")
@Produces("application/json")
Map<String, Object> undoImportTag(Map<String, Object> requestMap);
/**
* 系统导出
*
* @param requestMap
* @return
*/
@POST
@Path("exportSystem")
@Produces("application/json")
Map<String, Object> exportSystem(Map<String, Object> requestMap);
/**
* 系统导入
*
* @param requestMap
* @return
*/
@POST
@Path("importSystem")
@Produces("application/json")
Map<String, Object> importSystem(Map<String, Object> requestMap);
}
package com.keymobile.tagmanager.facade.service;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import java.util.Map;
/**
* 标签关系 ngdb SVC
* @author xiesh
* @version 1.0.0
* @date 2022/04/21
*/
@Path("rel")
public interface TagRelSVC {
/**
* 新增标签关系
*
* @param requestMap
* @return
*/
@POST
@Path("addTagRel")
@Produces("application/json")
Map<String, Object> addTagRel(Map<String, Object> requestMap) throws Exception;
/**
* 删除标签关系
*
* @param requestMap
* @return
*/
@POST
@Path("deleteTagRel")
@Produces("application/json")
Map<String, Object> deleteTagRel(Map<String, Object> requestMap);
/**
* 根据当前标签id获取源标签
*
* @param requestMap
* @return
*/
@POST
@Path("getSourceTags")
@Produces("application/json")
Map<String, Object> getSourceTags(Map<String, Object> requestMap);
/**
* 根据当前标签id获取目标标签
*
* @param requestMap
* @return
*/
@POST
@Path("getTargetTags")
@Produces("application/json")
Map<String, Object> getTargetTags(Map<String, Object> requestMap);
/**
* 获取所有标签关系
*
* @param requestMap
* @return
*/
@POST
@Path("getAll")
@Produces("application/json")
Map<String, Object> getAll(Map<String, Object> requestMap);
}
package com.keymobile.tagmanager.facade.service;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import java.util.Map;
/**
* 标签相关 ngdb SVC
* @author xiesh
* @version 1.0.0
* @date 2022/04/21
*/
@Path("tag")
public interface TagSVC {
/**
* 新增或更新标签
*
* @param requestMap
* @return
*/
@POST
@Path("addOrUpdateTag")
@Produces("application/json")
Map<String, Object> addOrUpdateTag(Map<String, Object> requestMap) throws Exception;
/**
* 删除标签
*
* @param requestMap
* @return
*/
@POST
@Path("deleteTag")
@Produces("application/json")
Map<String, Object> deleteTag(Map<String, Object> requestMap);
/**
* 存在节点
*
* @param requestMap
* @return
*/
@POST
@Path("hasChild")
@Produces("application/json")
Map<String, Object> hasChild(Map<String, Object> requestMap);
/**
* 根据多个标签id获取标签信息列表
*
* @param requestMap
* @return
*/
@POST
@Path("getTagListByIds")
@Produces("application/json")
Map<String, Object> getTagListByIds(Map<String, Object> requestMap);
/**
* 获取维度标签树
*
* @param requestMap
* @return
*/
@POST
@Path("queryDimensionTagAsTree")
@Produces("application/json")
Map<String, Object> queryDimensionTagAsTree(Map<String, Object> requestMap);
/**
* 获取个人标签树
*
* @param requestMap
* @return
*/
@POST
@Path("queryPersonalTagAsTree")
@Produces("application/json")
Map<String, Object> queryPersonalTagAsTree(Map<String, Object> requestMap);
/**
* 搜索维度标签里面的个人标签
*
* @param requestMap
* @return
*/
@POST
@Path("searchPersonalDimensionTagByPage")
@Produces("application/json")
Map<String, Object> searchPersonalDimensionTagByPage(Map<String, Object> requestMap);
/**
* 搜索个人标签
*
* @param requestMap
* @return
*/
@POST
@Path("searchPersonalTagByPage")
@Produces("application/json")
Map<String, Object> searchPersonalTagByPage(Map<String, Object> requestMap);
/**
* 查询系统标签树
*
* @param requestMap
* @return
*/
@POST
@Path("querySystemTagAsTree")
@Produces("application/json")
Map<String, Object> querySystemTagAsTree(Map<String, Object> requestMap);
/**
* 搜索系統标签
*
* @param requestMap
* @return
*/
@POST
@Path("searchSystemTagByPage")
@Produces("application/json")
Map<String, Object> searchSystemTagByPage(Map<String, Object> requestMap);
/**
* 查询个人标签树不包括分享的标签
*
* @param requestMap
* @return
*/
@POST
@Path("queryPersonalTagExcludeOpenTypeAsTree")
@Produces("application/json")
Map<String, Object> queryPersonalTagExcludeOpenTypeAsTree(Map<String, Object> requestMap);
/**
* 分享/取消分享标签
*
* @param requestMap
* @return
*/
@POST
@Path("shareTags")
@Produces("application/json")
Map<String, Object> shareTags(Map<String, Object> requestMap);
/**
* 标签分析
*
* @param requestMap
* @return
*/
@POST
@Path("tagAnalysis")
@Produces("application/json")
Map<String, Object> tagAnalysis(Map<String, Object> requestMap);
/**
* 导出标签分析excel文件
*
* @param requestMap
* @return
*/
@POST
@Path("exportTagAnalysis")
@Produces("application/json")
Map<String, Object> exportTagAnalysis(Map<String, Object> requestMap);
/**
* 根据用户授予的数据权限加载标签元数据
*
* @param requestMap
* @return
*/
@POST
@Path("getByTagWithPrivilege")
@Produces("application/json")
Map<String, Object> getByTagWithPrivilege(Map<String, Object> requestMap);
/**
* 获取所有维度标签数据
*
* @param requestMap
* @return
*/
@POST
@Path("getAllDimensionTag")
@Produces("application/json")
Map<String, Object> getAllDimensionTag(Map<String, Object> requestMap);
/**
* 获取所有根目录维度标签
*
* @param requestMap
* @return
*/
@POST
@Path("getAllDimensionRootTag")
@Produces("application/json")
Map<String, Object> getAllDimensionRootTag(Map<String, Object> requestMap);
/**
* 前台获取所有根目录维度标签
*
* @param requestMap
* @return
*/
@POST
@Path("getDimensionRootTag")
@Produces("application/json")
Map<String, Object> getDimensionRootTag(Map<String, Object> requestMap);
/**
* 分析系统
*
* @param requestMap
* @return
*/
@POST
@Path("analysisSystem")
@Produces("application/json")
Map<String, Object> analysisSystem(Map<String, Object> requestMap);
/**
* 查询系统标签
*
* @param requestMap
* @return
*/
@POST
@Path("listSystems")
@Produces("application/json")
Map<String, Object> listSystems(Map<String, Object> requestMap);
/**
* 查询系统标签
*
* @param requestMap
* @return
*/
@POST
@Path("getSystemByCode")
@Produces("application/json")
Map<String, Object> getSystemByCode(Map<String, Object> requestMap);
/**
* 更新系统抽取信息
*
* @param requestMap
* @return
*/
@POST
@Path("updateSystemExtractInfo")
@Produces("application/json")
Map<String, Object> updateSystemExtractInfo(Map<String, Object> requestMap);
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>tag-manager</artifactId>
<groupId>com.keymobile</groupId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tag-runtime</artifactId>
<dependencies>
<dependency>
<groupId>com.keymobile</groupId>
<artifactId>tag-service</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
package com.keymobile.tagmanager;
import com.alipay.sofa.boot.autoconfigure.tracer.EnterpriseDstSofaTracerAutoConfiguration;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.autoconfigure.security.servlet.ManagementWebSecurityAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ImportResource;
import org.springframework.data.mongodb.repository.config.EnableMongoRepositories;
@ImportResource({"classpath*:sofa/ngdb_*.xml"})
@SpringBootApplication(scanBasePackages = {"com.sdebank.ngdb.*", "com.keymobile.*"},
exclude = {EnterpriseDstSofaTracerAutoConfiguration.class,
SecurityAutoConfiguration.class,
ManagementWebSecurityAutoConfiguration.class})
@MapperScan({"com.sdebank.ngdb.oaps.engine.*.mapper"})
@EnableMongoRepositories(basePackages = {"com.keymobile.tagmanager.model"})
@EntityScan("com.keymobile.infomanage.common.entity")
@MapperScan({"com.sdebank.ngdb.oaps.engine.*.mapper"})
@EnableFeignClients(basePackages = {"com.keymobile.tagmanager.remote"})
@EnableCaching
public class TagManagerApplication {
public static void main(String[] args) {
SpringApplication.run(TagManagerApplication.class, args);
}
}
package com.keymobile.tagmanager.config; package com.keymobile.tagmanager.runtime.config;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.keymobile.tagmanager.util.DateUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.keymobile.tagmanager.util.DateUtils; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
//@ControllerAdvice //@ControllerAdvice
public class ExceptionAdvice { public class ExceptionAdvice {
......
package com.keymobile.tagmanager.config; package com.keymobile.tagmanager.runtime.config;
import feign.auth.BasicAuthRequestInterceptor;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import feign.auth.BasicAuthRequestInterceptor;
@Configuration @Configuration
public class FeignClientConfig { public class FeignClientConfig {
......
package com.keymobile.tagmanager.config; package com.keymobile.tagmanager.runtime.config;
import java.util.ArrayList;
import java.util.List; import com.mongodb.*;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.gridfs.GridFSBucket;
import com.mongodb.client.gridfs.GridFSBuckets;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
...@@ -14,17 +19,9 @@ import org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper; ...@@ -14,17 +19,9 @@ import org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper;
import org.springframework.data.mongodb.core.convert.MappingMongoConverter; import org.springframework.data.mongodb.core.convert.MappingMongoConverter;
import org.springframework.data.mongodb.core.mapping.MongoMappingContext; import org.springframework.data.mongodb.core.mapping.MongoMappingContext;
import org.springframework.data.mongodb.gridfs.GridFsTemplate; import org.springframework.data.mongodb.gridfs.GridFsTemplate;
import com.mongodb.MongoClient;
import com.mongodb.MongoClientOptions; import java.util.ArrayList;
import com.mongodb.MongoClientURI; import java.util.List;
import com.mongodb.MongoCredential;
import com.mongodb.ReadPreference;
import com.mongodb.ServerAddress;
import com.mongodb.client.MongoDatabase;
import com.mongodb.client.gridfs.GridFSBucket;
import com.mongodb.client.gridfs.GridFSBuckets;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
@Configuration @Configuration
public class MongoDBConfig extends AbstractMongoConfiguration { public class MongoDBConfig extends AbstractMongoConfiguration {
......
package com.keymobile.tagmanager.config; package com.keymobile.tagmanager.runtime.config;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.HashOperations; import org.springframework.data.redis.core.*;
import org.springframework.data.redis.core.ListOperations; import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.data.redis.core.SetOperations; import org.springframework.session.data.redis.config.ConfigureRedisAction;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.data.redis.core.ZSetOperations; /**
import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; * redis配置类
import org.springframework.data.redis.serializer.StringRedisSerializer; */
import org.springframework.session.data.redis.config.ConfigureRedisAction; @Configuration
public class RedisConfig {
@Configuration
public class RedisConf { /**
* 注入 RedisConnectionFactory
/** */
* 注入 RedisConnectionFactory
*/ @Autowired
RedisConnectionFactory redisConnectionFactory;
@Autowired
RedisConnectionFactory redisConnectionFactory; /**
* 实例化 RedisTemplate 对象
/** *
* 实例化 RedisTemplate 对象 * @return
* */
* @return @Bean
*/ public RedisTemplate<String, Object> functionDomainRedisTemplate() {
@Bean RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
public RedisTemplate<String, Object> functionDomainRedisTemplate() { initDomainRedisTemplate(redisTemplate, redisConnectionFactory);
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>(); return redisTemplate;
initDomainRedisTemplate(redisTemplate, redisConnectionFactory); }
return redisTemplate;
} /**
* 设置数据存入 redis 的序列化方式
/** *
* 设置数据存入 redis 的序列化方式 * @param redisTemplate
* * @param factory
* @param redisTemplate */
* @param factory private void initDomainRedisTemplate(RedisTemplate<String, Object> redisTemplate, RedisConnectionFactory factory) {
*/ redisTemplate.setKeySerializer(new StringRedisSerializer());
private void initDomainRedisTemplate(RedisTemplate<String, Object> redisTemplate, RedisConnectionFactory factory) { redisTemplate.setHashKeySerializer(new StringRedisSerializer());
redisTemplate.setKeySerializer(new StringRedisSerializer()); redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
redisTemplate.setHashKeySerializer(new StringRedisSerializer()); redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer()); redisTemplate.setConnectionFactory(factory);
redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
redisTemplate.setConnectionFactory(factory); }
} /**
* 实例化 HashOperations 对象,可以使用 Hash 类型操作
/** *
* 实例化 HashOperations 对象,可以使用 Hash 类型操作 * @param redisTemplate
* * @return
* @param redisTemplate */
* @return @Bean
*/ public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
@Bean return redisTemplate.opsForHash();
public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) { }
return redisTemplate.opsForHash();
} /**
* 实例化 ValueOperations 对象,可以使用 String 操作
/** *
* 实例化 ValueOperations 对象,可以使用 String 操作 * @param redisTemplate
* * @return
* @param redisTemplate */
* @return @Bean
*/ public ValueOperations<String, Object> valueOperations(RedisTemplate<String, Object> redisTemplate) {
@Bean return redisTemplate.opsForValue();
public ValueOperations<String, Object> valueOperations(RedisTemplate<String, Object> redisTemplate) { }
return redisTemplate.opsForValue();
} /**
* 实例化 ListOperations 对象,可以使用 List 操作
/** *
* 实例化 ListOperations 对象,可以使用 List 操作 * @param redisTemplate
* * @return
* @param redisTemplate */
* @return @Bean
*/ public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) {
@Bean return redisTemplate.opsForList();
public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) { }
return redisTemplate.opsForList();
} /**
* 实例化 SetOperations 对象,可以使用 Set 操作
/** *
* 实例化 SetOperations 对象,可以使用 Set 操作 * @param redisTemplate
* * @return
* @param redisTemplate */
* @return @Bean
*/ public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) {
@Bean return redisTemplate.opsForSet();
public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) { }
return redisTemplate.opsForSet();
} /**
* 实例化 ZSetOperations 对象,可以使用 ZSet 操作
/** *
* 实例化 ZSetOperations 对象,可以使用 ZSet 操作 * @param redisTemplate
* * @return
* @param redisTemplate */
* @return @Bean
*/ public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
@Bean return redisTemplate.opsForZSet();
public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) { }
return redisTemplate.opsForZSet(); }
}
@Bean
public static ConfigureRedisAction configureRedisAction(){
return ConfigureRedisAction.NO_OP;
}
}
package com.keymobile.tagmanager.config; package com.keymobile.tagmanager.runtime.config;
import javax.sql.DataSource; import com.keymobile.common.security.CustomizedUserDetailService;
import com.keymobile.auth.common.security.CustomizedUserDetailService;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -13,15 +11,18 @@ import org.springframework.security.config.annotation.method.configuration.Enabl ...@@ -13,15 +11,18 @@ import org.springframework.security.config.annotation.method.configuration.Enabl
import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.crypto.password.NoOpPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
import javax.sql.DataSource;
@Configuration @Configuration
@EnableWebSecurity @EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true) @EnableGlobalMethodSecurity(prePostEnabled = true)
@ComponentScan("com.keymobile.auth.common.security") @ComponentScan("com.keymobile.common.security")
public class SecurityConfig extends WebSecurityConfigurerAdapter { public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired @Autowired
private CustomizedUserDetailService customUserDetailService; private CustomizedUserDetailService customUserDetailService;
...@@ -33,7 +34,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -33,7 +34,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired @Autowired
public void configure(AuthenticationManagerBuilder auth) throws Exception { public void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(customUserDetailService).passwordEncoder(new SHA1PasswordEncoder()); auth.userDetailsService(customUserDetailService).passwordEncoder(NoOpPasswordEncoder.getInstance());
} }
@Override @Override
...@@ -58,5 +59,4 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter { ...@@ -58,5 +59,4 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
return DigestUtils.sha1Hex(charSequence.toString()).equals(s); return DigestUtils.sha1Hex(charSequence.toString()).equals(s);
} }
} }
} }
package com.keymobile.tagmanager.config; package com.keymobile.tagmanager.runtime.config;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors; import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.builders.RequestHandlerSelectors;
......
mongodb:
database: dmgt
uri: 101.132.149.116:27017
username: dmgt
password: dmgt
maxConnectionIdleTime: 120000
spring:
data:
jpa:
repositories:
enabled: false
redis:
repositories:
enabled: false
servlet:
multipart:
max-file-size: 20MB
max-request-size: 100MB
session:
store-type: redis
redis:
namespace: sdebank
redis:
host: 47.107.70.172
port: 6379
password: baige123456
datasource:
url: jdbc:mysql://rm-q0sid6o090do561j1.mysql.rds.ops.aliyun-test.sdebank.com:3306/dmgt?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
username: dmgt
password: dmgt
hikari:
maximum-pool-size: 10
validationTimeout: 3000
main:
allow-bean-definition-overriding: true
# rabbitmq:
# host: 172.16.88.108
# port: 5672
# username: datamgt_test
# password: datamgt_test
# virtualHost: datamgt_test
# listener:
# simple:
# concurrency: 5
# acknowledge-mode: manual
# max-concurrency: 10
# prefetch: 1
# exchange: metadata-exchange
# queue: standard-queue
server:
port: 8099
security:
permit: true
authUser: root
authPwd: 37fa265330ad83eaa879efb1e2db6380896cf639
needApply: false
##远程服务配置
service:
url:
activiti: localhost:8110
auth: localhost:8097
metadata: localhost:8099
dataq: localhost:8765
feign:
client:
config:
default:
connectTimeout: 10000
readTimeout: 10000
loggerLevel: basic
logging:
config: classpath:logback-custom.xml
mongodb:
database: dmgt
uri: 107.255.17.254:27017
username: dmgt
password: dmgt
maxConnectionIdleTime: 120000
lower_case_metadata_names: true
spring:
data:
jpa:
repositories:
enabled: false
redis:
repositories:
enabled: false
servlet:
multipart:
max-file-size: 20MB
max-request-size: 100MB
session:
store-type: redis
redis:
namespace: dmgt
redis:
host: r-q0s49a7201b396e4.redis.rds.ops.aliyun-test.sdebank.com
port: 6379
password: Abcd1234
datasource:
url: jdbc:mysql://rm-q0sid6o090do561j1.mysql.rds.ops.aliyun-test.sdebank.com:3306/dmgt?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
username: dmgt
password: dmgt
hikari:
maximum-pool-size: 3
validationTimeout: 3000
driver-class-name: com.mysql.jdbc.Driver
main:
allow-bean-definition-overriding: true
# rabbitmq:
# host: 172.16.88.108
# port: 5672
# username: datamgt_test
# password: datamgt_test
# virtualHost: datamgt_test
# listener:
# simple:
# concurrency: 5
# acknowledge-mode: manual
# max-concurrency: 10
# prefetch: 1
# exchange: metadata-exchange
# queue: standard-queue
server:
port: 8099
security:
permit: false
authUser: root
authPwd: 37fa265330ad83eaa879efb1e2db6380896cf639
needApply: true
##远程服务配置
service:
url:
activiti: 172.16.88.109:8080
auth: 172.16.88.109:8080
metadata: 172.16.88.109:8080
dataq: 172.16.88.109:8080
feign:
client:
config:
default:
connectTimeout: 10000
readTimeout: 10000
loggerLevel: basic
logging:
config: classpath:logback-custom.xml
mongodb:
database: sdebank
uri: dev-vm-00:27017
username: sdebank
password: sdebank
maxConnectionIdleTime: 120000
spring:
data:
jpa:
repositories:
enabled: false
redis:
repositories:
enabled: false
servlet:
multipart:
max-file-size: 20MB
max-request-size: 100MB
session:
store-type: redis
redis:
namespace: sdebank
redis:
host: dev-vm-00
port: 6379
datasource:
url: jdbc:mysql://192.168.0.192:3306/sdebank?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8
username: test
password: test
hikari:
maximum-pool-size: 3
validationTimeout: 3000
main:
allow-bean-definition-overriding: true
# rabbitmq:
# host: 172.16.88.108
# port: 5672
# username: datamgt_test
# password: datamgt_test
# virtualHost: datamgt_test
# listener:
# simple:
# concurrency: 5
# acknowledge-mode: manual
# max-concurrency: 10
# prefetch: 1
# exchange: metadata-exchange
# queue: standard-queue
server:
port: 8099
security:
permit: false
authUser: root
authPwd: 37fa265330ad83eaa879efb1e2db6380896cf639
##远程服务配置
service:
url:
activiti: 192.168.0.166:8110
auth: 192.168.0.166:8097
metadata: 192.168.0.166:8099
dataq: 192.168.0.166:8765
feign:
client:
config:
default:
connectTimeout: 10000
readTimeout: 10000
loggerLevel: basic
logging:
config: classpath:logback-custom.xml
application.code=NGDMCP
#management.endpoint.health.show-details=always
run.mode=DEV
com.alipay.env=shared
com.alipay.instanceid=GGR3SMJXTNZB
com.antcloud.antvip.endpoint=localhost
com.antcloud.mw.access=ACgYoMcAHo4vPMJU
com.antcloud.mw.secret=Wi2JaDa6M4xUdtReyPTHiCbPeFcMs9bt
#数据库连接池配置
spring.datasource.druid.enable=true
spring.datasource.druid.min-idle=50
spring.datasource.druid.max-active=200
spring.datasource.druid.validation-query=select 1
spring.datasource.druid.max-wait=6000
spring.datasource.druid.test-on-borrow=false
spring.datasource.druid.test-on-return=false
spring.datasource.druid.test-while-idle=true
spring.datasource.druid.pool-prepared-statements=false
spring.datasource.druid.max-open-prepared-statements=150
spring.datasource.druid.time-between-eviction-runs-millis=60000
spring.datasource.druid.min-evictable-idle-time-millis=300000
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
com.alipay.sofa.rpc.rest-allowed-origins=*
com.sdebank.ngdb.global.redis.host=r-q0s49a7201b396e4.redis.rds.ops.aliyun-test.sdebank.com
com.sdebank.ngdb.global.redis.port=6379
com.sdebank.ngdb.global.redis.password=Abcd1234
com.sdebank.ngdb.global.redis.lettuce.pool.max-active=30
com.sdebank.ngdb.global.redis.lettuce.pool.min-idle=1
com.sdebank.ngdb.global.redis.enable=true
#mybatis配置
mybatis.mapper-locations=classpath*:mybatis/mapping/mysql/*Mapper.xml
#显示健康检查的详细信息
management.endpoint.health.show-details=always
#日志路径
logging.path=./logs
#日志级别
logging.level.com.sdebank.ngdb=INFO
logging.level.org.flowable=INFO
#网卡绑定
com.alipay.sofa.rpc.bind-network-interface=eth0
#sofa rest协议端口配置
com.alipay.sofa.rpc.rest.port=8341
#sofa bolt协议端口配置
com.alipay.sofa.rpc.bolt.port=12200
#sofa bolt协议核心线程数
com.alipay.sofa.rpc.bolt-thread-pool-core-size=200
#sofa bolt协议最大线程数
com.alipay.sofa.rpc.bolt-thread-pool-max-size=500
#sofa bolt协议线程队列数
com.alipay.sofa.rpc.bolt-thread-pool-queue-size=100
#OSS对外服务的访问域名,由资源组提供
com.sdebank.ngdb.oss.endpoint=oss-cn-shanghai.aliyuncs.com
#OSS接入的accessKey,由资源组提供
com.sdebank.ngdb.oss.accessKey=LTAIPVU6FazcZeIx
#OSS接入的秘钥,由资源组提供
com.sdebank.ngdb.oss.secretKey=AlIFwCpK9K4Md4r4Ybx0rmYj3HL6xN
#OSS接入的bucketName,由资源组提供
com.sdebank.ngdb.oss.bucketName=jadeite-dev
com.sdebank.ngdb.oss.switch=on
com.sdebank.ngdb.dcn.code=001
com.sdebank.ngdb.aac.code=001
com.sdebank.ngdb.idc.code=1
com.sdebank.ngdb.pod.code=
#SOFOTracer配置
com.alipay.sofa.tracer.remote=dst
com.alipay.sofa.tracer.dst.acvip=false
com.alipay.sofa.tracer.dst.url=
com.alipay.sofa.tracer.datasource.enterprise=true
#DRM动态配置推送OAPS
sofa.ddcs.region=oaps
com.sdebank.ngdb.sofa.mq.dataCenter=dc1
#工作流引擎配置
flowable.database-schema-update=false
flowable.app.enabled=false
flowable.cmmn.enabled=false
flowable.idm.enabled=false
flowable.content.enabled=false
flowable.dmn.enabled=false
flowable.form.enabled=false
flowable.jpa-enabled=false
flowable.history-level=audit
flowable.async-executor-activate=true
flowable.async-history-executor-activate=true
flowable.process.async.executor.async-job-acquisition-enabled=true
flowable.process.async-history.executor.async-job-acquisition-enabled=true
flowable.process.async.executor.core-pool-size=200
flowable.process.async.executor.max-pool-size=500
flowable.process.async.executor.queue-size=100
flowable.process.async-history.executor.core-pool-size=200
flowable.process.async-history.executor.max-pool-size=500
flowable.process.async-history.executor.queue-size=100
\ No newline at end of file
spring: spring:
application: application:
name: tagManager name: tagmanager
profiles: profiles:
active: test active: local
cloud: cloud:
config: config:
uri: http://localhost:8082 uri:
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration> <configuration>
<springProperty name="spring.datasource.driverClassName" source="spring.datasource.driverClassName"/> <springProperty scope="context" name="spring.datasource.url" source="spring.datasource.url"/>
<springProperty name="spring.datasource.url" source="spring.datasource.url"/> <springProperty scope="context" name="spring.datasource.username" source="spring.datasource.username"/>
<springProperty name="spring.datasource.username" source="spring.datasource.username"/> <springProperty scope="context" name="spring.datasource.password" source="spring.datasource.password"/>
<springProperty name="spring.datasource.password" source="spring.datasource.password"/>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> <encoder>
<encoder> <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n
<pattern>%d{HH:mm:ss.SSS} [%thread] %X{user} %X{session} %-5level %logger{5} - %msg%n</pattern> </pattern>
</encoder> </encoder>
</appender> </appender>
<appender name="db" class="ch.qos.logback.classic.db.DBAppender"> <appender name="db" class="ch.qos.logback.classic.db.DBAppender">
<connectionSource <connectionSource
class="ch.qos.logback.core.db.DriverManagerConnectionSource"> class="ch.qos.logback.core.db.DriverManagerConnectionSource">
<driverClass>com.mysql.jdbc.Driver</driverClass> <driverClass>com.mysql.jdbc.Driver</driverClass>
<url>${spring.datasource.url}</url> <url>${spring.datasource.url}</url>
<user>${spring.datasource.username}</user> <user>${spring.datasource.username}</user>
<password>${spring.datasource.password}</password> <password>${spring.datasource.password}</password>
</connectionSource> </connectionSource>
</appender> </appender>
<logger name="tagManager.OPTTAG"> <logger name="tagManager.OPTTAG">
<appender-ref ref="db" /> <appender-ref ref="db" />
</logger> </logger>
<logger name="tagManager.OPTFILETAG"> <logger name="tagManager.OPTFILETAG">
<appender-ref ref="db" /> <appender-ref ref="db" />
</logger> </logger>
<logger name="tagManager.OPTTAGREL"> <logger name="tagManager.OPTTAGREL">
<appender-ref ref="db" /> <appender-ref ref="db" />
</logger> </logger>
<root level="INFO"> <root level="INFO">
<appender-ref ref="stdout" /> <appender-ref ref="stdout" />
</root> </root>
</configuration> </configuration>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.keymobile</groupId>
<artifactId>tag-manager</artifactId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>tag-service</artifactId>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<akka.version>2.6.0</akka.version>
<poi.version>4.1.1</poi.version>
<fastjson.version>1.2.70</fastjson.version>
<easyExcel.version>2.1.1</easyExcel.version>
<mockito.version>2.18.3</mockito.version>
<junit.jupiter.version>5.5.2</junit.jupiter.version>
<!-- <druid.version>1.0.29</druid.version>-->
<easypoi.version>4.1.3</easypoi.version>
</properties>
<dependencies>
<dependency>
<groupId>com.keymobile</groupId>
<artifactId>tag-facade</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.keymobile.sdrcb</groupId>
<artifactId>feign-core-naive</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.keymobile.sdrcb</groupId>
<artifactId>common-core</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.keymobile.sdrcb</groupId>
<artifactId>common-ngdb-security</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.keymobile.sdrcb</groupId>
<artifactId>common-oss-service</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>${easyExcel.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-elasticsearch</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</exclusion>
</exclusions>
</dependency><dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.9.10.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
<version>4.7</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.46</version>
</dependency>
<!-- 引入easypoi -->
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-base</artifactId>
<version>${easypoi.version}</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-web</artifactId>
<version>${easypoi.version}</version>
</dependency>
<dependency>
<groupId>cn.afterturn</groupId>
<artifactId>easypoi-annotation</artifactId>
<version>${easypoi.version}</version>
</dependency>
<!-- cas相关 -->
<!-- <dependency>-->
<!-- <groupId>com.kakawait</groupId>-->
<!-- <artifactId>cas-security-spring-boot-starter</artifactId>-->
<!-- <version>1.0.0-beta-1</version>-->
<!-- </dependency>-->
<!-- gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.github.ulisesbocchio</groupId>-->
<!-- <artifactId>jasypt-spring-boot-starter</artifactId>-->
<!-- <version>3.0.3</version>-->
<!-- </dependency>-->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.3</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.keymobile.tagmanager.api; package com.keymobile.tagmanager.api;
import cn.afterturn.easypoi.excel.ExcelImportUtil; import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams; import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.keymobile.tagmanager.logging.LogConstants; import com.keymobile.tagmanager.logging.LogConstants;
import com.keymobile.tagmanager.logging.LogManager; import com.keymobile.tagmanager.logging.LogManager;
import com.keymobile.tagmanager.model.SysTag; import com.keymobile.tagmanager.model.SysTag;
import com.keymobile.tagmanager.model.system.SysApplication; import com.keymobile.tagmanager.model.system.SysApplication;
import com.keymobile.tagmanager.model.system.SysConstruction; import com.keymobile.tagmanager.model.system.SysConstruction;
import com.keymobile.tagmanager.model.system.SysFunction; import com.keymobile.tagmanager.model.system.SysFunction;
import com.keymobile.tagmanager.model.system.SysInfo; import com.keymobile.tagmanager.model.system.SysInfo;
import com.keymobile.tagmanager.model.system.SysOperations; import com.keymobile.tagmanager.model.system.SysOperations;
import com.keymobile.tagmanager.service.ExcelParserService; import com.keymobile.tagmanager.service.ExcelParserService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@Api(value = "Excel文件处理", tags = "Excel文件处理") @Api(value = "Excel文件处理", tags = "Excel文件处理")
@RestController @RestController
@RequestMapping(value = "/Excel") @RequestMapping(value = "/Excel")
public class ExcelParser { public class ExcelParser {
@Autowired @Autowired
private ExcelParserService excelParserService; private ExcelParserService excelParserService;
@ApiOperation(value = "解析Excel文件", notes = "解析Excel文件") @ApiOperation(value = "解析Excel文件", notes = "解析Excel文件")
@PostMapping("/parseExcel") @PostMapping("/parseExcel")
public List<SysTag> importSystem(MultipartFile file, HttpServletResponse response) throws Exception { public List<SysTag> importSystem(MultipartFile file, HttpServletResponse response) throws Exception {
ImportParams params = new ImportParams(); ImportParams params = new ImportParams();
params.setTitleRows(0); params.setTitleRows(0);
params.setHeadRows(1); params.setHeadRows(1);
params.setNeedVerify(false); params.setNeedVerify(false);
ExcelImportResult<SysTag> excelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SysTag.class, params); ExcelImportResult<SysTag> excelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SysTag.class, params);
List<SysTag> sysTags = excelImportResult.getList(); List<SysTag> sysTags = excelImportResult.getList();
return sysTags; return sysTags;
} }
@ApiOperation(value = "解析系统Excel文件", notes = "解析系统Excel文件") @ApiOperation(value = "解析系统Excel文件", notes = "解析系统Excel文件")
@PostMapping("/parseSysExcel") @PostMapping("/parseSysExcel")
public List<SysInfo> importSystemExcel(MultipartFile file) throws Exception { public List<SysInfo> importSystemExcel(MultipartFile file) throws Exception {
return excelParserService.importSystemExcel(file); return excelParserService.importSystemExcel(file);
} }
@ApiOperation(value = "系统导出(系统id传参样式:4,9,10,23)", notes = "系统导出(系统id传参样式:4,9,10,23)") @ApiOperation(value = "系统导出(系统id传参样式:4,9,10,23)", notes = "系统导出(系统id传参样式:4,9,10,23)")
@GetMapping(value = "/exportSystemExcel") @GetMapping(value = "/exportSystemExcel")
public void exportSystem(@RequestParam String systemIdString,HttpServletRequest request, public void exportSystem(@RequestParam String systemIdString,HttpServletRequest request,
HttpServletResponse response) throws Exception{ HttpServletResponse response) throws Exception{
if(StringUtils.isNotBlank(systemIdString)) { if(StringUtils.isNotBlank(systemIdString)) {
List<Long> systemIds = new ArrayList<>(); List<Long> systemIds = new ArrayList<>();
String[] systemId = systemIdString.split(","); String[] systemId = systemIdString.split(",");
for(String sid : systemId) { for(String sid : systemId) {
systemIds.add(Long.valueOf(sid)); systemIds.add(Long.valueOf(sid));
} }
excelParserService.exportSystemExcel(systemIds, request, response); excelParserService.exportSystemExcel(systemIds, request, response);
} }
LogManager.logInfo(LogConstants.CTX_OPTFILETAG, "导出系统"); LogManager.logInfo(LogConstants.CTX_OPTFILETAG, "导出系统");
} }
} }
package com.keymobile.tagmanager.api; package com.keymobile.tagmanager.api;
import java.util.List; import java.util.List;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.keymobile.auth.common.security.GrantedAuthHelper; import com.keymobile.common.security.GrantedAuthHelper;
import com.keymobile.tagmanager.logging.LogConstants; import com.keymobile.tagmanager.logging.LogConstants;
import com.keymobile.tagmanager.logging.LogManager; import com.keymobile.tagmanager.logging.LogManager;
import com.keymobile.tagmanager.model.TagRelation; import com.keymobile.tagmanager.model.TagRelation;
import com.keymobile.tagmanager.service.TagRelService; import com.keymobile.tagmanager.service.TagRelService;
import com.keymobile.tagmanager.util.UserInfoUtils; import com.keymobile.tagmanager.util.UserInfoUtils;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@Api(value = "标签关系", tags = "标签关系") @Api(value = "标签关系", tags = "标签关系")
@RestController @RestController
public class TagRelCtrl { public class TagRelCtrl {
private Logger logger = LoggerFactory.getLogger(TagRelCtrl.class); private Logger logger = LoggerFactory.getLogger(TagRelCtrl.class);
@Autowired @Autowired
private TagRelService tagRelService; private TagRelService tagRelService;
@ApiOperation(value = "新增标签关系", notes = "新增标签关系") @ApiOperation(value = "新增标签关系", notes = "新增标签关系")
@PostMapping(value = "/addTagRel") @PostMapping(value = "/addTagRel")
public TagRelation add(@RequestParam String sourceId,@RequestParam String targetId) throws Exception { public TagRelation add(@RequestParam String sourceId,@RequestParam String targetId) throws Exception {
//获取当前登录用户名和id //获取当前登录用户名和id
/**String userName = UserInfoUtils.getUserName();*/ /**String userName = UserInfoUtils.getUserName();*/
String userId = UserInfoUtils.getUserId(); String userId = UserInfoUtils.getUserId();
//获取当前登录用户所属机构 //获取当前登录用户所属机构
String org = /**UserInfoUtils.getDataRoleOrg()*/String.valueOf(GrantedAuthHelper.getUserOrg()); String org = /**UserInfoUtils.getDataRoleOrg()*/String.valueOf(GrantedAuthHelper.getUserOrg());
if(sourceId.equals(targetId)) { if(sourceId.equals(targetId)) {
throw new Exception("can not make source and target as the same one."); throw new Exception("can not make source and target as the same one.");
} }
//判断关系是否存在 //判断关系是否存在
if(tagRelService.tagRelExist(sourceId, targetId)) { if(tagRelService.tagRelExist(sourceId, targetId)) {
throw new Exception("the tag relation is exist"); throw new Exception("the tag relation is exist");
} }
LogManager.logInfo(LogConstants.CTX_OPTTAGREL, "新增标签关系"); LogManager.logInfo(LogConstants.CTX_OPTTAGREL, "新增标签关系");
return tagRelService.addTagRel(sourceId, targetId, userId, org); return tagRelService.addTagRel(sourceId, targetId, userId, org);
} }
@ApiOperation(value = "删除标签关系", notes = "删除标签关系") @ApiOperation(value = "删除标签关系", notes = "删除标签关系")
@PostMapping(value = "/deleteTagRel") @PostMapping(value = "/deleteTagRel")
public void delete(@RequestParam String id) { public void delete(@RequestParam String id) {
LogManager.logInfo(LogConstants.CTX_OPTTAGREL, "删除标签关系"); LogManager.logInfo(LogConstants.CTX_OPTTAGREL, "删除标签关系");
tagRelService.deleteTagRel(id); tagRelService.deleteTagRel(id);
} }
@ApiOperation(value = "根据当前标签id获取源标签", notes = "根据当前标签id获取源标签") @ApiOperation(value = "根据当前标签id获取源标签", notes = "根据当前标签id获取源标签")
@PostMapping(value = "/getSourceTags") @PostMapping(value = "/getSourceTags")
public List<TagRelation> getSourceTags(@RequestParam String tagId){ public List<TagRelation> getSourceTags(@RequestParam String tagId){
return tagRelService.getSource(tagId); return tagRelService.getSource(tagId);
} }
@ApiOperation(value = "根据当前标签id获取目标标签", notes = "根据当前标签id获目标标签") @ApiOperation(value = "根据当前标签id获取目标标签", notes = "根据当前标签id获目标标签")
@PostMapping(value = "/getTargetTags") @PostMapping(value = "/getTargetTags")
public List<TagRelation> getTargetTags(@RequestParam String tagId){ public List<TagRelation> getTargetTags(@RequestParam String tagId){
return tagRelService.getTarget(tagId); return tagRelService.getTarget(tagId);
} }
@ApiOperation(value = "(2020-6-9)获取所有标签关系", notes = "(2020-6-9)获取所有标签关系") @ApiOperation(value = "(2020-6-9)获取所有标签关系", notes = "(2020-6-9)获取所有标签关系")
@PostMapping(value = "/getAll") @PostMapping(value = "/getAll")
public List<TagRelation> getAll(){ public List<TagRelation> getAll(){
return tagRelService.getAll(); return tagRelService.getAll();
} }
} }
package com.keymobile.tagmanager.logging; package com.keymobile.tagmanager.logging;
public interface LogConstants { public interface LogConstants {
public static final String CTX_OPTTAG = "tagManager.OPTTAG"; public static final String CTX_OPTTAG = "tagmanager.OPTTAG";
public static final String CTX_OPTFILETAG = "tagManager.OPTFILETAG"; public static final String CTX_OPTFILETAG = "tagmanager.OPTFILETAG";
public static final String CTX_OPTTAGREL = "tagManager.OPTTAGREL"; public static final String CTX_OPTTAGREL = "tagmanager.OPTTAGREL";
} }
package com.keymobile.tagmanager.logging; package com.keymobile.tagmanager.logging;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
public class LogManager { public class LogManager {
public static void logTrace(String context, Throwable e, String message) { public static void logTrace(String context, Throwable e, String message) {
Logger logger = LoggerFactory.getLogger(context); Logger logger = LoggerFactory.getLogger(context);
if (logger.isTraceEnabled()) { if (logger.isTraceEnabled()) {
logger.trace(message, e); logger.trace(message, e);
} }
} }
public static void logTrace(String context, String message) { public static void logTrace(String context, String message) {
logTrace(context, null, message); logTrace(context, null, message);
} }
public static void logDebug(String context, String message) { public static void logDebug(String context, String message) {
Logger logger = LoggerFactory.getLogger(context); Logger logger = LoggerFactory.getLogger(context);
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug(message); logger.debug(message);
} }
} }
public static void logInfo(String context, String message) { public static void logInfo(String context, String message) {
Logger logger = LoggerFactory.getLogger(context); Logger logger = LoggerFactory.getLogger(context);
if (logger.isInfoEnabled()) { if (logger.isInfoEnabled()) {
logger.info(message); logger.info(message);
} }
} }
public static void logWarning(String context, Throwable e, String message) { public static void logWarning(String context, Throwable e, String message) {
Logger logger = LoggerFactory.getLogger(context); Logger logger = LoggerFactory.getLogger(context);
if (logger.isWarnEnabled()) { if (logger.isWarnEnabled()) {
logger.warn(message, e); logger.warn(message, e);
} }
} }
public static void logWarning(String context, String message) { public static void logWarning(String context, String message) {
logWarning(context, null, message); logWarning(context, null, message);
} }
public static void logError(String context, Throwable e, String message) { public static void logError(String context, Throwable e, String message) {
Logger logger = LoggerFactory.getLogger(context); Logger logger = LoggerFactory.getLogger(context);
if (logger.isErrorEnabled()) { if (logger.isErrorEnabled()) {
logger.error(message, e); logger.error(message, e);
} }
} }
public static void logError(String context, String message) { public static void logError(String context, String message) {
logError(context, message); logError(context, message);
} }
} }
//package com.keymobile.tagmanager.logging;
//
//import org.springframework.security.core.Authentication;
//import org.springframework.security.core.context.SecurityContextHolder;
//import org.springframework.stereotype.Component;
//import org.slf4j.MDC;
//import org.springframework.web.context.request.RequestAttributes;
//import org.springframework.web.context.request.RequestContextHolder;
//
//import javax.servlet.*;
//import java.io.IOException;
//
//@Component("myMdcLogEnhancerFilter")
//public class MdcLogEnhancerFilter implements Filter {
//
// @Override
// public void destroy() {
//
// }
//
// @Override
// public void init(FilterConfig filterConfig) throws ServletException {
//
// }
//
// @Override
// public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException
// {
// MDC.put("user", getUser());
// MDC.put("session", getSession());
// filterChain.doFilter(servletRequest, servletResponse);
// }
//
// private String getUser() {
// Authentication auth = SecurityContextHolder.getContext().getAuthentication();
// String userName = "NO_USER";
// if (auth != null) {
// userName = auth.getName();
// }
// return userName;
// }
//
// private String getSession() {
// RequestAttributes attrs = RequestContextHolder.getRequestAttributes();
// String session = "NO_SESSION";
// if (attrs != null) {
// session = attrs.getSessionId();
// }
// return session;
// }
//
//}
package com.keymobile.tagmanager.model; package com.keymobile.tagmanager.model;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import com.keymobile.tagmanager.util.Constants; import com.keymobile.tagmanager.util.Constants;
public class ExtTag extends Tag{ public class ExtTag extends Tag{
/** /**
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String operable = Constants.TAG_OPERABLE_FALSE; private String operable = Constants.TAG_OPERABLE_FALSE;
private String shareable = Constants.TAG_SHAREABLE_FALSE; private String shareable = Constants.TAG_SHAREABLE_FALSE;
public ExtTag(Tag t, String operable) { public ExtTag(Tag t, String operable) {
BeanUtils.copyProperties(t, this); BeanUtils.copyProperties(t, this);
this.operable = operable; this.operable = operable;
} }
public ExtTag(Tag t, String operable,String shareable) { public ExtTag(Tag t, String operable,String shareable) {
BeanUtils.copyProperties(t, this); BeanUtils.copyProperties(t, this);
this.operable = operable; this.operable = operable;
this.shareable = shareable; this.shareable = shareable;
} }
public void setOperable(String operable) { public void setOperable(String operable) {
this.operable = operable; this.operable = operable;
} }
public String getOperable() { public String getOperable() {
return operable; return operable;
} }
public String getShareable() { public String getShareable() {
return shareable; return shareable;
} }
public void setShareable(String shareable) { public void setShareable(String shareable) {
this.shareable = shareable; this.shareable = shareable;
} }
} }
package com.keymobile.tagmanager.model; package com.keymobile.tagmanager.model;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import javax.persistence.Id; import javax.persistence.Id;
import org.springframework.data.annotation.Transient; import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;
import com.keymobile.tagmanager.util.Constants; import com.keymobile.tagmanager.util.Constants;
import com.keymobile.tagmanager.util.DateUtils; import com.keymobile.tagmanager.util.DateUtils;
@Document(collection="ImportLog") @Document(collection="ImportLog")
public class ImportLog implements Serializable { public class ImportLog implements Serializable {
/** /**
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
private String id; private String id;
private String startTime = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss"); private String startTime = DateUtils.formatDate(new Date(), "yyyy-MM-dd HH:mm:ss");
private String endTime; private String endTime;
private String creator; private String creator;
private boolean hasFailNum = false; private boolean hasFailNum = false;
private int totalNum; private int totalNum;
private List<String> successIds = new ArrayList<>(); private List<String> successIds = new ArrayList<>();
@SuppressWarnings("unused") @SuppressWarnings("unused")
private String report; private String report;
private boolean hasFinish = false; private boolean hasFinish = false;
private String type = Constants.COMMON_TAG_LOG_TYPE; private String type = Constants.COMMON_TAG_LOG_TYPE;
private String dept; private String dept;
@Transient @Transient
private StringBuilder errorMsgSb; private StringBuilder errorMsgSb;
public ImportLog() { public ImportLog() {
} }
public ImportLog(String id) { public ImportLog(String id) {
this.id = id; this.id = id;
} }
public void appendErrorMsg(String errorMsg) { public void appendErrorMsg(String errorMsg) {
if (errorMsgSb == null) { if (errorMsgSb == null) {
errorMsgSb = new StringBuilder(); errorMsgSb = new StringBuilder();
} }
errorMsgSb.append(errorMsg + "<br>"); errorMsgSb.append(errorMsg + "<br>");
} }
public void setReport(String report) { public void setReport(String report) {
this.report = report; this.report = report;
} }
public void setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
} }
public String getId() { public String getId() {
return id; return id;
} }
public String generateReport() { public String generateReport() {
int failNum = totalNum - successIds.size(); int failNum = totalNum - successIds.size();
String firstPart = String.format("总共导入:%s条, 成功条数为:%s, 失败条数为:%s", totalNum, successIds.size(), failNum); String firstPart = String.format("总共导入:%s条, 成功条数为:%s, 失败条数为:%s", totalNum, successIds.size(), failNum);
if (failNum > 0) { if (failNum > 0) {
firstPart += "<br>"; firstPart += "<br>";
firstPart += errorMsgSb.toString(); firstPart += errorMsgSb.toString();
} }
return firstPart; return firstPart;
} }
public void setDept(String dept) { public void setDept(String dept) {
this.dept = dept; this.dept = dept;
} }
public String getDept() { public String getDept() {
return dept; return dept;
} }
public void setType(String type) { public void setType(String type) {
this.type = type; this.type = type;
} }
public String getType() { public String getType() {
return type; return type;
} }
public String getReport() { public String getReport() {
return report; return report;
} }
public String getCreator() { public String getCreator() {
return creator; return creator;
} }
public void setCreator(String creator) { public void setCreator(String creator) {
this.creator = creator; this.creator = creator;
} }
public List<String> getSuccessIds() { public List<String> getSuccessIds() {
return successIds; return successIds;
} }
public void setSuccessIds(List<String> successIds) { public void setSuccessIds(List<String> successIds) {
this.successIds = successIds; this.successIds = successIds;
} }
public static long getSerialversionuid() { public static long getSerialversionuid() {
return serialVersionUID; return serialVersionUID;
} }
public int getTotalNum() { public int getTotalNum() {
return totalNum; return totalNum;
} }
public void setTotalNum(int totalNum) { public void setTotalNum(int totalNum) {
this.totalNum = totalNum; this.totalNum = totalNum;
} }
public String getStartTime() { public String getStartTime() {
return startTime; return startTime;
} }
public void setStartTime(String startTime) { public void setStartTime(String startTime) {
this.startTime = startTime; this.startTime = startTime;
} }
public String getEndTime() { public String getEndTime() {
return endTime; return endTime;
} }
public void setEndTime(String endTime) { public void setEndTime(String endTime) {
this.endTime = endTime; this.endTime = endTime;
} }
public boolean isHasFailNum() { public boolean isHasFailNum() {
return hasFailNum; return hasFailNum;
} }
public void setHasFailNum(boolean hasFailNum) { public void setHasFailNum(boolean hasFailNum) {
this.hasFailNum = hasFailNum; this.hasFailNum = hasFailNum;
} }
public boolean isHasFinish() { public boolean isHasFinish() {
return hasFinish; return hasFinish;
} }
public void setHasFinish(boolean hasFinish) { public void setHasFinish(boolean hasFinish) {
this.hasFinish = hasFinish; this.hasFinish = hasFinish;
} }
} }
package com.keymobile.tagmanager.model; package com.keymobile.tagmanager.model;
import java.io.Serializable; import java.io.Serializable;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget; import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import cn.afterturn.easypoi.handler.inter.IExcelDataModel; import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
import cn.afterturn.easypoi.handler.inter.IExcelModel; import cn.afterturn.easypoi.handler.inter.IExcelModel;
@ExcelTarget("TagAnalysis") @ExcelTarget("TagAnalysis")
public class TagAnalysis implements Serializable, IExcelModel, IExcelDataModel{ public class TagAnalysis implements Serializable, IExcelModel, IExcelDataModel{
/** /**
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Excel(name = "标签名称", orderNum = "0", width=30) @Excel(name = "标签名称", orderNum = "0", width=30)
@NotNull @NotNull
private String name; private String name;
@Excel(name = "标签英文名称", orderNum = "1", width=30) @Excel(name = "标签英文名称", orderNum = "1", width=30)
@NotNull @NotNull
private String nameEn; private String nameEn;
@Excel(name = "排名", orderNum = "2", width=30) @Excel(name = "排名", orderNum = "2", width=30)
@NotNull @NotNull
private String sort; private String sort;
@Excel(name = "总数", orderNum = "3", width=30) @Excel(name = "总数", orderNum = "3", width=30)
@NotNull @NotNull
private String total; private String total;
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public String getNameEn() { public String getNameEn() {
return nameEn; return nameEn;
} }
public void setNameEn(String nameEn) { public void setNameEn(String nameEn) {
this.nameEn = nameEn; this.nameEn = nameEn;
} }
public String getSort() { public String getSort() {
return sort; return sort;
} }
public void setSort(String sort) { public void setSort(String sort) {
this.sort = sort; this.sort = sort;
} }
public String getTotal() { public String getTotal() {
return total; return total;
} }
public void setTotal(String total) { public void setTotal(String total) {
this.total = total; this.total = total;
} }
@org.springframework.data.annotation.Transient @org.springframework.data.annotation.Transient
private String errMsg; private String errMsg;
@org.springframework.data.annotation.Transient @org.springframework.data.annotation.Transient
private int excelRowNum; private int excelRowNum;
@Override @Override
public String getErrorMsg() { public String getErrorMsg() {
return errMsg; return errMsg;
} }
@Override @Override
public void setErrorMsg(String errorMsg) { public void setErrorMsg(String errorMsg) {
this.errMsg = errorMsg; this.errMsg = errorMsg;
} }
@Override @Override
public Integer getRowNum() { public Integer getRowNum() {
return excelRowNum; return excelRowNum;
} }
@Override @Override
public void setRowNum(Integer rowNum) { public void setRowNum(Integer rowNum) {
this.excelRowNum = rowNum; this.excelRowNum = rowNum;
} }
} }
package com.keymobile.tagmanager.model; package com.keymobile.tagmanager.model;
import java.io.Serializable; import java.io.Serializable;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget; import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import cn.afterturn.easypoi.handler.inter.IExcelDataModel; import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
import cn.afterturn.easypoi.handler.inter.IExcelModel; import cn.afterturn.easypoi.handler.inter.IExcelModel;
@ExcelTarget("TagMetadata") @ExcelTarget("TagMetadata")
public class TagMetadata implements Serializable, IExcelModel, IExcelDataModel{ public class TagMetadata implements Serializable, IExcelModel, IExcelDataModel{
/** /**
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Excel(name = "模型", orderNum = "0", width=30) @Excel(name = "模型", orderNum = "0", width=30)
@NotNull @NotNull
private String metaModel; private String metaModel;
@Excel(name = "名称", orderNum = "1", width=30) @Excel(name = "名称", orderNum = "1", width=30)
@NotNull @NotNull
private String name; private String name;
@Excel(name = "元数据名称", orderNum = "2", width=30) @Excel(name = "元数据名称", orderNum = "2", width=30)
@NotNull @NotNull
private String metaName; private String metaName;
@Excel(name = "标签名称", orderNum = "3", width=30) @Excel(name = "标签名称", orderNum = "3", width=30)
private String tagName; private String tagName;
public String getMetaModel() { public String getMetaModel() {
return metaModel; return metaModel;
} }
public void setMetaModel(String metaModel) { public void setMetaModel(String metaModel) {
this.metaModel = metaModel; this.metaModel = metaModel;
} }
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public String getMetaName() { public String getMetaName() {
return metaName; return metaName;
} }
public void setMetaName(String metaName) { public void setMetaName(String metaName) {
this.metaName = metaName; this.metaName = metaName;
} }
public String getTagName() { public String getTagName() {
return tagName; return tagName;
} }
public void setTagName(String tagName) { public void setTagName(String tagName) {
this.tagName = tagName; this.tagName = tagName;
} }
@org.springframework.data.annotation.Transient @org.springframework.data.annotation.Transient
private String errMsg; private String errMsg;
@org.springframework.data.annotation.Transient @org.springframework.data.annotation.Transient
private int excelRowNum; private int excelRowNum;
@Override @Override
public String getErrorMsg() { public String getErrorMsg() {
return errMsg; return errMsg;
} }
@Override @Override
public void setErrorMsg(String errorMsg) { public void setErrorMsg(String errorMsg) {
this.errMsg = errorMsg; this.errMsg = errorMsg;
} }
@Override @Override
public Integer getRowNum() { public Integer getRowNum() {
return excelRowNum; return excelRowNum;
} }
@Override @Override
public void setRowNum(Integer rowNum) { public void setRowNum(Integer rowNum) {
this.excelRowNum = rowNum; this.excelRowNum = rowNum;
} }
} }
package com.keymobile.tagmanager.model; package com.keymobile.tagmanager.model;
import java.io.Serializable; import java.io.Serializable;
import javax.persistence.Id; import javax.persistence.Id;
import org.springframework.data.mongodb.core.mapping.Document; import org.springframework.data.mongodb.core.mapping.Document;
@Document(collection="TagRelation") @Document(collection="TagRelation")
public class TagRelation implements Serializable{ public class TagRelation implements Serializable{
/** /**
* *
*/ */
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@Id @Id
private String id; private String id;
private String sourceId; private String sourceId;
private String targetId; private String targetId;
private String org; private String org;
private String creater; private String creater;
private String createTime = String.valueOf(System.currentTimeMillis()); private String createTime = String.valueOf(System.currentTimeMillis());
public TagRelation() {} public TagRelation() {}
public TagRelation(String sourceId,String targetId) { public TagRelation(String sourceId,String targetId) {
this.sourceId = sourceId; this.sourceId = sourceId;
this.targetId = targetId; this.targetId = targetId;
} }
public TagRelation(String sourceId,String targetId,String creater,String org) { public TagRelation(String sourceId,String targetId,String creater,String org) {
this.sourceId = sourceId; this.sourceId = sourceId;
this.targetId = targetId; this.targetId = targetId;
this.creater = creater; this.creater = creater;
this.org = org; this.org = org;
} }
public String getId() { public String getId() {
return id; return id;
} }
public void setId(String id) { public void setId(String id) {
this.id = id; this.id = id;
} }
public String getSourceId() { public String getSourceId() {
return sourceId; return sourceId;
} }
public void setSourceId(String sourceId) { public void setSourceId(String sourceId) {
this.sourceId = sourceId; this.sourceId = sourceId;
} }
public String getTargetId() { public String getTargetId() {
return targetId; return targetId;
} }
public void setTargetId(String targetId) { public void setTargetId(String targetId) {
this.targetId = targetId; this.targetId = targetId;
} }
public String getCreater() { public String getCreater() {
return creater; return creater;
} }
public void setCreater(String creater) { public void setCreater(String creater) {
this.creater = creater; this.creater = creater;
} }
public String getCreateTime() { public String getCreateTime() {
return createTime; return createTime;
} }
public void setCreateTime(String createTime) { public void setCreateTime(String createTime) {
this.createTime = createTime; this.createTime = createTime;
} }
public String getOrg() { public String getOrg() {
return org; return org;
} }
public void setOrg(String org) { public void setOrg(String org) {
this.org = org; this.org = org;
} }
} }
package com.keymobile.tagmanager.model.authService; package com.keymobile.tagmanager.model.authService;
/** /**
* author:zhangkb time:2020-1-6 desc:定义用于接收结构信息实体 * author:zhangkb time:2020-1-6 desc:定义用于接收结构信息实体
*/ */
public class Org { public class Org {
private Long id; private Long id;
private String fullName; private String fullName;
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public Long getId() { public Long getId() {
return id; return id;
} }
public String getFullName() { public String getFullName() {
return fullName; return fullName;
} }
public void setFullName(String fullName) { public void setFullName(String fullName) {
this.fullName = fullName; this.fullName = fullName;
} }
} }
package com.keymobile.tagmanager.model.system; package com.keymobile.tagmanager.model.system;
import java.io.Serializable; import java.io.Serializable;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.handler.inter.IExcelDataModel; import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
import cn.afterturn.easypoi.handler.inter.IExcelModel; import cn.afterturn.easypoi.handler.inter.IExcelModel;
public class SysApplication implements Serializable, IExcelModel, IExcelDataModel{ public class SysApplication implements Serializable, IExcelModel, IExcelDataModel{
@Excel(name = "系统代码", orderNum = "1", width=30) @Excel(name = "系统代码", orderNum = "1", width=30)
private String systemCode; private String systemCode;
@Excel(name = "业务牵头部门", orderNum = "2", width=30) @Excel(name = "业务牵头部门", orderNum = "2", width=30)
private String informationApplicationDepartment; private String informationApplicationDepartment;
@Excel(name = "业务牵头部门联系人", orderNum = "3", width=30) @Excel(name = "业务牵头部门联系人", orderNum = "3", width=30)
private String fillingPerson; private String fillingPerson;
@Excel(name = "业务域", orderNum = "4", width=30) @Excel(name = "业务域", orderNum = "4", width=30)
private String businessDomain; private String businessDomain;
@Excel(name = "立项号", orderNum = "5", width=30) @Excel(name = "立项号", orderNum = "5", width=30)
private String itemNo; private String itemNo;
@Excel(name = "无形资产主数据号", orderNum = "6", width=30) @Excel(name = "无形资产主数据号", orderNum = "6", width=30)
private String intangibleNo; private String intangibleNo;
@Excel(name = "开发支岀资产主数据号", orderNum = "7", width=30) @Excel(name = "开发支岀资产主数据号", orderNum = "7", width=30)
private String devNo; private String devNo;
public String getSystemCode() { public String getSystemCode() {
return systemCode; return systemCode;
} }
public void setSystemCode(String systemCode) { public void setSystemCode(String systemCode) {
this.systemCode = systemCode; this.systemCode = systemCode;
} }
public String getInformationApplicationDepartment() { public String getInformationApplicationDepartment() {
return informationApplicationDepartment; return informationApplicationDepartment;
} }
public void setInformationApplicationDepartment(String informationApplicationDepartment) { public void setInformationApplicationDepartment(String informationApplicationDepartment) {
this.informationApplicationDepartment = informationApplicationDepartment; this.informationApplicationDepartment = informationApplicationDepartment;
} }
public String getFillingPerson() { public String getFillingPerson() {
return fillingPerson; return fillingPerson;
} }
public void setFillingPerson(String fillingPerson) { public void setFillingPerson(String fillingPerson) {
this.fillingPerson = fillingPerson; this.fillingPerson = fillingPerson;
} }
public String getBusinessDomain() { public String getBusinessDomain() {
return businessDomain; return businessDomain;
} }
public void setBusinessDomain(String businessDomain) { public void setBusinessDomain(String businessDomain) {
this.businessDomain = businessDomain; this.businessDomain = businessDomain;
} }
public String getItemNo() { public String getItemNo() {
return itemNo; return itemNo;
} }
public void setItemNo(String itemNo) { public void setItemNo(String itemNo) {
this.itemNo = itemNo; this.itemNo = itemNo;
} }
public String getIntangibleNo() { public String getIntangibleNo() {
return intangibleNo; return intangibleNo;
} }
public void setIntangibleNo(String intangibleNo) { public void setIntangibleNo(String intangibleNo) {
this.intangibleNo = intangibleNo; this.intangibleNo = intangibleNo;
} }
public String getDevNo() { public String getDevNo() {
return devNo; return devNo;
} }
public void setDevNo(String devNo) { public void setDevNo(String devNo) {
this.devNo = devNo; this.devNo = devNo;
} }
@org.springframework.data.annotation.Transient @org.springframework.data.annotation.Transient
private String errMsg; private String errMsg;
@org.springframework.data.annotation.Transient @org.springframework.data.annotation.Transient
private int excelRowNum; private int excelRowNum;
@Override @Override
public String getErrorMsg() { public String getErrorMsg() {
return errMsg; return errMsg;
} }
@Override @Override
public void setErrorMsg(String errorMsg) { public void setErrorMsg(String errorMsg) {
this.errMsg = errorMsg; this.errMsg = errorMsg;
} }
@Override @Override
public Integer getRowNum() { public Integer getRowNum() {
return excelRowNum; return excelRowNum;
} }
@Override @Override
public void setRowNum(Integer rowNum) { public void setRowNum(Integer rowNum) {
this.excelRowNum = rowNum; this.excelRowNum = rowNum;
} }
} }
package com.keymobile.tagmanager.model.system; package com.keymobile.tagmanager.model.system;
import java.io.Serializable; import java.io.Serializable;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.handler.inter.IExcelDataModel; import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
import cn.afterturn.easypoi.handler.inter.IExcelModel; import cn.afterturn.easypoi.handler.inter.IExcelModel;
public class SysConstruction implements Serializable, IExcelModel, IExcelDataModel{ public class SysConstruction implements Serializable, IExcelModel, IExcelDataModel{
@Excel(name = "系统代码", orderNum = "1", width=30) @Excel(name = "系统代码", orderNum = "1", width=30)
private String systemCode; private String systemCode;
@Excel(name = "系统建设实施方", orderNum = "2", width=30) @Excel(name = "系统建设实施方", orderNum = "2", width=30)
private String constructionDepartment; private String constructionDepartment;
@Excel(name = "系统建设实施方项目经理", orderNum = "3", width=30) @Excel(name = "系统建设实施方项目经理", orderNum = "3", width=30)
private String personnelList; private String personnelList;
@Excel(name = "系统功能点", orderNum = "4", width=30) @Excel(name = "系统功能点", orderNum = "4", width=30)
private String systemFunction; private String systemFunction;
@Excel(name = "系统功能模块描述", orderNum = "5", width=30) @Excel(name = "系统功能模块描述", orderNum = "5", width=30)
private String moduleDescription; private String moduleDescription;
@Excel(name = "调用接口名称", orderNum = "6", width=30) @Excel(name = "调用接口名称", orderNum = "6", width=30)
private String callRelationship; private String callRelationship;
@Excel(name = "系统上线时间", orderNum = "7", width=30) @Excel(name = "系统上线时间", orderNum = "7", width=30)
private String systemOnlineTime; private String systemOnlineTime;
@Excel(name = "项目实际投入人力(人/月)", orderNum = "8", width=30) @Excel(name = "项目实际投入人力(人/月)", orderNum = "8", width=30)
private String projectHumanInput; private String projectHumanInput;
@Excel(name = "项目实际投入金额(万元)", orderNum = "9", width=30) @Excel(name = "项目实际投入金额(万元)", orderNum = "9", width=30)
private String projectMoneyInput; private String projectMoneyInput;
@Excel(name = "项目过程文档存放地址", orderNum = "10", width=30) @Excel(name = "项目过程文档存放地址", orderNum = "10", width=30)
private String documents; private String documents;
public String getSystemCode() { public String getSystemCode() {
return systemCode; return systemCode;
} }
public void setSystemCode(String systemCode) { public void setSystemCode(String systemCode) {
this.systemCode = systemCode; this.systemCode = systemCode;
} }
public String getConstructionDepartment() { public String getConstructionDepartment() {
return constructionDepartment; return constructionDepartment;
} }
public void setConstructionDepartment(String constructionDepartment) { public void setConstructionDepartment(String constructionDepartment) {
this.constructionDepartment = constructionDepartment; this.constructionDepartment = constructionDepartment;
} }
public String getPersonnelList() { public String getPersonnelList() {
return personnelList; return personnelList;
} }
public void setPersonnelList(String personnelList) { public void setPersonnelList(String personnelList) {
this.personnelList = personnelList; this.personnelList = personnelList;
} }
public String getSystemFunction() { public String getSystemFunction() {
return systemFunction; return systemFunction;
} }
public void setSystemFunction(String systemFunction) { public void setSystemFunction(String systemFunction) {
this.systemFunction = systemFunction; this.systemFunction = systemFunction;
} }
public String getModuleDescription() { public String getModuleDescription() {
return moduleDescription; return moduleDescription;
} }
public void setModuleDescription(String moduleDescription) { public void setModuleDescription(String moduleDescription) {
this.moduleDescription = moduleDescription; this.moduleDescription = moduleDescription;
} }
public String getCallRelationship() { public String getCallRelationship() {
return callRelationship; return callRelationship;
} }
public void setCallRelationship(String callRelationship) { public void setCallRelationship(String callRelationship) {
this.callRelationship = callRelationship; this.callRelationship = callRelationship;
} }
public String getSystemOnlineTime() { public String getSystemOnlineTime() {
return systemOnlineTime; return systemOnlineTime;
} }
public void setSystemOnlineTime(String systemOnlineTime) { public void setSystemOnlineTime(String systemOnlineTime) {
this.systemOnlineTime = systemOnlineTime; this.systemOnlineTime = systemOnlineTime;
} }
public String getProjectHumanInput() { public String getProjectHumanInput() {
return projectHumanInput; return projectHumanInput;
} }
public void setProjectHumanInput(String projectHumanInput) { public void setProjectHumanInput(String projectHumanInput) {
this.projectHumanInput = projectHumanInput; this.projectHumanInput = projectHumanInput;
} }
public String getProjectMoneyInput() { public String getProjectMoneyInput() {
return projectMoneyInput; return projectMoneyInput;
} }
public void setProjectMoneyInput(String projectMoneyInput) { public void setProjectMoneyInput(String projectMoneyInput) {
this.projectMoneyInput = projectMoneyInput; this.projectMoneyInput = projectMoneyInput;
} }
public String getDocuments() { public String getDocuments() {
return documents; return documents;
} }
public void setDocuments(String documents) { public void setDocuments(String documents) {
this.documents = documents; this.documents = documents;
} }
@org.springframework.data.annotation.Transient @org.springframework.data.annotation.Transient
private String errMsg; private String errMsg;
@org.springframework.data.annotation.Transient @org.springframework.data.annotation.Transient
private int excelRowNum; private int excelRowNum;
@Override @Override
public String getErrorMsg() { public String getErrorMsg() {
return errMsg; return errMsg;
} }
@Override @Override
public void setErrorMsg(String errorMsg) { public void setErrorMsg(String errorMsg) {
this.errMsg = errorMsg; this.errMsg = errorMsg;
} }
@Override @Override
public Integer getRowNum() { public Integer getRowNum() {
return excelRowNum; return excelRowNum;
} }
@Override @Override
public void setRowNum(Integer rowNum) { public void setRowNum(Integer rowNum) {
this.excelRowNum = rowNum; this.excelRowNum = rowNum;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment