Initial Commit

main
BlueMatthew 1 year ago
parent 302d43abe7
commit a5e796658c

32
.gitignore vendored

@ -23,4 +23,36 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**
### 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/
### VS Code ###
.vscode/

310
mvnw vendored

@ -0,0 +1,310 @@
#!/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 "$@"

182
mvnw.cmd vendored

@ -0,0 +1,182 @@
@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%

@ -0,0 +1,349 @@
<?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>
<groupId>com.chenxi</groupId>
<artifactId>chenxi</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>chenxi</name>
<description>Demo project for Spring Boot</description>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.1.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<swagger.version>2.9.2</swagger.version>
<mybatis.spring.boot.starter.version>1.3.2</mybatis.spring.boot.starter.version>
<pagehelper.spring.boot.starter.version>1.2.5</pagehelper.spring.boot.starter.version>
<fastjson.version>1.2.47</fastjson.version>
<druid.version>1.1.14</druid.version>
<commons.io.version>2.5</commons.io.version>
<commons.fileupload.version>1.3.3</commons.fileupload.version>
<bitwalker.version>1.19</bitwalker.version>
<jwt.version>0.9.0</jwt.version>
<swagger.version>2.9.2</swagger.version>
<poi.version>3.17</poi.version>
<oshi.version>3.9.1</oshi.version>
<hutool.version>5.0.6</hutool.version>
<mybatisplus.version>3.2.0</mybatisplus.version>
</properties>
<dependencies>
<!-- SpringBoot 核心包 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<!--
<exclusions>
<exclusion>
<artifactId>spring-boot-starter-tomcat</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
</exclusions>
-->
</dependency>
<!-- SpringBoot 测试 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- SpringBoot 拦截器 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!-- SpringBoot Web容器 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!-- spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional> <!-- 表示依赖不会传递 -->
</dependency>
<!-- spring security 安全认证 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- redis 缓存操作 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
<!-- pool 对象池 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
</dependency>
<!-- Mysql驱动包 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<!-- SpringBoot集成mybatis框架 -->
<!--<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>${mybatis.spring.boot.starter.version}</version>
</dependency>-->
<!-- pagehelper 分页插件 -->
<!--<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>${pagehelper.spring.boot.starter.version}</version>
</dependency>-->
<!-- SpringBoot集成mybatis框架 -->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatisplus.version}</version>
</dependency>
<!--阿里数据库连接池 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<!--常用工具类 -->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>${hutool.version}</version>
</dependency>
<!--常用工具类 -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<!--io常用工具类 -->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons.io.version}</version>
</dependency>
<!--文件上传工具类 -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>${commons.fileupload.version}</version>
</dependency>
<!-- 解析客户端操作系统、浏览器等 -->
<dependency>
<groupId>eu.bitwalker</groupId>
<artifactId>UserAgentUtils</artifactId>
<version>${bitwalker.version}</version>
</dependency>
<!-- 阿里JSON解析器 -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!--Spring框架基本的核心工具-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<!--Token生成与解析-->
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jwt.version}</version>
</dependency>
<!-- swagger2-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
</exclusion>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--防止进入swagger页面报类型转换错误排除2.9.2中的引用手动增加1.5.21版本-->
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.5.21</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
<!-- swagger2-UI-->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<!-- 获取系统信息 -->
<dependency>
<groupId>com.github.oshi</groupId>
<artifactId>oshi-core</artifactId>
<version>${oshi.version}</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
</dependency>
<!-- excel工具 -->
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi.version}</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger.version}</version>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.3.0</version>
</dependency>
<!-- 外部依赖 -->
<dependency>
<groupId>com.Algorithm_vibration</groupId>
<artifactId>Algorithm_vibration</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${project.basedir}/src/main/resources/lib/Algorithm_vibration-1.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.javabuilder</groupId>
<artifactId>javabuilder</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${project.basedir}/src/main/resources/lib/javabuilder-1.0.jar</systemPath>
</dependency>
<dependency>
<groupId>com.arraytest</groupId>
<artifactId>arraytest</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${project.basedir}/src/main/resources/lib/arraytest-1.0.jar</systemPath>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork> <!-- 如果没有该配置devtools不会生效 -->
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

@ -0,0 +1,7 @@
public class TestMain {
// public static void main(String[] args)
// {
// new BigDecimal(0.002364345566222).setScale(4, RoundingMode.UP).doubleValue();
// }
}

@ -0,0 +1,18 @@
package com.chenxuan;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
@EnableAutoConfiguration(exclude = DataSourceAutoConfiguration.class)
@ComponentScan(value = "com.chenxuan")
@MapperScan("com.chenxuan.mapper")
@SpringBootApplication
public class ChenxiApplication {
public static void main(String[] args) {
SpringApplication.run( ChenxiApplication.class, args );
}
}

@ -0,0 +1,55 @@
package com.chenxuan.base.controller;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.entity.model.SysUser;
import com.chenxuan.security.LoginUser;
import com.chenxuan.security.service.JwtTokenService;
import com.chenxuan.utils.ServletUtils;
import com.chenxuan.utils.spring.SpringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import java.beans.PropertyEditorSupport;
import java.util.Date;
import com.chenxuan.utils.DateUtils;
public class BaseController {
private JwtTokenService jwtTokenService = SpringUtils.getBean( JwtTokenService.class );
public LoginUser getLoginInfo(){
LoginUser loginUser = jwtTokenService.getLoginUser( ServletUtils.getRequest() );
return loginUser ;
}
public SysUser getLoginUser(){
LoginUser loginUser = jwtTokenService.getLoginUser( ServletUtils.getRequest() );
if(null != loginUser){
return loginUser.getUser();
}
return null ;
}
/**
* Date
*/
@InitBinder
public void initBinder(WebDataBinder binder) {
// Date 类型转换
binder.registerCustomEditor( Date.class, new PropertyEditorSupport() {
@Override
public void setAsText(String text) {
setValue( DateUtils.parseDate( text ) );
}
} );
}
public AjaxResult returnAjax(boolean flag) {
return flag ? AjaxResult.success() : AjaxResult.error();
}
}

@ -0,0 +1,146 @@
package com.chenxuan.base.entity;
import com.chenxuan.constants.HttpStatusCode;
import java.util.HashMap;
/**
* @ClassNameAjaxResult
* @Description Ajax
* @Author Arno_Fu
* @CreatTime11/26/2019 - 12:51 PM
* @Version V1.0
*/
public class AjaxResult extends HashMap<String, Object> {
/**
*
*/
public static final String CODE_TAG = "code";
/**
*
*/
public static final String MSG_TAG = "msg";
/**
*
*/
public static final String DATA_TAG = "data";
/**
* AjaxResult 使
*/
public AjaxResult() {
}
/**
* AjaxResult
*
* @param code
* @param msg
*/
public AjaxResult(int code, String msg) {
super.put(CODE_TAG, code);
super.put(MSG_TAG, msg);
}
/**
* AjaxResult
*
* @param code
* @param msg
* @param data
*/
public AjaxResult(int code, String msg, Object data) {
super.put(CODE_TAG, code);
super.put(MSG_TAG, msg);
if (data != null) {
super.put(DATA_TAG, data);
}
}
/**
*
*
* @return
*/
public static AjaxResult success() {
return AjaxResult.success("操作成功");
}
/**
*
*
* @return
*/
public static AjaxResult success(Object data) {
return AjaxResult.success("操作成功", data);
}
/**
*
*
* @param msg
* @return
*/
public static AjaxResult success(String msg) {
return AjaxResult.success(msg, null);
}
/**
*
*
* @param msg
* @param data
* @return
*/
public static AjaxResult success(String msg, Object data) {
return new AjaxResult(HttpStatusCode.SUCCESS, msg, data);
}
/**
*
*
* @return
*/
public static AjaxResult error() {
return AjaxResult.error("操作失败");
}
/**
*
*
* @param msg
* @return
*/
public static AjaxResult error(String msg) {
return AjaxResult.error(msg, null);
}
/**
*
*
* @param msg
* @param data
* @return
*/
public static AjaxResult error(String msg, Object data) {
return new AjaxResult(HttpStatusCode.ERROR, msg, data);
}
/**
*
*
* @param code
* @param msg
* @return
*/
public static AjaxResult error(int code, String msg) {
return new AjaxResult(code, msg, null);
}
}

@ -0,0 +1,51 @@
package com.chenxuan.base.entity;
import com.chenxuan.entity.model.ScheduleJob;
import com.chenxuan.utils.ScheduleRunnable;
import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.PersistJobDataAfterExecution;
import org.springframework.scheduling.quartz.QuartzJobBean;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
/**
* @ClassNameDynamicQuartzJobManager
* @Description
* @Author Arno_Fu
* @CreatTime12/25/2019 - 5:49 PM
* @Version V1.0
*/
@Slf4j
@PersistJobDataAfterExecution
@DisallowConcurrentExecution// 不允许并发执行
public class CustomQuartzJobBean extends QuartzJobBean {
private ExecutorService service = Executors.newSingleThreadExecutor();
@Override
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
//任务开始时间
ScheduleJob scheduleJob = (ScheduleJob) context.getMergedJobDataMap().get( JobConstant.JOB_PARAM_KEY );
//任务开始时间
long startTime = System.currentTimeMillis();
try {
ScheduleRunnable task = new ScheduleRunnable( scheduleJob.getBeanName(),
scheduleJob.getMethodName(), scheduleJob.getMethodParams() );
Future<?> future = service.submit( task );
Object object = future.get();
} catch (Exception e) {
log.error( "任务执行失败任务ID" + scheduleJob.getJobId(), e );
} finally {
}
}
}

@ -0,0 +1,21 @@
package com.chenxuan.base.entity;
public class JobConstant {
/**
* key
*/
public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";
/**
*
*/
public final static String JOB_KEY = "JOB_KEY";
/**
*
*/
public final static String TRIGGER_kEY = "TRIGGER_kEY";
}

@ -0,0 +1,40 @@
package com.chenxuan.base.entity;
/**
* @ClassNameJobOperateEnum
* @Description
* @Author Arno_Fu
* @CreatTime12/25/2019 - 3:51 PM
* @Version V1.0
*/
public enum JobOperateEnum {
START( "1", "启动" ),
PAUSE( "2", "暂停" ),
DELETE( "3", "删除" );
private final String value;
private final String desc;
JobOperateEnum(final String value, final String desc) {
this.value = value;
this.desc = desc;
}
public String getValue() {
return this.value;
}
// Jackson 注解为 JsonValue 返回中文 json 描述
public String getDesc() {
return this.desc;
}
public String getEnumName() {
return name();
}
}

@ -0,0 +1,65 @@
package com.chenxuan.base.entity;
import com.alibaba.fastjson.JSON;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
public class Query implements Serializable {
public String page = "1";
public String limit = "10";
public String orderByField = "";
public String isAsc = "";
/**
*
*/
private String params;
public Integer getPage() {
return Integer.parseInt( page );
}
public void setPage(String page) {
this.page = page;
}
public Integer getLimit() {
return Integer.parseInt( limit );
}
public void setLimit(String limit) {
this.limit = limit;
}
public String getOrderByField() {
return orderByField;
}
public void setOrderByField(String orderByField) {
this.orderByField = orderByField;
}
public String getIsAsc() {
return isAsc;
}
public void setIsAsc(String isAsc) {
this.isAsc = isAsc;
}
public Map<String, Object> getParams() {
if (params == null) {
return new HashMap<>();
}
return JSON.parseObject(params , Map.class );
}
public void setParams(String params) {
this.params = params;
}
}

@ -0,0 +1,105 @@
package com.chenxuan.base.exception;
import cn.hutool.core.util.StrUtil;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.constants.HttpStatusCode;
import com.chenxuan.exception.BaseException;
import com.chenxuan.exception.CustomException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.AccessDeniedException;
import org.springframework.security.authentication.AccountExpiredException;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.validation.BindException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.NoHandlerFoundException;
/**
* @ClassNameGlobalExceptionHandler
* @Description
* @Author Arno_Fu
* @CreatTime11/26/2019 - 9:57 PM
* @Version V1.0
*/
@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {
/**
*
*/
@ExceptionHandler(BaseException.class)
public AjaxResult baseException(BaseException e) {
return AjaxResult.error( e.getMessage() );
}
/**
*
*/
@ExceptionHandler(CustomException.class)
public AjaxResult businessException(CustomException e) {
if (e.getCode() == null)
{
return AjaxResult.error(e.getMessage());
}
return AjaxResult.error( e.getCode(), e.getMessage() );
}
@ExceptionHandler(NoHandlerFoundException.class)
public AjaxResult handlerNoFoundException(Exception e) {
log.error( e.getMessage(), e );
return AjaxResult.error( HttpStatusCode.NOT_FOUND, "路径不存在,请检查路径是否正确" );
}
@ExceptionHandler(AccessDeniedException.class)
public AjaxResult handleAuthorizationException(AccessDeniedException e) {
log.error( e.getMessage() );
return AjaxResult.error( HttpStatusCode.FORBIDDEN, "没有权限,请联系管理员授权" );
}
@ExceptionHandler(AccountExpiredException.class)
public AjaxResult handleAccountExpiredException(AccountExpiredException e) {
log.error( e.getMessage(), e );
return AjaxResult.error( e.getMessage() );
}
@ExceptionHandler(UsernameNotFoundException.class)
public AjaxResult handleUsernameNotFoundException(UsernameNotFoundException e) {
log.error( e.getMessage(), e );
return AjaxResult.error( e.getMessage() );
}
@ExceptionHandler(Exception.class)
public AjaxResult handleException(Exception e) {
log.error( e.getMessage(), e );
return AjaxResult.error( e.getMessage() );
}
/**
*
*/
@ExceptionHandler(BindException.class)
public AjaxResult validatedBindException(BindException e) {
log.error( e.getMessage(), e );
String message = e.getAllErrors().get( 0 ).getDefaultMessage();
return AjaxResult.error( message );
}
/**
*
*/
@ExceptionHandler(MethodArgumentNotValidException.class)
public Object validExceptionHandler(MethodArgumentNotValidException e) {
log.error( e.getMessage(), e );
String message = e.getBindingResult().getFieldError().getDefaultMessage();
return AjaxResult.error( message );
}
}

@ -0,0 +1,27 @@
package com.chenxuan.bean.annotation;
import com.chenxuan.enums.DataSourceType;
import java.lang.annotation.*;
/**
* @ClassNameDsAnnotation
* @Description
* @Author Arno_Fu
* @CreatTime12/23/2019 - 5:21 PM
* @Version V1.0
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface DsAnnotation {
/**
*
*/
public DataSourceType value() default DataSourceType.MASTER;
}

@ -0,0 +1,46 @@
package com.chenxuan.bean.annotation;
import com.chenxuan.enums.ClientType;
import com.chenxuan.enums.OperateType;
import java.lang.annotation.*;
/**
* @ClassNameLogAnnotation
* @Description
* @Author Arno_Fu
* @CreatTime11/26/2019 - 4:18 PM
* @Version V1.0
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface LogAnnotation {
/**
*
*/
String module();
/**
*
*/
boolean recordParam() default true;
/**
*
*/
public OperateType operateType() default OperateType.OTHER;
/**
*
*/
public ClientType clientType() default ClientType.MANAGE;
}

@ -0,0 +1,70 @@
package com.chenxuan.bean.aop;
import com.chenxuan.bean.annotation.DsAnnotation;
import com.chenxuan.bean.datasource.DynamicDataSourceContextHolder;
import com.chenxuan.utils.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
/**
* @ClassNameDataSourceAop
* @Description
* @Author Arno_Fu
* @CreatTime12/23/2019 - 5:33 PM
* @Version V1.0
*/
@Aspect
@Order(1)
@Component
public class DataSourceAop {
protected Logger logger = LoggerFactory.getLogger( getClass() );
@Pointcut("@annotation(com.chenxuan.bean.annotation.DsAnnotation)"
+ "|| @within(com.chenxuan.bean.annotation.DsAnnotation)")
public void dsPointCut() {
}
@Around("dsPointCut()")
public Object around(ProceedingJoinPoint point) throws Throwable {
DsAnnotation dataSource = getDataSource( point );
if (StringUtils.isNotNull( dataSource )) {
DynamicDataSourceContextHolder.setDataSourceType( dataSource.value().name() );
}
try {
return point.proceed();
} finally {
// 销毁数据源 在执行方法之后
DynamicDataSourceContextHolder.clearDataSourceType();
}
}
/**
*
*/
public DsAnnotation getDataSource(ProceedingJoinPoint point) {
MethodSignature signature = (MethodSignature) point.getSignature();
Class<? extends Object> targetClass = point.getTarget().getClass();
DsAnnotation targetDataSource = targetClass.getAnnotation( DsAnnotation.class );
if (StringUtils.isNotNull( targetDataSource )) {
return targetDataSource;
} else {
Method method = signature.getMethod();
DsAnnotation dataSource = method.getAnnotation( DsAnnotation.class );
return dataSource;
}
}
}

@ -0,0 +1,257 @@
package com.chenxuan.bean.aop;
import com.alibaba.fastjson.JSON;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.entity.model.SysOperLog;
import com.chenxuan.enums.BusinessStatus;
import com.chenxuan.enums.HttpMethod;
import com.chenxuan.manager.AsyncManager;
import com.chenxuan.manager.factory.AsyncFactory;
import com.chenxuan.security.LoginUser;
import com.chenxuan.security.service.JwtTokenService;
import com.chenxuan.utils.ServletUtils;
import com.chenxuan.utils.StringUtils;
import com.chenxuan.utils.ip.IpUtils;
import com.chenxuan.utils.spring.SpringUtils;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.HandlerMapping;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
import java.util.Date;
import java.util.Map;
/**
* @ClassNameLogAop
* @Description .
* @Author Arno_Fu
* @CreatTime11/26/2019 - 4:20 PM
* @Version V1.0
*/
@Slf4j
@Aspect
@Component
public class LogAop {
@Pointcut("@annotation(com.chenxuan.bean.annotation.LogAnnotation)")
public void logPointCut() {
}
/**
*
*
* @param joinPoint
*/
@AfterReturning(pointcut = "logPointCut()", returning = "jsonResult")
public void doAfterReturning(JoinPoint joinPoint, Object jsonResult) {
handleLog( joinPoint, null, jsonResult );
}
/**
*
*
* @param joinPoint
* @param e
*/
@AfterThrowing(value = "logPointCut()", throwing = "e")
public void doAfterThrowing(JoinPoint joinPoint, Exception e) {
handleLog( joinPoint, e, null );
}
protected void handleLog(final JoinPoint joinPoint, final Exception e, Object jsonResult) {
try {
// 获得注解
LogAnnotation controllerLog = getAnnotationLog( joinPoint );
if (controllerLog == null) {
return;
}
// 获取当前的用户
LoginUser loginUser = SpringUtils.getBean( JwtTokenService.class ).getLoginUser( ServletUtils.getRequest() );
// *========数据库日志=========*//
SysOperLog operLog = new SysOperLog();
operLog.setStatus( BusinessStatus.SUCCESS.ordinal() );
// 请求的地址
String ip = IpUtils.getIpAddr( ServletUtils.getRequest() );
operLog.setOperIp( ip );
// 返回参数
operLog.setJsonResult( JSON.toJSONString( jsonResult ) );
operLog.setOperUrl( ServletUtils.getRequest().getRequestURI() );
if (loginUser != null) {
operLog.setOperName( loginUser.getUsername() );
}
if (e != null) {
operLog.setStatus( BusinessStatus.FAIL.ordinal() );
operLog.setErrorMsg( StringUtils.substring( e.getMessage(), 0, 2000 ) );
}
// 设置方法名称
String className = joinPoint.getTarget().getClass().getName();
String methodName = joinPoint.getSignature().getName();
operLog.setMethod( className + "." + methodName + "()" );
// 设置请求方式
operLog.setRequestMethod( ServletUtils.getRequest().getMethod() );
operLog.setOperTime( new Date() );
// 处理设置注解上的参数
getControllerMethodDescription( joinPoint, controllerLog, operLog );
// 保存数据库
AsyncManager.me().execute( AsyncFactory.recordOperLog( operLog ) );
} catch (Exception exp) {
// 记录本地异常日志
log.error( "==前置通知异常==" );
log.error( "异常信息:{}", exp.getMessage() );
exp.printStackTrace();
}
}
/**
* Controller
*
* @param log
* @param operLog
* @throws Exception
*/
public void getControllerMethodDescription(JoinPoint joinPoint, LogAnnotation log, SysOperLog operLog) throws Exception {
// 设置action动作
operLog.setOperatorType( log.operateType().ordinal() );
// 设置标题
operLog.setTitle( log.module() );
// 设置操作人类别
operLog.setOperatorType( log.clientType().ordinal() );
// 是否需要保存request参数和值
if (log.recordParam()) {
// 获取参数的信息,传入到数据库中。
setRequestValue( joinPoint, operLog );
}
}
/**
* log
*
* @param operLog
* @throws Exception
*/
private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog) throws Exception {
String requestMethod = operLog.getRequestMethod();
if (HttpMethod.PUT.name().equals( requestMethod ) || HttpMethod.POST.name().equals( requestMethod )) {
String params = argsArrayToString( joinPoint.getArgs() );
operLog.setOperParam( StringUtils.substring( params, 0, 2000 ) );
} else {
Map<?, ?> paramsMap = (Map<?, ?>) ServletUtils.getRequest().getAttribute( HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE );
operLog.setOperParam( StringUtils.substring( paramsMap.toString(), 0, 2000 ) );
}
}
/**
*
*/
private LogAnnotation getAnnotationLog(JoinPoint joinPoint) throws Exception {
Signature signature = joinPoint.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
Method method = methodSignature.getMethod();
if (method != null) {
return method.getAnnotation( LogAnnotation.class );
}
return null;
}
/**
*
*/
private String argsArrayToString(Object[] paramsArray) {
String params = "";
if (paramsArray != null && paramsArray.length > 0) {
for (int i = 0; i < paramsArray.length; i++) {
if (!isFilterObject( paramsArray[i] )) {
Object jsonObj = JSON.toJSON( paramsArray[i] );
params += jsonObj.toString() + " ";
}
}
}
return params.trim();
}
/**
*
*
* @param o
* @return truefalse
*/
public boolean isFilterObject(final Object o) {
return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse;
}
/* @Around("logPointCut()")
public Object around(ProceedingJoinPoint point) throws Throwable {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
LogVO logVO = new LogVO( );
logVO.setCreateTime( new Date( ) );
logVO.setUserName("");
logVO.setIpAddr( "" );
logVO.setRequestUri( request.getRequestURL().toString() );
MethodSignature signature = (MethodSignature) point.getSignature();
Method method = signature.getMethod();
//请求的方法名
String className = point.getTarget().getClass().getName();
String methodName = signature.getName();
logVO.setMethod( className + "." + methodName );
LogAnnotation logAnnotation = method.getDeclaredAnnotation( LogAnnotation.class );
logVO.setModule( logAnnotation.module() );
if(logAnnotation.recordParam()){
String[] parameterNames = signature.getParameterNames();
if(null != parameterNames && parameterNames.length > 0){
Map<String, Object> params = new HashMap<>( );
Object[] args = point.getArgs();
for (int i = 0 ; i < parameterNames.length; i++ ) {
params.put( parameterNames [i], args[i] );
}
try {
logVO.setParams( JSONObject.toJSONString( params ) );
} catch (Exception e) {
log.error( "记录日志失败:{}", e.getMessage() );
}
}
}
try {
Object object = point.proceed();
logVO.setFlag( "1" );
return object;
} catch (Exception e) {
logVO.setFlag( "0" );
logVO.setMark( e.getMessage() );
throw e;
}finally {
// TODO 保存日志
}
}*/
}

