commit
4c7af7702b
35 changed files with 2332 additions and 0 deletions
@ -0,0 +1,33 @@ |
|||
HELP.md |
|||
target/ |
|||
!.mvn/wrapper/maven-wrapper.jar |
|||
!**/src/main/**/target/ |
|||
!**/src/test/**/target/ |
|||
|
|||
### STS ### |
|||
.apt_generated |
|||
.classpath |
|||
.factorypath |
|||
.project |
|||
.settings |
|||
.springBeans |
|||
.sts4-cache |
|||
|
|||
### IntelliJ IDEA ### |
|||
.idea |
|||
*.iws |
|||
*.iml |
|||
*.ipr |
|||
|
|||
### NetBeans ### |
|||
/nbproject/private/ |
|||
/nbbuild/ |
|||
/dist/ |
|||
/nbdist/ |
|||
/.nb-gradle/ |
|||
build/ |
|||
!**/src/main/**/build/ |
|||
!**/src/test/**/build/ |
|||
|
|||
### VS Code ### |
|||
.vscode/ |
|||
Binary file not shown.
@ -0,0 +1,18 @@ |
|||
# 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. |
|||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip |
|||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar |
|||
@ -0,0 +1,316 @@ |
|||
#!/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. |
|||
# ---------------------------------------------------------------------------- |
|||
|
|||
# ---------------------------------------------------------------------------- |
|||
# Maven 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 /usr/local/etc/mavenrc ] ; then |
|||
. /usr/local/etc/mavenrc |
|||
fi |
|||
|
|||
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="`\\unset -f command; \\command -v 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/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" |
|||
else |
|||
jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.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" || rm -f "$wrapperJarPath" |
|||
else |
|||
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$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 \ |
|||
$MAVEN_DEBUG_OPTS \ |
|||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ |
|||
"-Dmaven.home=${M2_HOME}" \ |
|||
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ |
|||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" |
|||
@ -0,0 +1,188 @@ |
|||
@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 Maven 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 keystroke 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 "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* |
|||
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\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/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" |
|||
|
|||
FOR /F "usebackq 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%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.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 "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" |
|||
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\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% |
|||
|
|||
cmd /C exit /B %ERROR_CODE% |
|||
@ -0,0 +1,105 @@ |
|||
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|||
<modelVersion>4.0.0</modelVersion> |
|||
<parent> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-parent</artifactId> |
|||
<version>2.7.13</version> |
|||
<relativePath/> <!-- lookup parent from repository --> |
|||
</parent> |
|||
<groupId>com.hxgk</groupId> |
|||
<artifactId>zxxy</artifactId> |
|||
<version>0.0.1-SNAPSHOT</version> |
|||
<name>zxxy</name> |
|||
<description>hxgk.zxxy</description> |
|||
<properties> |
|||
<java.version>1.8</java.version> |
|||
</properties> |
|||
<dependencies> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-web</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.baomidou</groupId> |
|||
<artifactId>dynamic-datasource-spring-boot-starter</artifactId> |
|||
<version>3.1.1</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.alibaba</groupId> |
|||
<artifactId>druid-spring-boot-starter</artifactId> |
|||
<version>1.2.9</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-devtools</artifactId> |
|||
<optional>true</optional> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
|
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-data-redis</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-starter-test</artifactId> |
|||
<scope>test</scope> |
|||
<exclusions> |
|||
<exclusion> |
|||
<groupId>org.junit.vintage</groupId> |
|||
<artifactId>junit-vintage-engine</artifactId> |
|||
</exclusion> |
|||
</exclusions> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>org.mybatis.spring.boot</groupId> |
|||
<artifactId>mybatis-spring-boot-starter</artifactId> |
|||
<version>2.1.3</version> |
|||
</dependency> |
|||
|
|||
<dependency> |
|||
<groupId>mysql</groupId> |
|||
<artifactId>mysql-connector-java</artifactId> |
|||
<version>8.0.24</version> |
|||
</dependency> |
|||
|
|||
|
|||
<dependency> |
|||
<groupId>org.apache.commons</groupId> |
|||
<artifactId>commons-lang3</artifactId> |
|||
<version>3.9</version> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>org.apache.commons</groupId> |
|||
<artifactId>commons-pool2</artifactId> |
|||
</dependency> |
|||
<dependency> |
|||
<groupId>com.github.pagehelper</groupId> |
|||
<artifactId>pagehelper-spring-boot-starter</artifactId> |
|||
<version>1.4.6</version> |
|||
</dependency> |
|||
|
|||
</dependencies> |
|||
|
|||
<build> |
|||
<plugins> |
|||
<plugin> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-maven-plugin</artifactId> |
|||
</plugin> |
|||
<plugin> |
|||
<groupId>org.springframework.boot</groupId> |
|||
<artifactId>spring-boot-maven-plugin</artifactId> |
|||
<configuration> |
|||
<fork>true</fork><!--必须添加这个配置--> |
|||
</configuration> |
|||
</plugin> |
|||
</plugins> |
|||
|
|||
|
|||
</build> |
|||
|
|||
</project> |
|||
@ -0,0 +1,18 @@ |
|||
package com.hxgk.zxxy; |
|||
|
|||
import org.mybatis.spring.annotation.MapperScan; |
|||
import org.springframework.boot.SpringApplication; |
|||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
|||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
|||
import org.springframework.transaction.annotation.EnableTransactionManagement; |
|||
|
|||
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class}) |
|||
@MapperScan("com.hxgk.zxxy.mapper") |
|||
@EnableTransactionManagement |
|||
public class ZxxyApplication { |
|||
|
|||
public static void main(String[] args) { |
|||
SpringApplication.run(ZxxyApplication.class, args); |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
package com.hxgk.zxxy.config; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonAutoDetect; |
|||
import com.fasterxml.jackson.annotation.PropertyAccessor; |
|||
import com.fasterxml.jackson.databind.ObjectMapper; |
|||
import org.springframework.context.annotation.Bean; |
|||
import org.springframework.context.annotation.Configuration; |
|||
import org.springframework.data.redis.connection.RedisConnectionFactory; |
|||
import org.springframework.data.redis.core.RedisTemplate; |
|||
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; |
|||
import org.springframework.data.redis.serializer.StringRedisSerializer; |
|||
|
|||
@Configuration |
|||
public class RedisTemplateConfiguration { |
|||
/** |
|||
* @param redisConnectionFactory |
|||
* @return |
|||
*/ |
|||
@Bean |
|||
public RedisTemplate<Object, Object> |
|||
redisTemplate(RedisConnectionFactory redisConnectionFactory) { |
|||
RedisTemplate<Object, Object> redisTemplate = new RedisTemplate<>(); |
|||
|
|||
redisTemplate.setConnectionFactory(redisConnectionFactory); |
|||
// 使⽤Jackson2JsonRedisSerialize 替换认序列化
|
|||
Jackson2JsonRedisSerializer jackson2JsonRedisSerializer = new Jackson2JsonRedisSerializer(Object.class); |
|||
ObjectMapper objectMapper = new ObjectMapper(); |
|||
|
|||
objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY); |
|||
|
|||
jackson2JsonRedisSerializer.setObjectMapper(objectMapper); |
|||
// 设置key和value的序列化规则
|
|||
redisTemplate.setKeySerializer(new StringRedisSerializer()); |
|||
|
|||
redisTemplate.setValueSerializer(jackson2JsonRedisSerializer); |
|||
//redisTemplate.setValueSerializer(new StringRedisSerializer());
|
|||
// 设置hashKey和hashValue的序列化规则
|
|||
redisTemplate.setHashKeySerializer(new StringRedisSerializer()); |
|||
|
|||
redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer); |
|||
// 设置⽀持事物
|
|||
|
|||
//redisTemplate.setEnableTransactionSupport(true);
|
|||
redisTemplate.afterPropertiesSet(); |
|||
return redisTemplate; |
|||
} |
|||
} |
|||
@ -0,0 +1,26 @@ |
|||
package com.hxgk.zxxy.controller; |
|||
|
|||
import com.hxgk.zxxy.model.entity.ArchivesType; |
|||
import com.hxgk.zxxy.model.request.ArchivesTypeRequest; |
|||
import com.hxgk.zxxy.service.ArchivesTypeService; |
|||
import com.hxgk.zxxy.utils.JsonData; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@RequestMapping("archive") |
|||
public class ArchivesTypeController { |
|||
@Autowired |
|||
private ArchivesTypeService archivesTypeService; |
|||
@PostMapping("zxxy") |
|||
public JsonData getZxxyArchivesType(@RequestBody ArchivesTypeRequest archivesTypeRequest){ |
|||
|
|||
Long L = Long.parseLong(archivesTypeRequest.getAtParentId()); |
|||
List<ArchivesType> archivesTypeList = archivesTypeService.getZxxyArchivesType(L); |
|||
return JsonData.buildSuccess(archivesTypeList); |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
package com.hxgk.zxxy.controller; |
|||
|
|||
import com.github.pagehelper.Page; |
|||
import com.hxgk.zxxy.model.entity.ArchivesType; |
|||
import com.hxgk.zxxy.model.entity.Graphicform; |
|||
import com.hxgk.zxxy.model.request.ArchivesTypeRequest; |
|||
import com.hxgk.zxxy.model.request.GraphicformRequest; |
|||
import com.hxgk.zxxy.service.ArchivesTypeService; |
|||
import com.hxgk.zxxy.service.GraphicformService; |
|||
import com.hxgk.zxxy.utils.JsonData; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
@RestController |
|||
@RequestMapping("graphicform") |
|||
public class GraphicformController { |
|||
@Autowired |
|||
private GraphicformService graphicformService; |
|||
@PostMapping("zxxy") |
|||
public JsonData getZxxyArchivesType(@RequestBody GraphicformRequest graphicformRequest) throws Exception { |
|||
List<Graphicform> graphicformList = graphicformService.queryListByParam(graphicformRequest); |
|||
return JsonData.buildSuccess(graphicformList); |
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
package com.hxgk.zxxy.controller; |
|||
|
|||
import com.hxgk.zxxy.model.entity.UserDetail; |
|||
import com.hxgk.zxxy.service.UserService; |
|||
import com.hxgk.zxxy.utils.JsonData; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@RestController |
|||
@RequestMapping("user") |
|||
public class UserController { |
|||
@Autowired |
|||
private UserService userService; |
|||
@RequestMapping(value = "detail") |
|||
public JsonData getUserDetailFromRedis(@RequestBody Map<String,String> userInfo){ |
|||
UserDetail userDetail = userService.getUserDetailFromRedis(userInfo); |
|||
return JsonData.buildSuccess(userDetail); |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
package com.hxgk.zxxy.exception; |
|||
|
|||
/** |
|||
* 小滴课堂 |
|||
* 自定义异常类 |
|||
*/ |
|||
public class HxgkException extends RuntimeException{ |
|||
|
|||
private Integer code; |
|||
|
|||
private String msg; |
|||
|
|||
public HxgkException(Integer code, String msg){ |
|||
this.code = code; |
|||
this.msg = msg; |
|||
} |
|||
|
|||
public Integer getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public void setCode(Integer code) { |
|||
this.code = code; |
|||
} |
|||
|
|||
public String getMsg() { |
|||
return msg; |
|||
} |
|||
|
|||
public void setMsg(String msg) { |
|||
this.msg = msg; |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
package com.hxgk.zxxy.mapper; |
|||
|
|||
import com.hxgk.zxxy.model.entity.ArchivesType; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface ArchivesTypeMapper { |
|||
|
|||
List<ArchivesType> getZxxyArchivesType(@Param("at_parent_id") long atParentId); |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
package com.hxgk.zxxy.mapper; |
|||
|
|||
import com.baomidou.dynamic.datasource.annotation.DS; |
|||
import com.hxgk.zxxy.model.entity.Graphicform; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface GraphicformMapper { |
|||
/* |
|||
SELECT |
|||
* |
|||
FROM |
|||
graphicform |
|||
WHERE |
|||
1 = 1 |
|||
AND g_parent_sun = #{g_parent_sun}----------------------------------分类(精益改善,流程制度) |
|||
AND g_state = 2 |
|||
AND ( |
|||
( g_visit_strat = 1 ) |
|||
OR ( g_visit_strat = 2 AND g_bf_id = #{g_bf_id} )-----------分厂-----需要查 |
|||
OR ( |
|||
g_visit_strat = 3 |
|||
AND g_ws_id IN |
|||
<foreach collection="list" item="gWsId" index="index" open="(" close=")" separator=","> |
|||
#{gWsId}----------------------------------------工段------需要查,可能是数组 |
|||
</foreach> |
|||
) |
|||
OR ( |
|||
g_visit_strat = 4 |
|||
AND FIND_IN_SET( #{key}, g_range )-------------------用户唯一识别码 |
|||
) |
|||
) |
|||
ORDER BY |
|||
g_add_time DESC, |
|||
g_recommend ASC |
|||
|
|||
*/ |
|||
@DS("readdocument") |
|||
List<Graphicform> queryListByParam(@Param("g_parent") String gParent,@Param("g_parent_sun") String gParentSun, @Param("gBfIdList") List<Long> gBfIdList, @Param("gWsIdList") List<Long> gWsIdList, @Param("key") Long key); |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
package com.hxgk.zxxy.mapper; |
|||
|
|||
import com.hxgk.zxxy.model.entity.OrgContType; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface OrgContTypeMapper { |
|||
|
|||
OrgContType queryLever(@Param("adminorg") Long adminorg); |
|||
|
|||
List<OrgContType> queryLowOrg(@Param("adminorg") Long adminorg); |
|||
} |
|||
@ -0,0 +1,103 @@ |
|||
package com.hxgk.zxxy.model.entity; |
|||
|
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public class ArchivesType { |
|||
/*`at_id` bigint unsigned NOT NULL, |
|||
`at_title` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '档案分类名称', |
|||
`at_stater` tinyint unsigned NOT NULL DEFAULT '1' COMMENT '档案分类状态', |
|||
`at_parent_id` bigint unsigned NOT NULL DEFAULT '0' COMMENT '档案分类父级', |
|||
`at_time` bigint unsigned NOT NULL DEFAULT '0' COMMENT '写入时间', |
|||
`at_uid` bigint unsigned NOT NULL DEFAULT '0' COMMENT '添加人员', |
|||
`at_sort` smallint unsigned NOT NULL DEFAULT '50' COMMENT '排序', |
|||
PRIMARY KEY (`at_id`) USING BTREE, |
|||
UNIQUE KEY `at_id` (`at_id`) USING BTREE, |
|||
KEY `at_pr_id` (`at_parent_id`) USING BTREE COMMENT '父级', |
|||
KEY `at_sort` (`at_sort`) USING BTREE COMMENT '排序' |
|||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COMMENT='档案管理分类';*/ |
|||
|
|||
|
|||
private String atId; |
|||
//档案分类名称
|
|||
private String atTitle; |
|||
//档案分类状态
|
|||
private Byte atStater; |
|||
//档案分类父级
|
|||
private String atParentId; |
|||
//写入时间
|
|||
private String atTime; |
|||
//添加人员
|
|||
private String atUid; |
|||
//排序
|
|||
private Short atSort; |
|||
|
|||
public String getAtId() { |
|||
return atId; |
|||
} |
|||
|
|||
public void setAtId(String atId) { |
|||
this.atId = atId; |
|||
} |
|||
|
|||
public String getAtTitle() { |
|||
return atTitle; |
|||
} |
|||
|
|||
public void setAtTitle(String atTitle) { |
|||
this.atTitle = atTitle; |
|||
} |
|||
|
|||
public Byte getAtStater() { |
|||
return atStater; |
|||
} |
|||
|
|||
public void setAtStater(Byte atStater) { |
|||
this.atStater = atStater; |
|||
} |
|||
|
|||
public String getAtParentId() { |
|||
return atParentId; |
|||
} |
|||
|
|||
public void setAtParentId(String atParentId) { |
|||
this.atParentId = atParentId; |
|||
} |
|||
|
|||
public String getAtTime() { |
|||
return atTime; |
|||
} |
|||
|
|||
public void setAtTime(String atTime) { |
|||
this.atTime = atTime; |
|||
} |
|||
|
|||
public String getAtUid() { |
|||
return atUid; |
|||
} |
|||
|
|||
public void setAtUid(String atUid) { |
|||
this.atUid = atUid; |
|||
} |
|||
|
|||
public Short getAtSort() { |
|||
return atSort; |
|||
} |
|||
|
|||
public void setAtSort(Short atSort) { |
|||
this.atSort = atSort; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "ArchivesType{" + |
|||
"atId='" + atId + '\'' + |
|||
", atTitle='" + atTitle + '\'' + |
|||
", atStater=" + atStater + |
|||
", atParentId='" + atParentId + '\'' + |
|||
", atTime='" + atTime + '\'' + |
|||
", atUid='" + atUid + '\'' + |
|||
", atSort=" + atSort + |
|||
'}'; |
|||
} |
|||
} |
|||
@ -0,0 +1,388 @@ |
|||
package com.hxgk.zxxy.model.entity; |
|||
|
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
//图文信息表实体类
|
|||
public class Graphicform { |
|||
//
|
|||
private Long gId; |
|||
//标题
|
|||
private String gTitle; |
|||
//关键字
|
|||
private String gKey; |
|||
//描述
|
|||
private String gDescribe; |
|||
//父级
|
|||
private Long gParent; |
|||
//分类
|
|||
private Long gParentSun; |
|||
//文档来源(1:原创;2:转载)
|
|||
private Byte gSource; |
|||
//转载地址
|
|||
private String gSourceUrl; |
|||
//缩略图
|
|||
private String gThumbnail; |
|||
//排序
|
|||
private Long gSort; |
|||
//评论设置(1:允许评论;2:禁止评论)
|
|||
private Byte gComment; |
|||
//访问权限(1:公开;2:分厂;3:工段;4:自定义)
|
|||
private Byte gVisitStrat; |
|||
//状态(1:草稿;2:发表;3:下架;4:删除)
|
|||
private Byte gState; |
|||
//写入时间
|
|||
private Long gAddTime; |
|||
//修改时间
|
|||
private Long gEiteTime; |
|||
//编辑人员
|
|||
private Long gUserKey; |
|||
//分厂
|
|||
private Long gBfId; |
|||
//工段
|
|||
private Long gWsId; |
|||
//班组
|
|||
private Long gTeam; |
|||
//是否允许下载(1:允许;2:禁止)
|
|||
private Byte gDownloadState; |
|||
//阅读量
|
|||
private Integer gRead; |
|||
//评论数
|
|||
private Integer gComSum; |
|||
//收藏数
|
|||
private Integer gCollectionSum; |
|||
//点赞数
|
|||
private Integer gLikes; |
|||
//推荐(1:推荐,2:不推荐)
|
|||
private Byte gRecommend; |
|||
//图文详情
|
|||
private String gContent; |
|||
//踩数量
|
|||
private Integer gStepOn; |
|||
//自定义可见范围
|
|||
private String gRange; |
|||
//写入分厂
|
|||
private Long gWriteBfid; |
|||
//正文文档名称
|
|||
private String gTextName; |
|||
//正文文档URL
|
|||
private String gTestUrl; |
|||
//物理地址
|
|||
private String gPhysicsPath; |
|||
//写入人员组织
|
|||
private Long gWriteGroup; |
|||
//外部链接
|
|||
private String gOuterLink; |
|||
|
|||
public Long getgId() { |
|||
return gId; |
|||
} |
|||
|
|||
public void setgId(Long gId) { |
|||
this.gId = gId; |
|||
} |
|||
|
|||
public String getgTitle() { |
|||
return gTitle; |
|||
} |
|||
|
|||
public void setgTitle(String gTitle) { |
|||
this.gTitle = gTitle; |
|||
} |
|||
|
|||
public String getgKey() { |
|||
return gKey; |
|||
} |
|||
|
|||
public void setgKey(String gKey) { |
|||
this.gKey = gKey; |
|||
} |
|||
|
|||
public String getgDescribe() { |
|||
return gDescribe; |
|||
} |
|||
|
|||
public void setgDescribe(String gDescribe) { |
|||
this.gDescribe = gDescribe; |
|||
} |
|||
|
|||
public Long getgParent() { |
|||
return gParent; |
|||
} |
|||
|
|||
public void setgParent(Long gParent) { |
|||
this.gParent = gParent; |
|||
} |
|||
|
|||
public Long getgParentSun() { |
|||
return gParentSun; |
|||
} |
|||
|
|||
public void setgParentSun(Long gParentSun) { |
|||
this.gParentSun = gParentSun; |
|||
} |
|||
|
|||
public Byte getgSource() { |
|||
return gSource; |
|||
} |
|||
|
|||
public void setgSource(Byte gSource) { |
|||
this.gSource = gSource; |
|||
} |
|||
|
|||
public String getgSourceUrl() { |
|||
return gSourceUrl; |
|||
} |
|||
|
|||
public void setgSourceUrl(String gSourceUrl) { |
|||
this.gSourceUrl = gSourceUrl; |
|||
} |
|||
|
|||
public String getgThumbnail() { |
|||
return gThumbnail; |
|||
} |
|||
|
|||
public void setgThumbnail(String gThumbnail) { |
|||
this.gThumbnail = gThumbnail; |
|||
} |
|||
|
|||
public Long getgSort() { |
|||
return gSort; |
|||
} |
|||
|
|||
public void setgSort(Long gSort) { |
|||
this.gSort = gSort; |
|||
} |
|||
|
|||
public Byte getgComment() { |
|||
return gComment; |
|||
} |
|||
|
|||
public void setgComment(Byte gComment) { |
|||
this.gComment = gComment; |
|||
} |
|||
|
|||
public Byte getgVisitStrat() { |
|||
return gVisitStrat; |
|||
} |
|||
|
|||
public void setgVisitStrat(Byte gVisitStrat) { |
|||
this.gVisitStrat = gVisitStrat; |
|||
} |
|||
|
|||
public Byte getgState() { |
|||
return gState; |
|||
} |
|||
|
|||
public void setgState(Byte gState) { |
|||
this.gState = gState; |
|||
} |
|||
|
|||
public Long getgAddTime() { |
|||
return gAddTime; |
|||
} |
|||
|
|||
public void setgAddTime(Long gAddTime) { |
|||
this.gAddTime = gAddTime; |
|||
} |
|||
|
|||
public Long getgEiteTime() { |
|||
return gEiteTime; |
|||
} |
|||
|
|||
public void setgEiteTime(Long gEiteTime) { |
|||
this.gEiteTime = gEiteTime; |
|||
} |
|||
|
|||
public Long getgUserKey() { |
|||
return gUserKey; |
|||
} |
|||
|
|||
public void setgUserKey(Long gUserKey) { |
|||
this.gUserKey = gUserKey; |
|||
} |
|||
|
|||
public Long getgBfId() { |
|||
return gBfId; |
|||
} |
|||
|
|||
public void setgBfId(Long gBfId) { |
|||
this.gBfId = gBfId; |
|||
} |
|||
|
|||
public Long getgWsId() { |
|||
return gWsId; |
|||
} |
|||
|
|||
public void setgWsId(Long gWsId) { |
|||
this.gWsId = gWsId; |
|||
} |
|||
|
|||
public Long getgTeam() { |
|||
return gTeam; |
|||
} |
|||
|
|||
public void setgTeam(Long gTeam) { |
|||
this.gTeam = gTeam; |
|||
} |
|||
|
|||
public Byte getgDownloadState() { |
|||
return gDownloadState; |
|||
} |
|||
|
|||
public void setgDownloadState(Byte gDownloadState) { |
|||
this.gDownloadState = gDownloadState; |
|||
} |
|||
|
|||
public Integer getgRead() { |
|||
return gRead; |
|||
} |
|||
|
|||
public void setgRead(Integer gRead) { |
|||
this.gRead = gRead; |
|||
} |
|||
|
|||
public Integer getgComSum() { |
|||
return gComSum; |
|||
} |
|||
|
|||
public void setgComSum(Integer gComSum) { |
|||
this.gComSum = gComSum; |
|||
} |
|||
|
|||
public Integer getgCollectionSum() { |
|||
return gCollectionSum; |
|||
} |
|||
|
|||
public void setgCollectionSum(Integer gCollectionSum) { |
|||
this.gCollectionSum = gCollectionSum; |
|||
} |
|||
|
|||
public Integer getgLikes() { |
|||
return gLikes; |
|||
} |
|||
|
|||
public void setgLikes(Integer gLikes) { |
|||
this.gLikes = gLikes; |
|||
} |
|||
|
|||
public Byte getgRecommend() { |
|||
return gRecommend; |
|||
} |
|||
|
|||
public void setgRecommend(Byte gRecommend) { |
|||
this.gRecommend = gRecommend; |
|||
} |
|||
|
|||
public String getgContent() { |
|||
return gContent; |
|||
} |
|||
|
|||
public void setgContent(String gContent) { |
|||
this.gContent = gContent; |
|||
} |
|||
|
|||
public Integer getgStepOn() { |
|||
return gStepOn; |
|||
} |
|||
|
|||
public void setgStepOn(Integer gStepOn) { |
|||
this.gStepOn = gStepOn; |
|||
} |
|||
|
|||
public String getgRange() { |
|||
return gRange; |
|||
} |
|||
|
|||
public void setgRange(String gRange) { |
|||
this.gRange = gRange; |
|||
} |
|||
|
|||
public Long getgWriteBfid() { |
|||
return gWriteBfid; |
|||
} |
|||
|
|||
public void setgWriteBfid(Long gWriteBfid) { |
|||
this.gWriteBfid = gWriteBfid; |
|||
} |
|||
|
|||
public String getgTextName() { |
|||
return gTextName; |
|||
} |
|||
|
|||
public void setgTextName(String gTextName) { |
|||
this.gTextName = gTextName; |
|||
} |
|||
|
|||
public String getgTestUrl() { |
|||
return gTestUrl; |
|||
} |
|||
|
|||
public void setgTestUrl(String gTestUrl) { |
|||
this.gTestUrl = gTestUrl; |
|||
} |
|||
|
|||
public String getgPhysicsPath() { |
|||
return gPhysicsPath; |
|||
} |
|||
|
|||
public void setgPhysicsPath(String gPhysicsPath) { |
|||
this.gPhysicsPath = gPhysicsPath; |
|||
} |
|||
|
|||
public Long getgWriteGroup() { |
|||
return gWriteGroup; |
|||
} |
|||
|
|||
public void setgWriteGroup(Long gWriteGroup) { |
|||
this.gWriteGroup = gWriteGroup; |
|||
} |
|||
|
|||
public String getgOuterLink() { |
|||
return gOuterLink; |
|||
} |
|||
|
|||
public void setgOuterLink(String gOuterLink) { |
|||
this.gOuterLink = gOuterLink; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "Graphicform{" + |
|||
"gId=" + gId + |
|||
", gTitle='" + gTitle + '\'' + |
|||
", gKey='" + gKey + '\'' + |
|||
", gDescribe='" + gDescribe + '\'' + |
|||
", gParent=" + gParent + |
|||
", gParentSun=" + gParentSun + |
|||
", gSource=" + gSource + |
|||
", gSourceUrl='" + gSourceUrl + '\'' + |
|||
", gThumbnail='" + gThumbnail + '\'' + |
|||
", gSort=" + gSort + |
|||
", gComment=" + gComment + |
|||
", gVisitStrat=" + gVisitStrat + |
|||
", gState=" + gState + |
|||
", gAddTime=" + gAddTime + |
|||
", gEiteTime=" + gEiteTime + |
|||
", gUserKey=" + gUserKey + |
|||
", gBfId=" + gBfId + |
|||
", gWsId=" + gWsId + |
|||
", gTeam=" + gTeam + |
|||
", gDownloadState=" + gDownloadState + |
|||
", gRead=" + gRead + |
|||
", gComSum=" + gComSum + |
|||
", gCollectionSum=" + gCollectionSum + |
|||
", gLikes=" + gLikes + |
|||
", gRecommend=" + gRecommend + |
|||
", gContent='" + gContent + '\'' + |
|||
", gStepOn=" + gStepOn + |
|||
", gRange='" + gRange + '\'' + |
|||
", gWriteBfid=" + gWriteBfid + |
|||
", gTextName='" + gTextName + '\'' + |
|||
", gTestUrl='" + gTestUrl + '\'' + |
|||
", gPhysicsPath='" + gPhysicsPath + '\'' + |
|||
", gWriteGroup=" + gWriteGroup + |
|||
", gOuterLink='" + gOuterLink + '\'' + |
|||
'}'; |
|||
} |
|||
} |
|||
@ -0,0 +1,86 @@ |
|||
package com.hxgk.zxxy.model.entity; |
|||
|
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
@Repository |
|||
public class OrgContType { |
|||
private Long id; |
|||
private String numbe; |
|||
private String name; |
|||
private Long superior; |
|||
private String typename; |
|||
private Integer level; |
|||
private Byte state; |
|||
|
|||
|
|||
public Long getId() { |
|||
return id; |
|||
} |
|||
|
|||
public void setId(Long id) { |
|||
this.id = id; |
|||
} |
|||
|
|||
public String getNumbe() { |
|||
return numbe; |
|||
} |
|||
|
|||
public void setNumbe(String numbe) { |
|||
this.numbe = numbe; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public Long getSuperior() { |
|||
return superior; |
|||
} |
|||
|
|||
public void setSuperior(Long superior) { |
|||
this.superior = superior; |
|||
} |
|||
|
|||
public String getTypename() { |
|||
return typename; |
|||
} |
|||
|
|||
public void setTypename(String typename) { |
|||
this.typename = typename; |
|||
} |
|||
|
|||
|
|||
|
|||
public Byte getState() { |
|||
return state; |
|||
} |
|||
|
|||
public void setState(Byte state) { |
|||
this.state = state; |
|||
} |
|||
|
|||
public Integer getLevel() { |
|||
return level; |
|||
} |
|||
|
|||
public void setLevel(Integer level) { |
|||
this.level = level; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "OrgContType{" + |
|||
"id=" + id + |
|||
", numbe='" + numbe + '\'' + |
|||
", name='" + name + '\'' + |
|||
", superior=" + superior + |
|||
", typename='" + typename + '\'' + |
|||
", level=" + level + |
|||
", state=" + state + |
|||
'}'; |
|||
} |
|||
} |
|||
@ -0,0 +1,69 @@ |
|||
package com.hxgk.zxxy.model.entity; |
|||
|
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
|
|||
|
|||
@Repository |
|||
public class UserDetail { |
|||
//证件号码
|
|||
private String idcardno; |
|||
//姓名
|
|||
private String name; |
|||
//头像
|
|||
private String icon; |
|||
//工号
|
|||
private String wmNumber; |
|||
//唯一识别码
|
|||
private Long wmKey; |
|||
//adminorg
|
|||
private Long adminorg; |
|||
|
|||
public String getIdcardno() { |
|||
return idcardno; |
|||
} |
|||
|
|||
public void setIdcardno(String idcardno) { |
|||
this.idcardno = idcardno; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getIcon() { |
|||
return icon; |
|||
} |
|||
|
|||
public void setIcon(String icon) { |
|||
this.icon = icon; |
|||
} |
|||
|
|||
public String getWmNumber() { |
|||
return wmNumber; |
|||
} |
|||
|
|||
public void setWmNumber(String wmNumber) { |
|||
this.wmNumber = wmNumber; |
|||
} |
|||
|
|||
public Long getWmKey() { |
|||
return wmKey; |
|||
} |
|||
|
|||
public void setWmKey(Long wmKey) { |
|||
this.wmKey = wmKey; |
|||
} |
|||
|
|||
public Long getAdminorg() { |
|||
return adminorg; |
|||
} |
|||
|
|||
public void setAdminorg(Long adminorg) { |
|||
this.adminorg = adminorg; |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
package com.hxgk.zxxy.model.request; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonProperty; |
|||
|
|||
public class ArchivesTypeRequest { |
|||
//@JsonProperty("at_parent_id")
|
|||
private String atParentId; |
|||
|
|||
public String getAtParentId() { |
|||
return atParentId; |
|||
} |
|||
|
|||
public void setAtParentId(String atParentId) { |
|||
this.atParentId = atParentId; |
|||
} |
|||
} |
|||
@ -0,0 +1,107 @@ |
|||
package com.hxgk.zxxy.model.request; |
|||
|
|||
public class GraphicformRequest { |
|||
|
|||
private Integer pagesize; |
|||
|
|||
private Integer page; |
|||
|
|||
private Integer total; |
|||
|
|||
|
|||
//知识库or新闻资讯 database:archives_type.at_parent_id vue: naviQueryParam.atParentId
|
|||
private String archivesTypeAtParentId; |
|||
//graphicform.g_parent_sun==>archives_type.at_id 查询相关标题分类下的文章
|
|||
private String gParentSun; |
|||
//hr系统中org_cont_type表获取行政组织和类别id=adminorg
|
|||
private String adminorg; |
|||
//用户唯一识别码
|
|||
private String key; |
|||
private String userkey; |
|||
private String usertoken; |
|||
|
|||
public String getUserkey() { |
|||
return userkey; |
|||
} |
|||
|
|||
public void setUserkey(String userkey) { |
|||
this.userkey = userkey; |
|||
} |
|||
|
|||
public String getUsertoken() { |
|||
return usertoken; |
|||
} |
|||
|
|||
public void setUsertoken(String usertoken) { |
|||
this.usertoken = usertoken; |
|||
} |
|||
|
|||
public Integer getPagesize() { |
|||
return pagesize; |
|||
} |
|||
|
|||
public void setPagesize(Integer pagesize) { |
|||
this.pagesize = pagesize; |
|||
} |
|||
|
|||
public Integer getPage() { |
|||
return page; |
|||
} |
|||
|
|||
public void setPage(Integer page) { |
|||
this.page = page; |
|||
} |
|||
|
|||
public Integer getTotal() { |
|||
return total; |
|||
} |
|||
|
|||
public void setTotal(Integer total) { |
|||
this.total = total; |
|||
} |
|||
|
|||
public String getArchivesTypeAtParentId() { |
|||
return archivesTypeAtParentId; |
|||
} |
|||
|
|||
public void setArchivesTypeAtParentId(String archivesTypeAtParentId) { |
|||
this.archivesTypeAtParentId = archivesTypeAtParentId; |
|||
} |
|||
|
|||
public String getgParentSun() { |
|||
return gParentSun; |
|||
} |
|||
|
|||
public void setgParentSun(String gParentSun) { |
|||
this.gParentSun = gParentSun; |
|||
} |
|||
|
|||
public String getAdminorg() { |
|||
return adminorg; |
|||
} |
|||
|
|||
public void setAdminorg(String adminorg) { |
|||
this.adminorg = adminorg; |
|||
} |
|||
|
|||
public String getKey() { |
|||
return key; |
|||
} |
|||
|
|||
public void setKey(String key) { |
|||
this.key = key; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return "GraphicformRequest{" + |
|||
"pagesize=" + pagesize + |
|||
", page=" + page + |
|||
", total=" + total + |
|||
", archivesTypeAtParentId='" + archivesTypeAtParentId + '\'' + |
|||
", gParentSun='" + gParentSun + '\'' + |
|||
", adminorg=" + adminorg + |
|||
", key=" + key + |
|||
'}'; |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
package com.hxgk.zxxy.service; |
|||
|
|||
import com.hxgk.zxxy.model.entity.ArchivesType; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
public interface ArchivesTypeService { |
|||
|
|||
List<ArchivesType> getZxxyArchivesType(long atParentId); |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
package com.hxgk.zxxy.service; |
|||
|
|||
import com.hxgk.zxxy.model.entity.Graphicform; |
|||
import com.hxgk.zxxy.model.request.GraphicformRequest; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface GraphicformService { |
|||
List<Graphicform> queryListByParam(GraphicformRequest graphicformRequest) throws Exception; |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
package com.hxgk.zxxy.service; |
|||
|
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
public interface HrService { |
|||
|
|||
List<Long> queryGBfId(Long adminorg); |
|||
|
|||
List<Long> queryGWsId(Long adminorg) throws Exception; |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
package com.hxgk.zxxy.service; |
|||
|
|||
import com.hxgk.zxxy.model.entity.UserDetail; |
|||
|
|||
import java.util.Map; |
|||
|
|||
public interface UserService { |
|||
|
|||
/** |
|||
* 根据usertoken和userkey从redis中获取user信息. |
|||
*/ |
|||
UserDetail getUserDetailFromRedis (Map<String, String> userInfo); |
|||
} |
|||
@ -0,0 +1,25 @@ |
|||
package com.hxgk.zxxy.service.impl; |
|||
|
|||
import com.hxgk.zxxy.mapper.ArchivesTypeMapper; |
|||
import com.hxgk.zxxy.model.entity.ArchivesType; |
|||
import com.hxgk.zxxy.service.ArchivesTypeService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Service |
|||
public class ArchivesTypeServiceImpl implements ArchivesTypeService { |
|||
@Autowired |
|||
private ArchivesTypeMapper archivesTypeMapper; |
|||
|
|||
/** |
|||
* 根据atParentId获取知行学院的navi列表 |
|||
* @param atParentId |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public List<ArchivesType> getZxxyArchivesType(long atParentId) { |
|||
return archivesTypeMapper.getZxxyArchivesType(atParentId); |
|||
} |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
package com.hxgk.zxxy.service.impl; |
|||
|
|||
import com.baomidou.dynamic.datasource.annotation.DS; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import com.hxgk.zxxy.mapper.GraphicformMapper; |
|||
import com.hxgk.zxxy.model.entity.Graphicform; |
|||
import com.hxgk.zxxy.model.entity.UserDetail; |
|||
import com.hxgk.zxxy.model.request.GraphicformRequest; |
|||
import com.hxgk.zxxy.service.GraphicformService; |
|||
import com.hxgk.zxxy.service.HrService; |
|||
import com.hxgk.zxxy.service.UserService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class GraphicformServiceImpl implements GraphicformService { |
|||
@Autowired |
|||
HrService hrService; |
|||
@Autowired |
|||
GraphicformMapper graphicformMapper; |
|||
@Autowired |
|||
UserService userService; |
|||
|
|||
@DS("readdocument") |
|||
@Override |
|||
public List<Graphicform> queryListByParam(GraphicformRequest graphicformRequest) throws Exception { |
|||
Map<String, String> userInfo = new HashMap<>(); |
|||
userInfo.put("userkey",graphicformRequest.getUserkey()); |
|||
userInfo.put("usertoken",graphicformRequest.getUsertoken()); |
|||
UserDetail userDetail = userService.getUserDetailFromRedis(userInfo); |
|||
//去Hr中查询分厂(部门)和工段,工段可能是list(如果该用户层级较高,则拥有多个工段的权限.)当该用户层级低时,需向上查询他的上级机构码
|
|||
List<Long> gBfIdList = hrService.queryGBfId( userDetail.getAdminorg()); |
|||
//工段(list)
|
|||
List<Long> gWsIdList = hrService.queryGWsId( userDetail.getAdminorg()); |
|||
//开启分页
|
|||
PageHelper.startPage(graphicformRequest.getPage(), graphicformRequest.getPagesize()); |
|||
List<Graphicform> graphicforms = graphicformMapper |
|||
.queryListByParam(graphicformRequest.getArchivesTypeAtParentId(),graphicformRequest.getgParentSun(), gBfIdList, gWsIdList, Long.parseLong(graphicformRequest.getKey())); |
|||
PageInfo<Graphicform> pageInfo = new PageInfo<Graphicform>(graphicforms); |
|||
return pageInfo.getList(); |
|||
} |
|||
} |
|||
@ -0,0 +1,149 @@ |
|||
package com.hxgk.zxxy.service.impl; |
|||
|
|||
import com.baomidou.dynamic.datasource.annotation.DS; |
|||
import com.hxgk.zxxy.mapper.OrgContTypeMapper; |
|||
import com.hxgk.zxxy.model.entity.OrgContType; |
|||
import com.hxgk.zxxy.service.HrService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 分厂条件,level=1,2时,要用in,他要看下属的所有分厂,要查出下属所有分厂的id,3时为adminorg,456时要向上查他隶属的分厂 |
|||
* 工段条件,level=1,2,3,4,5时,要用in,他要看下属的所有工段,要查出下属所有工段的id,6时为adminorg |
|||
* 备煤,机焦表里是车间,level5,但是要当成部门,level4,我查时,向上向下查询时,如果adminorg in[282,115],则说明他是机焦或者备煤,他level看作4 |
|||
*/ |
|||
|
|||
@Service |
|||
@DS("hrnew") |
|||
public class HrServiceImpl implements HrService { |
|||
|
|||
|
|||
@Autowired |
|||
OrgContTypeMapper orgContTypeMapper; |
|||
|
|||
|
|||
//根据id查分厂
|
|||
//分厂条件,level=1,2时,要用in,他要看下属的所有分厂,要查出下属所有分厂的id,3时为adminorg,456时要向上查他隶属的分厂
|
|||
//备煤,机焦表里是车间,level5,但是要当成部门,level4,我查时,向上向下查询时,如果adminorg in[282,115],则说明他是机焦或者备煤,他level看作4
|
|||
@Override |
|||
public List<Long> queryGBfId(Long adminorg) { |
|||
adminorg = 313L; |
|||
OrgContType orgContType = queryOrgContTypeByAdminorg(adminorg); |
|||
Integer level = orgContType.getLevel(); |
|||
List<Long> gBfIdList = new ArrayList<Long>(); |
|||
if (level <= 2) { |
|||
|
|||
ArrayList<OrgContType> allBfList = new ArrayList(); |
|||
findAllUnder(orgContType,allBfList); |
|||
for (int i = 0; i < allBfList.size(); i++) { |
|||
if (allBfList.get(i).getLevel() == 3) { |
|||
gBfIdList.add(allBfList.get(i).getId()); |
|||
} |
|||
} |
|||
System.out.println("a"); |
|||
|
|||
} else if (level == 3) { |
|||
gBfIdList.add(adminorg); |
|||
} else {//level in [4,5,6] 递归查找至level=3,取id add入gBfIdList
|
|||
OrgContType highFac = queryHighFacId(orgContType); |
|||
gBfIdList.add(highFac.getId()); |
|||
} |
|||
return gBfIdList; |
|||
} |
|||
|
|||
|
|||
//根据id查工段
|
|||
//工段条件,level=1,2,3,4,5时,要用in,他要看下属的所有工段,要查出下属所有工段的id,6时为adminorg
|
|||
//备煤,机焦表里是车间,level5,但是要当成部门,level4,我查时,向上向下查询时,如果adminorg in[282,115],则说明他是机焦或者备煤,他level看作4
|
|||
//如果当前org的superior(父级)为115或282(备煤或机焦),则当前org即可能是level6,也可能是level5,如果是level6,则加入list,如果是level5则继续查询
|
|||
@Override |
|||
public List<Long> queryGWsId(Long adminorg) throws Exception { |
|||
adminorg = 313L; |
|||
List<Long> gGWsIdList = new ArrayList<Long>(); |
|||
OrgContType orgContType = queryOrgContTypeByAdminorg(adminorg); |
|||
Integer level = orgContType.getLevel(); |
|||
ArrayList<OrgContType> allWsList = new ArrayList(); |
|||
|
|||
findAllUnder(orgContType,allWsList); |
|||
for (int i = 0; i < allWsList.size(); i++) { |
|||
if (allWsList.get(i).getLevel() == 6) { |
|||
gGWsIdList.add(allWsList.get(i).getId()); |
|||
} |
|||
} |
|||
|
|||
|
|||
return gGWsIdList; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 根据adminorg查询orgContType |
|||
* |
|||
* @param adminorg |
|||
* @return |
|||
*/ |
|||
|
|||
public OrgContType queryOrgContTypeByAdminorg(Long adminorg) { |
|||
OrgContType orgContType = orgContTypeMapper.queryLever(adminorg); |
|||
return orgContType; |
|||
} |
|||
|
|||
/** |
|||
* 查询本机构下级机构 |
|||
* |
|||
* @param orgContType |
|||
* @return |
|||
*/ |
|||
private List<OrgContType> queryLowOrg(OrgContType orgContType) { |
|||
List<OrgContType> orgContTypeList = orgContTypeMapper.queryLowOrg(orgContType.getId()); |
|||
List<Long> lowFacList = new ArrayList<Long>(); |
|||
for (int i = 0; i < orgContTypeList.size(); i++) { |
|||
lowFacList.add(orgContTypeList.get(i).getId()); |
|||
} |
|||
return orgContTypeList; |
|||
} |
|||
|
|||
/** |
|||
* 递归查询level为456的机构的上级分厂 |
|||
* |
|||
* @param orgContType |
|||
* @return |
|||
*/ |
|||
|
|||
private OrgContType queryHighFacId(OrgContType orgContType) { |
|||
//查他父级
|
|||
Long superior = orgContType.getSuperior(); |
|||
OrgContType superiorOrg = queryOrgContTypeByAdminorg(superior); |
|||
//父级不是分厂
|
|||
if (superiorOrg.getLevel() != 3) { |
|||
return queryHighFacId(superiorOrg); |
|||
} else { |
|||
return superiorOrg; |
|||
} |
|||
|
|||
} |
|||
|
|||
/** |
|||
* 递归查询直到org没有下级 |
|||
* 期间将所有org对象存入allList |
|||
* |
|||
* @param org |
|||
* @return |
|||
*/ |
|||
|
|||
private void findAllUnder(OrgContType org, ArrayList<OrgContType> allWsList) { |
|||
List<OrgContType> list = queryLowOrg(org); |
|||
if (list.size() != 0) { |
|||
for (int i = 0; i < list.size(); i++) { |
|||
allWsList.add(list.get(i)); |
|||
findAllUnder(list.get(i), allWsList); |
|||
} |
|||
} |
|||
|
|||
} |
|||
|
|||
|
|||
} |
|||
@ -0,0 +1,81 @@ |
|||
package com.hxgk.zxxy.service.impl; |
|||
|
|||
import com.hxgk.zxxy.model.entity.UserDetail; |
|||
import com.hxgk.zxxy.service.UserService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.data.redis.core.HashOperations; |
|||
import org.springframework.data.redis.core.StringRedisTemplate; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Map; |
|||
|
|||
@Service |
|||
public class UserServiceImpl implements UserService { |
|||
@Autowired |
|||
private UserDetail userDetail1; |
|||
@Autowired |
|||
private StringRedisTemplate redisTemplate; |
|||
|
|||
/** |
|||
* 从redis中根据userkey和usertoken获取userDetail |
|||
* |
|||
* @param userInfo |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public UserDetail getUserDetailFromRedis(Map<String, String> userInfo) { |
|||
UserDetail userDetail = new UserDetail(); |
|||
String userkey = ""; |
|||
String usertoken = ""; |
|||
//获取userkey,usertoken
|
|||
for (Map.Entry<String, String> entry : userInfo.entrySet()) { |
|||
|
|||
if (StringUtils.isNotEmpty(entry.getKey()) && entry.getKey().equals("userkey")) { |
|||
userkey = entry.getValue(); |
|||
} |
|||
if (StringUtils.isNotEmpty(entry.getKey()) && entry.getKey().equals("usertoken")) { |
|||
usertoken = entry.getValue(); |
|||
} |
|||
} |
|||
//从redis中根据userkey和usertoken获取userDetail
|
|||
|
|||
String userRedisHashKey = "HXGK_GO_ZhixingCollege:ScanCode:Authentication:LoginApi_dev_" + userkey; |
|||
Object value1 = redisTemplate.boundHashOps(userRedisHashKey).get("key"); |
|||
//唯一识别码
|
|||
String key = value1.toString(); |
|||
|
|||
//工号
|
|||
Object wmNumber = redisTemplate.boundHashOps(userRedisHashKey).get("usernumber"); |
|||
|
|||
String userDetailKey = "HXGK_GO_ZhixingCollege:ScanCode:Authentication:UserCont_dev_" + wmNumber; |
|||
|
|||
HashOperations hashOps = redisTemplate.opsForHash(); |
|||
Map<String, String> entries = hashOps.entries(userDetailKey); |
|||
for (Map.Entry<String, String> entry : entries.entrySet()) { |
|||
|
|||
if (StringUtils.isNotEmpty(entry.getKey()) && entry.getKey().equals("idcardno")) { |
|||
userDetail.setIdcardno(entry.getValue()); |
|||
} |
|||
if (StringUtils.isNotEmpty(entry.getKey()) && entry.getKey().equals("name")) { |
|||
userDetail.setName(entry.getValue()); |
|||
} |
|||
if (StringUtils.isNotEmpty(entry.getKey()) && entry.getKey().equals("icon")) { |
|||
userDetail.setIcon(entry.getValue()); |
|||
} |
|||
if (StringUtils.isNotEmpty(entry.getKey()) && entry.getKey().equals("number")) { |
|||
userDetail.setWmNumber(entry.getValue()); |
|||
} |
|||
if (StringUtils.isNotEmpty(entry.getKey()) && entry.getKey().equals("key")) { |
|||
long l = Long.parseLong(entry.getValue()); |
|||
userDetail.setWmKey(l); |
|||
} |
|||
if (StringUtils.isNotEmpty(entry.getKey()) && entry.getKey().equals("adminorg")) { |
|||
long adminorg = Long.parseLong(entry.getValue()); |
|||
userDetail.setAdminorg(adminorg); |
|||
} |
|||
} |
|||
|
|||
return userDetail; |
|||
} |
|||
} |
|||
@ -0,0 +1,91 @@ |
|||
package com.hxgk.zxxy.utils; |
|||
|
|||
public class JsonData { |
|||
|
|||
/** |
|||
* 状态码 0表示成功过,1表示处理中,-1 表示失败 |
|||
*/ |
|||
private Integer code; |
|||
/** |
|||
* 信息表示 |
|||
*/ |
|||
private String msg; |
|||
/** |
|||
* 业务数据 |
|||
*/ |
|||
private Object data; |
|||
|
|||
|
|||
|
|||
public JsonData(){} |
|||
|
|||
public JsonData(Integer code, Object data, String msg){ |
|||
this.code = code; |
|||
this.data = data; |
|||
this.msg = msg; |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 成功,不用返回数据 |
|||
* @return |
|||
*/ |
|||
public static JsonData buildSuccess(){ |
|||
return new JsonData(0,null,null); |
|||
} |
|||
|
|||
/** |
|||
* 成功,返回数据 |
|||
* @param data |
|||
* @return |
|||
*/ |
|||
public static JsonData buildSuccess(Object data){ |
|||
return new JsonData(0,data,null); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 失败,固定状态码 |
|||
* @param msg |
|||
* @return |
|||
*/ |
|||
public static JsonData buildError(String msg){ |
|||
return new JsonData(-1 ,null,msg); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 失败,自定义错误码和信息 |
|||
* @param code |
|||
* @param msg |
|||
* @return |
|||
*/ |
|||
public static JsonData buildError(Integer code , String msg){ |
|||
return new JsonData(code ,null,msg); |
|||
} |
|||
|
|||
|
|||
public Integer getCode() { |
|||
return code; |
|||
} |
|||
|
|||
public void setCode(Integer code) { |
|||
this.code = code; |
|||
} |
|||
|
|||
public Object getData() { |
|||
return data; |
|||
} |
|||
|
|||
public void setData(Object data) { |
|||
this.data = data; |
|||
} |
|||
|
|||
public String getMsg() { |
|||
return msg; |
|||
} |
|||
|
|||
public void setMsg(String msg) { |
|||
this.msg = msg; |
|||
} |
|||
} |
|||
@ -0,0 +1,127 @@ |
|||
|
|||
server.port=8088 |
|||
|
|||
|
|||
###MySQL druid多数据源配置(纯粹多库)### |
|||
#去除durid配置 |
|||
spring.autoconfigure.exclude=com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure |
|||
#指定默认数据源(必须配置) |
|||
spring.datasource.dynamic.primary=hengxingaoketes |
|||
#设置严格模式,默认false不启动. 启动后在未匹配到指定数据源时候回抛出异常,不启动会使用默认数据源. |
|||
spring.datasource.dynamic.strict=false |
|||
|
|||
spring.datasource.dynamic.datasource.hengxingaoketes.url=jdbc:mysql://172.20.2.87:3306/hengxingaoke_tes?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false |
|||
spring.datasource.dynamic.datasource.hengxingaoketes.username=hengxingaoke_tes |
|||
spring.datasource.dynamic.datasource.hengxingaoketes.password=rjwi58B6zYCHMbGZ |
|||
spring.datasource.dynamic.datasource.hengxingaoketes.driver-class-name=com.mysql.cj.jdbc.Driver |
|||
|
|||
spring.datasource.dynamic.datasource.leaguetabledata.url=jdbc:mysql://172.20.2.87:3306/league_table_data?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false |
|||
spring.datasource.dynamic.datasource.leaguetabledata.username=league_table_data |
|||
spring.datasource.dynamic.datasource.leaguetabledata.password=e0eb142add |
|||
spring.datasource.dynamic.datasource.leaguetabledata.driver-class-name=com.mysql.cj.jdbc.Driver |
|||
|
|||
spring.datasource.dynamic.datasource.statisticsing.url=jdbc:mysql://172.20.2.87:3306/statisticsing?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false |
|||
spring.datasource.dynamic.datasource.statisticsing.username=statisticsing |
|||
spring.datasource.dynamic.datasource.statisticsing.password=19c66cdb65 |
|||
spring.datasource.dynamic.datasource.statisticsing.driver-class-name=com.mysql.cj.jdbc.Driver |
|||
|
|||
spring.datasource.dynamic.datasource.quesandanswers.url=jdbc:mysql://172.20.2.87:3306/ques_and_answers?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false |
|||
spring.datasource.dynamic.datasource.quesandanswers.username=ques_and_answers |
|||
spring.datasource.dynamic.datasource.quesandanswers.password=c8caf5d256 |
|||
spring.datasource.dynamic.datasource.quesandanswers.driver-class-name=com.mysql.cj.jdbc.Driver |
|||
|
|||
spring.datasource.dynamic.datasource.learnmessage.url=jdbc:mysql://172.20.2.87:3306/learn_message?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false |
|||
spring.datasource.dynamic.datasource.learnmessage.username=learn_message |
|||
spring.datasource.dynamic.datasource.learnmessage.password=3bdd844687 |
|||
spring.datasource.dynamic.datasource.learnmessage.driver-class-name=com.mysql.cj.jdbc.Driver |
|||
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/online_xdclass?useUnicode=true&characterEncoding=utf-8&useSSL=false |
|||
spring.datasource.dynamic.datasource.wrongquestionbank.url=jdbc:mysql://172.20.2.87:3306/wrong_question_bank?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false |
|||
spring.datasource.dynamic.datasource.wrongquestionbank.username=wrong_question_bank |
|||
spring.datasource.dynamic.datasource.wrongquestionbank.password=7f7ac6c8f5 |
|||
spring.datasource.dynamic.datasource.wrongquestionbank.driver-class-name=com.mysql.cj.jdbc.Driver |
|||
|
|||
spring.datasource.dynamic.datasource.selftestdatabase.url=jdbc:mysql://172.20.2.87:3306/selftestdatabase?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false |
|||
spring.datasource.dynamic.datasource.selftestdatabase.username=selftestdatabase |
|||
spring.datasource.dynamic.datasource.selftestdatabase.password=6755319456 |
|||
spring.datasource.dynamic.datasource.selftestdatabase.driver-class-name=com.mysql.cj.jdbc.Driver |
|||
|
|||
|
|||
spring.datasource.dynamic.datasource.readdocument.url=jdbc:mysql://172.20.2.87:3306/readdocument?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false |
|||
spring.datasource.dynamic.datasource.readdocument.username=readdocument |
|||
spring.datasource.dynamic.datasource.readdocument.password=f2c943d2ab |
|||
spring.datasource.dynamic.datasource.readdocument.driver-class-name=com.mysql.cj.jdbc.Driver |
|||
|
|||
|
|||
spring.datasource.dynamic.datasource.hrnew.url=jdbc:mysql://172.20.2.87:3306/hr_new?allowPublicKeyRetrieval=true&uuseUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&tinyInt1isBit=false |
|||
spring.datasource.dynamic.datasource.hrnew.username=hr_new |
|||
spring.datasource.dynamic.datasource.hrnew.password=AnknKiXiXaxNrw78 |
|||
spring.datasource.dynamic.datasource.hrnew.driver-class-name=com.mysql.cj.jdbc.Driver |
|||
|
|||
|
|||
#数据源基础配置 |
|||
spring.datasource.dynamic.druid.initial-size=5 |
|||
spring.datasource.dynamic.druid.min-idle=5 |
|||
spring.datasource.dynamic.druid.max-active=20 |
|||
# 配置获取连接等待超时的时间 |
|||
spring.datasource.dynamic.druid.max-wait=6000 |
|||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 |
|||
spring.datasource.dynamic.druid.time-between-eviction-runs-millis=60000 |
|||
# 配置一个连接在池中最小生存的时间,单位是毫秒 |
|||
spring.datasource.dynamic.druid.min-evictable-idle-time-millis=300000 |
|||
spring.datasource.dynamic.druid.validation-query=SELECT 1 FROM DUAL |
|||
spring.datasource.dynamic.druid.test-while-idle=true |
|||
spring.datasource.dynamic.druid.test-on-borrow=false |
|||
spring.datasource.dynamic.druid.test-on-return=false |
|||
# 打开PSCache,并且指定每个连接上PSCache的大小 |
|||
spring.datasource.dynamic.druid.pool-prepared-statements=true |
|||
spring.datasource.dynamic.druid.max-pool-prepared-statement-per-connection-size=20 |
|||
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙 |
|||
spring.datasource.dynamic.druid.filters=stat,wall |
|||
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录 |
|||
spring.datasource.dynamic.druid.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 |
|||
|
|||
|
|||
|
|||
|
|||
#Redis |
|||
#spring.redis.host=127.0.0.1 |
|||
spring.redis.host=127.0.0.1 |
|||
spring.redis.database=5 |
|||
## Redis服务器连接端口 |
|||
spring.redis.port=6379 |
|||
## 连接超时时间(毫秒) |
|||
#spring.redis.timeout=10000 |
|||
## Redis服务器连接密码(默认为空) |
|||
#spring.redis.password=123456 |
|||
## 连接池中的最大连接数 |
|||
#spring.redis.poolMaxTotal=10 |
|||
## 连接池中的最大空闲连接 |
|||
#spring.redis.poolMaxIdle=10 |
|||
## 连接池最大阻塞等待时间(使用负值表示没有限制) |
|||
#redis.poolMaxWait=3 |
|||
|
|||
|
|||
# 连接池最?连接数(使?负值表示没有限制) |
|||
spring.redis.lettuce.pool.max-active = 10 |
|||
# 连接池中的最?空闲连接 |
|||
spring.redis.lettuce.pool.max-idle = 10 |
|||
# 连接池中的最?空闲连接 |
|||
spring.redis.lettuce.pool.min-idle = 0 |
|||
# 连接池最?阻塞等待时间(使?负值表示没有限制) |
|||
spring.redis.lettuce.pool.max-wait= -1ms |
|||
|
|||
|
|||
#开启控制台打印sql |
|||
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl |
|||
|
|||
# mybatis 下划线转驼峰配置,两者都可以 |
|||
#mybatis.configuration.mapUnderscoreToCamelCase=true |
|||
mybatis.configuration.map-underscore-to-camel-case=true |
|||
#配置扫描 |
|||
mybatis.mapper-locations=classpath:mapper/*.xml |
|||
|
|||
#配置xml的结果别名 |
|||
mybatis.type-aliases-package=com.hxgk.zxxy.model.entity |
|||
|
|||
|
|||
|
|||
@ -0,0 +1,14 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
|||
<mapper namespace="com.hxgk.zxxy.mapper.ArchivesTypeMapper"> |
|||
|
|||
|
|||
|
|||
|
|||
<select id="getZxxyArchivesType" resultType="ArchivesType"> |
|||
|
|||
select * from archives_type where at_stater=1 and at_parent_id = #{at_parent_id} ORDER BY at_sort |
|||
|
|||
</select> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,39 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
|||
<mapper namespace="com.hxgk.zxxy.mapper.GraphicformMapper"> |
|||
|
|||
|
|||
<select id="queryListByParam" resultType="Graphicform"> |
|||
|
|||
SELECT * FROM graphicform WHERE 1 = 1 |
|||
|
|||
<if test="g_parent_sun =='2'"> |
|||
AND g_parent_sun = #{g_parent_sun} |
|||
</if> |
|||
and g_parent = #{g_parent} |
|||
|
|||
AND g_state = 2 |
|||
AND ( |
|||
( g_visit_strat = 1 ) |
|||
OR ( g_visit_strat = 2 AND g_bf_id IN |
|||
<foreach collection="gBfIdList" item="gBfId" index="index" open="(" close=")" separator=","> |
|||
#{gBfId} |
|||
</foreach> |
|||
) |
|||
<if test="gWsIdList.size() >'0'"> |
|||
OR ( g_visit_strat = 3 AND g_ws_id IN |
|||
<foreach collection="gWsIdList" item="gWsId" index="index" open="(" close=")" separator=","> |
|||
#{gWsId} |
|||
</foreach> |
|||
) |
|||
</if> |
|||
OR ( |
|||
g_visit_strat = 4 AND FIND_IN_SET( #{key}, g_range ) |
|||
) |
|||
) |
|||
ORDER BY |
|||
g_add_time DESC, |
|||
g_recommend ASC |
|||
</select> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,18 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
|||
<mapper namespace="com.hxgk.zxxy.mapper.OrgContTypeMapper"> |
|||
|
|||
|
|||
<select id="queryLever" resultType="OrgContType"> |
|||
|
|||
select * from org_cont_type where id=#{adminorg} |
|||
|
|||
</select> |
|||
|
|||
<select id="queryLowOrg" resultType="OrgContType"> |
|||
|
|||
select * from org_cont_type where superior =#{adminorg} |
|||
|
|||
</select> |
|||
|
|||
</mapper> |
|||
@ -0,0 +1,20 @@ |
|||
package com.hxgk.zxxy; |
|||
|
|||
import org.junit.jupiter.api.Test; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.boot.test.context.SpringBootTest; |
|||
import org.springframework.data.redis.core.RedisTemplate; |
|||
import org.springframework.data.redis.core.StringRedisTemplate; |
|||
|
|||
@SpringBootTest |
|||
class ZxxyApplicationTests { |
|||
@Autowired |
|||
private StringRedisTemplate redisTemplate; |
|||
@Test |
|||
void contextLoads() { |
|||
//redisTemplate.getConnectionFactory().getConnection().select(5);
|
|||
redisTemplate.opsForValue().set("name1","to1m"); |
|||
|
|||
} |
|||
|
|||
} |
|||
Loading…
Reference in new issue