@ -0,0 +1,205 @@
package com.chenxuan.bean.component;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.*;
import org.springframework.stereotype.Component;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
* @ClassNameRedisCacheService
* @Description redis
* @Author Arno_Fu
* @CreatTime11/26/2019 - 6:40 PM
* @Version V1.0
*/
@Component
public class RedisCacheService {
@Autowired
public RedisTemplate redisTemplate;
/**
* IntegerString
*
* @param key
* @param value
* @return
*/
public <T> ValueOperations<String, T> setCacheObject(String key, T value)
{
ValueOperations<String, T> operation = redisTemplate.opsForValue();
operation.set(key, value);
return operation;
}
/**
* IntegerString
*
* @param key
* @param value
* @param timeout
* @param timeUnit
* @return
*/
public <T> ValueOperations<String, T> setCacheObject(String key, T value, Integer timeout, TimeUnit timeUnit)
{
ValueOperations<String, T> operation = redisTemplate.opsForValue();
operation.set(key, value, timeout, timeUnit);
return operation;
}
/**
*
*
* @param key
* @return
*/
public <T> T getCacheObject(String key)
{
ValueOperations<String, T> operation = redisTemplate.opsForValue();
return operation.get(key);
}
/**
*
*
* @param key
*/
public void deleteObject(String key)
{
redisTemplate.delete(key);
}
/**
*
*
* @param collection
*/
public void deleteObject(Collection collection)
{
redisTemplate.delete(collection);
}
/**
* List
*
* @param key
* @param dataList List
* @return
*/
public <T> ListOperations<String, T> setCacheList(String key, List<T> dataList)
{
ListOperations listOperation = redisTemplate.opsForList();
if (null != dataList)
{
int size = dataList.size();
for (int i = 0; i < size; i++)
{
listOperation.leftPush(key, dataList.get(i));
}
}
return listOperation;
}
/**
* list
*
* @param key
* @return
*/
public <T> List<T> getCacheList(String key)
{
List<T> dataList = new ArrayList<T>();
ListOperations<String, T> listOperation = redisTemplate.opsForList();
Long size = listOperation.size(key);
for (int i = 0; i < size; i++)
{
dataList.add(listOperation.index(key, i));
}
return dataList;
}
/**
* Set
*
* @param key
* @param dataSet
* @return
*/
public <T> BoundSetOperations<String, T> setCacheSet(String key, Set<T> dataSet)
{
BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
Iterator<T> it = dataSet.iterator();
while (it.hasNext())
{
setOperation.add(it.next());
}
return setOperation;
}
/**
* set
*
* @param key
* @return
*/
public <T> Set<T> getCacheSet(String key)
{
Set<T> dataSet = new HashSet<T>();
BoundSetOperations<String, T> operation = redisTemplate.boundSetOps(key);
Long size = operation.size();
for (int i = 0; i < size; i++)
{
dataSet.add(operation.pop());
}
return dataSet;
}
/**
* Map
*
* @param key
* @param dataMap
* @return
*/
public <T> HashOperations<String, String, T> setCacheMap(String key, Map<String, T> dataMap)
{
HashOperations hashOperations = redisTemplate.opsForHash();
if (null != dataMap)
{
for (Map.Entry<String, T> entry : dataMap.entrySet())
{
hashOperations.put(key, entry.getKey(), entry.getValue());
}
}
return hashOperations;
}
/**
* Map
*
* @param key
* @return
*/
public <T> Map<String, T> getCacheMap(String key)
{
Map<String, T> map = redisTemplate.opsForHash().entries(key);
return map;
}
/**
*
*
* @param pattern
* @return
*/
public Collection<String> keys(String pattern)
{
return redisTemplate.keys(pattern);
}
}

@ -0,0 +1,102 @@
package com.chenxuan.bean.config;
import com.alibaba.druid.pool.DruidDataSource;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
import com.alibaba.druid.util.Utils;
import com.chenxuan.bean.config.properties.DruidProperties;
import com.chenxuan.bean.datasource.DynamicDataSource;
import com.chenxuan.enums.DataSourceType;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import javax.servlet.*;
import javax.sql.DataSource;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
/**
* @ClassNameDruidConfig
* @Description druid
* @Author Arno_Fu
* @CreatTime12/23/2019 - 4:57 PM
* @Version V1.0
*/
@Configuration
public class DruidConfig {
@Bean
@ConfigurationProperties("spring.datasource.druid.master")
public DataSource masterDataSource(DruidProperties druidProperties) {
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
return druidProperties.dataSource( dataSource );
}
@Bean
@ConfigurationProperties("spring.datasource.druid.slave")
@ConditionalOnProperty(prefix = "spring.datasource.druid.slave", name = "enabled", havingValue = "true")
public DataSource slaveDataSource(DruidProperties druidProperties) {
DruidDataSource dataSource = DruidDataSourceBuilder.create().build();
return druidProperties.dataSource( dataSource );
}
@Bean(name = "dynamicDataSource")
@Primary
public DynamicDataSource dataSource(DataSource masterDataSource, DataSource slaveDataSource) {
Map<Object, Object> targetDataSources = new HashMap<>();
targetDataSources.put( DataSourceType.MASTER.name(), masterDataSource );
targetDataSources.put( DataSourceType.SLAVE.name(), slaveDataSource );
return new DynamicDataSource( masterDataSource, targetDataSources );
}
/**
* 广
*/
@SuppressWarnings({"rawtypes", "unchecked"})
@Bean
@ConditionalOnProperty(name = "spring.datasource.druid.statViewServlet.enabled", havingValue = "true")
public FilterRegistrationBean removeDruidFilterRegistrationBean(DruidStatProperties properties) {
// 获取web监控页面的参数
DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
// 提取common.js的配置路径
String pattern = config.getUrlPattern() != null ? config.getUrlPattern() : "/druid/*";
String commonJsPattern = pattern.replaceAll( "\\*", "js/common.js" );
final String filePath = "support/http/resources/js/common.js";
// 创建filter进行过滤
Filter filter = new Filter() {
@Override
public void init(javax.servlet.FilterConfig filterConfig) throws ServletException {
}
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
throws IOException, ServletException {
chain.doFilter( request, response );
// 重置缓冲区,响应头不会被重置
response.resetBuffer();
// 获取common.js
String text = Utils.readFromResource( filePath );
// 正则替换banner, 除去底部的广告信息
text = text.replaceAll( "<a.*?banner\"></a><br/>", "" );
text = text.replaceAll( "powered.*?shrek.wang</a>", "" );
response.getWriter().write( text );
}
@Override
public void destroy() {
}
};
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter( filter );
registrationBean.addUrlPatterns( commonJsPattern );
return registrationBean;
}
}

@ -0,0 +1,74 @@
package com.chenxuan.bean.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.parser.ParserConfig;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.type.TypeFactory;
import org.springframework.data.redis.serializer.RedisSerializer;
import org.springframework.data.redis.serializer.SerializationException;
import org.springframework.util.Assert;
import java.nio.charset.Charset;
/**
* @ClassNameFastJson2JsonRedisSerializer
* @Description Redis使FastJson
* @Author Arno_Fu
* @CreatTime11/26/2019 - 10:37 PM
* @Version V1.0
*/
public class FastJson2JsonRedisSerializer<T> implements RedisSerializer<T>
{
@SuppressWarnings("unused")
private ObjectMapper objectMapper = new ObjectMapper();
public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
private Class<T> clazz;
static
{
ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
}
public FastJson2JsonRedisSerializer(Class<T> clazz)
{
super();
this.clazz = clazz;
}
public byte[] serialize(T t) throws SerializationException
{
if (t == null)
{
return new byte[0];
}
return JSON.toJSONString(t, SerializerFeature.WriteClassName).getBytes(DEFAULT_CHARSET);
}
public T deserialize(byte[] bytes) throws SerializationException
{
if (bytes == null || bytes.length <= 0)
{
return null;
}
String str = new String(bytes, DEFAULT_CHARSET);
return JSON.parseObject(str, clazz);
}
public void setObjectMapper(ObjectMapper objectMapper)
{
Assert.notNull(objectMapper, "'objectMapper' must not be null");
this.objectMapper = objectMapper;
}
protected JavaType getJavaType(Class<?> clazz)
{
return TypeFactory.defaultInstance().constructType(clazz);
}
}

@ -0,0 +1,52 @@
package com.chenxuan.bean.config;
import com.chenxuan.utils.StringUtils;
import com.chenxuan.xxs.XssFilter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.DispatcherType;
import java.util.HashMap;
import java.util.Map;
/**
* @ClassNameFilterConfig
* @Description Filter
* @Author Arno_Fu
* @CreatTime12/23/2019 - 10:38 AM
* @Version V1.0
*/
@Configuration
public class FilterConfig
{
@Value("${xss.enabled}")
private String enabled;
@Value("${xss.excludes}")
private String excludes;
@Value("${xss.urlPatterns}")
private String urlPatterns;
@SuppressWarnings({ "rawtypes", "unchecked" })
@Bean
public FilterRegistrationBean xssFilterRegistration()
{
FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setDispatcherTypes( DispatcherType.REQUEST);
registration.setFilter(new XssFilter());
registration.addUrlPatterns( StringUtils.split(urlPatterns, ","));
registration.setName("xssFilter");
registration.setOrder(Integer.MAX_VALUE);
Map<String, String> initParameters = new HashMap<String, String>();
initParameters.put("excludes", excludes);
initParameters.put("enabled", enabled);
registration.setInitParameters(initParameters);
return registration;
}
}

@ -0,0 +1,31 @@
package com.chenxuan.bean.config;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @ClassNameMybatisPlusConfig
* @Description MybatisPlus.
* @Author Arno_Fu
* @CreatTime11/26/2019 - 5:14 PM
* @Version V1.0
*/
@Configuration
public class MybatisPlusConfig {
/**
*
* @description:
* @return: PaginationInterceptor
*
**/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}

@ -0,0 +1,45 @@
package com.chenxuan.bean.config;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.cache.annotation.CachingConfigurerSupport;
import org.springframework.cache.annotation.EnableCaching;
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.StringRedisSerializer;
/**
* @ClassNameRedisConfig
* @Description redis
* @Author Arno_Fu
* @CreatTime11/26/2019 - 10:36 PM
* @Version V1.0
*/
@Configuration
@EnableCaching
public class RedisConfig extends CachingConfigurerSupport
{
@Bean
@SuppressWarnings(value = { "unchecked", "rawtypes" })
public RedisTemplate<Object, Object> redisTemplate(RedisConnectionFactory connectionFactory)
{
RedisTemplate<Object, Object> template = new RedisTemplate<>();
template.setConnectionFactory(connectionFactory);
FastJson2JsonRedisSerializer serializer = new FastJson2JsonRedisSerializer(Object.class);
ObjectMapper mapper = new ObjectMapper();
mapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
mapper.enableDefaultTyping(ObjectMapper.DefaultTyping.NON_FINAL);
serializer.setObjectMapper(mapper);
template.setValueSerializer(serializer);
template.setKeySerializer(new StringRedisSerializer());
template.afterPropertiesSet();
return template;
}
}

@ -0,0 +1,112 @@
package com.chenxuan.bean.config;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.*;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassNameSwaggerConfig
* @Description Swagger2
* @Author Arno_Fu
* @CreatTime12/23/2019 - 10:55 AM
* @Version V1.0
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig
{
/**
* API
*/
@Bean
public Docket createRestApi()
{
return new Docket( DocumentationType.SWAGGER_2)
//.pathMapping("/dev-api")
// 用来创建该API的基本信息展示在文档的页面中自定义展示的信息
.apiInfo(apiInfo())
// 设置哪些接口暴露给Swagger展示
.select()
// 扫描所有有注解的api用这种方式更灵活
.apis( RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
// 扫描指定包中的swagger注解
//.apis(RequestHandlerSelectors.basePackage("com.ruoyi.project.tool.swagger"))
// 扫描所有 .apis(RequestHandlerSelectors.any())
.paths( PathSelectors.any())
.build()
/* 设置安全模式swagger可以设置访问token */
.securitySchemes(securitySchemes())
.securityContexts(securityContexts());
}
/**
* tokenAuthorization
*/
private List<ApiKey> securitySchemes()
{
List<ApiKey> apiKeyList = new ArrayList<ApiKey>();
apiKeyList.add(new ApiKey("Authorization", "Authorization", "header"));
return apiKeyList;
}
/**
*
*/
private List<SecurityContext> securityContexts()
{
List<SecurityContext> securityContexts = new ArrayList<>();
securityContexts.add(
SecurityContext.builder()
.securityReferences(defaultAuth())
.forPaths( PathSelectors.regex("^(?!auth).*$"))
.build());
return securityContexts;
}
/**
*
*/
private List<SecurityReference> defaultAuth()
{
AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
List<SecurityReference> securityReferences = new ArrayList<>();
securityReferences.add(new SecurityReference("Authorization", authorizationScopes));
return securityReferences;
}
/**
*
*/
private ApiInfo apiInfo()
{
// 用ApiInfoBuilder进行定制
return new ApiInfoBuilder()
// 设置标题
.title("标题若依管理系统_接口文档")
// 描述
.description("描述:用于管理集团旗下公司的人员信息,具体包括XXX,XXX模块...")
// 作者信息
.contact(new Contact("HC", null, null))
// 版本
.version("版本号:1.0.0" )
.build();
}
}

@ -0,0 +1,69 @@
package com.chenxuan.bean.config;
import com.chenxuan.utils.Threads;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadPoolExecutor;
/**
* @ClassNameThreadPoolConfig
* @Description 线
* @Author Arno_Fu
* @CreatTime12/23/2019 - 10:37 AM
* @Version V1.0
*/
@Configuration
public class ThreadPoolConfig
{
// 核心线程池大小
private int corePoolSize = 50;
// 最大可创建的线程数
private int maxPoolSize = 200;
// 队列最大长度
private int queueCapacity = 1000;
// 线程池维护线程所允许的空闲时间
private int keepAliveSeconds = 300;
@Bean(name = "threadPoolTaskExecutor")
public ThreadPoolTaskExecutor threadPoolTaskExecutor()
{
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setMaxPoolSize(maxPoolSize);
executor.setCorePoolSize(corePoolSize);
executor.setQueueCapacity(queueCapacity);
executor.setKeepAliveSeconds(keepAliveSeconds);
// 线程池对拒绝任务(无线程可用)的处理策略
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
return executor;
}
/**
*
*/
@Bean(name = "scheduledExecutorService")
protected ScheduledExecutorService scheduledExecutorService()
{
return new ScheduledThreadPoolExecutor(corePoolSize,
new BasicThreadFactory.Builder().namingPattern("schedule-pool-%d").daemon(true).build())
{
@Override
protected void afterExecute(Runnable r, Throwable t)
{
super.afterExecute(r, t);
Threads.printException(r, t);
}
};
}
}

@ -0,0 +1,41 @@
package com.chenxuan.bean.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @ClassNameUploadConfig
* @Description
* @Author Arno_Fu
* @CreatTime12/23/2019 - 10:48 AM
* @Version V1.0
*/
@Component
@ConfigurationProperties(prefix = "upload")
public class UploadConfig {
/** 上传路径 */
private static String profile;
/** 获取地址开关 */
private static boolean addressEnabled;
public static String getProfile() {
return profile;
}
public static void setProfile(String profile) {
UploadConfig.profile = profile;
}
public static boolean isAddressEnabled() {
return addressEnabled;
}
public static void setAddressEnabled(boolean addressEnabled) {
UploadConfig.addressEnabled = addressEnabled;
}
}

@ -0,0 +1,80 @@
package com.chenxuan.bean.config.properties;
import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
/**
* @ClassNameDruidProperties
* @Description druid
* @Author Arno_Fu
* @CreatTime12/23/2019 - 4:55 PM
* @Version V1.0
*/
@Configuration
public class DruidProperties {
@Value("${spring.datasource.druid.initial-size}")
private int initialSize;
@Value("${spring.datasource.druid.minIdle}")
private int minIdle;
@Value("${spring.datasource.druid.maxActive}")
private int maxActive;
@Value("${spring.datasource.druid.maxWait}")
private int maxWait;
@Value("${spring.datasource.druid.timeBetweenEvictionRunsMillis}")
private int timeBetweenEvictionRunsMillis;
@Value("${spring.datasource.druid.minEvictableIdleTimeMillis}")
private int minEvictableIdleTimeMillis;
@Value("${spring.datasource.druid.maxEvictableIdleTimeMillis}")
private int maxEvictableIdleTimeMillis;
@Value("${spring.datasource.druid.validationQuery}")
private String validationQuery;
@Value("${spring.datasource.druid.testWhileIdle}")
private boolean testWhileIdle;
@Value("${spring.datasource.druid.testOnBorrow}")
private boolean testOnBorrow;
@Value("${spring.datasource.druid.testOnReturn}")
private boolean testOnReturn;
public DruidDataSource dataSource(DruidDataSource datasource) {
/** 配置初始化大小、最小、最大 */
datasource.setInitialSize( initialSize );
datasource.setMaxActive( maxActive );
datasource.setMinIdle( minIdle );
/** 配置获取连接等待超时的时间 */
datasource.setMaxWait( maxWait );
/** 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 */
datasource.setTimeBetweenEvictionRunsMillis( timeBetweenEvictionRunsMillis );
/** 配置一个连接在池中最小、最大生存的时间,单位是毫秒 */
datasource.setMinEvictableIdleTimeMillis( minEvictableIdleTimeMillis );
datasource.setMaxEvictableIdleTimeMillis( maxEvictableIdleTimeMillis );
/**
* sqlselect 'x'validationQuerynulltestOnBorrowtestOnReturntestWhileIdle
*/
datasource.setValidationQuery( validationQuery );
/** 建议配置为true不影响性能并且保证安全性。申请连接的时候检测如果空闲时间大于timeBetweenEvictionRunsMillis执行validationQuery检测连接是否有效。 */
datasource.setTestWhileIdle( testWhileIdle );
/** 申请连接时执行validationQuery检测连接是否有效做了这个配置会降低性能。 */
datasource.setTestOnBorrow( testOnBorrow );
/** 归还连接时执行validationQuery检测连接是否有效做了这个配置会降低性能。 */
datasource.setTestOnReturn( testOnReturn );
return datasource;
}
}

@ -0,0 +1,34 @@
package com.chenxuan.bean.datasource;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;
import javax.sql.DataSource;
import java.util.Map;
/**
* @ClassNameDynamicDataSource
* @Description
* @Author Arno_Fu
* @CreatTime12/23/2019 - 5:00 PM
* @Version V1.0
*/
public class DynamicDataSource extends AbstractRoutingDataSource {
public DynamicDataSource(DataSource defaultTargetDataSource, Map<Object, Object> targetDataSources) {
super.setDefaultTargetDataSource( defaultTargetDataSource );
super.setTargetDataSources( targetDataSources );
super.afterPropertiesSet();
}
/*
* determineCurrentLookupKey
* applicationContext.xml(non-Javadoc)
* @see org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource#determineCurrentLookupKey()
*/
@Override
protected Object determineCurrentLookupKey() {
return DynamicDataSourceContextHolder.getDataSourceType();
}
}

@ -0,0 +1,77 @@
package com.chenxuan.bean.datasource;
import com.chenxuan.enums.DataSourceType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassNameDynamicDataSourceContextHolder
* @Description
* @Author Arno_Fu
* @CreatTime12/23/2019 - 5:00 PM
* @Version V1.0
*/
public class DynamicDataSourceContextHolder {
public static final Logger log = LoggerFactory.getLogger( DynamicDataSourceContextHolder.class );
/**
* 使ThreadLocalThreadLocal使线
* 线线
*/
private static final ThreadLocal<String> CONTEXT_HOLDER = new ThreadLocal<>();
/*
* id;
* ;
*/
public static List<String> dataSourceIds = new ArrayList<String>();
/**
*
*/
public static void setDataSourceType(String dsType) {
log.info( "切换到{}数据源", dsType );
CONTEXT_HOLDER.set( dsType );
}
/**
*
*/
public static String getDataSourceType() {
String db = CONTEXT_HOLDER.get();
if(null == db){
log.error( "未获取到数据源........" );
db = DataSourceType.MASTER.name();
}
return db;
}
/**
*
*/
public static void clearDataSourceType() {
CONTEXT_HOLDER.remove();
}
/**
* DataSrouce
*
*/
public static boolean containsDataSource(String dataSourceId) {
return dataSourceIds.contains( dataSourceId );
}
}

@ -0,0 +1,28 @@
package com.chenxuan.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@Configuration
public class CookieConfig {
/**
* APP.NAME
*/
@Value("${APP.NAME}")
private String appName;
@Bean
public ServletContextInitializer servletContextInitializer() {
return new ServletContextInitializer() {
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
servletContext.getSessionCookieConfig().setName(appName);
}
};
}
}

@ -0,0 +1,29 @@
package com.chenxuan.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
@Configuration
public class RestTemplateConfig {
//最好是用不注释的方法,在注入的同时设置连接时间,这种注释的也可以,但是没有设置超时时间
/*@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder){
return builder.build();
}*/
@Bean
public RestTemplate restTemplate(ClientHttpRequestFactory factory){
return new RestTemplate(factory);
}
@Bean
public ClientHttpRequestFactory simpleClientHttpRequestFactory(){
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setReadTimeout(5000);//单位为ms
factory.setConnectTimeout(5000);//单位为ms
return factory;
}
}

@ -0,0 +1,79 @@
package com.chenxuan.constants;
/**
*
* @author Jordan_Li
*
*/
public class BusiUrlConstants {
public static final String HEADER = "";
public static final String IS_DELETE = "0";
//主变信息
public static final String BUSI_MAIN_DEVICE = HEADER + "busiMainDeviceController";
//主变装置信息
public static final String BUSI_SUB_DEVICE = HEADER + "busiSubDeviceController";
//原副边电流电压实时数据配置
public static final String BUSI_TRANSFORMER_CONF = HEADER + "busiTransformerConfController";
//控制参数设置
public static final String BUSI_CONTROL_CONFIG = HEADER + "busiControlConfigController";
//振动装置阈值配置
public static final String BUSI_AMPLI_THRESHOLD_CONF = HEADER + "busiAmpliThresholdConfController";
//中心点电流阈值配置
public static final String BUSI_CENTER_THRESHOLD_CONF = HEADER + "busiCenterThresholdConfController";
//噪声装置阈值配置
public static final String BUSI_NOISE_THRESHOLD_CONF = HEADER + "busiNoiseThresholdConfController";
//振动装置-频率定义
public static final String BUSI_FREQUENCY_CONF = HEADER + "busiFrequencyConfController";
//振动装置-日增长率
public static final String BUSI_AMPLI_DAY_INCREASE = HEADER + "busiAmpliDayIncreaseController";
//原副边电流电压实时数据
public static final String BUSI_TRANSFORMER_REAL = HEADER + "busiTransformerRealController";
//中心点实时数据
public static final String BUSI_CENTER_REAL = HEADER + "busiCenterRealController";
//噪声实时数据
public static final String BUSI_NOISE_REAL = HEADER + "busiNoiseRealController";
//振动实时数据
public static final String BUSI_SHOCK_REAL = HEADER + "busiShockRealController";
//告警信息
public static final String BUSI_WARNING = HEADER + "busiWarningController";
//通信参数设置
public static final String BUSI_COMMUNICATION_PARAMETERS = HEADER + "busiCommunicationParametersController";
//评估页面
public static final String BUSI_CALC_PARAM_CONF = HEADER + "busiCalcParamConfController";
//评估页面
public static final String BUSI_DEVICE_CALIBRATION = HEADER + "busiDeviceCalibrationContorller";
//装置特殊展示页面
public static final String BUSI_DEVICE_SPECIAL_SHOW = HEADER + "busiDeviceSpecialShowContorller";
//远程登录
public static final String REMOTE_LOGIN = HEADER + "sysLoginRemoteController";
//远程新增用户
public static final String REMOTE_USER = HEADER + "userRemote";
//IED信息
public static final String BUSI_IED = HEADER + "iedController";
//IED参数绑定
public static final String BUSI_PARAM_BIND = HEADER + "busiParamBindController";
}

@ -0,0 +1,103 @@
package com.chenxuan.constants;
import io.jsonwebtoken.Claims;
/**
* @ClassNameConstants
* @Description
* @Author Arno_Fu
* @CreatTime11/26/2019 - 10:21 PM
* @Version V1.0
*/
public class Constants {
/**
* UTF-8
*/
public static final String UTF8 = "UTF-8";
/**
*
*/
public static final String SUCCESS = "0";
/**
*
*/
public static final String FAIL = "1";
/**
*
*/
public static final String LOGIN_SUCCESS = "Success";
/**
*
*/
public static final String LOGOUT = "Logout";
/**
*
*/
public static final String LOGIN_FAIL = "Error";
/**
* redis key
*/
public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
/**
* redis key
*/
public static final String LOGIN_TOKEN_KEY = "login_tokens:";
/**
*
*/
public static final Integer CAPTCHA_EXPIRATION = 2;
/**
*
*/
public static final String TOKEN = "token";
/**
*
*/
public static final String TOKEN_PREFIX = "Bearer ";
/**
*
*/
public static final String LOGIN_USER_KEY = "login_user_key";
/**
* ID
*/
public static final String JWT_USERID = "userid";
/**
*
*/
public static final String JWT_USERNAME = Claims.SUBJECT;
/**
*
*/
public static final String JWT_AVATAR = "avatar";
/**
*
*/
public static final String JWT_CREATED = "created";
/**
*
*/
public static final String JWT_AUTHORITIES = "authorities";
/**
*
*/
public static final String RESOURCE_PREFIX = "/profile";
}

@ -0,0 +1,490 @@
package com.chenxuan.constants;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.poi.xssf.usermodel.XSSFCell;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* excel util
* @author Jordan_Li
*
*/
public class ExcelUtils {
public static final String OFFICE_EXCEL_2003_POSTFIX = "xls";
public static final String OFFICE_EXCEL_2010_POSTFIX = "xlsx";
public static final String EMPTY = "";
public static final String POINT = ".";
public static SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
/**
* get path suffix
*
* @param path
* @return
*/
public static String getPostfix(String path) {
if (path == null || EMPTY.equals(path.trim())) {
return EMPTY;
}
if (path.contains(POINT)) {
return path.substring(path.lastIndexOf(POINT) + 1, path.length());
}
return EMPTY;
}
/**
* cell style
*
* @param hssfCell
* @return
*/
@SuppressWarnings({ "static-access" })
public static String getHValue(HSSFCell hssfCell) {
if (hssfCell.getCellType() == hssfCell.CELL_TYPE_BOOLEAN) {
return String.valueOf(hssfCell.getBooleanCellValue());
} else if (hssfCell.getCellType() == hssfCell.CELL_TYPE_NUMERIC) {
String cellValue = "";
if (HSSFDateUtil.isCellDateFormatted(hssfCell)) {
Date date = HSSFDateUtil.getJavaDate(hssfCell.getNumericCellValue());
cellValue = sdf.format(date);
} else {
DecimalFormat df = new DecimalFormat("#.##");
cellValue = df.format(hssfCell.getNumericCellValue());
String strArr = cellValue.substring(cellValue.lastIndexOf(POINT) + 1, cellValue.length());
if (strArr.equals("00")) {
cellValue = cellValue.substring(0, cellValue.lastIndexOf(POINT));
}
}
return cellValue;
} else {
return String.valueOf(hssfCell.getStringCellValue());
}
}
/**
* cell style
*
* @param xssfCell
* @return
*/
public static String getXValue(XSSFCell xssfCell) {
if (xssfCell.getCellType() == Cell.CELL_TYPE_BOOLEAN) {
return String.valueOf(xssfCell.getBooleanCellValue());
} else if (xssfCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
String cellValue = "";
if (DateUtil.isCellDateFormatted(xssfCell)) {
Date date = DateUtil.getJavaDate(xssfCell.getNumericCellValue());
cellValue = sdf.format(date);
} else {
DecimalFormat df = new DecimalFormat("#.##");
cellValue = df.format(xssfCell.getNumericCellValue());
String strArr = cellValue.substring(cellValue.lastIndexOf(POINT) + 1, cellValue.length());
if (strArr.equals("00")) {
cellValue = cellValue.substring(0, cellValue.lastIndexOf(POINT));
}
}
return cellValue;
} else {
return String.valueOf(xssfCell.getStringCellValue());
}
}
/**
* create row data
*
* @param currentRow
*
* @param textList
*
*/
public static void creatRow(HSSFRow currentRow, String[] textList) {
if (textList != null && textList.length > 0) {
int i = 0;
for (String cellValue : textList) {
HSSFCell userNameLableCell = currentRow.createCell(i++);
userNameLableCell.setCellValue(cellValue);
}
}
}
public static void creatborderRow(HSSFWorkbook hwb, HSSFRow currentRow,
String[] textList, HSSFCellStyle unLock, HSSFCellStyle locked) {
if (textList != null && textList.length > 0) {
int i = 0;
for (String cellValue : textList) {
HSSFCell userNameLableCell = currentRow.createCell(i++);
userNameLableCell.setCellValue(cellValue);
}
}
}
public static void creatRow(HSSFRow currentRow, Object[] textList) {
if (textList != null && textList.length > 0) {
int i = 0;
for (Object cellValue : textList) {
HSSFCell userNameLableCell = currentRow.createCell(i++);
userNameLableCell.setCellValue(cellValue.toString());
}
}
}
public static void creatFlexibleRow(HSSFRow currentRow, String[] textList,
int beginNum, int endNum) {
if (textList != null && textList.length > 0) {
int i = 0;
for (int j = beginNum; j < textList.length - endNum; j++) {
HSSFCell userNameLableCell = currentRow.createCell(i++);
userNameLableCell.setCellValue(textList[j]);
}
}
}
public static void creatFlexibleRow(HSSFRow currentRow, Object[] textList,
int beginNum, int endNum) {
if (textList != null && textList.length > 0) {
int i = 0;
for (int j = beginNum; j < textList.length - endNum; j++) {
HSSFCell userNameLableCell = currentRow.createCell(i++);
userNameLableCell.setCellValue(textList[j].toString());
}
}
}
public static void creatFlexibleRow(HSSFRow currentRow, Object[] textList,
int beginNum, int endNum, int CellNum, String CellValue) {
if (textList != null && textList.length > 0) {
HSSFCell userNameLableCellT = currentRow.createCell(0);
userNameLableCellT.setCellValue(CellValue);
for (int j = beginNum; j < textList.length - endNum; j++) {
HSSFCell userNameLableCell = currentRow.createCell(CellNum++);
userNameLableCell.setCellValue(textList[j].toString());
}
}
}
/**
* create row data with style
*
* @param currentRow
* @param textList
*/
public static void creatStyleRow(HSSFRow currentRow, String[] textList,
HSSFWorkbook workbook) {
HSSFCellStyle style = workbook.createCellStyle();
/*style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
style.setFillForegroundColor(HSSFColor.LAVENDER.index);
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
style.setBorderBottom(HSSFCellStyle.BORDER_DOTTED);
style.setBorderLeft(HSSFCellStyle.BORDER_DOTTED);
style.setBorderRight(HSSFCellStyle.BORDER_THIN);
style.setBorderTop(HSSFCellStyle.BORDER_THIN);*/
HSSFFont font = workbook.createFont();
font.setFontName("Verdana");
font.setColor(HSSFColor.BLUE.index);
style.setFont(font);
if (textList != null && textList.length > 0) {
int i = 0;
for (String cellValue : textList) {
HSSFCell userNameLableCell = currentRow.createCell(i++);
userNameLableCell.setCellStyle(style);
userNameLableCell.setCellValue(cellValue);
}
}
}
/**
* create row data with no color
*
* @param currentRow
* @param textList
*/
public static void creatNoColorRow(Row currentRow, String[] textList,
Workbook workbook) {
if (textList != null && textList.length > 0) {
int i = 0;
for (String cellValue : textList) {
Cell userNameLableCell = currentRow.createCell(i++);
currentRow.setHeightInPoints(20);
userNameLableCell.setCellValue(cellValue);
}
}
}
/**
* data valid list
* @param selectTextList
* @param naturalRowIndex
* @param naturalColumnIndex
* @return
*/
public static DataValidation getDataValidationList(String[] selectTextList,
int naturalRowIndex, int naturalColumnIndex) {
DVConstraint constraint = DVConstraint
.createExplicitListConstraint(selectTextList);
int firstRow = naturalRowIndex - 1;
int lastRow = naturalRowIndex - 1;
int firstCol = naturalColumnIndex - 1;
int lastCol = naturalColumnIndex - 1;
CellRangeAddressList regions = new CellRangeAddressList(firstRow,
lastRow, firstCol, lastCol);
DataValidation data_validation_list = new HSSFDataValidation(regions,
constraint);
return data_validation_list;
}
/**
* data valid list
*
* @param formulaString
* @param naturalRowIndex
* @param naturalColumnIndex
* @return
*/
public static DataValidation getDataValidationByFormula(
String formulaString, int naturalRowIndex, int naturalColumnIndex) {
DVConstraint constraint = DVConstraint
.createFormulaListConstraint(formulaString);
int firstRow = naturalRowIndex - 1;
int lastRow = naturalRowIndex - 1;
int firstCol = naturalColumnIndex - 1;
int lastCol = naturalColumnIndex - 1;
CellRangeAddressList regions = new CellRangeAddressList(firstRow,
lastRow, firstCol, lastCol);
DataValidation data_validation_list = new HSSFDataValidation(regions,
constraint);
return data_validation_list;
}
/**
* create excel name
* @param workbook
*
* @param fistMenuList
*
* @param secondMenuList
*/
public static void creatExcelNameList(HSSFWorkbook workbook,
String[] fistMenuList, List<String[]> secondMenuList,
String hideSheetName, String workForm) {
Name name;
name = workbook.createName();
name.setNameName(workForm);
if (fistMenuList.length > 0) {
name.setRefersToFormula(hideSheetName + "!$A$1:$"
+ intToExcelIndex(fistMenuList.length) + "$1");
}
if (null != secondMenuList && secondMenuList.size() > 0) {
for (int i = 0; i < secondMenuList.size(); i++) {
String[] secondMenu = (String[]) secondMenuList.get(i);
name = workbook.createName();
name.setNameName(secondMenu[0]);
if (secondMenu.length > 0) {
name.setRefersToFormula(hideSheetName + "!$B$" + (2 + i)
+ ":$" + intToExcelIndex(secondMenu.length) + "$"
+ (2 + i) + "");
}
}
}
}
/**
* set workbook style
*
* @param workbook
* @date 2016-8-3 14:55:33
* @author mary_ma
*/
public static void setCellStyle(Workbook workbook) {
CellStyle headstyle = workbook.createCellStyle();
//居中
headstyle.setAlignment(HorizontalAlignment.CENTER);
//垂直
headstyle.setVerticalAlignment(VerticalAlignment.CENTER);
headstyle.setWrapText(true);
Font headfont = workbook.createFont();
headfont.setFontName("新宋体");
headfont.setFontHeightInPoints((short)13);
//headfont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
headstyle.setFont(headfont);
}
public static void titleStyle(Workbook wb, Row currentRow, XSSFSheet sheet, String name, int lastCol) {
//标题样式
XSSFCellStyle titleStyle = (XSSFCellStyle) wb.createCellStyle();
//居中
titleStyle.setAlignment(HorizontalAlignment.CENTER);
//垂直
titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);
Font ztFont = wb.createFont();
// 设置字体为斜体字
ztFont.setItalic(false);
//将字体大小设置为18px
ztFont.setFontHeightInPoints((short)18);
//将“宋体”字体应用到当前单元格上
ztFont.setFontName("宋体");
//字体加粗
ztFont.setBold(true);
titleStyle.setFont(ztFont);
// 创建单元格excel的单元格参数为列索引可以是0255之间的任何一个
Cell cell = currentRow.createCell(0);
// 合并单元格CellRangeAddress构造参数依次表示起始行截至行起始列 截至列
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, lastCol));
// 设置单元格内容
cell.setCellValue(name);
cell.setCellStyle(titleStyle);
}
/**
* generation hide sheet
*
* @param workbook
* @param hideSheetName
* @param firstMenuList
* @param secondMenuList
*/
public static void creatHideSheet(HSSFWorkbook workbook,
String hideSheetName, String[] firstMenuList,
List<String[]> secondMenuList) {
HSSFSheet hideselectinfosheet = workbook.createSheet(hideSheetName);
HSSFRow firstMenuRow = hideselectinfosheet.createRow(0);
creatRow(firstMenuRow, firstMenuList);
if (null != secondMenuList && secondMenuList.size() > 0) {
for (int i = 0; i < secondMenuList.size(); i++) {
String[] secondMenu = (String[]) secondMenuList.get(i);
HSSFRow secondMenuRow = hideselectinfosheet.createRow(i + 1);
creatRow(secondMenuRow, secondMenu);
}
}
workbook.setSheetHidden(workbook.getSheetIndex(hideSheetName), true);
}
/**
* generation cascading drop-down menu
*
* @param userinfosheet1
* @param naturalRowIndex
*/
public static void creatAppRow(HSSFSheet userinfosheet1,
int naturalRowIndex, int firstMenuIndex, int secondMenuIndex,
String workForm) {
DataValidation data_validation_list = getDataValidationByFormula(workForm, naturalRowIndex,
firstMenuIndex);
userinfosheet1.addValidationData(data_validation_list);
DataValidation data_validation_list2 = getDataValidationByFormula("INDIRECT($"
+ intToExcelIndex(firstMenuIndex) + ""
+ naturalRowIndex + ")", naturalRowIndex,
secondMenuIndex);
userinfosheet1.addValidationData(data_validation_list2);
}
/**
* generation non-cascading drop-down menu
*
* @param userinfosheet1
* @param selectTextList
* @param naturalColumnIndex
*/
public static void creatAloneRow(HSSFSheet userinfosheet1,
String[] selectTextList, int firstRow, int lastRow,
int naturalColumnIndex) {
DVConstraint constraint = DVConstraint
.createExplicitListConstraint(selectTextList);
int firstCol = naturalColumnIndex - 1;
int lastCol = naturalColumnIndex - 1;
CellRangeAddressList regions = new CellRangeAddressList(firstRow,
lastRow, firstCol, lastCol);
DataValidation data_validation_list = new HSSFDataValidation(regions,
constraint);
userinfosheet1.addValidationData(data_validation_list);
}
/**
* alphabet convert to number
* @param i
*
* @return
*/
private static String intToExcelIndex(int i) {
String s = "";
int m = i % 26;
i = i / 26;
while (i != 0 || m != 0) {
if (m == 0) {
i--;
m = 26;
}
s = (char) (m + (char) ('A') - 1) + s;
m = i % 26;
i = i / 26;
}
return s;
}
/**
* hide row
*
* @param currentRow
* @param textList
* @param workbook
*/
public static void creatHidenRow(HSSFRow currentRow, String[] textList,
HSSFWorkbook workbook, boolean isLock) {
HSSFCellStyle style = workbook.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER);
style.setVerticalAlignment(VerticalAlignment.CENTER);
style.setLocked(isLock);
if (textList != null && textList.length > 0) {
int i = 0;
for (String cellValue : textList) {
HSSFCell userNameLableCell = currentRow.createCell(i++);
userNameLableCell.setCellStyle(style);
userNameLableCell.setCellValue(cellValue);
}
currentRow.setZeroHeight(true);
}
}
/**
* get style
* @param workbook
* @param isLock
* @return
*/
public static HSSFCellStyle getStyle(HSSFWorkbook workbook, boolean isLock) {
HSSFCellStyle headStyle = workbook.createCellStyle();
// headStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
// headStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
// headStyle.setFillForegroundColor(HSSFColor.LIGHT_TURQUOISE.index);
// headStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
// headStyle.setBorderBottom(HSSFCellStyle.BORDER_DOTTED);
// headStyle.setBorderLeft(HSSFCellStyle.BORDER_DOTTED);
// headStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);
// headStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);
headStyle.setLocked(isLock);
headStyle.setWrapText(true);
return headStyle;
}
}

@ -0,0 +1,21 @@
package com.chenxuan.constants;
import java.util.Random;
/**
* systemCode
* @author Jordan_Li
*
*/
public class GenerateUtil {
public static String generateCode(int length) {
String ALLCHAR2 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
StringBuffer sb = new StringBuffer();
Random random = new Random();
for (int i = 0; i < length; i++) {
sb.append(ALLCHAR2.charAt(random.nextInt(ALLCHAR2.length())));
}
return sb.toString();
}
}

@ -0,0 +1,106 @@
package com.chenxuan.constants;
/**
*
* @Description:
*
* @Author: Arno_Fu
*
* @Since: 11/26/2019 11:21 AM
*
* @Version: 1.0.0
**/
public interface HttpStatusCode
{
/**
*
*/
public static final int SUCCESS = 200;
/**
*
*/
public static final int CREATED = 201;
/**
*
*/
public static final int ACCEPTED = 202;
/**
*
*/
public static final int NO_CONTENT = 204;
/**
*
*/
public static final int MOVED_PERM = 301;
/**
*
*/
public static final int SEE_OTHER = 303;
/**
*
*/
public static final int NOT_MODIFIED = 304;
/**
*
*/
public static final int BAD_REQUEST = 400;
/**
*
*/
public static final int UNAUTHORIZED = 401;
/**
* 访
*/
public static final int FORBIDDEN = 403;
/**
*
*/
public static final int NOT_FOUND = 404;
/**
* http
*/
public static final int BAD_METHOD = 405;
/**
*
*/
public static final int CONFLICT = 409;
/**
*
*/
public static final int UNSUPPORTED_TYPE = 415;
/**
*
*/
public static final int ERROR = 500;
/**
*
*/
public static final int NOT_IMPLEMENTED = 501;
/**
* token
*/
public static final int TOKEN_INVALID= 601;
/**
*
*/
public static final int NO_DATA = 10000;
}

@ -0,0 +1,69 @@
package com.chenxuan.constants;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/**
*
* @author Jordan_Li
*
*/
public class MD5Utils {
/*public static String stringToMD5(String plainText) {
byte[] secretBytes = null;
try {
secretBytes = MessageDigest.getInstance("md5").digest(
plainText.getBytes());
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException("没有这个md5算法");
}
String md5code = new BigInteger(1, secretBytes).toString(16);
for (int i = 0; i < 32 - md5code.length(); i++) {
md5code = "0" + md5code;
}
return md5code;
}*/
/**
* MD5 32md5      
*/
public static String string2MD5(String inStr) {
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (Exception e) {
System.out.println(e.toString());
e.printStackTrace();
return "";
}
char[] charArray = inStr.toCharArray();
byte[] byteArray = new byte[charArray.length];
for (int i = 0; i < charArray.length; i++)
byteArray[i] = (byte) charArray[i];
byte[] md5Bytes = md5.digest(byteArray);
StringBuffer hexValue = new StringBuffer();
for (int i = 0; i < md5Bytes.length; i++) {
int val = ((int) md5Bytes[i]) & 0xff;
if (val < 16)
hexValue.append("0");
hexValue.append(Integer.toHexString(val));
}
return hexValue.toString();
}
/**
*  
*/
public static String convertMD5(String inStr) {
char[] a = inStr.toCharArray();
for (int i = 0; i < a.length; i++) {
a[i] = (char) (a[i] ^ 't');
}
String s = new String(a);
return s;
}
}

@ -0,0 +1,34 @@
package com.chenxuan.constants;
/**
* @ClassNameUserStatus
* @Description
* @Author Arno_Fu
* @CreatTime12/23/2019 - 4:48 PM
* @Version V1.0
*/
public enum UserStatus
{
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
private final String code;
private final String info;
UserStatus(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

@ -0,0 +1,16 @@
package com.chenxuan.constants;
import java.util.UUID;
/**
* Uuid Utils
* @author Jordan_Li
*
*/
public class UuidUtils {
public static String getUUID() {
return UUID.randomUUID().toString().replace("-", "");
}
}

@ -0,0 +1,87 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.model.BusiAmpliDayIncrease;
import com.chenxuan.entity.vo.BusiAmpliDayIncreaseVo;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiAmpliDayIncreaseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "振动装置日增长率")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_AMPLI_DAY_INCREASE)
public class BusiAmpliDayIncreaseController extends BaseController {
@Autowired
private BusiAmpliDayIncreaseService busiAmpliDayIncreaseService;
/**
* @Description:
* @Param:
* @Return: TableDataInfo
**/
@ApiOperation(value = "获取振动装置日增长率列表")
@PostMapping(value = "/page")
public AjaxResult page(Query queryParam) {
Page<BusiAmpliDayIncreaseVo> page = busiAmpliDayIncreaseService.page( queryParam );
return AjaxResult.success( page );
}
/**
*
*/
@ApiOperation(value = "新增振动装置日增长率信息")
@LogAnnotation(module = "振动装置日增长率", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody BusiAmpliDayIncrease busiAmpliDayIncrease) {
return returnAjax( busiAmpliDayIncreaseService.insertAmpliDayIncrease( busiAmpliDayIncrease ) );
}
/**
*
*/
@ApiOperation(value = "修改振动装置日增长率信息")
@LogAnnotation(module = "振动装置日增长率", operateType = OperateType.UPDATE)
@PutMapping(value = "/update")
public AjaxResult update(@RequestBody BusiAmpliDayIncrease busiAmpliDayIncrease) {
return returnAjax( busiAmpliDayIncreaseService.updateAmpliDayIncrease( busiAmpliDayIncrease ) );
}
/**
* id
*/
@ApiOperation(value = "根据主变id加载其振动装置日增长率信息")
@GetMapping(value = "/getAmpliDayIncreaseByMainId/{mainId}")
public AjaxResult getAmpliDayIncreaseByMainId(@PathVariable("mainId") String mainId) {
return AjaxResult.success( busiAmpliDayIncreaseService.selectAmpliDayIncreaseByMainId( mainId ) );
}
/**
* id
*/
@ApiOperation(value = "根据id删除振动装置日增长率信息")
@LogAnnotation(module = "振动装置日增长率", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete/{id}")
public AjaxResult delete(@RequestParam("id") String id) {
return returnAjax( busiAmpliDayIncreaseService.delete( id ) );
}
}

@ -0,0 +1,114 @@
package com.chenxuan.controller;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.dto.BusiAmpliRealDto;
import com.chenxuan.entity.model.BusiAmpliReal;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiAmpliRealService;
import com.chenxuan.service.BusiExportDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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;
@Api(tags = "振动实时数据")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_SHOCK_REAL)
public class BusiAmpliRealController extends BaseController {
@Autowired
private BusiAmpliRealService busiAmpliRealService;
@Autowired
private BusiExportDataService busiExportDataService;
/**
*
*/
@ApiOperation(value = "新增振动实时数据信息")
@LogAnnotation(module = "振动实时数据", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody List<BusiAmpliReal> busiAmpliRealList) {
return returnAjax(busiAmpliRealService.insertShockReal(busiAmpliRealList));
}
/**
*
*/
@ApiOperation(value = "根据条件加载振动实时数据信息")
@PostMapping(value = "/getShockRealByMainId")
public AjaxResult getShockRealByMainId(@RequestBody BusiAmpliRealDto dto) {
return AjaxResult.success(busiAmpliRealService.selectShockRealByMainId(dto));
}
/**
* id
*/
@ApiOperation(value = "根据条件加载振动实时数据详细信息")
@PostMapping(value = "/getShockRealDetailsByCondition")
public AjaxResult getShockRealDetailsByCondition(@RequestBody BusiAmpliRealDto busiAmpliRealDto) {
return AjaxResult.success(busiAmpliRealService.getShockRealDetailsByCondition(busiAmpliRealDto));
}
/**
* id
*/
@ApiOperation(value = "根据主变id以及对应装置信息加载振动装置振幅和频率谱图信息")
@PostMapping(value = "/queryShockRealChartByInfo")
public AjaxResult queryShockRealChartByInfo(@RequestBody BusiAmpliRealDto busiAmpliRealDto) {
return AjaxResult.success(busiAmpliRealService.getShockRealChartByInfo(busiAmpliRealDto));
}
/**
* id
*/
@ApiOperation(value = "根据主变id以及对应装置信息加载振动装置振幅和频率三维图信息")
@PostMapping(value = "/getAmpliRealChart")
public AjaxResult getAmpliRealChart(@RequestBody BusiAmpliRealDto busiAmpliRealDto) {
return AjaxResult.success(busiAmpliRealService.getAmpliRealThreeChart(busiAmpliRealDto));
}
/**
*
*/
@ApiOperation(value = "三级界面重新计算接口")
@PostMapping(value = "/recountData")
public AjaxResult recountData(@RequestBody BusiAmpliRealDto busiAmpliRealDto) {
return AjaxResult.success(busiAmpliRealService.recount(busiAmpliRealDto));
}
/**
*
*/
@ApiOperation(value = "二级页面跳转详情加载三级页面")
@PostMapping(value = "/showShockRealDetails")
public AjaxResult showShockRealDetails(@RequestBody BusiAmpliRealDto busiAmpliRealDto) {
return AjaxResult.success(busiAmpliRealService.loadingDetails(busiAmpliRealDto));
}
/**
* Excel
*/
@ApiOperation(value = "导出震动实时数据三级界面列表信息Excel")
@PostMapping(value = "/exportShockRealDetailsPage")
public AjaxResult exportShockRealDetailsPage(@RequestBody BusiAmpliRealDto dto) {
return busiExportDataService.exportShockRealDetails(dto);
}
/**
*
*/
@ApiOperation(value = "导出传感器实时数据")
@PostMapping(value = "/exportAmpliRealByCondition")
public AjaxResult exportAmpliRealByCondition(@RequestBody BusiAmpliRealDto dto) {
return busiExportDataService.exportAmpliReal(dto);
}
}

@ -0,0 +1,90 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.constants.HttpStatusCode;
import com.chenxuan.entity.dto.BusiAmpliThresholdConfDto;
import com.chenxuan.entity.model.BusiAmpliThresholdConf;
import com.chenxuan.entity.vo.BusiAmpliThresholdConfNewVo;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiAmpliThresholdConfService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(tags = "振动装置阈值配置")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_AMPLI_THRESHOLD_CONF)
public class BusiAmpliThresholdConfController extends BaseController {
@Autowired
private BusiAmpliThresholdConfService busiAmpliThresholdConfService;
/**
* @Description:
* @Param:
* @Return: TableDataInfo
**/
@ApiOperation(value = "获取振动装置阈值配置列表")
@PostMapping(value = "/page")
public AjaxResult page(@RequestBody BusiAmpliThresholdConfDto dto) {
Page<BusiAmpliThresholdConfNewVo> page = busiAmpliThresholdConfService.page(dto);
return AjaxResult.success(page);
}
/**
*
*/
@ApiOperation(value = "新增振动装置阈值配置信息")
@LogAnnotation(module = "振动装置阈值配置", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody List<BusiAmpliThresholdConf> busiAmpliThresholdConfList) {
return returnAjax(busiAmpliThresholdConfService.insertThresholdConf(busiAmpliThresholdConfList));
}
/**
*
*/
@ApiOperation(value = "修改振动装置阈值配置信息")
@LogAnnotation(module = "振动装置阈值配置", operateType = OperateType.UPDATE)
@PostMapping(value = "/update")
public AjaxResult update(@RequestBody BusiAmpliThresholdConfNewVo busiAmpliThresholdConfNewVo) {
boolean b = busiAmpliThresholdConfService.updateThresholdConf(busiAmpliThresholdConfNewVo);
if (!b) {
return new AjaxResult(HttpStatusCode.ERROR, "主变有未配置的装置");
}
return returnAjax(b);
}
/**
* id
*/
@ApiOperation(value = "根据主变id加载振动装置阈值配置信息")
@GetMapping(value = "/getAmpliThresholdConfByMainId/{mainId}")
public AjaxResult getAmpliThresholdConfByMainId(@PathVariable("mainId") String mainId) {
return AjaxResult.success(busiAmpliThresholdConfService.selectThresholdConfByMainId(mainId));
}
/**
* id
*/
@ApiOperation(value = "根据振动装置阈值配置id删除其配置信息")
@LogAnnotation(module = "振动装置阈值配置", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete/{id}")
public AjaxResult delete(@RequestParam("id") String id) {
return returnAjax(busiAmpliThresholdConfService.delete(id));
}
}

@ -0,0 +1,53 @@
package com.chenxuan.controller;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.dto.BusiCalcParamConfDto;
import com.chenxuan.entity.vo.BusiCalcParamConfVo;
import com.chenxuan.service.BusiCalcParamConfService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* @author Carrey Zheng
* @create 2020-06-28 8:10 PM
**/
@Api(tags = "评估页面")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_CALC_PARAM_CONF)
public class BusiCalcParamConfController {
@Autowired
private BusiCalcParamConfService busiParamGisService;
/**
*
*
* @param mainEquipmentId
* @return
*/
@ApiOperation(value = "列表查询")
@GetMapping(value = "/list/{mainId}", produces = {"application/json;charset=utf-8"})
public Map<String, Object> queryList(@PathVariable("mainId") String mainEquipmentId) {
List<BusiCalcParamConfVo> busiParamGis = busiParamGisService.findBusiParamGis(mainEquipmentId);
return AjaxResult.success(busiParamGis);
}
/**
*
*
* @param busiParams
* @return
*/
@ApiOperation(value = "参数提交")
@PostMapping(value = "/save")
public AjaxResult saveBusiSite(@RequestBody List<BusiCalcParamConfDto> busiParams) {
return busiParamGisService.saveBusiParamGis(busiParams);
}
}

@ -0,0 +1,97 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.dto.BusiCenterRealDto;
import com.chenxuan.entity.model.BusiCenterReal;
import com.chenxuan.entity.vo.BusiCenterRealDetailsVo;
import com.chenxuan.entity.vo.BusiCenterRealVo;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiCenterRealService;
import com.chenxuan.service.BusiExportDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = "中心点实时数据")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_CENTER_REAL)
public class BusiCenterRealController extends BaseController {
@Autowired
private BusiCenterRealService busiCenterRealService;
@Autowired
private BusiExportDataService busiExportDataService;
/**
*
*/
@ApiOperation(value = "新增中心点实时数据信息")
@LogAnnotation(module = "中心点实时数据", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody List<BusiCenterReal> busiCenterRealList) {
return returnAjax(busiCenterRealService.insertCenterReal(busiCenterRealList));
}
/**
* id
*/
@ApiOperation(value = "根据主变id加载中心点实时数据信息")
@GetMapping(value = "/getCenterRealByMainId/{mainId}")
public AjaxResult getCenterRealByMainId(@PathVariable("mainId") String mainId) {
return AjaxResult.success(busiCenterRealService.selectCenterRealByMainId(mainId));
}
/**
* id
*/
@ApiOperation(value = "根据主变id及当天时间加载中心点谱图信息")
@PostMapping(value = "/queryCenterRealChartByInfo")
public AjaxResult queryCenterRealChartByInfo(@RequestBody BusiCenterRealDto busiCenterRealDto) {
return AjaxResult.success(busiCenterRealService.findCenterRealChartByInfo(busiCenterRealDto));
}
/**
* id
*/
@ApiOperation(value = "根据主变id和时间加载中心点实时数据信息")
@PostMapping(value = "/getCenterRealByMainIdAndCreateTime")
public AjaxResult getCenterRealByMainIdAndCreateTime(@RequestBody BusiCenterRealVo busiCenterRealVo) {
return AjaxResult.success(busiCenterRealService.selectCenterRealByMainIdAndCreateTime(busiCenterRealVo));
}
/**
* id
*/
@ApiOperation(value = "根据主变id加载中心点实时数据详细信息")
@PostMapping(value = "/getCenterRealDetailsByMainId")
public AjaxResult getCenterRealDetailsByMainId(@RequestBody BusiCenterRealDto dto) {
Page<BusiCenterRealDetailsVo> centerRealDetailsByMainId = busiCenterRealService.getCenterRealDetailsByMainId(dto);
return AjaxResult.success(centerRealDetailsByMainId);
}
/**
* Excel
*/
@ApiOperation(value = "导出中心点实时数据详细信息Excel")
@PostMapping(value = "/exportCenterRealDetails")
public AjaxResult exportCenterRealDetails(@RequestBody BusiCenterRealDto dto) {
return busiExportDataService.exportCenterRealDetails(dto);
}
/**
*
*/
@ApiOperation(value = "导出中心点实时数据")
@PostMapping(value = "/exportCenterRealByMainId")
public AjaxResult exportCenterRealByMainId(@RequestBody BusiCenterRealDto dto) {
return busiExportDataService.exportCenterReal(dto);
}
}

@ -0,0 +1,87 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.dto.BusiCenterThresholdConfDto;
import com.chenxuan.entity.model.BusiCenterThresholdConf;
import com.chenxuan.entity.vo.BusiCenterThresholdConfVo;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiCenterThresholdConfService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = "中心点电流阈值配置")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_CENTER_THRESHOLD_CONF)
public class BusiCenterThresholdConfController extends BaseController {
@Autowired
private BusiCenterThresholdConfService busiCenterThresholdConfService;
/**
* @Description:
* @Param:
* @Return: TableDataInfo
**/
@ApiOperation(value = "获取中心点电流阈值配置列表")
@PostMapping(value = "/page")
public AjaxResult page(@RequestBody BusiCenterThresholdConfDto busiCenterThresholdConfDto) {
Page<BusiCenterThresholdConfVo> page = busiCenterThresholdConfService.page(busiCenterThresholdConfDto);
return AjaxResult.success(page);
}
/**
*
*/
@ApiOperation(value = "新增中心点电流阈值配置信息")
@LogAnnotation(module = "中心点电流阈值配置", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody BusiCenterThresholdConf busiCenterThresholdConf) {
return busiCenterThresholdConfService.insertThresholdConf(busiCenterThresholdConf);
}
/**
*
*/
@ApiOperation(value = "修改中心点电流阈值配置信息")
@LogAnnotation(module = "中心点电流阈值配置", operateType = OperateType.UPDATE)
@PutMapping(value = "/update")
public AjaxResult update(@RequestBody BusiCenterThresholdConf busiCenterThresholdConf) {
return busiCenterThresholdConfService.updateThresholdConf(busiCenterThresholdConf);
}
/**
* id
*/
@ApiOperation(value = "根据主变id加载中心点电流阈值配置信息")
@GetMapping(value = "/getCenterThresholdConfByMainId/{mainId}")
public AjaxResult getCenterThresholdConfByMainId(@PathVariable("mainId") String mainId) {
return AjaxResult.success(busiCenterThresholdConfService.selectCenterThresholdConfByMainId(mainId));
}
/**
* id
*/
@ApiOperation(value = "根据主变id删除中心点电流阈值配置信息")
@LogAnnotation(module = "中心点电流阈值配置", operateType = OperateType.DELETE)
@DeleteMapping(value = "/deleteByMainId/{mainId}")
public AjaxResult remove(@RequestParam("mainId") String mainId) {
return returnAjax(busiCenterThresholdConfService.deleteThresholdConfByMainId(mainId));
}
/**
* id
*/
@ApiOperation(value = "根据中心点电流阈值配置id删除其配置信息")
@LogAnnotation(module = "中心点电流阈值配置", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete")
public AjaxResult delete(@RequestParam("id") String id) {
return returnAjax(busiCenterThresholdConfService.delete(id));
}
}

@ -0,0 +1,90 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.model.BusiCommunicationParameters;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiCommunicationParametersService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "通信参数设置")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_COMMUNICATION_PARAMETERS)
public class BusiCommunicationParametersController extends BaseController {
@Autowired
private BusiCommunicationParametersService busiCommunicationParametersService;
/**
* @Description:
* @Param:
* @Return: TableDataInfo
**/
@ApiOperation(value = "分页查询通信参数列表")
@PostMapping(value = "/page")
public AjaxResult page(Query queryParam) {
Page<BusiCommunicationParameters> page = busiCommunicationParametersService.page(queryParam);
return AjaxResult.success(page);
}
/**
*
*/
@ApiOperation(value = "新增通信参数信息")
// @LogAnnotation(module = "通信参数设置", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody BusiCommunicationParameters busiCommunicationParameters) {
return returnAjax(busiCommunicationParametersService.insertBusiCommunicationParameters(busiCommunicationParameters));
}
/**
*
*/
@ApiOperation(value = "修改通信参数信息")
@LogAnnotation(module = "通信参数设置", operateType = OperateType.UPDATE)
@PostMapping(value = "/update")
public AjaxResult update(@RequestBody BusiCommunicationParameters busiCommunicationParameters) {
return returnAjax(busiCommunicationParametersService.updateBusiCommunicationParameters(busiCommunicationParameters));
}
/**
* id
*/
@ApiOperation(value = "根据id加载通信参数信息")
@GetMapping(value = "/getBusiCommunicationParametersById/{id}")
public AjaxResult getBusiCommunicationParametersById(@PathVariable("id") String id) {
return AjaxResult.success(busiCommunicationParametersService.selectBusiCommunicationParametersById(id));
}
/**
*
*/
@ApiOperation(value = "删除通信参数信息")
// @LogAnnotation(module = "通信参数设置", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete/{id}")
public AjaxResult remove(@RequestParam("id") String id) {
return returnAjax(busiCommunicationParametersService.deleteById(id));
}
@ApiOperation(value = "根据通信协议类型加载通信参数信息")
@GetMapping(value = "/getBusiCommunicationParametersByProtocol/{protocol}")
public AjaxResult getBusiCommunicationParametersByProtocol(@PathVariable("protocol") String protocol) {
return AjaxResult.success(busiCommunicationParametersService.selectBusiCommunicationParametersByProtocol(protocol));
}
}

@ -0,0 +1,95 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.model.BusiControlConfig;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiControlConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(tags = "控制参数设置")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_CONTROL_CONFIG)
public class BusiControlConfigController extends BaseController {
@Autowired
private BusiControlConfigService busiControlConfigService;
/**
* @Description:
* @Param:
* @Return: TableDataInfo
**/
@ApiOperation(value = "获取控制参数设置列表")
@GetMapping(value = "/page")
public AjaxResult page(Query queryParam) {
Page<BusiControlConfig> page = busiControlConfigService.page(queryParam);
return AjaxResult.success(page);
}
/**
*
*/
@ApiOperation(value = "新增控制参数设置信息")
@LogAnnotation(module = "控制参数设置", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody List<BusiControlConfig> busiControlConfigList) {
return returnAjax(busiControlConfigService.insertConfigs(busiControlConfigList));
}
/**
*
*/
@ApiOperation(value = "修改控制参数设置信息")
@LogAnnotation(module = "控制参数设置", operateType = OperateType.UPDATE)
@PostMapping(value = "/update")
public AjaxResult update(@RequestBody List<BusiControlConfig> busiControlConfigList) {
return busiControlConfigService.updateConfigs(busiControlConfigList);
}
/**
*
*/
@ApiOperation(value = "加载对应主变的控制参数设置信息")
@GetMapping(value = "/getTransformerConfigByMainId/{mainId}")
public AjaxResult getTransformerConfigByMainId(@PathVariable("mainId") String mainId) {
return AjaxResult.success(busiControlConfigService.selectConfigsByMainId(mainId));
}
/**
*
*/
@ApiOperation(value = "删除控制参数设置")
@LogAnnotation(module = "控制参数设置", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete")
public AjaxResult remove(@RequestParam("id") String id) {
return returnAjax(busiControlConfigService.deleteConfById(id));
}
/**
* id
*/
@ApiOperation(value = "根据主变id删除该主变对应的控制参数设置信息")
@LogAnnotation(module = "控制参数设置", operateType = OperateType.DELETE)
@DeleteMapping(value = "/deleteByMainId")
public AjaxResult deleteByMainId(@RequestParam("mainId") String mainId) {
return returnAjax(busiControlConfigService.deleteConfsByMainId(mainId));
}
}

@ -0,0 +1,39 @@
package com.chenxuan.controller;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.model.BusiDeviceCalibration;
import com.chenxuan.service.BusiDeviceCalibrationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = "装置校时设置")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_DEVICE_CALIBRATION)
public class BusiDeviceCalibrationContorller extends BaseController {
@Autowired
private BusiDeviceCalibrationService busiDeviceCalibrationService;
/**
*
*/
@ApiOperation(value = "加载对应主变装置校时设置设置信息")
@GetMapping(value = "/getBusiDeviceCalibrationByMainId")
public AjaxResult getBusiDeviceCalibrationByMainId(@RequestParam("mainId") String mainId) {
return AjaxResult.success(busiDeviceCalibrationService.selectBusiDeviceCalibrationByMainId(mainId));
}
/**
*
*/
@ApiOperation(value = "主变校准时间")
@PostMapping(value = "/timing")
public AjaxResult timing(@RequestBody BusiDeviceCalibration busiDeviceCalibration) {
return returnAjax(busiDeviceCalibrationService.timingBusiDeviceCalibration(busiDeviceCalibration));
}
}

@ -0,0 +1,51 @@
package com.chenxuan.controller;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.dto.BusiVibrationContrastDto;
import com.chenxuan.entity.model.BusiVibrationSeparation;
import com.chenxuan.service.BusiDeviceSpecialShowService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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;
@Api(tags = "装置特殊展示页面")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_DEVICE_SPECIAL_SHOW)
public class BusiDeviceSpecialShowContorller {
@Autowired
private BusiDeviceSpecialShowService specialShowService;
/**
*
*/
@ApiOperation(value = "振动分离")
@PostMapping(value = "/getShockRealChartByDevice")
public AjaxResult getShockRealChartByDevice(@RequestBody BusiVibrationSeparation vibrationSeparation) {
return AjaxResult.success(specialShowService.getShockRealChartByDevice(vibrationSeparation));
}
/**
*
*/
@ApiOperation(value = "振动对比实验")
@PostMapping(value = "/vibrationContrastExper")
public AjaxResult vibrationContrastExper(@RequestBody BusiVibrationContrastDto dto) {
return AjaxResult.success(specialShowService.getVibrationContrastExper(dto));
}
/**
*
*/
@ApiOperation(value = "原副边数据")
@PostMapping(value = "/fixation")
public AjaxResult getFixation() {
return AjaxResult.success(specialShowService.getFixation());
}
}

@ -0,0 +1,89 @@
package com.chenxuan.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.model.BusiFrequencyConf;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiFrequencyConfService;
@Api(tags = "振动装置-频率配置")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_FREQUENCY_CONF)
public class BusiFrequencyConfController extends BaseController {
@Autowired
private BusiFrequencyConfService busiFrequencyConfService;
/**
* @Description:
* @Param:
* @Return: TableDataInfo
**/
@ApiOperation(value = "分页查询振动装置频率配置列表")
@GetMapping(value = "/page")
public AjaxResult page(Query queryParam) {
Page<BusiFrequencyConf> page = busiFrequencyConfService.page( queryParam );
return AjaxResult.success( page );
}
/**
*
*/
@ApiOperation(value = "新增振动装置频率配置信息")
@LogAnnotation(module = "振动装置频率配置", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody BusiFrequencyConf busiFrequencyConf) {
return returnAjax( busiFrequencyConfService.insertFrequencyConf( busiFrequencyConf ) );
}
/**
*
*/
@ApiOperation(value = "修改振动装置频率配置信息")
@LogAnnotation(module = "振动装置频率配置", operateType = OperateType.UPDATE)
@PutMapping(value = "/update")
public AjaxResult update(@RequestBody BusiFrequencyConf busiFrequencyConf) {
return returnAjax( busiFrequencyConfService.updateFrequencyConf( busiFrequencyConf ) );
}
/**
* id
*/
@ApiOperation(value = "根据id加载振动装置频率配置信息")
@GetMapping(value = "/getMainDeviceById/{id}")
public AjaxResult getMainDeviceByMainId(@PathVariable("id") String id) {
return AjaxResult.success( busiFrequencyConfService.selectFrequencyConfById( id ) );
}
/**
*
*/
@ApiOperation(value = "删除振动装置频率配置信息")
@LogAnnotation(module = "振动装置频率配置", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete")
public AjaxResult remove(@RequestParam("id") String id) {
return returnAjax( busiFrequencyConfService.deleteFrequencyConfById( id ) );
}
}

@ -0,0 +1,126 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.dto.BusiMainDeviceDto;
import com.chenxuan.entity.model.BusiMainDevice;
import com.chenxuan.entity.vo.BusiMainDeviceVo;
import com.chenxuan.entity.vo.PercentageVo;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiMainDeviceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = "主变设置")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_MAIN_DEVICE)
public class BusiMainDeviceController extends BaseController {
@Autowired
private BusiMainDeviceService busiMainDeviceService;
/**
* @Description:
* @Param:
* @Return: TableDataInfo
**/
@ApiOperation(value = "分页查询主变列表")
@PostMapping(value = "/page")
public AjaxResult page(@RequestBody BusiMainDeviceDto busiMainDeviceDto) {
Page<BusiMainDeviceVo> page = busiMainDeviceService.page(busiMainDeviceDto);
return AjaxResult.success(page);
}
/**
*
*/
@ApiOperation(value = "新增主变信息")
@LogAnnotation(module = "主变信息", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody BusiMainDevice busiMainDevice) {
return busiMainDeviceService.insertMainDevice(busiMainDevice);
}
/**
*
*/
@ApiOperation(value = "修改主变信息")
@LogAnnotation(module = "主变信息", operateType = OperateType.UPDATE)
@PostMapping(value = "/update")
public AjaxResult update(@RequestBody BusiMainDevice busiMainDevice) {
return busiMainDeviceService.updateMainDevice(busiMainDevice);
}
/**
* id
*/
@ApiOperation(value = "根据id加载主变信息")
@GetMapping(value = "/getMainDeviceById/{id}")
public AjaxResult getMainDeviceByMainId(@PathVariable("id") String id) {
return AjaxResult.success(busiMainDeviceService.selectMainDeviceById(id));
}
/**
*
*/
@ApiOperation(value = "删除主变信息")
@LogAnnotation(module = "主变信息", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete")
public AjaxResult remove(@RequestParam("id") String id) {
return returnAjax(busiMainDeviceService.deleteMainDeviceById(id));
}
/**
* @Description: List
* @Param:
* @Return:
**/
@ApiOperation(value = "获取主变压器信息List")
@PostMapping(value = "/list")
public AjaxResult list() {
List<BusiMainDevice> list = busiMainDeviceService.selectBusiMainDeviceList();
return AjaxResult.success(list);
}
/**
* @Description:
* @Param:
* @Return:
**/
@ApiOperation(value = "获取设备总数")
@GetMapping(value = "/selectCountDeviceTotal")
public AjaxResult selectCountDeviceTotal() {
PercentageVo percentageVo = busiMainDeviceService.selectCountDeviceTotal();
return AjaxResult.success(percentageVo);
}
/**
* @Description:
* @Param:
* @Return:
**/
@ApiOperation(value = "获取设备总数")
@GetMapping(value = "/selectNormalDevice")
public AjaxResult selectNormalDevice() {
PercentageVo percentageVo = busiMainDeviceService.selectNormalDevice();
return AjaxResult.success(percentageVo);
}
/**
* @Description:
* @Param:
* @Return:
**/
@ApiOperation(value = "获取设备总数")
@GetMapping(value = "/selectCountEcpDevice")
public AjaxResult selectCountEcpDevice() {
PercentageVo percentageVo = busiMainDeviceService.selectCountEcpDevice();
return AjaxResult.success(percentageVo);
}
}

@ -0,0 +1,96 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.dto.BusiNoiseRealDto;
import com.chenxuan.entity.model.BusiNoiseReal;
import com.chenxuan.entity.vo.BusiNoiseRealDetailsVo;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiExportDataService;
import com.chenxuan.service.BusiNoiseRealService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = "噪声实时数据")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_NOISE_REAL)
public class BusiNoiseRealController extends BaseController {
@Autowired
private BusiNoiseRealService busiNoiseRealService;
@Autowired
private BusiExportDataService busiExportDataService;
/**
*
*/
@ApiOperation(value = "新增噪声实时数据信息")
@LogAnnotation(module = "噪声实时数据", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody List<BusiNoiseReal> busiNoiseRealList) {
return returnAjax(busiNoiseRealService.insertNoiseReal(busiNoiseRealList));
}
/**
* id
*/
@ApiOperation(value = "根据主变id加载噪声实时数据信息")
@GetMapping(value = "/getNoiseRealByMainId/{mainId}")
public AjaxResult getNoiseRealByMainId(@PathVariable("mainId") String mainId) {
return AjaxResult.success(busiNoiseRealService.selectNoiseRealByMainId(mainId));
}
/**
* id
*/
@ApiOperation(value = "根据主变id及当天时间加载噪声谱图信息")
@PostMapping(value = "/queryNoiseRealChartByInfo")
public AjaxResult queryNoiseRealChartByInfo(@RequestBody BusiNoiseRealDto busiNoiseRealDto) {
return AjaxResult.success(busiNoiseRealService.findNoiseRealChartByInfo(busiNoiseRealDto));
}
/**
* id
*/
@ApiOperation(value = "根据主变id和时间加载噪声实时数据信息")
@PostMapping(value = "/getNoiseRealByMainIdAndCreateTime")
public AjaxResult getNoiseRealByMainIdAndCreateTime(@RequestBody BusiNoiseRealDto busiNoiseRealDto) {
return AjaxResult.success(busiNoiseRealService.selectNoiseRealByMainIdAndCreateTime(busiNoiseRealDto));
}
/**
* id
*/
@ApiOperation(value = "根据主变id加载噪声实时数据详细信息")
@PostMapping(value = "/getNoiseRealDetailsByMainId")
public AjaxResult getNoiseRealDetailsByMainId(@RequestBody BusiNoiseRealDto dto) {
Page<BusiNoiseRealDetailsVo> pageList = busiNoiseRealService.getNoiseRealDetailsByMainId(dto);
return AjaxResult.success(pageList);
}
/**
* Excel
*/
@ApiOperation(value = "导出噪声实时数据详细信息Excel")
@PostMapping(value = "/exportNoiseRealDetails")
public AjaxResult exportNoiseRealDetails(@RequestBody BusiNoiseRealDto dto) {
return busiExportDataService.exportNoiseRealDetails(dto);
}
/**
*
*/
@ApiOperation(value = "导出噪声实时数据")
@PostMapping(value = "/exportNoiseRealByMainId")
public AjaxResult exportNoiseRealByMainId(@RequestBody BusiNoiseRealDto dto) {
return busiExportDataService.exportNoiseReal(dto);
}
}

@ -0,0 +1,90 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.dto.BusiNoiseThresholdConfDto;
import com.chenxuan.entity.model.BusiNoiseThresholdConf;
import com.chenxuan.entity.vo.BusiNoiseThresholdConfVo;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiNoiseThresholdConfService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = "噪声装置阈值配置")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_NOISE_THRESHOLD_CONF)
public class BusiNoiseThresholdConfController extends BaseController {
@Autowired
private BusiNoiseThresholdConfService busiNoiseThresholdConfService;
/**
* @Description:
* @Param:
* @Return: TableDataInfo
**/
@ApiOperation(value = "获取噪声装置阈值配置列表")
@PostMapping(value = "/page")
public AjaxResult page(@RequestBody BusiNoiseThresholdConfDto dto) {
Page<BusiNoiseThresholdConfVo> page = busiNoiseThresholdConfService.page(dto);
return AjaxResult.success(page);
}
/**
*
*/
@ApiOperation(value = "新增噪声装置阈值配置信息")
@LogAnnotation(module = "噪声装置阈值配置", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody BusiNoiseThresholdConf busiNoiseThresholdConf) {
return busiNoiseThresholdConfService.insertThresholdConf(busiNoiseThresholdConf);
}
/**
*
*/
@ApiOperation(value = "修改噪声装置阈值配置信息")
@LogAnnotation(module = "噪声装置阈值配置", operateType = OperateType.UPDATE)
@PutMapping(value = "/update")
public AjaxResult update(@RequestBody BusiNoiseThresholdConf busiNoiseThresholdConf) {
return busiNoiseThresholdConfService.updateThresholdConf(busiNoiseThresholdConf);
}
/**
* id
*/
@ApiOperation(value = "根据主变id加载噪声装置阈值配置信息")
@GetMapping(value = "/getCenterThresholdConfByMainId/{mainId}")
public AjaxResult getCenterThresholdConfByMainId(@PathVariable("mainId") String mainId) {
return AjaxResult.success(busiNoiseThresholdConfService.selectThresholdConfByMainId(mainId));
}
/**
* id
*/
@ApiOperation(value = "根据主变id删除噪声装置阈值配置信息")
@LogAnnotation(module = "噪声装置阈值配置", operateType = OperateType.DELETE)
@DeleteMapping(value = "/deleteByMainId")
public AjaxResult remove(@RequestParam("mainId") String mainId) {
return returnAjax(busiNoiseThresholdConfService.deleteThresholdConfByMainId(mainId));
}
/**
* id
*/
@ApiOperation(value = "根据噪声装置阈值配置id删除其配置信息")
@LogAnnotation(module = "噪声装置阈值配置", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete")
public AjaxResult delete(@RequestParam("ids") String id) {
return returnAjax(busiNoiseThresholdConfService.delete(id));
}
}

@ -0,0 +1,63 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.dto.BusiParamBindDto;
import com.chenxuan.entity.model.BusiParamBind;
import com.chenxuan.entity.vo.BusiMainDeviceVo;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiParamBindService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = "ied参数绑定")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_PARAM_BIND)
public class BusiParamBindController extends BaseController {
@Autowired
private BusiParamBindService busiParamBindService;
/**
* ied
*/
@ApiOperation(value = "新增ied参数信息")
@LogAnnotation(module = "ied参数信息", operateType = OperateType.INSERT)
@PostMapping(value = "/addParamBind")
public AjaxResult addParamBind(@RequestBody BusiParamBind busiParamBind) {
// return busiParamBindService.addParamBind(busiParamBind);
return returnAjax(busiParamBindService.addParamBind(busiParamBind));
}
/**
* ied
*/
@ApiOperation(value = "修改ied参数信息")
@LogAnnotation(module = "ied参数信息", operateType = OperateType.UPDATE)
@PostMapping(value = "/updateParamBind")
public AjaxResult updateParamBind(@RequestBody BusiParamBind busiParamBind) {
return returnAjax(busiParamBindService.updateParamBind(busiParamBind));
}
@ApiOperation(value = "分页查询")
@PostMapping(value = "/queryParamBind")
public AjaxResult queryParamBind(@RequestBody BusiParamBindDto dto) {
Page<BusiMainDeviceVo> page = busiParamBindService.queryParamBind(dto);
return AjaxResult.success(page);
}
/**
*
*/
@LogAnnotation(module = "用户管理", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delParamBind")
public AjaxResult delParamBind(@RequestParam("iedIds") int[] iedIds) {
return returnAjax(busiParamBindService.delParamBind(iedIds) > 0 ? true : false);
}
}

@ -0,0 +1,124 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.dto.BusiSubDeviceDto;
import com.chenxuan.entity.model.BusiSubDevice;
import com.chenxuan.entity.vo.BusiSubDeviceVo;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiSubDeviceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = "主变装置设置")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_SUB_DEVICE)
public class BusiSubDeviceController extends BaseController {
@Autowired
private BusiSubDeviceService busiSubDeviceService;
/**
* @Description:
* @Param:
* @Return: TableDataInfo
**/
@ApiOperation(value = "获取主变压器装置信息列表")
@PostMapping(value = "/page")
public AjaxResult page(@RequestBody BusiSubDeviceDto dto) {
Page<BusiSubDeviceVo> page = busiSubDeviceService.page(dto);
return AjaxResult.success(page);
}
@ApiOperation(value = "获取主变压器装置信息列表")
@GetMapping(value = "/queryAll")
public AjaxResult queryAll() {
List<BusiSubDeviceVo> list = busiSubDeviceService.queryAll();
return AjaxResult.success(list);
}
/**
*
*/
@ApiOperation(value = "新增主变装置信息")
@LogAnnotation(module = "主变装置信息", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody BusiSubDeviceDto dto) {
return busiSubDeviceService.insertSubDevice(dto);
}
/**
*
*/
@ApiOperation(value = "修改主变装置信息")
@LogAnnotation(module = "主变装置信息", operateType = OperateType.UPDATE)
@PutMapping(value = "/update")
public AjaxResult update(@RequestBody BusiSubDevice busiSubDevice) {
return busiSubDeviceService.updateSubDevice(busiSubDevice);
}
/**
* id
*/
@ApiOperation(value = "根据主变id加载主变装置信息")
@GetMapping(value = "/getSubDeviceByMainId/{mainId}")
public AjaxResult getSubDeviceByMainId(@PathVariable("mainId") String mainId) {
return AjaxResult.success(busiSubDeviceService.selectSubDeviceByMainId(mainId));
}
/**
* id
*/
@ApiOperation(value = "根据主变id加载主变装置信息")
@GetMapping(value = "/querySubDeviceById/{id}")
public AjaxResult querySubDeviceById(@PathVariable("id") String id) {
return AjaxResult.success(busiSubDeviceService.querySubDeviceById(id));
}
/**
* id
*/
@ApiOperation(value = "根据主变id加载主变装置信息")
@GetMapping(value = "/querySubDeviceByMainId/{mainId}")
public AjaxResult querySubDeviceByMainId(@PathVariable("mainId") String mainId) {
return AjaxResult.success(busiSubDeviceService.querySubDeviceByMainId(mainId));
}
// @ApiOperation(value = "根据通信协议类型加载通信参数信息")
// @GetMapping(value = "/getBusiCommunicationParametersByProtocol/{protocol}")
// public AjaxResult getBusiCommunicationParametersByProtocol(@PathVariable("protocol") String protocol) {
// return AjaxResult.success(busiCommunicationParametersService.selectBusiCommunicationParametersByProtocol(protocol));
// }
/**
* id
*/
@ApiOperation(value = "根据主变id删除该主变下对应的装置信息")
@LogAnnotation(module = "主变装置信息", operateType = OperateType.DELETE)
@DeleteMapping(value = "/deleteByMainId/{mainId}")
public AjaxResult remove(@RequestParam("mainId") String mainId) {
return returnAjax(busiSubDeviceService.deleteSubDeviceByMainId(mainId));
}
/**
* id
*/
@ApiOperation(value = "根据装置id删除装置信息")
@LogAnnotation(module = "主变装置信息", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete/{id}")
public AjaxResult delete(@RequestParam("id") String id) {
return returnAjax(busiSubDeviceService.delete(id));
}
}

@ -0,0 +1,97 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.model.BusiTransformerConf;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiTransformerConfService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(tags = "原副边电流电压配置")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_TRANSFORMER_CONF)
public class BusiTransformerConfController extends BaseController {
@Autowired
private BusiTransformerConfService busiTransformerConfService;
/**
* @Description:
* @Param:
* @Return: TableDataInfo
**/
@ApiOperation(value = "获取原副边电流电压配置列表")
@GetMapping(value = "/page")
public AjaxResult page(Query queryParam) {
Page<BusiTransformerConf> page = busiTransformerConfService.page(queryParam);
return AjaxResult.success(page);
}
/**
*
*/
@ApiOperation(value = "新增电流电压配置")
@LogAnnotation(module = "电流电压设置", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody List<BusiTransformerConf> busiTransformerConfList) {
return returnAjax(busiTransformerConfService.insertConfigs(busiTransformerConfList));
}
/**
*
*/
@ApiOperation(value = "修改电流电压配置")
// @LogAnnotation(module = "电流电压设置", operateType = OperateType.UPDATE)
@PostMapping(value = "/update")
public AjaxResult update(@RequestBody List<BusiTransformerConf> busiTransformerConfList) {
return returnAjax(busiTransformerConfService.updateConfigs(busiTransformerConfList));
}
/**
*
*/
@ApiOperation(value = "加载对应主变的原边副边电流电压信息")
@GetMapping(value = "/getTransformerConfigByMainId/{mainId}")
public AjaxResult getTransformerConfigByMainId(@PathVariable("mainId") String mainId) {
return AjaxResult.success(busiTransformerConfService.selectConfigsByMainId(mainId));
}
/**
*
*/
@ApiOperation(value = "根据配置id删除电流电压配置")
@LogAnnotation(module = "电流电压设置", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete")
public AjaxResult remove(@RequestParam("id") String id) {
return returnAjax(busiTransformerConfService.deleteConfById(id));
}
/**
* id
*/
@ApiOperation(value = "根据主变id删除该主变下对应的电流电压配置信息")
@LogAnnotation(module = "电流电压设置", operateType = OperateType.DELETE)
@DeleteMapping(value = "/deleteByMainId")
public AjaxResult deleteByMainId(@RequestParam("mainId") String mainId) {
return returnAjax(busiTransformerConfService.deleteConfsByMainId(mainId));
}
}

@ -0,0 +1,70 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.dto.BusiTransformerRealDto;
import com.chenxuan.entity.model.BusiTransformerReal;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiTransformerRealService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = "原副边电流电压实时数据")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_TRANSFORMER_REAL)
public class BusiTransformerRealController extends BaseController {
@Autowired
private BusiTransformerRealService busiTransformerRealService;
/**
* @Description:
* @Param:
* @Return: TableDataInfo
**/
@ApiOperation(value = "获取原副边电流电压实时数据列表")
@PostMapping(value = "/page")
public AjaxResult page(Query queryParam) {
Page<BusiTransformerReal> page = busiTransformerRealService.page( queryParam );
return AjaxResult.success( page );
}
/**
*
*/
@ApiOperation(value = "新增原副边电流电压实时数据")
@LogAnnotation(module = "原副边电流电压实时数据", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody List<BusiTransformerReal> busiTransformerRealList) {
return returnAjax( busiTransformerRealService.insertTransformerReals( busiTransformerRealList ) );
}
/**
*
*/
@ApiOperation(value = "加载对应主变的原副边电流电压实时数据信息")
@GetMapping(value = "/getTransformerConfigByMainId/{mainId}")
public AjaxResult getTransformerConfigByMainId(@PathVariable("mainId") String mainId) {
return AjaxResult.success( busiTransformerRealService.selectTransformerRealByMainId( mainId ) );
}
/**
* Excel
*/
@ApiOperation(value = "导出原副边电流电压实时数据Excel")
@PostMapping(value = "/exporTransformReal")
public AjaxResult exporTransformReal(@RequestBody BusiTransformerRealDto dto) {
return AjaxResult.success(busiTransformerRealService.exporTransformReal(dto));
}
}

@ -0,0 +1,64 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.dto.BusiWarningDto;
import com.chenxuan.entity.model.BusiWarning;
import com.chenxuan.entity.vo.BusiWarningVo;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.BusiWarningService;
import com.chenxuan.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@Api(tags = "告警信息")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_WARNING)
public class BusiWarningController extends BaseController {
@Autowired
private BusiWarningService busiWarningService;
/**
*
*
* @param dto
* @return
*/
@ApiOperation(value = "获取告警信息列表")
@PostMapping(value = "/page")
public AjaxResult page(@RequestBody BusiWarningDto dto) {
Page<BusiWarningVo> page;
if (StringUtils.isNotBlank(dto.getWarnType())) {
page = busiWarningService.getPage(dto);
} else {
page = busiWarningService.page(dto);
}
return AjaxResult.success(page);
}
/**
*
*/
@ApiOperation(value = "新增告警信息")
@LogAnnotation(module = "告警信息", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody BusiWarning busiWarning) {
return returnAjax(busiWarningService.insertWarning(busiWarning));
}
/**
*
*/
@ApiOperation(value = "修改告警信息")
@LogAnnotation(module = "告警信息", operateType = OperateType.UPDATE)
@PutMapping(value = "/update")
public AjaxResult update(@RequestBody BusiWarning busiWarning) {
return returnAjax(busiWarningService.updateWarning(busiWarning));
}
}

@ -0,0 +1,65 @@
package com.chenxuan.controller;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.util.IdUtil;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.component.RedisCacheService;
import com.chenxuan.constants.Constants;
import com.chenxuan.utils.VerifyCodeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.cache.RedisCache;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
/**
* @ClassNameCaptchaController
* @Description
* @Author Arno_Fu
* @CreatTime11/27/2019 - 2:19 PM
* @Version V1.0
*/
@RestController
public class CaptchaController {
@Autowired
private RedisCacheService redisCacheService;
/**
*
*/
@GetMapping("/captchaImage")
public AjaxResult getCode(HttpServletResponse response) throws IOException {
// 生成随机字串
String verifyCode = VerifyCodeUtils.generateVerifyCode( 4 );
// 唯一标识
String uuid = IdUtil.simpleUUID();
String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
redisCacheService.setCacheObject( verifyKey, verifyCode, Constants.CAPTCHA_EXPIRATION, TimeUnit.MINUTES );
ByteArrayOutputStream stream = null;
try {
// 生成图片
int w = 111, h = 36;
stream = new ByteArrayOutputStream();
VerifyCodeUtils.outputImage( w, h, stream, verifyCode );
AjaxResult ajax = AjaxResult.success();
ajax.put( "uuid", uuid );
ajax.put( "img", Base64.encode( stream.toByteArray() ) );
return ajax;
} catch (Exception e) {
e.printStackTrace();
return AjaxResult.error( e.getMessage() );
} finally {
stream.close();
}
}
}

@ -0,0 +1,26 @@
package com.chenxuan.controller;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.service.BusiIedparamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "主变装置设置")
@RestController
@RequestMapping(value = BusiUrlConstants.BUSI_IED)
public class IedController {
@Autowired
private BusiIedparamService busiIedparamService;
@ApiOperation(value = "加载对应主变的原副边电流电压实时数据信息")
@GetMapping(value = "/quereyIcdById/{id}")
public AjaxResult quereyIcdById(@PathVariable("id") String id) {
return AjaxResult.success(busiIedparamService.quereyIcdById(id) );
}
}

@ -0,0 +1,135 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.entity.dto.ScheduleJobDto;
import com.chenxuan.entity.model.ScheduleJob;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.ScheduleJobService;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @ClassNameScheduleJobController
* @Description
* @Author Arno_Fu
* @CreatTime12/26/2019 - 4:57 PM
* @Version V1.0
*/
@RestController
@RequestMapping("/quartz/job")
public class ScheduleJobController extends BaseController {
@Autowired
private ScheduleJobService scheduleJobService;
/**
*
*/
@GetMapping("/page")
public AjaxResult page(ScheduleJobDto dto) {
Page<ScheduleJob> page = scheduleJobService.queryPage(dto);
return AjaxResult.success(page);
}
/**
*
*
* @param jobId
* @return
*/
@GetMapping("/info")
public AjaxResult info(@RequestParam("jobId") Long jobId) {
ScheduleJob job = scheduleJobService.getById(jobId);
return AjaxResult.success(job);
}
/**
*
*
* @param job
* @return
* @throws SchedulerException
*/
@PostMapping("/add")
@LogAnnotation(module = "新增定时任务", operateType = OperateType.INSERT)
public AjaxResult add(@RequestBody ScheduleJob job) throws SchedulerException {
return scheduleJobService.add(job);
}
/**
*
*
* @param job
* @return
* @throws SchedulerException
*/
@PutMapping("/update")
public AjaxResult update(@RequestBody ScheduleJob job) throws SchedulerException {
return scheduleJobService.update(job);
}
/**
*
*
* @param jobIds
* @return
* @throws SchedulerException
*/
@GetMapping("/start")
public AjaxResult start(@RequestParam("jobIds") String[] jobIds) throws SchedulerException {
return returnAjax(scheduleJobService.start(jobIds));
}
/**
*
*
* @param jobIds
* @return
* @throws SchedulerException
*/
@GetMapping("/pause")
public AjaxResult pause(@RequestParam("jobIds") String[] jobIds) throws SchedulerException {
return returnAjax(scheduleJobService.pause(jobIds));
}
/**
*
*
* @param jobIds
* @return
* @throws SchedulerException
*/
@DeleteMapping("/delete")
public AjaxResult delete(@RequestParam("jobIds") String[] jobIds) throws SchedulerException {
return scheduleJobService.delete(jobIds);
}
/**
*
*
* @return
* @throws SchedulerException
*/
@GetMapping("/startAllJob")
public AjaxResult startAllJob() throws SchedulerException {
scheduleJobService.startAllJob();
return AjaxResult.success();
}
/**
*
*
* @return
* @throws SchedulerException
*/
@GetMapping("/pauseAllJob")
public AjaxResult pauseAllJob() throws SchedulerException {
scheduleJobService.pauseAllJob();
return AjaxResult.success();
}
}

@ -0,0 +1,103 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.entity.model.SysConfig;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.SysConfigService;
import com.chenxuan.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
/**
* @ClassNameSysConfigController
* @Description
* @Author Arno_Fu
* @CreatTime12/20/2019 - 10:50 AM
* @Version V1.0
*/
@RestController
@RequestMapping("/system/config")
public class SysConfigController extends BaseController {
@Autowired
private SysConfigService sysConfigService;
/**
*
*/
@GetMapping("/page")
public AjaxResult page(Query query) {
Page<SysConfig> page = sysConfigService.queryPage( query );
return AjaxResult.success( page );
}
/* @LogAnnotation(module= "参数管理", operateType = OperateType.EXPORT)
@GetMapping("/export")
public AjaxResult export(SysConfig config) {
List<SysConfig> list = sysConfigService.selectConfigList( config );
ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>( SysConfig.class );
return util.exportExcel( list, "参数数据" );
}*/
/**
*
*/
@GetMapping(value = "/info")
public AjaxResult getInfo(@RequestParam("configId") Long configId) {
return AjaxResult.success( sysConfigService.selectConfigById( configId ) );
}
/**
*
*/
@GetMapping(value = "/configKey")
public AjaxResult getConfigKey(@RequestParam("configKey") String configKey) {
return AjaxResult.success( sysConfigService.selectConfigByKey( configKey ) );
}
/**
*
*/
@LogAnnotation(module = "参数管理", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody SysConfig config) {
if (!sysConfigService.checkConfigKeyUnique( config )) {
return AjaxResult.error( "新增参数'" + config.getConfigName() + "'失败,参数键名已存在" );
}
config.setCreateBy( SecurityUtils.getUsername() );
config.setCreateTime( new Date() );
return returnAjax( sysConfigService.insertConfig( config ) );
}
/**
*
*/
@LogAnnotation(module = "参数管理", operateType = OperateType.UPDATE)
@PutMapping(value = "/update")
public AjaxResult update(@RequestBody SysConfig config) {
if (!sysConfigService.checkConfigKeyUnique( config )) {
return AjaxResult.error( "修改参数'" + config.getConfigName() + "'失败,参数键名已存在" );
}
config.setUpdateBy( SecurityUtils.getUsername() );
config.setUpdateTime( new Date() );
return returnAjax( sysConfigService.updateConfig( config ) );
}
/**
*
*/
@LogAnnotation(module = "参数管理", operateType = OperateType.DELETE)
@DeleteMapping("/delete")
public AjaxResult delete(@RequestParam("configIds") Long[] configIds) {
return returnAjax( sysConfigService.deleteConfigByIds( configIds ) );
}
}

@ -0,0 +1,112 @@
package com.chenxuan.controller;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.entity.model.SysDept;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.SysDeptService;
import com.chenxuan.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
* @ClassNameSysDeptController
* @Description
* @Author Arno_Fu
* @CreatTime11/28/2019 - 6:09 PM
* @Version V1.0
*/
@RestController
@RequestMapping("/system/dept")
public class SysDeptController extends BaseController {
@Autowired
private SysDeptService deptService;
/**
*
*/
@GetMapping("/list")
public AjaxResult list(Query query) {
List<SysDept> depts = deptService.getDeptList( query );
return AjaxResult.success( deptService.buildDeptTree( depts ) );
}
/**
*
*/
@GetMapping("/treeselect")
public AjaxResult treeselect() {
List<SysDept> depts = deptService.getDeptList();
return AjaxResult.success( deptService.buildDeptTreeSelect( depts ) );
}
/**
*
*/
@LogAnnotation(module = "部门管理", operateType = OperateType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody SysDept dept) {
if (!deptService.checkDeptNameUnique( dept )) {
return AjaxResult.error( "新增部门'" + dept.getDeptName() + "'失败,部门名称已存在" );
}
dept.setCreateBy( SecurityUtils.getUsername() );
dept.setCreateTime( new Date() );
return returnAjax( deptService.insertDept( dept ) );
}
/**
*
*/
@LogAnnotation(module = "部门管理", operateType = OperateType.UPDATE)
@PutMapping("/update")
public AjaxResult edit(@RequestBody SysDept dept) {
if (!deptService.checkDeptNameUnique( dept )) {
return AjaxResult.error( "修改部门'" + dept.getDeptName() + "'失败,部门名称已存在" );
}
if (dept.getParentId().equals( dept.getDeptId() )) {
return AjaxResult.error( "修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己" );
}
dept.setUpdateBy( SecurityUtils.getUsername() );
dept.setUpdateTime( new Date() );
return returnAjax( deptService.updateDept( dept ) );
}
/**
*
*/
@LogAnnotation(module = "部门管理", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete")
public AjaxResult delete(@RequestParam("deptId") Long deptId) {
if (deptService.hasChildByDeptId( deptId )) {
return AjaxResult.error( "存在下级部门,不允许删除" );
}
if (deptService.checkDeptExistUser( deptId )) {
return AjaxResult.error( "部门存在用户,不允许删除" );
}
return returnAjax( deptService.deleteDeptById( deptId ) );
}
/**
*
*/
@GetMapping(value = "info")
public AjaxResult info(@RequestParam("deptId") Long deptId) {
return AjaxResult.success( deptService.getByPK( deptId ) );
}
@GetMapping(value = "/roleDeptTreeselect")
public AjaxResult roleDeptTreeselect(@RequestParam("roleId") Long roleId)
{
return AjaxResult.success(deptService.selectDeptListByRoleId(roleId));
}
}

@ -0,0 +1,115 @@
package com.chenxuan.controller;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.entity.model.SysDictData;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.SysDictDataService;
import com.chenxuan.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@RestController
@RequestMapping("/system/dict/data")
/**
* @ClassNameSysDictDataController
* @Description
* @Author Arno_Fu
* @CreatTime11/28/2019 - 4:54 PM
* @Version V1.0
*/
public class SysDictDataController extends BaseController {
@Autowired
private SysDictDataService dictDataService;
/**
* @param dictType
* @Description:
* @Param:
* @Return: com.chenxuan.base.entity.AjaxResult
**/
@GetMapping(value = "/dictType/{dictType}")
public AjaxResult dictType(@PathVariable String dictType) {
List<SysDictData> list = dictDataService.getDictDataByType(dictType);
return AjaxResult.success(list);
}
/**
*
*
* @param query
* @return
*/
@GetMapping("/page")
public AjaxResult page(Query query) {
return AjaxResult.success(dictDataService.selectDictDataPage(query));
}
/* @Log(title = "字典数据", businessType = BusinessType.EXPORT)
@PreAuthorize("@ss.hasPermi('system:dict:export')")
@GetMapping("/export")
public AjaxResult export(SysDictData dictData)
{
List<SysDictData> list = dictDataService.selectDictDataList(dictData);
ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class);
return util.exportExcel(list, "字典数据");
}*/
/**
*
*/
@GetMapping(value = "/info")
public AjaxResult getInfo(@RequestParam("dictCode") Long dictCode) {
return AjaxResult.success(dictDataService.selectDictDataById(dictCode));
}
@GetMapping(value = "/selectDictLabel")
public AjaxResult selectDictLabel(@RequestParam("dictType") String dictType,@RequestParam("dictValue") String dictValue) {
return AjaxResult.success(dictDataService.selectDictLabel(dictType,dictValue));
}
/**
*
*/
@LogAnnotation(module = "字典数据", operateType = OperateType.INSERT)
@PostMapping(value = "add")
public AjaxResult add(@RequestBody SysDictData dict) {
dict.setCreateBy(SecurityUtils.getUsername());
dict.setCreateTime(new Date());
return returnAjax(dictDataService.insertDictData(dict));
}
/**
*
*/
@LogAnnotation(module = "字典数据", operateType = OperateType.UPDATE)
@PutMapping(value = "update")
public AjaxResult update(@RequestBody SysDictData dict) {
dict.setUpdateBy(SecurityUtils.getUsername());
dict.setUpdateTime(new Date());
return returnAjax(dictDataService.updateDictData(dict));
}
/**
*
*/
@LogAnnotation(module = "字典类型", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete")
public AjaxResult delete(@RequestParam("dictCodes") Long[] dictCodes) {
return returnAjax(dictDataService.deleteDictDataByIds(dictCodes));
}
}

@ -0,0 +1,120 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.entity.model.SysDictType;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.SysDictTypeService;
import com.chenxuan.service.SysExportDataService;
import com.chenxuan.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
* @ClassNameSysDictTypeController
* @Description
* @Author Arno_Fu
* @CreatTime12/20/2019 - 1:38 PM
* @Version V1.0
*/
@RestController
@RequestMapping("/system/dict/type/")
public class SysDictTypeController extends BaseController {
@Autowired
private SysDictTypeService sysDictService;
@Autowired
private SysExportDataService sysExportDataService;
/**
*
*
* @param query
* @return
*/
@GetMapping("/page")
public AjaxResult page(Query query) {
Page<SysDictType> page = sysDictService.selectDictTypePage(query);
return AjaxResult.success(page);
}
/**
*
*
* @param query
* @return
*/
@GetMapping("/list")
public AjaxResult list(Query query) {
List<SysDictType> List = sysDictService.selectDictTypeList();
return AjaxResult.success(List);
}
/**
*
*
* @param query
* @return
*/
@LogAnnotation(module = "字典类型", operateType = OperateType.EXPORT)
@PostMapping("/export")
public AjaxResult export(Query query) {
return AjaxResult.success(sysExportDataService.exportDictInfo(query));
}
/**
*
*/
@GetMapping(value = "/info")
public AjaxResult info(@RequestParam("dictId") Long dictId) {
return AjaxResult.success(sysDictService.selectDictTypeById(dictId));
}
/**
*
*/
@LogAnnotation(module = "字典类型", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody SysDictType dict) {
if (!sysDictService.checkDictTypeUnique(dict)) {
return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setCreateBy(SecurityUtils.getUsername());
dict.setCreateTime(new Date());
return returnAjax(sysDictService.insertDictType(dict));
}
/**
*
*/
@LogAnnotation(module = "字典类型", operateType = OperateType.UPDATE)
@PutMapping(value = "/update")
public AjaxResult update(@RequestBody SysDictType dict) {
if (!sysDictService.checkDictTypeUnique(dict)) {
return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在");
}
dict.setUpdateBy(SecurityUtils.getUsername());
dict.setUpdateTime(new Date());
return returnAjax(sysDictService.updateDictType(dict));
}
/**
*
*/
@LogAnnotation(module = "字典类型", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete")
public AjaxResult delete(@RequestParam("dictIds") Long[] dictIds) {
return returnAjax(sysDictService.deleteDictTypeByIds(dictIds));
}
}

@ -0,0 +1,29 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.entity.model.SysUser;
import com.chenxuan.service.SysPostService;
import com.chenxuan.service.SysRoleService;
import com.chenxuan.service.SysExecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/system/exec")
public class SysExecController extends BaseController {
@Autowired
private SysExecService sysExecService;
@GetMapping(value = "/exec")
public AjaxResult page(String command) {
sysExecService.runtimeExec( command );
return AjaxResult.success( );
}
}

@ -0,0 +1,107 @@
package com.chenxuan.controller;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.constants.Constants;
import com.chenxuan.entity.model.SysMenu;
import com.chenxuan.entity.model.SysUser;
import com.chenxuan.security.LoginUser;
import com.chenxuan.security.service.CustomPermissionService;
import com.chenxuan.security.service.JwtTokenService;
import com.chenxuan.security.service.LoginService;
import com.chenxuan.service.SysMenuService;
import com.chenxuan.utils.ServletUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Set;
/**
* @ClassNameSysLoginController
* @Description
* @Author Arno_Fu
* @CreatTime11/26/2019 - 1:47 PM
* @Version V1.0
*/
@RestController
public class SysLoginController {
@Autowired
private LoginService loginService;
@Autowired
private SysMenuService menuService;
@Autowired
private CustomPermissionService customPermissionService;
@Autowired
private JwtTokenService jwtTokenService;
/**
* @Description
*
* @param username
* @param password
* @param code
* @param uuid
* @return com.chenxuan.domain.AjaxResult
*/
@PostMapping("/login")
public AjaxResult login(String username, String password, String code, String uuid)
{
AjaxResult ajax = AjaxResult.success();
String token = loginService.login(username, password, code, uuid);
ajax.put(Constants.TOKEN, token);
return ajax;
}
/**
* @Description
*
* @return com.chenxuan.base.entity.AjaxResult
*/
@GetMapping("getInfo")
public AjaxResult getInfo(){
SysUser user = getSysUser();
// 权限集合
Set<String> permissions = customPermissionService.getMenuPermission(user);
// 角色集合
Set<String> roles = customPermissionService.getRolePermission(user);
AjaxResult ajax = AjaxResult.success();
ajax.put("user", user);
ajax.put("roles", roles);
ajax.put("permissions", permissions);
return ajax;
}
/**
* @Description
*
* @return com.chenxuan.base.entity.AjaxResult
*/
@GetMapping("getRouters")
public AjaxResult getRouters(){
SysUser user = getSysUser();
List<SysMenu> menus = menuService.getMenuTreeByUserId(user);
return AjaxResult.success(menuService.buildMenus(menus));
}
private SysUser getSysUser() {
LoginUser loginUser = jwtTokenService.getLoginUser( ServletUtils.getRequest());
return loginUser.getUser();
}
}

@ -0,0 +1,78 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.entity.dto.SysLoginLogDto;
import com.chenxuan.entity.model.SysLoginLog;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.SysExportDataService;
import com.chenxuan.service.SysLoginLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 访
*
* @author ruoyi
*/
@RestController
@RequestMapping("/monitor/loginlog")
public class SysLoginLogController extends BaseController {
@Autowired
private SysLoginLogService sysLoginLogService;
@Autowired
private SysExportDataService sysExportDataService;
/**
*
*
* @param query
* @return
*/
@GetMapping("/page")
public AjaxResult page(Query query) {
Page<SysLoginLog> page = sysLoginLogService.selectLoginLogPage(query);
return AjaxResult.success(page);
}
/**
*
*
* @param dto
* @return
*/
@LogAnnotation(module = "登录日志", operateType = OperateType.EXPORT)
@PostMapping("/export")
public AjaxResult export(@RequestBody SysLoginLogDto dto) {
return sysExportDataService.exportLoginLog(dto);
}
/**
*
*
* @param infoIds
* @return
*/
@LogAnnotation(module = "登陆日志", operateType = OperateType.DELETE)
@DeleteMapping("/delete")
public AjaxResult delete(@RequestParam("infoIds") Long[] infoIds) {
return returnAjax(sysLoginLogService.deleteLoginLogByIds(infoIds));
}
/**
*
*
* @return
*/
@LogAnnotation(module = "登陆日志", operateType = OperateType.CLEAN)
@DeleteMapping("/clean")
public AjaxResult clean() {
sysLoginLogService.cleanLoginLog();
return AjaxResult.success();
}
}

@ -0,0 +1,115 @@
package com.chenxuan.controller;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.entity.model.SysMenu;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.SysMenuService;
import com.chenxuan.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
/**
* @ClassNameSysMenuController
* @Description
* @Author Arno_Fu
* @CreatTime12/3/2019 - 9:13 PM
* @Version V1.0
*/
@RestController
@RequestMapping("/system/menu")
public class SysMenuController extends BaseController {
@Autowired
private SysMenuService menuService;
/**
*
*/
@GetMapping("/list")
public AjaxResult list(Query query) {
List<SysMenu> menus = menuService.getMenuList( query );
return AjaxResult.success( menuService.buildMenuTree( menus ) );
}
/**
*
*/
@GetMapping(value = "/info")
public AjaxResult getInfo(@RequestParam("menuId") Long menuId) {
return AjaxResult.success( menuService.getByPK( menuId ) );
}
/**
*
*/
@GetMapping("/treeselect")
public AjaxResult treeselect() {
List<SysMenu> menus = menuService.getMenuList( );
return AjaxResult.success( menuService.buildMenuTreeSelect( menus ) );
}
/**
*
*/
@GetMapping(value = "/roleMenuTreeselect/{roleId}")
public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) {
return AjaxResult.success( menuService.selectMenuListByRoleId( roleId ) );
}
/**
*
*/
@LogAnnotation(module = "菜单管理", operateType = OperateType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody SysMenu menu) {
if (! menuService.checkMenuNameUnique( menu ) ) {
return AjaxResult.error( "新增菜单'" + menu.getMenuName() + "'失败,菜单名称已存在" );
}
menu.setCreateBy( SecurityUtils.getUsername() );
menu.setCreateTime( new Date() );
return returnAjax( menuService.insertMenu( menu ) );
}
/**
*
*/
@LogAnnotation(module = "菜单管理", operateType = OperateType.UPDATE)
@PutMapping("/update")
public AjaxResult edit(@RequestBody SysMenu menu) {
if ( !menuService.checkMenuNameUnique( menu ) ) {
return AjaxResult.error( "修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在" );
}
menu.setUpdateBy( SecurityUtils.getUsername() );
menu.setUpdateTime( new Date( ) );
return returnAjax( menuService.updateMenu( menu ) );
}
/**
*
*/
@LogAnnotation(module = "菜单管理", operateType = OperateType.DELETE)
@DeleteMapping("/delete")
public AjaxResult remove(@RequestParam("menuId") Long menuId) {
if (menuService.hasChildByMenuId( menuId )) {
return AjaxResult.error( "存在子菜单,不允许删除" );
}
if (menuService.checkMenuExistRole( menuId )) {
return AjaxResult.error( "菜单已分配,不允许删除" );
}
return returnAjax( menuService.deleteMenuById( menuId ) );
}
}

@ -0,0 +1,81 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.entity.dto.SysOperLogDto;
import com.chenxuan.entity.model.SysOperLog;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.SysExportDataService;
import com.chenxuan.service.SysOperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @ClassNameSysOperlogController
* @Description
* @Author Arno_Fu
* @CreatTime12/23/2019 - 1:17 PM
* @Version V1.0
*/
@RestController
@RequestMapping("/monitor/operlog")
public class SysOperlogController extends BaseController {
@Autowired
private SysOperLogService sysOperLogService;
@Autowired
private SysExportDataService sysExportDataService;
/**
*
*
* @param query
* @return
*/
@GetMapping("/page")
public AjaxResult page(Query query) {
Page<SysOperLog> page = sysOperLogService.selectOperLogPage(query);
return AjaxResult.success(page);
}
/**
*
*
* @param dto
* @return
*/
@LogAnnotation(module = "操作日志", operateType = OperateType.EXPORT)
@PostMapping("/export")
public AjaxResult export(@RequestBody SysOperLogDto dto) {
return sysExportDataService.exportOperLog(dto);
}
/**
*
*
* @param operIds
* @return
*/
@DeleteMapping("/delete")
public AjaxResult remove(@RequestParam("operIds") Long[] operIds) {
return returnAjax(sysOperLogService.deleteOperLogByIds(operIds) > 0 ? true : false);
}
/**
*
*
* @return
*/
@LogAnnotation(module = "操作日志", operateType = OperateType.CLEAN)
@DeleteMapping("/clean")
public AjaxResult clean() {
sysOperLogService.cleanOperLog();
return AjaxResult.success();
}
}

@ -0,0 +1,123 @@
package com.chenxuan.controller;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.entity.model.SysPost;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.SysPostService;
import com.chenxuan.utils.SecurityUtils;
import lombok.extern.slf4j.Slf4j;
/**
* @ClassNameSysPostController
* @Description
* @Author Arno_Fu
* @CreatTime11/29/2019 - 1:51 PM
* @Version V1.0
*/
@Slf4j
@RestController
@RequestMapping("/system/post")
public class SysPostController extends BaseController {
@Autowired
private SysPostService postService;
/**
*
*/
@GetMapping(value = "/list")
public AjaxResult list( ) {
List<SysPost> list = postService.lists( );
return AjaxResult.success( list );
}
/**
*
*/
@GetMapping(value = "/page")
public AjaxResult page( Query query) {
log.debug( "--- 分页请求参数 -->>[{}]", query );
Page<SysPost> page = postService.page( query );
log.debug( "--- 分页请求返回数据 -->>[{}]", page );
return AjaxResult.success( page );
}
/**
*
*/
@LogAnnotation(module = "岗位管理", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody SysPost post) {
if (!postService.checkPostNameUnique( post )) {
return AjaxResult.error( "新增岗位'" + post.getPostName() + "'失败,岗位名称已存在" );
}
if (!postService.checkPostCodeUnique( post )) {
return AjaxResult.error( "新增岗位'" + post.getPostName() + "'失败,岗位编码已存在" );
}
post.setCreateBy( SecurityUtils.getUsername() );
post.setCreateTime( new Date() );
postService.insertPost( post );
return AjaxResult.success();
}
/**
*
*/
@LogAnnotation(module = "岗位管理", operateType = OperateType.UPDATE)
@PutMapping(value = "/update")
public AjaxResult update(@RequestBody SysPost post) {
if (!postService.checkPostNameUnique( post )) {
return AjaxResult.error( "修改岗位'" + post.getPostName() + "'失败,岗位名称已存在" );
}
if (!postService.checkPostCodeUnique( post )) {
return AjaxResult.error( "修改岗位'" + post.getPostName() + "'失败,岗位编码已存在" );
}
post.setUpdateBy( SecurityUtils.getUsername() );
post.setUpdateTime( new Date() );
postService.updatePost( post );
return AjaxResult.success();
}
/**
*
*/
@LogAnnotation(module = "岗位管理", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete")
public AjaxResult remove(@RequestParam("ids") Long[] ids) {
postService.deleteByIds( ids ) ;
return AjaxResult.success();
}
/**
*
*/
@GetMapping(value = "/info")
public AjaxResult info(@RequestParam("id") Long id) {
SysPost find = postService.getByPK(id );
return AjaxResult.success(find);
}
}

@ -0,0 +1,94 @@
package com.chenxuan.controller;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.entity.model.SysUser;
import com.chenxuan.enums.OperateType;
import com.chenxuan.security.LoginUser;
import com.chenxuan.security.service.JwtTokenService;
import com.chenxuan.service.SysUserService;
import com.chenxuan.utils.SecurityUtils;
import com.chenxuan.utils.ServletUtils;
import lombok.extern.java.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
/**
*
*
* @author ruoyi
*/
@RestController
@RequestMapping("/system/user/profile")
public class SysProfileController extends BaseController {
@Autowired
private SysUserService sysUserService;
@Autowired
private JwtTokenService jwtTokenService;
/**
*
*/
@GetMapping
public AjaxResult profile() {
LoginUser loginUser = jwtTokenService.getLoginUser( ServletUtils.getRequest() );
SysUser user = loginUser.getUser();
AjaxResult ajax = AjaxResult.success( user );
ajax.put( "roleGroup", sysUserService.selectUserRoleGroup( loginUser.getUsername() ) );
ajax.put( "postGroup", sysUserService.selectUserPostGroup( loginUser.getUsername() ) );
return ajax;
}
/**
*
*/
@LogAnnotation(module = "个人信息", operateType = OperateType.UPDATE)
@PutMapping
public AjaxResult updateProfile(@RequestBody SysUser user) {
return returnAjax( sysUserService.updateUserProfile( user ) );
}
/**
*
*/
@LogAnnotation(module = "个人信息", operateType = OperateType.UPDATE)
@PutMapping("/updatePwd")
public AjaxResult updatePwd(String oldPassword, String newPassword) {
LoginUser loginUser = jwtTokenService.getLoginUser( ServletUtils.getRequest() );
String userName = loginUser.getUsername();
String password = loginUser.getPassword();
if (!SecurityUtils.matchesPassword( oldPassword, password )) {
return AjaxResult.error( "修改密码失败,旧密码错误" );
}
if (SecurityUtils.matchesPassword( newPassword, password )) {
return AjaxResult.error( "新密码不能与旧密码相同" );
}
return returnAjax( sysUserService.resetUserPwd( userName, SecurityUtils.encryptPassword( newPassword ) ) );
}
/**
*
*/
@LogAnnotation(module = "用户头像", operateType = OperateType.UPDATE)
@PostMapping("/avatar")
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws IOException {
// if (!file.isEmpty()) {
// LoginUser loginUser = jwtTokenService.getLoginUser( ServletUtils.getRequest() );
// String avatar = FileUploadUtils.upload( RuoYiConfig.getAvatarPath(), file );
// if (userService.updateUserAvatar( loginUser.getUsername(), avatar )) {
// AjaxResult ajax = AjaxResult.success();
// ajax.put( "imgUrl", avatar );
// loginUser.getUser().setAvatar( avatar );
// tokenService.setLoginUser( loginUser );
// return ajax;
// }
// }
return AjaxResult.error( "上传图片异常,请联系管理员" );
}
}

@ -0,0 +1,154 @@
package com.chenxuan.controller;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.entity.dto.SysRoleDto;
import com.chenxuan.entity.model.SysRole;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.SysExportDataService;
import com.chenxuan.service.SysRoleService;
import com.chenxuan.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
/**
* @ClassNameSysRoleController
* @Description
* @Author Arno_Fu
* @CreatTime11/30/2019 - 10:36 AM
* @Version V1.0
*/
@RestController
@RequestMapping("/system/role")
public class SysRoleController extends BaseController {
@Autowired
private SysRoleService sysRoleService;
@Autowired
private SysExportDataService sysExportDataService;
/**
*
*
* @return
*/
@GetMapping("/list")
public AjaxResult list() {
return AjaxResult.success(sysRoleService.lists());
}
/**
*
*
* @param query
* @return
*/
@GetMapping("/page")
public AjaxResult page(Query query) {
return AjaxResult.success(sysRoleService.pages(query));
}
/**
*
*
* @param dto
* @return
*/
@LogAnnotation(module = "角色管理", operateType = OperateType.EXPORT)
@PostMapping("/export")
public AjaxResult export(@RequestBody SysRoleDto dto) {
return sysExportDataService.exportRoleInfo(dto);
}
/**
*
*/
@GetMapping(value = "/info")
public AjaxResult getInfo(@RequestParam("roleId") Long roleId) {
return AjaxResult.success(sysRoleService.getByPK(roleId));
}
/**
*
*/
@LogAnnotation(module = "角色管理", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@Validated @RequestBody SysRole role) {
if (!sysRoleService.checkRoleNameUnique(role)) {
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
if (!sysRoleService.checkRoleKeyUnique(role)) {
return AjaxResult.error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setCreateBy(SecurityUtils.getUsername());
role.setCreateTime(new Date());
return returnAjax(sysRoleService.insertRole(role));
}
/**
*
*/
@LogAnnotation(module = "角色管理", operateType = OperateType.UPDATE)
@PutMapping(value = "/update")
public AjaxResult update(@RequestBody SysRole role) {
sysRoleService.checkRoleAllowed(role);
if (!sysRoleService.checkRoleNameUnique(role)) {
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
if (!sysRoleService.checkRoleKeyUnique(role)) {
return AjaxResult.error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
role.setUpdateBy(SecurityUtils.getUsername());
role.setUpdateTime(new Date());
return returnAjax(sysRoleService.updateRole(role));
}
/**
*
*/
@LogAnnotation(module = "角色管理", operateType = OperateType.UPDATE)
@PutMapping("/dataScope")
public AjaxResult dataScope(@RequestBody SysRole role) {
sysRoleService.checkRoleAllowed(role);
return returnAjax(sysRoleService.authDataScope(role));
}
/**
*
*/
@LogAnnotation(module = "角色管理", operateType = OperateType.UPDATE)
@PutMapping("/changeStatus")
public AjaxResult changeStatus(@RequestBody SysRole role) {
sysRoleService.checkRoleAllowed(role);
role.setUpdateBy(SecurityUtils.getUsername());
return returnAjax(sysRoleService.updateRoleStatus(role));
}
/**
*
*/
@LogAnnotation(module = "角色管理", operateType = OperateType.DELETE)
@DeleteMapping("/delete")
public AjaxResult remove(@RequestParam("ids") Long[] ids) {
return returnAjax(sysRoleService.deleteRoleByIds(ids));
}
/**
*
*/
@GetMapping("/optionselect")
public AjaxResult optionselect() {
return AjaxResult.success(sysRoleService.selectRoleAll());
}
}

@ -0,0 +1,145 @@
package com.chenxuan.controller;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.base.entity.Query;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.UuidUtils;
import com.chenxuan.entity.model.SysUser;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.SysExportDataService;
import com.chenxuan.service.SysPostService;
import com.chenxuan.service.SysRoleService;
import com.chenxuan.service.SysUserService;
import com.chenxuan.utils.Md5;
import com.chenxuan.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
@RestController
@RequestMapping("/system/user")
public class SysUserController extends BaseController {
@Autowired
private SysUserService sysUserService;
@Autowired
private SysRoleService sysRoleService;
@Autowired
private SysPostService sysPostService;
@Autowired
private SysExportDataService sysExportDataService;
/**
* @Description:
* @Param: user
* @Return: TableDataInfo
**/
@GetMapping(value = "/page")
public AjaxResult page(Query query) {
return AjaxResult.success(sysUserService.page(query));
}
/**
*
*
* @param query
* @return
*/
@LogAnnotation(module = "用户管理", operateType = OperateType.EXPORT)
@GetMapping("/export")
public AjaxResult export(Query query) {
return sysExportDataService.exportUserInfo(query);
}
/**
*
*
* @param sysUser
* @return
*/
@LogAnnotation(module = "用户管理", operateType = OperateType.INSERT)
@PostMapping(value = "/add")
public AjaxResult add(@RequestBody SysUser sysUser) {
if (!sysUserService.checkUserNameUnique(sysUser.getUserName())) {
return AjaxResult.error("新增用户'" + sysUser.getUserName() + "'失败,登录账号已存在");
}
if (!sysUserService.checkPhoneUnique(sysUser)) {
return AjaxResult.error("新增用户'" + sysUser.getUserName() + "'失败,手机号码已存在");
}
String salt = UuidUtils.getUUID();
sysUser.setCreateTime(new Date());
sysUser.setPasswordSalt(salt);
sysUser.setPassword(Md5.getMD5Code(salt + sysUser.getPassword()));
return returnAjax(sysUserService.insertUser(sysUser));
}
/**
* id
*
* @param userId
* @return
*/
@GetMapping(value = "/info")
public AjaxResult getInfo(@RequestParam("userId") Long userId) {
AjaxResult ajax = AjaxResult.success(sysUserService.getById(userId));
ajax.put("postIds", sysPostService.selectPostListByUserId(userId));
ajax.put("roleIds", sysRoleService.selectRoleListByUserId(userId));
return ajax;
}
/**
*
*/
@LogAnnotation(module = "用户管理", operateType = OperateType.UPDATE)
@PutMapping(value = "/update")
public AjaxResult update(@RequestBody SysUser user) {
sysUserService.checkUserAllowed(user);
if (!sysUserService.checkPhoneUnique(user)) {
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
}
user.setUpdateBy(SecurityUtils.getUsername());
user.setUpdateTime(new Date());
return returnAjax(sysUserService.updateUser(user));
}
/**
*
*/
@LogAnnotation(module = "用户管理", operateType = OperateType.DELETE)
@DeleteMapping(value = "/delete")
public AjaxResult remove(@RequestParam("userIds") Long[] userIds) {
return returnAjax(sysUserService.deleteUserByIds(userIds) > 0 ? true : false);
}
/**
*
*/
@LogAnnotation(module = "用户管理", operateType = OperateType.UPDATE)
@PutMapping(value = "/resetPwd")
public AjaxResult resetPwd(@RequestBody SysUser user) {
sysUserService.checkUserAllowed(user);
String salt = UuidUtils.getUUID();
user.setPasswordSalt(salt);
user.setPassword(Md5.getMD5Code(salt + user.getPassword()));
user.setUpdateBy(SecurityUtils.getUsername());
return returnAjax(sysUserService.resetPwd(user));
}
/**
*
*/
@LogAnnotation(module = "用户管理", operateType = OperateType.UPDATE)
@PutMapping(value = "/changeStatus")
public AjaxResult changeStatus(@RequestBody SysUser user) {
sysUserService.checkUserAllowed(user);
user.setUpdateBy(SecurityUtils.getUsername());
return returnAjax(sysUserService.updateUserStatus(user));
}
}

@ -0,0 +1,80 @@
package com.chenxuan.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.bean.component.RedisCacheService;
import com.chenxuan.constants.Constants;
import com.chenxuan.entity.model.SysUserOnline;
import com.chenxuan.enums.OperateType;
import com.chenxuan.security.LoginUser;
import com.chenxuan.service.SysUserOnlineService;
import com.chenxuan.utils.StringUtils;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* @ClassNameSysUserOnlineController
* @Description 线
* @Author Arno_Fu
* @CreatTime12/23/2019 - 4:25 PM
* @Version V1.0
*/
@RestController
@RequestMapping("/monitor/online")
public class SysUserOnlineController {
@Autowired
private SysUserOnlineService sysUserOnlineService;
@Autowired
private RedisCacheService redisCacheService;
@GetMapping("/list")
public AjaxResult list(String ipaddr, String userName) {
Collection<String> keys = redisCacheService.keys( Constants.LOGIN_TOKEN_KEY + "*" );
List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
for (String key : keys) {
LoginUser user = redisCacheService.getCacheObject( key );
if (StringUtils.isNotEmpty( ipaddr ) && StringUtils.isNotEmpty( userName )) {
if (StringUtils.equals( ipaddr, user.getIpaddr() ) && StringUtils.equals( userName, user.getUsername() )) {
userOnlineList.add( sysUserOnlineService.selectOnlineByInfo( ipaddr, userName, user ) );
}
} else if (StringUtils.isNotEmpty( ipaddr )) {
if (StringUtils.equals( ipaddr, user.getIpaddr() )) {
userOnlineList.add( sysUserOnlineService.selectOnlineByIpaddr( ipaddr, user ) );
}
} else if (StringUtils.isNotEmpty( userName ) && StringUtils.isNotNull( user.getUser() )) {
if (StringUtils.equals( userName, user.getUsername() )) {
userOnlineList.add( sysUserOnlineService.selectOnlineByUserName( userName, user ) );
}
} else {
userOnlineList.add( sysUserOnlineService.loginUserToUserOnline( user ) );
}
}
Collections.reverse( userOnlineList );
userOnlineList.removeAll( Collections.singleton( null ) );
Page page = new Page( );
page.setRecords( userOnlineList );
page.setTotal(userOnlineList.size() );
return AjaxResult.success( page );
}
/**
* 退
*/
@LogAnnotation(module= "在线用户", operateType = OperateType.DELETE)
@DeleteMapping("/{tokenId}")
public AjaxResult forceLogout(@PathVariable String tokenId) {
redisCacheService.deleteObject( Constants.LOGIN_TOKEN_KEY + tokenId );
return AjaxResult.success();
}
}

@ -0,0 +1,20 @@
package com.chenxuan.controller;
import com.chenxuan.base.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "swaager测试")
@RestController
@RequestMapping("/test")
public class TestController extends BaseController {
@ApiOperation(value = "测试")
@PostMapping(value = "/info")
public String info() {
return "test Success";
}
}

@ -0,0 +1,32 @@
package com.chenxuan.controller.remote;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.service.remote.RemoteService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@Api(tags = "主变设置")
@RestController
@RequestMapping(value = "remote/busiMainDeviceRemote")
public class BusiMainDeviceRemoteController extends BaseController {
@Autowired
private RemoteService remoteService;
/**
* @Description: BusiMainDeviceController
* @Param:
* @Return:
**/
@ApiOperation(value = "获取设备总数")
@GetMapping(value = "/findTransformerSubTree")
public AjaxResult findTransformerSubTree() {
Map<String,Object> map = remoteService.findTransformerSubTree();
return AjaxResult.success(map);
}
}

@ -0,0 +1,90 @@
package com.chenxuan.controller.remote;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.constants.Constants;
import com.chenxuan.entity.model.SysMenu;
import com.chenxuan.entity.model.SysUser;
import com.chenxuan.security.LoginUser;
import com.chenxuan.security.service.CustomPermissionService;
import com.chenxuan.security.service.JwtTokenService;
import com.chenxuan.security.service.LoginService;
import com.chenxuan.service.SysMenuService;
import com.chenxuan.utils.ServletUtils;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Set;
/**
* @ClassNameSysLoginController
* @Description
* @Author Arno_Fu
* @CreatTime11/26/2019 - 1:47 PM
* @Version V1.0
*/
@Api(tags = "远程调用登录接口")
@RestController
@RequestMapping(value = BusiUrlConstants.REMOTE_LOGIN)
public class SysLoginRemoteController {
@Autowired
private LoginService loginService;
@Autowired
private SysMenuService menuService;
@Autowired
private CustomPermissionService customPermissionService;
@Autowired
private JwtTokenService jwtTokenService;
/**
* @return com.chenxuan.domain.AjaxResult
* @Description
*/
@PostMapping("/login")
public AjaxResult login(@RequestBody SysUser sysUser) {
AjaxResult ajax = AjaxResult.success();
String token = loginService.remoteLogin(sysUser.getUserName(), sysUser.getPassword());
ajax.put(Constants.TOKEN, token);
return ajax;
}
/**
* @Description
*
* @return com.chenxuan.base.entity.AjaxResult
*/
@GetMapping("getInfo")
public AjaxResult getInfo(){
SysUser user = getSysUser();
// 权限集合
Set<String> permissions = customPermissionService.getMenuPermission(user);
// 角色集合
Set<String> roles = customPermissionService.getRolePermission(user);
AjaxResult ajax = AjaxResult.success();
ajax.put("user", user);
ajax.put("roles", roles);
ajax.put("permissions", permissions);
return ajax;
}
/**
* @Description
*
* @return com.chenxuan.base.entity.AjaxResult
*/
@GetMapping("getRouters")
public AjaxResult getRouters(){
SysUser user = getSysUser();
List<SysMenu> menus = menuService.getMenuTreeByUserId(user);
return AjaxResult.success(menuService.buildMenus(menus));
}
private SysUser getSysUser() {
LoginUser loginUser = jwtTokenService.getLoginUser( ServletUtils.getRequest());
return loginUser.getUser();
}
}

@ -0,0 +1,70 @@
package com.chenxuan.controller.remote;
import com.chenxuan.base.controller.BaseController;
import com.chenxuan.base.entity.AjaxResult;
import com.chenxuan.bean.annotation.LogAnnotation;
import com.chenxuan.constants.BusiUrlConstants;
import com.chenxuan.entity.model.SysUser;
import com.chenxuan.enums.OperateType;
import com.chenxuan.service.SysExportDataService;
import com.chenxuan.service.SysPostService;
import com.chenxuan.service.SysRoleService;
import com.chenxuan.service.SysUserService;
import com.chenxuan.utils.SecurityUtils;
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.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.Date;
import java.util.Map;
@RestController
//@RequestMapping("/remote/user")
@RequestMapping(value = BusiUrlConstants.REMOTE_USER)
public class SysUserRemoteController extends BaseController {
@Autowired
private SysUserService sysUserService;
@Autowired
private SysRoleService sysRoleService;
@Autowired
private SysPostService sysPostService;
@Autowired
private SysExportDataService sysExportDataService;
/**
*
*
* @param param
* @return
*/
@LogAnnotation(module = "用户管理", operateType = OperateType.INSERT)
@RequestMapping(value = "/addUser",method = RequestMethod.POST)
public AjaxResult add(@RequestBody Map<String,Object> param) {
if (!sysUserService.checkUserNameUnique(param.get("userName").toString())) {
return AjaxResult.error("新增用户'" + param.get("userName") + "'失败,登录账号已存在");
}
if (!sysUserService.checkPhoneUnique(param.get("phone").toString())) {
return AjaxResult.error("新增用户'" + param.get("userName") + "'失败,手机号码已存在");
}
SysUser sysUser = new SysUser();
String userName = param.get("userName").toString();
String nickName= userName;
// if(userName.length()>8)
// {
// nickName = userName.substring(0,7);
// }
sysUser.setUserName(userName);
sysUser.setNickName(nickName);
sysUser.setCreateTime(new Date());
sysUser.setPassword(SecurityUtils.encryptPassword(param.get("password").toString()));
sysUser.setEmail(param.get("email").toString());
sysUser.setPhone(param.get("phone").toString());
return returnAjax(sysUserService.insertUser(sysUser));
}
}

@ -0,0 +1,26 @@
package com.chenxuan.entity.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
@Data
public class AmplitudeDto implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@ApiModelProperty(value="名称", name="name")
private String name;
/**
*
*/
@ApiModelProperty(value="数据集合", name="data")
private List<BigDecimal> data;
}

@ -0,0 +1,96 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class BusiAmpliComtradResultDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
public static final String PRISIDE = "P"; // 原边
public static final String SECSIDE = "S"; // 副边
public static final String APHASE = "A"; // A相
public static final String BPHASE = "B"; // B相
public static final String CPHASE = "C"; // C相
public static final String UINOUT = "U"; // 上侧
public static final String DINOUT = "D"; // 下侧
/**
* id
*/
@ApiModelProperty(value="id", name="id")
private String id;
/**
* id
*/
@ApiModelProperty(value="录播文件记录id", name="fileId")
private String fileId;
/**
* id
*/
@ApiModelProperty(value="主变id", name="mainId")
private String mainId;
/**
* id
*/
@ApiModelProperty(value="装置id", name="subId")
private String subId;
/**
* 1: 2:
*/
@ApiModelProperty(value="负载类型 1:空载 2:负载", name="loadType")
private String loadType;
/**
* (P: S:,device_type=1)
*/
@ApiModelProperty(value="原副边 (P: 原边 S:副边,仅当device_type=1时有效)", name="side")
private String side;
/**
* (A:A B:B C:C Q:;,device_type=1)
*/
@ApiModelProperty(value="相位 (A:A相 B:B相 C:C相 Q:全相;,仅当device_type=1时有效)", name="phase")
private String phase;
/**
* (U:/ D:/)
*/
@ApiModelProperty(value="上下侧或进出侧(U:上侧/进口侧 D:下侧/出口侧)", name="inOut")
private String inOut;
/**
*
*/
@ApiModelProperty(value="振动频率", name="frequency")
private String frequency;
/**
*
*/
@ApiModelProperty(value="最大振幅", name="maxAmplitude")
private String maxAmplitude;
/**
*
*/
@ApiModelProperty(value="创建时间", name="insTime")
private Date insTime;
/**
* hbaserowkey
*/
@ApiModelProperty(value="hbase中的rowkey", name="hbaseRowkey")
private String hbaseRowkey;
}

@ -0,0 +1,109 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class BusiAmpliRealDetailsDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ApiModelProperty(value = "id", name = "id")
private String id;
/**
* id
*/
@ApiModelProperty(value = "主变id", name = "mainId")
private String mainId;
/**
* id
*/
@ApiModelProperty(value = "装置id", name = "subId")
private String subId;
/**
* (P: S:,device_type=1)
*/
@ApiModelProperty(value = "原副边 (P: 原边 S:副边,仅当device_type=1时有效)", name = "side")
private String side;
/**
* (A:A B:B C:C Q:;,device_type=1)
*/
@ApiModelProperty(value = "相位 (A:A相 B:B相 C:C相 Q:全相;,仅当device_type=1时有效)", name = "phase")
private String phase;
/**
* (I:/ O:/)
*/
@ApiModelProperty(value = "上下侧或进出侧(I:上侧/进口侧 O:下侧/出口侧)", name = "inOut")
private String inOut;
/**
*
*/
@ApiModelProperty(value = "振动频率", name = "frequency")
private String frequency;
/**
*
*/
@ApiModelProperty(value = "最大振幅", name = "maxAmplitude")
private String maxAmplitude;
/**
*
*/
@ApiModelProperty(value = "创建时间", name = "insTime")
private String insTime;
/**
* hbaserowkey
*/
@ApiModelProperty(value = "hbase中的rowkey", name = "hbaseRowkey")
private String hbaseRowkey;
/**
*
*/
@ApiModelProperty(value = "负载类型", name = "loadType")
private String loadType;
/**
*
*/
@ApiModelProperty(value = "日增长率", name = "dayRate")
private String dayRate;
/**
*
*/
@ApiModelProperty(value = "月增长率", name = "monthRate")
private String monthRate;
/**
*
*/
@ApiModelProperty(value = "月偏差率", name = "deviationRate")
private String deviationRate;
/**
*
*/
@ApiModelProperty(value = "开始日期", name = "startTime")
private String startTime;
/**
*
*/
@ApiModelProperty(value = "终止日期", name = "endTime")
private String endTime;
}

@ -0,0 +1,127 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassNameBusiAmpliRealDto
* @Description Dto
* @AuthorJordan_Li
* @CreatTime6/22/2020 - 16:20 PM
* @Version V1.0
*/
@Data
public class BusiAmpliRealDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
public static final String D = "day"; //日
public static final String W = "week"; //周
public static final String M = "month"; //月
/**
* id
*/
@ApiModelProperty(value = "id", name = "id")
private String id;
/**
* id
*/
@ApiModelProperty(value = "主变id", name = "mainId")
private String mainId;
/**
*
*/
@ApiModelProperty(value = "设备名称", name = "deviceName")
private String deviceName;
/**
* id
*/
@ApiModelProperty(value = "装置id", name = "subId")
private String subId;
/**
* 1: 2:
*/
@ApiModelProperty(value = "负载类型 1:空载 2:负载", name = "loadType")
private String loadType;
/**
* (P: S:,device_type=1)
*/
@ApiModelProperty(value = "原副边 (P: 原边 S:副边,仅当device_type=1时有效)", name = "side")
private String side;
/**
* (A:A B:B C:C Q:;,device_type=1)
*/
@ApiModelProperty(value = "相位 (A:A相 B:B相 C:C相 Q:全相;,仅当device_type=1时有效)", name = "phase")
private String phase;
/**
* (U:/ D:/)
*/
@ApiModelProperty(value = "上下侧或进出侧(U:上侧/进口侧 D:下侧/出口侧)", name = "inOut")
private String inOut;
/**
*
*/
@ApiModelProperty(value = "振动频率", name = "frequency")
private String frequency;
/**
*
*/
@ApiModelProperty(value = "最大振幅", name = "maxAmplitude")
private String maxAmplitude;
/**
*
*/
@ApiModelProperty(value = "创建时间", name = "insTime")
private String insTime;
/**
* hbaserowkey
*/
@ApiModelProperty(value = "hbase中的rowkey", name = "hbaseRowkey")
private String hbaseRowkey;
/**
*
*/
@ApiModelProperty(value = "开始日期", name = "startTime")
private String startTime;
/**
*
*/
@ApiModelProperty(value = "终止日期", name = "endTime")
private String endTime;
/**
*
*/
@ApiModelProperty(value = "周期类型", name = "dateType")
private String dateType;
/**
*
*/
@ApiModelProperty(value = "统计时间", name = "createTime")
private String createTime;
/**
* id
*/
@ApiModelProperty(value = "录播文件id", name = "fileId")
private String fileId;
}

@ -0,0 +1,119 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author Carrey Zheng
* @create 2020-07-13 5:56 PM
**/
@Data
public class BusiAmpliThresholdConfDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ApiModelProperty(value = "id", name = "id")
private String id;
/**
* id
*/
@ApiModelProperty(value = "主变id", name = "mainId")
private String mainId;
/**
*
*/
@ApiModelProperty(value = "主变名称", name = "deviceName")
private String deviceName;
/**
* id
*/
@ApiModelProperty(value = "装置id", name = "subId")
private String subId;
/**
*
*/
@ApiModelProperty(value = "装置名称", name = "subDeviceName")
private String subDeviceName;
/**
* (1: 2: 3:)
*/
@ApiModelProperty(value = "装置类别 (1:振动装置 2:噪声装置 3:中心点装置)", name = "deviceType")
private String deviceType;
/**
* (P: S:,device_type=1)
*/
@ApiModelProperty(value = "原副边 (P: 原边 S:副边,仅当device_type=1时有效)", name = "side")
private String side;
/**
* (A:A B:B C:C O:;,device_type=1)
*/
@ApiModelProperty(value = "相位 (A:A相 B:B相 C:C相 O:全相;,仅当device_type=1时有效)", name = "phase")
private String phase;
/**
* (I:/ O:/)
*/
@ApiModelProperty(value = "上下侧或进出侧(I:上侧/进口侧 O:下侧/出口侧)", name = "inAndOut")
private String inAndOut;
/**
* ID
*/
@ApiModelProperty(value = "频率段ID", name = "frequencyId")
private String frequencyId;
/**
*
*/
@ApiModelProperty(value = "频率", name = "frequency")
private String frequency;
/**
*
*/
@ApiModelProperty(value = "频率状态", name = "state")
private String state;
/**
* (mm/s2)
*/
@ApiModelProperty(value = "振幅阈值(mm/s2)", name = "amplitude")
private String amplitude;
/**
* (%)
*/
@ApiModelProperty(value = "振动幅值日增长率(%)", name = "dayRate")
private String dayRate;
/**
* (%)
*/
@ApiModelProperty(value = "振动幅值月增长率(%)", name = "monthRate")
private String monthRate;
/**
* (%)
*/
@ApiModelProperty(value = "振动幅值月偏差率(%)", name = "deviationRate")
private String deviationRate;
/**
*
*/
@ApiModelProperty(value = "创建时间", name = "insTime")
private String insTime;
}

@ -0,0 +1,129 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
public class BusiCalcParamConfDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ApiModelProperty(name = "id", value = "主键id")
private String id;
/**
* ID
*/
@ApiModelProperty(name = "mainEquipmentId", value = "主设备ID")
private String mainEquipmentId;
/**
* 1 2 3
*/
@ApiModelProperty(name = "weightLevel", value = "1第一级分项权重 2第二级 3第三级")
private String weightLevel;
/**
* 1: 2: 3: 4:
*/
private String hltype;
/**
*
*/
@ApiModelProperty(name = "name", value = "计算指标的名称")
private String name;
/**
*
*/
@ApiModelProperty(name = "pname", value = "上级计算指标名称")
private String pname;
/**
*
*/
@ApiModelProperty(name = "description", value = "描述")
private String description;
/**
*
*/
@ApiModelProperty(name = "value", value = "权重值")
private BigDecimal value;
/**
* AB:01
*/
@ApiModelProperty(name = "abValueFlag", value = "是否显示AB值:0——否1——是")
private String abValueFlag;
/**
* a
*/
@ApiModelProperty(name = "aValue", value = "a值")
private BigDecimal aValue;
/**
* b
*/
@ApiModelProperty(name = "bValue", value = "b值")
private BigDecimal bValue;
/**
*
*/
@ApiModelProperty(name = "warningValue", value = "注意值")
private String warningValue;
/**
* 1 2:
*/
@ApiModelProperty(name = "model", value = "评分模型1升 2:降")
private String model;
/**
*
*/
@ApiModelProperty(name = "unit", value = "单位")
private String unit;
/**
* : 0: 1
*/
@ApiModelProperty(name = "isAttend", value = "是否参与评测: 0:不参与 1参与")
private String isAttend;
/**
*
*/
@ApiModelProperty(name = "createTime", value = "创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty(name = "createUser", value = "创建人")
private String createUser;
/**
*
*/
@ApiModelProperty(name = "sortNum", value = "排序")
private Integer sortNum;
/**
*
*/
@ApiModelProperty(name = "children", value = "下级计算指标列表")
private List<BusiCalcParamConfDto> children;
}

@ -0,0 +1,90 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author Carrey Zheng
* @create 2020-06-22 3:01 PM
**/
@Data
public class BusiCenterRealDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ApiModelProperty(name = "id", value = "主键id")
private String id;
/**
* id
*/
@ApiModelProperty(name = "mainId", value = "主变id")
private String mainId;
/**
*
*/
@ApiModelProperty(name = "deviceName", value = "设备名称")
private String deviceName;
/**
*
*/
@ApiModelProperty(name = "frequency", value = "振动频率")
private String frequency;
/**
*
*/
@ApiModelProperty(name = "maxAmplitude", value = "最大振幅")
private String maxAmplitude;
/**
*
*/
@ApiModelProperty(name = "insTime", value = "创建时间")
private String insTime;
/**
* hbaserowkey
*/
@ApiModelProperty(name = "hbaseRowkey", value = "hbase中的rowkey")
private String hbaseRowkey;
/**
*
*/
@ApiModelProperty(name = "gatherTimeList", value = "统计时间集合")
private List<String> gatherTimeList;
/**
*
*/
@ApiModelProperty(name = "maxAmplitudeList", value = "最大幅值集合")
private List<String> maxAmplitudeList;
/**
*
*/
@ApiModelProperty(name = "createTime", value = "统计时间")
private String createTime;
/**
*
*/
@ApiModelProperty(name = "startTime", value = "开始日期")
private String startTime;
/**
*
*/
@ApiModelProperty(name = "endTime", value = "结束日期")
private String endTime;
}

@ -0,0 +1,93 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassNameBusiCenterThresholdConfVo
* @Description Vo
* @AuthorJordan_Li
* @CreatTime6/8/2020 - 13:15 PM
* @Version V1.0
*/
@Data
public class BusiCenterThresholdConfDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ApiModelProperty(name = "id", value = "主键id")
private String id;
/**
* id
*/
@ApiModelProperty(name = "mainId", value = "主变id")
private String mainId;
/**
* id
*/
@ApiModelProperty(name = "subId", value = "主变装置id")
private String subId;
/**
*
*/
@ApiModelProperty(name = "deviceName", value = "主变名称")
private String deviceName;
/**
* (A)
*/
@ApiModelProperty(name = "positive", value = "正电流(A)")
private String positive;
/**
* (A)
*/
@ApiModelProperty(name = "negative", value = "负电流(A)")
private String negative;
/**
* (%)
*/
@ApiModelProperty(name = "dayRate", value = "中心点电流日增长率(%)")
private String dayRate;
/**
* (%)
*/
@ApiModelProperty(name = "monthRate", value = "中心点电流月增长率(%)")
private String monthRate;
/**
* (%)
*/
@ApiModelProperty(name = "deviationRate", value = "中心点电流月偏差率(%)")
private String deviationRate;
/**
*
*/
@ApiModelProperty(name = "insTime", value = "创建时间")
private String insTime;
/**
*
*/
@ApiModelProperty(name = "startTime", value = "开始时间")
private String startTime;
/**
*
*/
@ApiModelProperty(name = "endTime", value = "结束时间")
private String endTime;
}

@ -0,0 +1,31 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author buck_guo
*/
@Data
public class BusiIedparamDto extends Query implements Serializable {
/**
*
*/
@ApiModelProperty(value="振动传感器", name="nodeId")
private String nodeId;
/**
*
*/
@ApiModelProperty(value="振动分量", name="nodeName")
private String nodeName;
/**
*
*/
@ApiModelProperty(value="振动类型", name="nodeType")
private String nodeType;
}

@ -0,0 +1,79 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class BusiMainDeviceDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ApiModelProperty(name = "id", value = "主键id")
private String id;
/**
*
*/
@ApiModelProperty(name = "deviceName", value = "主变名称")
private String deviceName;
/**
* (N(0): Y(1):)
*/
@ApiModelProperty(name = "state", value = "主变状态 (N(0):非正常 Y(1):正常)")
private String state;
/**
*
*/
@ApiModelProperty(name = "deliveryTime", value = "投运日期")
private String deliveryTime;
/**
*
*/
@ApiModelProperty(name = "deviceModel", value = "设备型号")
private String deviceModel;
/**
*
*/
@ApiModelProperty(name = "manufacturer", value = "制造厂家名称")
private String manufacturer;
/**
*
*/
@ApiModelProperty(name = "factoryTime", value = "出厂日期")
private String factoryTime;
/**
*
*/
@ApiModelProperty(name = "factoryNumber", value = "出厂序号")
private String factoryNumber;
/**
* 使寿()
*/
@ApiModelProperty(name = "designLife", value = "设计使用寿命(年)")
private String designLife;
/**
*
*/
@ApiModelProperty(name = "systemCode", value = "系统编码")
private String systemCode;
/**
* hbaserowkey
*/
@ApiModelProperty(name = "hbaseRowkey", value = "hbase中的rowkey")
private String hbaseRowkey;
}

@ -0,0 +1,94 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @ClassNameBusiNoiseRealDto
* @Description Dto
* @AuthorJordan_Li
* @CreatTime6/22/2020 - 15:50 PM
* @Version V1.0
*/
@Data
public class BusiNoiseRealDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ApiModelProperty(name = "id", value = "主键id")
private String id;
/**
* id
*/
@ApiModelProperty(name = "mainId", value = "主变id")
private String mainId;
/**
*
*/
@ApiModelProperty(name = "deviceName", value = "设备名称")
private String deviceName;
/**
*
*/
@ApiModelProperty(name = "frequency", value = "振动频率")
private String frequency;
/**
*
*/
@ApiModelProperty(name = "maxAmplitude", value = "最大振幅")
private String maxAmplitude;
/**
*
*/
@ApiModelProperty(name = "insTime", value = "创建时间")
private String insTime;
/**
* hbaserowkey
*/
@ApiModelProperty(name = "hbaseRowkey", value = "hbase中的rowkey")
private String hbaseRowkey;
/**
*
*/
@ApiModelProperty(name = "gatherTimeList", value = "统计时间集合")
private List<String> gatherTimeList;
/**
*
*/
@ApiModelProperty(name = "maxAmplitudeList", value = "最大幅值集合")
private List<String> maxAmplitudeList;
/**
*
*/
@ApiModelProperty(name = "createTime", value = "统计时间")
private String createTime;
/**
*
*/
@ApiModelProperty(name = "startTime", value = "开始时间")
private String startTime;
/**
*
*/
@ApiModelProperty(name = "endTime", value = "结束时间")
private String endTime;
}

@ -0,0 +1,87 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassNameBusiNoiseThresholdConfVo
* @Description Vo
* @AuthorJordan_Li
* @CreatTime6/11/2020 - 16:16 PM
* @Version V1.0
*/
@Data
public class BusiNoiseThresholdConfDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ApiModelProperty(name = "id", value = "主键id")
private String id;
/**
* id
*/
@ApiModelProperty(name = "mainId", value = "主变id")
private String mainId;
/**
* id
*/
@ApiModelProperty(name = "subId", value = "主变装置id")
private String subId;
/**
*
*/
@ApiModelProperty(name = "deviceName", value = "主变名称")
private String deviceName;
/**
* (db)
*/
@ApiModelProperty(name = "noise", value = "噪声阈值(db)")
private String noise;
/**
* (%)
*/
@ApiModelProperty(name = "dayRate", value = "噪声日增长率(%)")
private String dayRate;
/**
* (%)
*/
@ApiModelProperty(name = "monthRate", value = "噪声月增长率(%)")
private String monthRate;
/**
* (%)
*/
@ApiModelProperty(name = "deviationRate", value = "噪声月偏差率(%)")
private String deviationRate;
/**
*
*/
@ApiModelProperty(name = "insTime", value = "创建时间")
private String insTime;
/**
*
*/
@ApiModelProperty(name = "startTime", value = "开始时间")
private String startTime;
/**
*
*/
@ApiModelProperty(name = "endTime", value = "结束时间")
private String endTime;
}

@ -0,0 +1,67 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@Data
public class BusiParamBindDto extends Query implements Serializable {
/**
* id
*/
@ApiModelProperty(value="主键", name="id")
private String id;
/**
* id
*/
@ApiModelProperty(value="主设备ID,源自表busi_main_device.id", name="mainId")
private String mainId;
/**
* id
*/
@ApiModelProperty(value="装置ID,源自表busi_sub_device.id", name="subId")
private String subId;
/**
* code
*/
@ApiModelProperty(value="传感器code,源自表busi_sub_device.sensor_code", name="sensorCode")
private String sensorCode;
/**
*
*/
@ApiModelProperty(value="振动传感器", name="nodeId")
private String nodeId;
/**
*
*/
@ApiModelProperty(value="振动分量", name="nodeName")
private String nodeName;
/**
* (Hz)
*/
@ApiModelProperty(value="频率(Hz)", name="frequency")
private String frequency;
/**
*
*/
@ApiModelProperty(name = "deviceName", value = "设备名称")
private String deviceName;
/**
*
*/
@ApiModelProperty(name = "subDeviceName", value = "装置名称")
private String subDeviceName;
}

@ -0,0 +1,110 @@
package com.chenxuan.entity.dto;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
* @author Carrey Zheng
* @create 2020-06-30 2:48 PM
**/
@Data
public class BusiSubDeviceDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
public static final Integer Ampli = 1; //传感器
public static final Integer NOISE = 2; //噪声
public static final Integer CENTER = 3; //中心点
/**
* id
*/
@ApiModelProperty(name = "id", value = "主键id")
private String id;
/**
* id
*/
@ApiModelProperty(name = "mainId", value = "主变id")
private String mainId;
/**
*
*/
@ApiModelProperty(name = "deviceName", value = "设备名称")
private String deviceName;
/**
*
*/
@ApiModelProperty(name = "subDeviceName", value = "装置名称")
private String subDeviceName;
/**
*
*/
@ApiModelProperty(name = "sensorCode", value = "传感器编码")
private String sensorCode;
/**
* (1: 2: 3:)
*/
@ApiModelProperty(name = "deviceType", value = "装置类别 (1:振动装置 2:噪声装置 3:中心点装置)")
private Integer deviceType;
/**
* (P: S:,device_type=1)
*/
@ApiModelProperty(name = "side", value = "原副边 (P: 原边 S:副边,仅当device_type=1时有效)")
private String side;
/**
* (A:A B:B C:C Q:;,device_type=1)
*/
@ApiModelProperty(name = "phase", value = "相位 (A:A相 B:B相 C:C相 Q:全相;,仅当device_type=1时有效)")
private String phase;
/**
* (I:/ O:/)
*/
@ApiModelProperty(name = "inOut", value = "上下侧或进出侧(I:上侧/进口侧 O:下侧/出口侧)")
private String inOut;
/**
*
*/
@ApiModelProperty(name = "insTime", value = "创建日期")
private String insTime;
/**
*
*/
@ApiModelProperty(name = "startTime", value = "开始时间")
private String startTime;
/**
*
*/
@ApiModelProperty(name = "endTime", value = "结束时间")
private String endTime;
/**
*
*/
@ApiModelProperty(name = "params", value = "请求参数")
private Object params;
public Map<String, Object> getParams() {
if (params == null) {
return new HashMap<>();
}
return JSON.parseObject(JSONObject.toJSONString(params), Map.class);
}
}

@ -0,0 +1,80 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class BusiTransformerRealDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ApiModelProperty(name = "id", value = "主键id")
private String id;
/**
* id
*/
@ApiModelProperty(name = "mainId", value = "主变id")
private String mainId;
/**
*
*/
@ApiModelProperty(name = "deviceName", value = "设备名称")
private String deviceName;
/**
* (P: S:,device_type=1)
*/
@ApiModelProperty(name = "side", value = "原副边 (P: 原边 S:副边,仅当device_type=1时有效)")
private String side;
/**
* (kV)
*/
@ApiModelProperty(name = "voltage", value = "电压(kV)")
private BigDecimal voltage;
/**
* (A)
*/
@ApiModelProperty(name = "current", value = "电流(A)")
private BigDecimal current;
/**
*
*/
@ApiModelProperty(name = "insTime", value = "创建时间")
private String insTime;
/**
*
*/
@ApiModelProperty(name = "startTime", value = "开始时间")
private String startTime;
/**
*
*/
@ApiModelProperty(name = "endTime", value = "结束时间")
private String endTime;
/**
* hbaserowkey
*/
@ApiModelProperty(name = "hbaseRowkey", value = "hbase中的rowkey")
private String hbaseRowkey;
/**
*
*/
@ApiModelProperty(name = "createTime", value = "导出时间")
private String createTime;
}

@ -0,0 +1,195 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
public class BusiVibrationContrastDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 线kV
*/
@ApiModelProperty(name = "voltage", value = "线电压kV")
private String voltage;
/**
* 线A
*/
@ApiModelProperty(name = "electricity", value = "线电流A")
private String electricity;
/**
* - kV
*/
@ApiModelProperty(name = "uAmplitudeList", value = "电压-幅值 横坐标kV")
private List<BigDecimal> uAmplitudeList;
/**
* - A
*/
@ApiModelProperty(name = "iAmplitudeList", value = "电流-幅值 横坐标A")
private List<BigDecimal> iAmplitudeList;
/**
*
*/
@ApiModelProperty(name = "coreUList", value = "电压铁芯振动幅值")
private List<AmplitudeDto> coreUList;
/**
*
*/
@ApiModelProperty(name = "windingIList", value = "电流绕组振动幅值")
private List<AmplitudeDto> windingIList;
/**
* 线
*/
@ApiModelProperty(name = "uAccList", value = "当前线电压下铁芯振动幅值")
private List<BigDecimal> uAccList;
/**
* 线
*/
@ApiModelProperty(name = "iAccList", value = "当前线电流下绕组振动幅值")
private List<BigDecimal> iAccList;
/**
*
*/
@ApiModelProperty(name = "frequencyList", value = "频率集合")
private List<BigDecimal> frequencyList;
/**
*
*/
@ApiModelProperty(name = "maxCoreAmplitude", value = "铁芯最大幅值")
private BigDecimal maxCoreAmplitude;
/**
*
*/
@ApiModelProperty(name = "maxWindingAmplitude", value = "绕组最大幅值")
private BigDecimal maxWindingAmplitude;
/**
*
*/
@ApiModelProperty(name = "coreFrequency", value = "铁芯对应频率")
private String coreFrequency;
/**
*
*/
@ApiModelProperty(name = "windingFrequency", value = "绕组对应频率")
private String windingFrequency;
public String getVoltage() {
return voltage;
}
public void setVoltage(String voltage) {
this.voltage = voltage;
}
public String getElectricity() {
return electricity;
}
public void setElectricity(String electricity) {
this.electricity = electricity;
}
public List<BigDecimal> getuAmplitudeList() {
return uAmplitudeList;
}
public void setuAmplitudeList(List<BigDecimal> uAmplitudeList) {
this.uAmplitudeList = uAmplitudeList;
}
public List<BigDecimal> getiAmplitudeList() {
return iAmplitudeList;
}
public void setiAmplitudeList(List<BigDecimal> iAmplitudeList) {
this.iAmplitudeList = iAmplitudeList;
}
public List<AmplitudeDto> getCoreUList() {
return coreUList;
}
public void setCoreUList(List<AmplitudeDto> coreUList) {
this.coreUList = coreUList;
}
public List<AmplitudeDto> getWindingIList() {
return windingIList;
}
public void setWindingIList(List<AmplitudeDto> windingIList) {
this.windingIList = windingIList;
}
public List<BigDecimal> getuAccList() {
return uAccList;
}
public void setuAccList(List<BigDecimal> uAccList) {
this.uAccList = uAccList;
}
public List<BigDecimal> getiAccList() {
return iAccList;
}
public void setiAccList(List<BigDecimal> iAccList) {
this.iAccList = iAccList;
}
public List<BigDecimal> getFrequencyList() {
return frequencyList;
}
public void setFrequencyList(List<BigDecimal> frequencyList) {
this.frequencyList = frequencyList;
}
public BigDecimal getMaxCoreAmplitude() {
return maxCoreAmplitude;
}
public void setMaxCoreAmplitude(BigDecimal maxCoreAmplitude) {
this.maxCoreAmplitude = maxCoreAmplitude;
}
public BigDecimal getMaxWindingAmplitude() {
return maxWindingAmplitude;
}
public void setMaxWindingAmplitude(BigDecimal maxWindingAmplitude) {
this.maxWindingAmplitude = maxWindingAmplitude;
}
public String getCoreFrequency() {
return coreFrequency;
}
public void setCoreFrequency(String coreFrequency) {
this.coreFrequency = coreFrequency;
}
public String getWindingFrequency() {
return windingFrequency;
}
public void setWindingFrequency(String windingFrequency) {
this.windingFrequency = windingFrequency;
}
}

@ -0,0 +1,199 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @ClassNameBusiWarningVo
* @Description Vo
* @AuthorJordan_Li
* @CreatTime6/18/2020 - 16:29 PM
* @Version V1.0
*/
@Data
public class BusiWarningDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
public static final String SOLVE = "0"; // 已处理
public static final String UNSOLVE = "1"; // 未处理
/**
* id
*/
@ApiModelProperty(name = "id", value = "主键id")
private String id;
/**
* ID,busi_sub_device.id
*/
@ApiModelProperty(name = "subId", value = "装置ID,源自表busi_sub_device.id")
private String subId;
/**
*
*/
@ApiModelProperty(name = "warnTime", value = "告警时间")
private String warnTime;
/**
* 1: 2: 3: 4: 5:
* 6: 7: 8: 9: 10:
* 11:IED 12: 13: 14:
*/
@ApiModelProperty(name = "warnType", value = "告警分类")
private String warnType;
/**
* 1: 2:
*/
@ApiModelProperty(name = "loadType", value = "负载类型 1:空载 2:负载")
private String loadType;
/**
*
*/
@ApiModelProperty(name = "sampleValue", value = "采样值")
private String sampleValue;
/**
* (A)(db)(mm/s2)
*/
@ApiModelProperty(name = "valueUnit", value = "采样值单位(A)(db)(mm/s2)")
private String valueUnit;
/**
* //
*/
@ApiModelProperty(name = "warnDesc", value = "告警信息/设备名称/设备安装位置")
private String warnDesc;
/**
* 0: 1: 2:
*/
@ApiModelProperty(name = "warnLevel", value = "告警级别 0:高 1:中 2:低")
private String warnLevel;
/**
* 0: 1:
*/
@ApiModelProperty(name = "state", value = "处理状态 0:已处理 1:未处理")
private String state;
/**
*
*/
@ApiModelProperty(name = "process", value = "处理结果描述")
private String process;
/**
* id
*/
@ApiModelProperty(name = "processUser", value = "处理人id")
private String processUser;
/**
*
*/
@ApiModelProperty(name = "processTime", value = "处理时间")
private String processTime;
/**
* hbase
*/
@ApiModelProperty(name = "hbaseKey", value = "hbase同步主键")
private String hbaseKey;
/**
*
*/
@ApiModelProperty(name = "deviceLocation", value = "装置位置")
private String deviceLocation;
/**
*
*/
@ApiModelProperty(name = "amplitudeThreshold", value = "振幅阈值")
private String amplitudeThreshold;
/**
*
*/
@ApiModelProperty(name = "amplitudeRate", value = "振幅增长率")
private String amplitudeRate;
/**
*
*/
@ApiModelProperty(name = "currentThreshold", value = "电流阈值")
private String currentThreshold;
/**
*
*/
@ApiModelProperty(name = "currentRate", value = "电流增长率")
private String currentRate;
/**
*
*/
@ApiModelProperty(name = "noiseThreshold", value = "噪声阈值")
private String noiseThreshold;
/**
*
*/
@ApiModelProperty(name = "noiseRate", value = "噪声增长率")
private String noiseRate;
/**
*
*/
@ApiModelProperty(name = "rate", value = "增长率")
private String rate;
/**
*
*/
@ApiModelProperty(name = "threshold", value = "预警值")
private String threshold;
/**
*
*/
@ApiModelProperty(name = "deviceType", value = "设备类型")
private String deviceType;
/**
*
*/
@ApiModelProperty(name = "warningSum", value = "告警次数")
private String warningSum;
/**
* id
*/
@ApiModelProperty(name = "mainId", value = "主变id")
private String mainId;
/**
*
*/
@ApiModelProperty(name = "deviceName", value = "装置名称")
private String deviceName;
/**
*
*/
@ApiModelProperty(name = "startTime", value = "开始时间")
private String startTime;
/**
*
*/
@ApiModelProperty(name = "endTime", value = "结束时间")
private String endTime;
}

@ -0,0 +1,80 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class ScheduleJobDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@ApiModelProperty(name = "jobId", value = "参数主键")
private Long jobId;
/**
* cron
*/
@ApiModelProperty(name = "cronExpression", value = "cron表达式")
private String cronExpression;
/**
*
*/
@ApiModelProperty(name = "beanName", value = "服务名称")
private String beanName;
/**
*
*/
@ApiModelProperty(name = "methodName", value = "方法名称")
private String methodName;
/**
*
*/
@ApiModelProperty(name = "methodParams", value = "方法参数")
private String methodParams;
/**
* 1. 2.
*/
@ApiModelProperty(name = "status", value = "状态 1.启动 2.暂停")
private String status;
/**
*
*/
@ApiModelProperty(name = "createBy", value = "创建者")
private String createBy;
/**
*
*/
@ApiModelProperty(name = "createTime", value = "创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty(name = "updateBy", value = "更新者")
private String updateBy;
/**
*
*/
@ApiModelProperty(name = "updateTime", value = "更新时间")
private Date updateTime;
/**
*
*/
@ApiModelProperty(name = "remark", value = "备注")
private String remark;
}

@ -0,0 +1,80 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SysLoginLogDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@ApiModelProperty(name = "loginId", value = "登录id")
private Long loginId;
/**
*
*/
@ApiModelProperty(name = "userName", value = "用户账号")
private String userName;
/**
* 0 1
*/
@ApiModelProperty(name = "status", value = "登录状态 0成功 1失败")
private String status;
/**
* IP
*/
@ApiModelProperty(name = "ipaddr", value = "登录IP地址")
private String ipaddr;
/**
*
*/
@ApiModelProperty(name = "loginLocation", value = "登录地点")
private String loginLocation;
/**
*
*/
@ApiModelProperty(name = "browser", value = "浏览器类型")
private String browser;
/**
*
*/
@ApiModelProperty(name = "os", value = "操作系统")
private String os;
/**
*
*/
@ApiModelProperty(name = "msg", value = "提示消息")
private String msg;
/**
* 访
*/
@ApiModelProperty(name = "loginTime", value = "访问时间")
private Date loginTime;
/**
*
*/
@ApiModelProperty(name = "beginTime", value = "开始时间")
private String beginTime;
/**
*
*/
@ApiModelProperty(name = "endTime", value = "结束时间")
private String endTime;
}

@ -0,0 +1,116 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SysOperLogDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@ApiModelProperty(name = "operId", value = "日志主键")
private Long operId;
/**
*
*/
@ApiModelProperty(name = "modules", value = "操作模块")
private String modules;
/**
* 0 1 2 3
*/
@ApiModelProperty(name = "businessType", value = "业务类型")
private Integer businessType;
/**
*
*/
@ApiModelProperty(name = "method", value = "请求方法")
private String method;
/**
*
*/
@ApiModelProperty(name = "requestMethod", value = "请求方式")
private String requestMethod;
/**
* 0 1 2
*/
@ApiModelProperty(name = "operateType", value = "操作类别")
private Integer operateType;
/**
*
*/
@ApiModelProperty(name = "operName", value = "操作人员")
private String operName;
/**
*
*/
@ApiModelProperty(name = "deptName", value = "部门名称")
private String deptName;
/**
* url
*/
@ApiModelProperty(name = "operUrl", value = "操作url")
private String operUrl;
/**
*
*/
@ApiModelProperty(name = "operIp", value = "操作地址")
private String operIp;
/**
*
*/
@ApiModelProperty(name = "operLocation", value = "操作地点")
private String operLocation;
/**
*
*/
@ApiModelProperty(name = "operParam", value = "请求参数")
private String operParam;
/**
*
*/
@ApiModelProperty(name = "jsonResult", value = "返回参数")
private String jsonResult;
/**
* 0 1
*/
@ApiModelProperty(name = "status", value = "操作状态")
private Integer status;
/**
*
*/
@ApiModelProperty(name = "errorMsg", value = "错误消息")
private String errorMsg;
/**
*
*/
@ApiModelProperty(name = "operTime", value = "操作时间")
private Date operTime;
/**
*
*/
@ApiModelProperty(name = "businessTypes", value = "业务类型数组")
private Integer[] businessTypes;
}

@ -0,0 +1,98 @@
package com.chenxuan.entity.dto;
import com.chenxuan.base.entity.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SysRoleDto extends Query implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ApiModelProperty(name = "roleId", value = "角色ID")
private Long roleId;
/**
*
*/
@ApiModelProperty(name = "roleName", value = "角色名称")
private String roleName;
/**
*
*/
@ApiModelProperty(name = "roleKey", value = "角色权限字符串")
private String roleKey;
/**
*
*/
@ApiModelProperty(name = "roleSort", value = "显示顺序")
private Integer roleSort;
/**
* 1 2 3 4
*/
@ApiModelProperty(name = "dataScope", value = "数据范围")
private String dataScope;
/**
* 0 1
*/
@ApiModelProperty(name = "status", value = "角色状态")
private String status;
/**
* 0 2
*/
@ApiModelProperty(name = "delFlag", value = "删除标志")
private String delFlag;
/**
*
*/
@ApiModelProperty(name = "createBy", value = "创建者")
private String createBy;
/**
*
*/
@ApiModelProperty(name = "createTime", value = "创建时间")
private Date createTime;
/**
*
*/
@ApiModelProperty(name = "updateBy", value = "更新者")
private String updateBy;
/**
*
*/
@ApiModelProperty(name = "updateTime", value = "更新时间")
private Date updateTime;
/**
*
*/
@ApiModelProperty(name = "remark", value = "备注")
private String remark;
/**
*
*/
@ApiModelProperty(name = "beginTime", value = "开始时间")
private String beginTime;
/**
*
*/
@ApiModelProperty(name = "endTime", value = "结束时间")
private String endTime;
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save