轨道交通项目迁出

This commit is contained in:
walker-sheng 2020-11-19 10:05:24 +08:00
commit ee5c36469d
1532 changed files with 223670 additions and 0 deletions

33
.gitignore vendored Normal file
View File

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

117
.mvn/wrapper/MavenWrapperDownloader.java vendored Normal file
View File

@ -0,0 +1,117 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;
public class MavenWrapperDownloader {
private static final String WRAPPER_VERSION = "0.5.6";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";
/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";
/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}
}

BIN
.mvn/wrapper/maven-wrapper.jar vendored Normal file

Binary file not shown.

2
.mvn/wrapper/maven-wrapper.properties vendored Normal file
View File

@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

310
mvnw vendored Normal file
View File

@ -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.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /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.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.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 Normal file
View File

@ -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 Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%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.6/maven-wrapper-0.5.6.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.6/maven-wrapper-0.5.6.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%

112
pom.xml Normal file
View File

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.5.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>club.joylink</groupId>
<artifactId>rtss</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>rtss</name>
<description> Rail transit simulation system</description>
<properties>
<java.version>11</java.version>
<pagehelper.version>4.1.1</pagehelper.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.3</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.3.0</version>
</dependency>
<!-- javax.validation -->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<!--spring切面aop依赖 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<!-- swagger -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</dependency>
<dependency>
<groupId>com.digitalpetri.modbus</groupId>
<artifactId>modbus-codec</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,15 @@
package club.joylink.rtss;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@EnableScheduling
public class RtssApplication {
public static void main(String[] args) {
SpringApplication.run(RtssApplication.class, args);
}
}

View File

@ -0,0 +1,28 @@
package club.joylink.rtss.configuration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
@Configuration
public class CrosConfiguration {
private CorsConfiguration buildConfig() {
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.addAllowedOrigin("*"); // 1
corsConfiguration.addAllowedHeader("*"); // 2
corsConfiguration.addAllowedMethod("*"); // 3
corsConfiguration.setAllowCredentials(true);
return corsConfiguration;
}
@Bean
public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", buildConfig()); // 4
return new CorsFilter(source);
}
}

View File

@ -0,0 +1,23 @@
package club.joylink.rtss.configuration;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.convert.converter.Converter;
import org.springframework.util.StringUtils;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
@Slf4j
public class LocalDateConverter implements Converter<String, LocalDate> {
private DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
@Override
public LocalDate convert(String dateStr) {
if(StringUtils.hasText(dateStr)) {
return LocalDate.parse(dateStr, this.formatter);
} else {
return null;
}
}
}

View File

@ -0,0 +1,52 @@
package club.joylink.rtss.configuration;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
@Configuration
public class LocalDateTimeSerializerConfig {
/**
* Date格式化字符串
*/
private static final String DATE_FORMAT = "yyyy-MM-dd";
/**
* DateTime格式化字符串
*/
private static final String DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
/**
* Time格式化字符串
*/
private static final String TIME_FORMAT = "HH:mm:ss";
@Bean
public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
return builder -> {
builder.serializerByType(LocalDateTime.class,
new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(DATETIME_FORMAT)));
builder.deserializerByType(LocalDateTime.class,
new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(DATETIME_FORMAT)));
builder.serializerByType(LocalDate.class,
new LocalDateSerializer(DateTimeFormatter.ofPattern(DATE_FORMAT)));
builder.deserializerByType(LocalDate.class,
new LocalDateDeserializer(DateTimeFormatter.ofPattern(DATE_FORMAT)));
builder.serializerByType(LocalTime.class,
new LocalTimeSerializer(DateTimeFormatter.ofPattern(TIME_FORMAT)));
builder.deserializerByType(LocalTime.class,
new LocalTimeDeserializer(DateTimeFormatter.ofPattern(TIME_FORMAT)));
};
}
}

View File

@ -0,0 +1,31 @@
package club.joylink.rtss.configuration;
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.http.converter.StringHttpMessageConverter;
import org.springframework.web.client.RestTemplate;
import java.nio.charset.Charset;
@Configuration
public class RestTemplateConfiguration {
@Bean
public RestTemplate restTemplate(ClientHttpRequestFactory factory){
StringHttpMessageConverter m = new StringHttpMessageConverter(Charset.forName("UTF-8"));
RestTemplate restTemplate = new RestTemplate(factory);
restTemplate.getMessageConverters().add(0, m);
return restTemplate;
}
@Bean
public ClientHttpRequestFactory simpleClientHttpRequestFactory(){
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setReadTimeout(5000);//单位为ms
factory.setConnectTimeout(5000);//单位为ms
return factory;
}
}

View File

@ -0,0 +1,60 @@
package club.joylink.rtss.configuration;
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
import club.joylink.rtss.controller.advice.LicenseInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.util.ArrayList;
import java.util.List;
@Configuration
public class WebConfig implements WebMvcConfigurer {
@Autowired
private AuthenticateInterceptor authenticateInterceptor;
@Autowired
private LicenseInterceptor licenseInterceptor;
@Override
public void addInterceptors(InterceptorRegistry registry) {
List<String> licenseWhiteList = new ArrayList<>();
licenseWhiteList.add("/api/license/validate");
licenseWhiteList.add("/api/license/local");
licenseWhiteList.add("/api/licensing/**");
registry.addInterceptor(licenseInterceptor).excludePathPatterns(licenseWhiteList);
List<String> whiteList = new ArrayList<>();
whiteList.add("/swagger-ui.html");
whiteList.add("/swagger-resources/**");
whiteList.add("/webjars/springfox-swagger-ui/**");
whiteList.add("/api/login/**");
whiteList.add("/api/wxpat/**");
whiteList.add("/api/sms/**");
whiteList.add("/api/register/**");
whiteList.add("/api/userinfo/**");
whiteList.add("/api/wechatpay/receive");
whiteList.add("/api/alipay/receive");
whiteList.add("/api/applet/**");
whiteList.add("/api/wxauth/**");
whiteList.add("/api/distribute/permission");
whiteList.add("/api/v1/jointTraining/permission");
whiteList.add("/api/jointTraining/permission");
whiteList.add("/api/user/bind/wm");
// 运行图工具
whiteList.add("/api/rpTools/**");
whiteList.add("/api/license/validate");
whiteList.add("/api/license/local");
registry.addInterceptor(authenticateInterceptor).excludePathPatterns(whiteList);
}
@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(new LocalDateConverter());
WebMvcConfigurer.super.addFormatters(registry);
}
}

View File

@ -0,0 +1,18 @@
package club.joylink.rtss.configuration.configProp;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix="common")
@Getter
@Setter
public class OtherConfig {
private String env;
private String licenseSecretKey;
}

View File

@ -0,0 +1,40 @@
package club.joylink.rtss.configuration.configProp;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix="tencent-cloud")
@Getter
@Setter
public class TencentCloudConfig {
private String domainUri;
private String appId;
private String appKey;
private Boolean allowSend;
/**
* 获取指定模板单发短信的url
* @return
*/
public String getSendsmsUrl() {
return new StringBuilder(this.domainUri)
.append("/sendsms?sdkappid=").append(this.appId).toString();
}
/**
* 获取指定模板群发短信的url
* @return
*/
public String sendMultiSmsUrl() {
return new StringBuilder(this.domainUri)
.append("/sendmultisms2?sdkappid=").append(this.appId).toString();
}
}

View File

@ -0,0 +1,111 @@
package club.joylink.rtss.configuration.configProp;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Component
@ConfigurationProperties(prefix="wechat")
@Getter
@Setter
public class WeChatConfig {
private String domainUri;
private String appId;
private String appSecret;
private String wxApiUrl;
private String wmBaseUrl;
private String spAppId;
private String spAppSecret;
/** 微信模块基础url */
private String wxModuleUrl;
/**
* 微信小程序配置
*/
private WeChatMiniProgramConfig mini;
public String getWxApiUrl(String redirect, String state) {
return String.format(wxApiUrl, redirect, state);
}
public String getWmLoginUrl(String state) {
return String.format(wmBaseUrl, "login", state);
}
public String getWmBindUrl(Long userId) {
return String.format(wmBaseUrl, "bind", userId);
}
public String getPermissionDistributeUrl(String state) {
return String.format(wmBaseUrl, "distribute", state);
}
public String getWmJointRoomUrl(String state) {
return String.format(wmBaseUrl, "joint", state);
}
public String getWmSimulationUrl(String state) {
return String.format(wmBaseUrl, "simulation", state);
}
/**
* 获取页面access_token的url
* @return
*/
public String getPageAccessTokenUrl(String code) {
return new StringBuilder(this.domainUri)
.append("/sns/oauth2/access_token?appid=").append(this.appId)
.append("&secret=").append(this.appSecret)
.append("&code=").append(code)
.append("&grant_type=authorization_code").toString();
}
public String getJsAccessTokenUrl(String jsCode) {
return new StringBuilder(this.domainUri)
.append("/sns/oauth2/jscode2session?appid=").append(this.spAppId)
.append("&secret=").append(this.spAppSecret)
.append("&js_code=").append(jsCode)
.append("&grant_type=authorization_code").toString();
}
public String getUserInfoUrl(String access_token, String openid) {
return new StringBuilder(this.domainUri)
.append("/sns/userinfo?access_token=").append(access_token)
.append("&openid=").append(openid)
.append("&lang=zh_CN").toString();
}
public String getCode2SessionUrl(String wmCode) {
return new StringBuilder(this.domainUri)
.append("/sns/jscode2session?appid=").append(spAppId)
.append("&secret=").append(this.spAppSecret)
.append("&js_code=").append(wmCode)
.append("&grant_type=authorization_code").toString();
}
public String getWxModuleBatchGetUserInfoUrl() {
return this.wxModuleUrl + "/api/user/batchget";
}
/**
* 获取微信服务模块打标签url
* @return
*/
public String getWxApiTagUrl() {
return this.wxModuleUrl+"/api/user/tagging";
}
public String getMsgSecCheckUrl() {
return this.wxModuleUrl + "/api/wm/msgSecCheck";
}
}

View File

@ -0,0 +1,16 @@
package club.joylink.rtss.configuration.configProp;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
public class WeChatMiniProgramConfig {
private boolean accessTokenTaskOn;
private String appId;
private String appSecret;
}

View File

@ -0,0 +1,631 @@
package club.joylink.rtss.constants;
public interface BusinessConsts {
String Default_NationCode = "86";
/**
* 状态 1-启用/有效
*/
String STATUS_USE = "1";
/**
* 状态 0-禁用/无效
*/
String STATUS_NOT_USE = "0";
/**
* 验证码有效期: 单位 分钟
*/
int VDCODE_TIMEOUT = 5;
String MAIL_SUBJECT_VALIDATE_CODE = "【琏课堂】注册验证码";
String MAIL_CONTENT_VALIDATE_CODE = "【琏课堂】验证码为%s有效期 %s 分钟,请在页面输入完成验证。";
String LOGIN_USER_KEY = "user";
/**
* 用户类型-实训用户
*/
String ROLE_01 = "01";
/**
* 用户类型-地图生产者
*/
String ROLE_02 = "02";
/**
* 用户类型-课程生产者
*/
String ROLE_03 = "03";
/**
* 用户类型-系统管理员
*/
String ROLE_04 = "04";
/**
* 用户类型-超级管理员
*/
String ROLE_05 = "05";
/**
* 用户类型-销售人员
*/
String ROLE_06 = "06";
/**
* 用户默认密码
*/
String DEFAULT_PASSWORD = "123456";
/**贵州装备智造学院默认导入学生用户密码*/
String GZB_DEFAULT_PASSWORD = "666666";
String SYSTEM_BIGSCREEN = "bigScreen";
String SYSTEM_PLAN = "plan";
String SYSTEM_LESSON = "";
String EMAIL_FORMAT = "^[A-Za-z0-9\\u4e00-\\u9fa5_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$";
String PHONE_FORMAT = "((\\+86|0086)?\\s*)((134[0-8]\\d{7})|(((13([0-3]|[5-9]))|(14[5-9])|15([0-3]|[5-9])|(16(2|[5-7]))|17([0-3]|[5-8])|18[0-9]|19(1|[8-9]))\\d{8})|(14(0|1|4)0\\d{7})|(1740([0-5]|[6-9]|[10-12])\\d{7}))";
/**
* 发布审核
*/
interface ReleaseReview {
/**
* 未发布状态
*/
String RELEASE_STATUS_01 = "0";
/**
* 已发布待审核状态
*/
String RELEASE_STATUS_02 = "1";
/**
* 发布成功状态
*/
String RELEASE_STATUS_03 = "2";
/**
* 驳回状态
*/
String RELEASE_STATUS_04 = "3";
}
/**
* 缓存前缀
* @author sheng
*/
interface CachePrefix {
String Map = "Map_Detail_";
String Map_3d = "Map_3d_";
String Plan = "Plan_Detail_";
String Map_Passenger_Flow = "Map_Passenger_Flow_";
}
/**
* webSocket订阅主题
*/
interface WebSocketSubscribeTopic {
String Common = "/topic/message";
/** 综合演练房间 */
String Room = "/queue/room/%s";
/** 仿真 */
String Simulation = "/queue/simulation/%s";
String Sandbox3D = "/queue/simulation/jl3d/%s";
String TrainDrive3D = "/queue/simulation/drive/%s";
String PassengerFlow = "/queue/simulation/passenger/%s";
String AssistantSimulation = "/topic/simulation/assistant/%s";
String WeiAngU3dSimulation = "/topic/simulation/wgu3d/%s";
}
/** 设备类型 */
interface DeviceType {
String Link = "01";
String Switch = "02";
String Section = "03";
String Signal = "04";
String StationControl = "05";
String StationStand = "06";
}
/** 车站计数器类型 */
interface CounterType {
/** 区故解 */
String type01 = "01";
/** 总人解 */
String type02 = "02";
}
interface Permission {
/**
* 权限类型
* @author Jade
*/
interface Type {
/** 教学 */
String Type01 = "01";
/** 考试 */
String Type02 = "02";
/** 仿真 */
String Type03 = "03";
/** 大屏 */
String Type04 = "04";
/** 琏计划 */
String Type05 = "05";
/** 三维 */
String Type06 = "06";
}
/**
* 试用时间单位
*/
interface TimeUnit {
/** 年 */
String TimeUnit01 = "01";
/** 月 */
String TimeUnit02 = "02";
/** 日 */
String TimeUnit03 = "03";
/** 时 */
String TimeUnit04 = "04";
/** 分(默认) */
String TimeUnit05 = "05";
/** 秒 */
String TimeUnit06 = "06";
}
/**
* 来源
*/
interface Source {
/** 来自订单 */
String Source01 = "01";
/** 来自订单权限分发打包 */
String Source02 = "02";
/** 来自个人权限分发 */
String Source03 = "03";
/** 来自个人权限打包分发 */
String Source04 = "04";
/** 来自个人权限转赠 */
String Source05 = "05";
}
}
interface Order {
/**
* 订单类型
* @author sheng
*/
interface Type {
/** 个人 */
String Type01 = "01";
/** 企业合同 */
String Type02 = "02";
/** 合约赠送 */
String Type03 = "03";
/** 内部分配 */
String Type04 = "04";
}
/**
* 业务类型
* @author sheng
*/
interface BizType {
/** 正常购买 */
String Type01 = "01";
/** 续费 */
String Type02 = "02";
/** 增加权限数量 */
String Type03 = "03";
/** 续费+增加权限数量 */
String Type04 = "04";
}
/**
* 支付类型
* @author sheng
*/
interface PayType {
/** 合同线下支付 */
String Type01 = "01";
/** 微信支付 */
String Type02 = "02";
/** 支付宝支付 */
String Type03 = "03";
}
/**
* 支付状态
* @author sheng
*/
interface PayStatus {
/** 待支付 */
String Status01 = "01";
/** 已支付 */
String Status02 = "02";
/** 取消 */
String Status03 = "03";
}
/**
* 订单状态
* @author sheng
*/
interface Status {
/** 未完成 */
String Status01 = "01";
/** 完成 */
String Status02 = "02";
/** 取消 */
String Status03 = "03";
}
}
interface Training {
interface Status {
/**
* 有效
*/
String Status01 = "01";
/**
* 无效
*/
String Status02 = "02";
}
/**
* 模式
* @author Jade
*/
interface Mode {
/**
* 测验模式
*/
String Mode04 = "04";
/**
* 考试
*/
String Mode05 = "05";
}
/**
* 实训状态类型
* @author Jade
*/
interface StatusType {
/** 开始 */
String Type01 = "01";
/** 结束 */
String Type02 = "02";
}
/**
* 实训生成类型
*/
interface GenerateType {
/** 自动 */
String GenerateType01 = "01";
/** 人工 */
String GenerateType02 = "02";
}
enum Type {
Section("区段实训"), Switch("道岔实训"), Signal("信号机实训"), Stand("站台实训"), Station("车站实训"), ControlConvertMenu("控制权实训"), TrainWindow("车次窗实训"), LimitControl("限速实训"), Driver("司机驾驶实训"), Train("列车实训");
private String description;
Type(String description) {
this.description = description;
}
public String getDescription() {
return description;
}
}
}
interface Exam {
/**
* 考试结果
* @author Jade
*/
interface Result {
/**
* 未计算
*/
String Result01 = "01";
/**
* 通过
*/
String Result02 = "02";
/**
* 未通过
*/
String Result03 = "03";
/**
* 已放弃
*/
String Result04 = "04";
}
/**考试试题作答结果/原因*/
interface QuestionCause{
String INCORRECT = "操作错误";
String OVERTIME = "操作超时";
String PERFECT = "操作完美";
String CORRECT = "操作正确,但没有达到最优操作时间";
}
}
/**
* 运行图
*/
interface RunPlan {
/**
* 车站类型
*/
interface StationType {
/**
* 下行
*/
String Type01 = "01";
/**
* 上行
*/
String Type02 = "02";
/**
* 特殊始发站和终点站
*/
String Type03 = "03";
}
/**
* 运行方向类型
*/
interface DirectionType {
/**
* 上行
*/
String Type02 = "2";
/**
* 下行
*/
String Type01 = "1";
}
}
interface MapPrd {
interface PrdType {
/**
* 现地类型
*/
String Type01 = "01";
/**
* 行调类型
*/
String Type02 = "02";
/**
* 综合演练
*/
String Type03 = "03";
/**
* 司机模拟驾驶
*/
String Type04 = "04";
/**
* 派班工作站
*/
String Type05 = "05";
}
}
interface Lesson {
enum PrdInfo {
prdType01("【ATS现地工作站实操】" ,"该课程基于国内知名信号厂商的真实ATS系统利用虚拟现实、人工智能等成熟的互联网技术并结合一线运营人员的宝贵经验实现了对现地工作站的原理级仿真。"),
prdType02("【ATS行调工作站实操】","该课程基于国内知名信号厂商的真实ATS系统利用虚拟现实、人工智能等成熟的互联网技术并结合一线运营人员的宝贵经验实现了对行调工作站的原理级仿真。") ;
private String name;
private String remarks;
PrdInfo(String name, String remarks) {
this.name =name;
this.remarks =remarks;
}
public String getName() {
return name;
}
public String getRemarks() {
return remarks;
}
}
interface Version{
String originalVersion = "0.0";
}
}
interface Section {
interface SectionType {
/**
* 物理区段
*/
String Type01 = "01";
/**
* 逻辑区段
*/
String Type02 = "02";
/**
* 道岔物理区段
*/
String Type03 = "03";
/**
* 道岔计轴区段
*/
String Type04 = "04";
}
}
interface User {
interface Tag {
/**
* 注册用户
*/
String Register = "100";
/**
* 订阅者
*/
String Subscriber = "101";
/**
* 销售人员
*/
String Seller = "102";
/**
* 订阅者 & 销售人员
*/
String Subscriber_Seller = "103";
}
}
interface Task {
/**
* 类型
*/
interface Type {
/** 实训生成任务 */
String Type01 = "01";
}
/**
* 状态
*/
interface Status {
/** 未开始 */
String Status01 = "01";
/** 进行中 */
String Status02 = "02";
/** 已完成 */
String Status03 = "03";
/** 待执行 */
String Status04 = "04";
/** 已取消 */
String Status05 = "05";
}
}
interface JointTraining {
/**
* 用户状态
*/
interface UserState {
/**
* 扫码
*/
String State01 = "01";
/**
* 其他
*/
String State02 = "02";
/**
* 被踢出房间
*/
String State03 = "03";
}
/**
* 房间状态
*/
interface RoomState {
/**
* 准备中
*/
String State01 = "01";
/**
* 仿真开始
*/
String State02 = "02";
/**
* 房间销毁
*/
String State03 = "03";
}
}
/**
* 仿真会话
*/
interface ConversationMessage {
/**
* 会话消息类型
*/
interface Type {
/* 文字 **/
String Type01 = "01";
/* 语音 **/
String Type02 = "02";
}
}
/**
* 线路常量
*/
interface RealLine {
interface Direction{
String LEFT = "left";
String RIGHT = "right";
}
}
interface SystemNoticeType{
String email ="01";
String sms ="02";
}
/**
* 作答模式
*/
interface AnswerMode {
/**
* 练习模式
*/
String Mode01 = "01";
/**
* 模拟考试模式
*/
String Mode02 = "02";
/**
* 小程序题库模拟竞技
*/
String Mode03 = "03";
/**
* 小程序错题库
*/
String Mode04 = "04";
}
/**
* 理论题类型
*/
enum TheoryType {
/** 单选题*/
select,
/** 多选题*/
multi,
/**判断题*/
judge,
/**填空题*/
fill,
/**问答*/
answer
}
}

View File

@ -0,0 +1,48 @@
package club.joylink.rtss.constants;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import lombok.Getter;
/**
* 客户端枚举
*/
@Getter
public enum Client {
Joylink("1", "joylink", "实训平台"),
Design("2", "design", "设计平台"),
Assistant("4", "linkassistant", "琏课堂助手"),
WeiAngU3d("5", "unitywa5", "Unity3D"),
Rate("6", "rate", "竞赛平台"),
Referee("7", "referee", "裁判平台"),
;
private String id;
private String secret;
private String name;
Client(String id, String secret, String name) {
this.id = id;
this.secret = secret;
this.name = name;
}
/**
* 根据客户端id查询客户端对象
* @param clientId
* @return
*/
public static Client getByIdAndSecret(String clientId, String secret) {
Client[] values = Client.values();
for (Client value : values) {
if(value.getId().equals(clientId)
&& value.getSecret().equals(secret)) {
return value;
}
}
throw BusinessExceptionAssertEnum.INVALID_CLIENT.exception("未找到id为[%s]的客户端");
}
}

View File

@ -0,0 +1,23 @@
package club.joylink.rtss.constants;
import lombok.Getter;
@Getter
public enum EmailSubject {
Valid_Code("【琏课堂】验证码", "【琏课堂】验证码为%s有效期 %s 分钟,请在页面输入完成验证。"),
System_Notice("【玖琏科技】平台通知", "%s%s");
private String subject;
private String template;
EmailSubject(String subject, String template) {
this.subject = subject;
this.template = template;
}
public String buildContent(Object... params) {
return String.format(this.template, params);
}
}

View File

@ -0,0 +1,33 @@
package club.joylink.rtss.constants;
import lombok.Getter;
@Getter
public enum MapPrdTypeEnum {
LOCAL("01", "ATS现地工作站"),
CENTER("02", "ATS行调工作站"),
JOINT("03", "综合演练云平台"),
DRIVER("04", "司机模拟驾驶系统"),
SCHEDULING("05", "派班工作站"),
ISCS("06", "ISCS工作站"),
BIG_SCREEN("07", "大屏工作站"),
;
private String code;
private String msg;
MapPrdTypeEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
public static MapPrdTypeEnum getMapPrdTypeEnumByCode(String code) {
for (MapPrdTypeEnum value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}
}

View File

@ -0,0 +1,20 @@
package club.joylink.rtss.constants;
import lombok.Getter;
/**
* 地图状态
*/
@Getter
public enum MapStatus {
Online("1"),
Offline("0"),
Delete("-1")
;
private String code;
MapStatus(String code) {
this.code = code;
}
}

View File

@ -0,0 +1,13 @@
package club.joylink.rtss.constants;
import lombok.Getter;
@Getter
public enum MapSystemType {
Lesson,
Exam,
Simulation,
Plan,
;
}

View File

@ -0,0 +1,20 @@
package club.joylink.rtss.constants;
import lombok.Getter;
@Getter
public enum PermissionDistributeSourceEnum {
FromUser("01", "来自用户"),
FromOrder("02","来自订单"),
Gift("03", "赠送")
;
private String code;
private String info;
PermissionDistributeSourceEnum(String code, String info) {
this.code = code;
this.info = info;
}
}

View File

@ -0,0 +1,34 @@
package club.joylink.rtss.constants;
import lombok.Getter;
import java.util.Objects;
@Getter
public enum PermissionTypeEnum {
Lesson("01", "课程"),
Exam("02", "考试"),
Simulation("03", "仿真"),
Teaching_Package("04", "实训平台教学权限包"),
;
private String code;
private String msg;
PermissionTypeEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
public static PermissionTypeEnum getPermissionTypeByCode(String code) {
for (PermissionTypeEnum value : PermissionTypeEnum.values()) {
if (Objects.equals(code, value.code)) {
return value;
}
}
throw new RuntimeException(String.format("code为[%s]的PermissionTypeEnum不存在", code));
}
}

View File

@ -0,0 +1,32 @@
package club.joylink.rtss.constants;
/**
* 项目
*/
public enum Project {
/** 自己项目 */
DEFAULT,
/** 西铁院定制项目 */
XTY,
/** 南铁院定制项目 */
NTY,
/** 西安地铁定制项目 */
XADT,
/** 贵州装备职业学院项目 */
GZB,
/** 哈尔滨项目 */
HEB,
/** 行调竞赛实训系统 */
DRTS,
/** 北京交通大学项目(客流量科研) */
BJD,
;
public static boolean isDefault(Project project) {
return DEFAULT.equals(project);
}
public static boolean isLoginWithCreateSimulation(Project project) {
return Project.DRTS.equals(project) || Project.BJD.equals(project);
}
}

View File

@ -0,0 +1,70 @@
package club.joylink.rtss.constants;
import lombok.Getter;
import java.util.Arrays;
import java.util.List;
/**
* 项目设备类型
*/
@Getter
public enum ProjectDeviceType {
/* -----------plc device start---------- */
/** 道岔 */
SWITCH,
/** 信号机 */
SIGNAL,
/** 屏蔽门控制柜 */
PSC,
/** 屏蔽门 */
PSD,
/** 端头控制盒(屏蔽门控制盒) */
PSL,
/** IBP盘 */
IBP,
/** PLC网关 */
PLC_GATEWAY,
/* -----------plc device end---------- */
/* -----------client device start---------- */
/** 教员机instructor machine */
IM,
/** 调度工作站control workstation */
CW,
/** 现地工作站local workstation */
LW,
/** 联锁工作站interlock workstation */
ILW,
/** 虚拟综合后备盘(Integrated Back-Up Panel) */
VR_IBP,
/** 大屏工作站large screen workstation */
LSW,
/** 列车驾驶终端 */
DRIVE,
/** 虚拟站台屏蔽门终端 */
VR_PSD,
/** 现地综合监控 */
ISCS_LW,
/** 中心综合监控 */
ISCS_CW,
/** 车辆段终端 */
DEPOT,
/** 虚拟CCTV */
CCTV,
/** 虚拟电子沙盘 */
SANDBOX,
/* -----------client device end---------- */
;
public static List<ProjectDeviceType> PlcDeviceList() {
return Arrays.asList(PLC_GATEWAY,
PSC,
PSD,
PSL,
IBP,
SWITCH,
SIGNAL);
}
}

View File

@ -0,0 +1,21 @@
package club.joylink.rtss.constants;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum RaceStatusEnum {
/** 尚未开始 */
Not_Started(0),
/** 正在进行中 */
In_Progress(1),
/** 已经结束了 */
Over(2),
/** 暂停中 */
Pause(3),
;
private int code;
}

View File

@ -0,0 +1,25 @@
package club.joylink.rtss.constants;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum RaceUserStatusEnum {
/** 尚未参赛 */
Not_Yet_Entered(0),
/** 进入赛场 */
Enter_The_Arena(1),
/** 理论赛场 */
Theory_The_Arena(2),
/** 完成理论 */
Finish_Theory_The_Arena(5),
/** 实操赛场 */
Practical_The_Arena(3),
/** 完成实操赛场 */
Finish_Practical_The_Arena(6),
/** 完成比赛 */
Finish(4),
;
private int code;
}

View File

@ -0,0 +1,34 @@
package club.joylink.rtss.constants;
import lombok.Getter;
/**
* 地图线路code
*/
@Getter
public enum RealLineEnum {
Whole("000", "全部线路"),
ChengDu_Line1("01", "成都一号线"),
FuZhou_Line1("02", "福州一号线"),
BeiJing_Line1("03", "北京一号线"),
ChengDu_Line3("04", "成都三号线"),
NingBo_Line1("06", "宁波一号线"),
HarBin_Line1("07", "哈尔滨一号线"),
Foshan_Tram("08", "佛山有轨电车"),
;
/**
* 数据字典皮肤风格编号
*/
private String code;
/**
* 数据字典皮肤风格名称
*/
private String name;
RealLineEnum(String code, String name) {
this.code = code;
this.name = name;
}
}

View File

@ -0,0 +1,19 @@
package club.joylink.rtss.constants;
import lombok.Getter;
@Getter
public enum RoleEnum {
User("01"),
LessonCreater("03"),
Admin("04"),
SuperAdmin("05"),
;
private String role;
RoleEnum(String role) {
this.role = role;
}
}

View File

@ -0,0 +1,20 @@
package club.joylink.rtss.constants;
import lombok.Getter;
@Getter
public enum SaleGoodsTypeEnum {
Type_Invalid("0", "无效"),
Type_Valid("1", "有效");
private String code;
private String msg;
SaleGoodsTypeEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
}

View File

@ -0,0 +1,20 @@
package club.joylink.rtss.constants;
import lombok.Getter;
@Getter
public enum SaleOrderPayStatusEnum {
Unpaid("01", "待支付"),
Paid("02", "已支付"),
Cancel("03", "取消支付"),
No_Need("04", "无需支付");
private String code;
private String msg;
SaleOrderPayStatusEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
}

View File

@ -0,0 +1,16 @@
package club.joylink.rtss.constants;
public enum SaleOrderPayWaysEnum {
Offline("01", "线下"),
Alipay("02", "支付宝"),
Wechat("03", "微信");
private String code;
private String msg;
SaleOrderPayWaysEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
}

View File

@ -0,0 +1,29 @@
package club.joylink.rtss.constants;
import lombok.Getter;
@Getter
public enum SaleOrderTypeEnum {
Individual("01", "个人"),
Business_Contract("02", "企业合同"),
Contract_Gift("03", "合约赠送"),
Internal_Distribution("04", "内部分配");
private String code;
private String msg;
SaleOrderTypeEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
public static SaleOrderTypeEnum getSaleOrderTypeByCode(String code) {
for (SaleOrderTypeEnum value : SaleOrderTypeEnum.values()) {
if (value.getCode().equals(code)) {
return value;
}
}
throw new RuntimeException(String.format("code为[%s]的SaleOrderTypeEnum不存在", code));
}
}

View File

@ -0,0 +1,13 @@
package club.joylink.rtss.constants;
public enum SortDirection {
/**
* 正序
*/
Asc,
/**
* 逆序
*/
Desc
}

View File

@ -0,0 +1,18 @@
package club.joylink.rtss.constants;
import lombok.Getter;
@Getter
public enum StatusEnum {
Invalid("0", "无效"),
Valid("1", "有效");
private String code;
private String msg;
StatusEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
}

View File

@ -0,0 +1,74 @@
package club.joylink.rtss.constants;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import lombok.Getter;
import java.util.Objects;
@Getter
public enum SystemEnv {
Dev("1", "dev"),
Test("2", "test"),
Prd("3", "prd"),
Local("9", "local"),
;
private String id;
private String name;
SystemEnv(String id, String name) {
this.id = id;
this.name = name;
}
public static String getSystemEnvIdByName(String name) {
SystemEnv[] envs = SystemEnv.values();
for (SystemEnv env : envs) {
if(Objects.equals(env.getName(), name)) {
return env.id;
}
}
throw BusinessExceptionAssertEnum.ARGUMENT_ILLEGAL.exception(String.format("没有对应系统环境[%s]", name));
}
public static boolean isPrdEnv(String name) {
SystemEnv[] envs = SystemEnv.values();
for (SystemEnv env : envs) {
if(Objects.equals(env.getName(), name)) {
if(Prd.equals(env)) {
return true;
}
break;
}
}
return false;
}
public static boolean isDevEnv(String name) {
SystemEnv[] envs = SystemEnv.values();
for (SystemEnv env : envs) {
if(Objects.equals(env.getName(), name)) {
if(Dev.equals(env)) {
return true;
}
break;
}
}
return false;
}
public static boolean isLocalEnv(String name) {
SystemEnv[] envs = SystemEnv.values();
for (SystemEnv env : envs) {
if(Objects.equals(env.getName(), name)) {
if(Local.equals(env)) {
return true;
}
break;
}
}
return false;
}
}

View File

@ -0,0 +1,32 @@
package club.joylink.rtss.constants;
import lombok.Getter;
/**
* 腾讯短信服务模板
*/
@Getter
public enum TencentSMSTemplate {
VerificationCode("玖琏科技", 123003, 2),
VerificationCode_International("JiuLian", 453984, 2),
OrderNotice("玖琏科技", 260120, 4),
SystemNotice("玖琏科技", 0000, 3),
;
private String sign;
private int tplId;
/** 参数个数 */
private int paramsCount;
TencentSMSTemplate(String sign, int tplId, int paramsCount) {
this.sign = sign;
this.tplId = tplId;
this.paramsCount = paramsCount;
}
public boolean validateParamsCount(int size) {
return this.paramsCount == size;
}}

View File

@ -0,0 +1,19 @@
package club.joylink.rtss.constants;
import lombok.Getter;
@Getter
public enum TreeNodeTypeEnum {
Map,
Prd,
Lesson,
Chapter,
Exam,
Training,
MapSystem,
System,
Plan,
TrainingType,
OperateType,
;
}

View File

@ -0,0 +1,18 @@
package club.joylink.rtss.constants;
import lombok.Getter;
@Getter
public enum UserPermissionStatusEnum {
Invalid("0", "无效"),
getInvalid("1", "有效");
private String code;
private String msg;
UserPermissionStatusEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
}

View File

@ -0,0 +1,63 @@
package club.joylink.rtss.constants;
public interface WxConstants {
String ACCESS_TOKEN = "access_token";
String EXPIRES_IN = "expires_in";
String ERRCODE = "errcode";
String ERRMSG = "errmsg";
/**
* 通过微信调用的接口
* @author Jade
*/
public interface WxApi {
/**
* 用户登录
*/
String LOGIN = "login";
/**
* 分发权限获取
*/
String DISTRIBUTE = "distribute";
/**
* 联合演练
*/
String JOINT = "joint";
/**
* 仿真
*/
String SIMULATION = "simulation";
}
/**
* 小程序二维码路径
*/
interface WmQrcodePath {
/**
* 登陆二维码
*/
String Login = "login";
/**
* 登陆二维码
*/
String Bind = "bind";
/**
* 权限分发二维码
*/
String PermissionDistribute = "distribute";
/**
* 综合演练房间二维码
*/
String Joint = "joint";
/**
* 仿真分发二维码
*/
String Simulation = "simulation";
}
}

View File

@ -0,0 +1,61 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.services.ICompanyService;
import club.joylink.rtss.vo.client.CompanyQueryVO;
import club.joylink.rtss.vo.client.CompanyVO;
import club.joylink.rtss.vo.client.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = {"公司单位管理接口"})
@RestController
@RequestMapping("/api/company")
public class CompanyController {
@Autowired
private ICompanyService iCompanyService;
@ApiOperation(value = "添加公司信息")
@PostMapping
public CompanyVO create(@RequestBody @Validated CompanyVO company) {
CompanyVO vo = this.iCompanyService.create(company);
return vo;
}
@ApiOperation(value = "获取公司列表")
@GetMapping
public List<CompanyVO> queryAll() {
List<CompanyVO> list = this.iCompanyService.queryOrganizations();
return list;
}
@ApiOperation(value = "分页获取公司列表")
@GetMapping("paging")
public PageVO<CompanyVO> pagingQueryAll(CompanyQueryVO queryVO) {
PageVO<CompanyVO> list = this.iCompanyService.queryPageOrganizations(queryVO);
return list;
}
@ApiOperation(value = "删除公司信息")
@DeleteMapping("{id}")
public void delete( @PathVariable Integer id) {
this.iCompanyService.deleteById(id);
}
@ApiOperation(value = "查询公司信息")
@GetMapping("{id}")
public CompanyVO get( @PathVariable Integer id) {
return this.iCompanyService.getById(id);
}
@ApiOperation(value = "更新公司信息")
@PutMapping("{id}")
public CompanyVO get(@PathVariable Integer id, @RequestBody @Validated CompanyVO company) {
return this.iCompanyService.update(id, company);
}
}

View File

@ -0,0 +1,112 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.constants.RoleEnum;
import club.joylink.rtss.controller.advice.Role;
import club.joylink.rtss.services.IExamService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.*;
import club.joylink.rtss.vo.client.validGroup.ExamDefinitionCheck;
import club.joylink.rtss.vo.client.validGroup.ExamDefinitionRulesCheck;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = {"考试定义接口"})
@RestController
@RequestMapping("api/exam")
public class ExamController {
@Autowired
private IExamService iExamService;
@ApiOperation(value = "创建考试")
@PostMapping(path = "")
public void create(@RequestBody @Validated(value = {ExamDefinitionCheck.class, ExamDefinitionRulesCheck.class})
ExamDefinitionVO examDefinitionVO, @RequestAttribute @ApiIgnore UserVO user) {
iExamService.create(examDefinitionVO, user);
}
@ApiOperation(value = "贵装备创建考试")
@PostMapping(path = "/project/GZB")
public void createGZBExam(@RequestBody @Validated(value = {ExamDefinitionCheck.class, ExamDefinitionRulesCheck.class})
ExamDefinitionVO examDefinitionVO, @RequestAttribute @ApiIgnore UserVO user) {
iExamService.createGZBExam(examDefinitionVO, user);
}
@ApiOperation(value = "检查分数是否合理")
@GetMapping(path = "/checkScore")
public boolean checkScore(@Validated(value = ExamDefinitionRulesCheck.class) ExamDefinitionVO examDefinitionVO) {
return iExamService.checkScore(examDefinitionVO);
}
// @ApiOperation(value = "查询课程下的章节信息")
// @GetMapping(path = "/{lessonId}/chapter")
// public CommonJsonResponse queryChapterInfo(@PathVariable(required = true) String lessonId) {
// return CommonJsonResponse.newSuccessResponse(iExamService.queryChapterInfo(lessonId));
// }
@ApiOperation(value = "查询课程所属产品下有实训的实训类型")
@GetMapping(path = "/{lessonId}/trainingTypes")
public List<String> queryTrainingTypes(@PathVariable Long lessonId) {
return iExamService.queryTrainingTypes(lessonId);
}
@ApiOperation(value = "查询试题信息及规则信息")
@GetMapping(path = "/{id}")
public ExamDefinitionVO queryExamInfo(@PathVariable Long id) {
return iExamService.queryExamInfo(id);
}
@ApiOperation(value = "查询课程信息及课程下的试题列表信息")
@GetMapping(path = "/{lessonId}/list")
public ExamsLessonVO queryExamList(@PathVariable Long lessonId, @ApiIgnore @RequestAttribute UserVO user) {
return iExamService.queryExamList(lessonId, user);
}
@ApiOperation(value = "查询试题列表信息")
@GetMapping(path = "/list")
public PageVO<ExamDefinitionVO> queryExamInfoList(ExamDefinitionQueryVO queryVO) {
return iExamService.queryExamInfoList(queryVO);
}
@ApiOperation(value = "删除试题")
@DeleteMapping(path = "/{id}")
public void deleteExam(@PathVariable String id, @ApiIgnore @RequestAttribute UserVO user) {
iExamService.deleteExam(id, user);
}
// @ApiOperation(value = "查询章节下允许创建的最多题目数量")
// @GetMapping(path = "/trainingNum/{lessonId}/{chapterId}")
// public CommonJsonResponse queryTrainingNum(@PathVariable(required = true) String lessonId, @PathVariable(required = true) String chapterId) {
// int trainingNum = iExamService.queryTrainingNum(lessonId, chapterId);
// return CommonJsonResponse.newSuccessResponse(trainingNum);
// }
@ApiOperation(value = "根据课程和实训类型查询实训数量")
@GetMapping(path = "/trainingNum/{lessonId}/{trainingType}")
public Long queryTrainingNum(@PathVariable Long lessonId, @PathVariable String trainingType, String operateType) {
return iExamService.queryTrainingNum(lessonId, trainingType, operateType);
}
@ApiOperation(value = "试题上线")
@PutMapping(value = "/{id}/onLine")
public void onLine(@PathVariable Long id, @RequestAttribute @ApiIgnore UserVO user) {
this.iExamService.onLine(id, user);
}
@ApiOperation(value = "试题下线")
@PutMapping(value = "/{id}/offLine")
public void offLine(@PathVariable Long id, @RequestAttribute @ApiIgnore UserVO user) {
this.iExamService.offLine(id, user);
}
@ApiOperation(value = "更新试题")
@PutMapping(path = "/{id}")
public void update(@PathVariable Long id, @RequestBody ExamDefinitionVO examDefinitionVO) {
this.iExamService.update(id, examDefinitionVO);
}
}

View File

@ -0,0 +1,187 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.constants.Project;
import club.joylink.rtss.services.ILearnService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageQueryVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.learn.LearnCommentVO;
import club.joylink.rtss.vo.client.learn.LearnCreateVO;
import club.joylink.rtss.vo.client.learn.LearnPostVO;
import club.joylink.rtss.vo.client.post.LearnMessageCreateVO;
import club.joylink.rtss.vo.client.post.LearnMessagePagedQueryVO;
import club.joylink.rtss.vo.client.post.LearnMessageVO;
import club.joylink.rtss.vo.client.validGroup.LearnCommentCreateCheck;
import club.joylink.rtss.vo.client.validGroup.LearnPostCreateCheck;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = { "学习吧接口" })
@RestController
@RequestMapping(path = "/api/learn")
public class LearnController {
@Autowired
private ILearnService iLearnService;
@ApiOperation(value = "分页查询帖子列表")
@GetMapping(path = "/post")
public PageVO<LearnPostVO> queryPagedPost(PageQueryVO queryVO) {
return iLearnService.queryPagedPost(queryVO);
}
@ApiOperation("查询项目留言板")
@GetMapping("/{project}/post")
public LearnPostVO queryPost(@PathVariable Project project) {
return iLearnService.queryPost(project);
}
@ApiOperation(value = "新建帖子")
@PostMapping(path = "/{mapId}/post")
public String createPost(@PathVariable Long mapId,
@RequestBody @Validated(value = LearnPostCreateCheck.class) LearnCreateVO postCreateVO,
@ApiIgnore @RequestAttribute UserVO user) {
return iLearnService.createPost(mapId, postCreateVO, user);
}
@ApiOperation(value = "获取帖子信息")
@GetMapping(path = "/{postId}")
public LearnPostVO getPostInfo(@PathVariable Long postId) {
return iLearnService.getPostInfo(postId);
}
@ApiOperation(value = "赞贴")
@PostMapping(path = "/post/{postId}/like")
public void likePost(@PathVariable Long postId, @ApiIgnore @RequestAttribute UserVO user) {
iLearnService.likePost(postId, user);
}
@ApiOperation(value = "踩贴")
@PostMapping(path = "/post/{postId}/unlike")
public void unlikePost(@PathVariable Long postId, @ApiIgnore @RequestAttribute UserVO user) {
iLearnService.unlikePost(postId, user);
}
@ApiOperation(value = "置顶-管理员操作")
@PutMapping(path = "/{postId}/top")
public void top(@PathVariable Long postId, @ApiIgnore @RequestAttribute UserVO user) {
iLearnService.top(postId, user);
}
@ApiOperation(value = "删除帖子-管理员操作")
@DeleteMapping(path = "/{postId}")
public void deletePost(@PathVariable Long postId, @ApiIgnore @RequestAttribute UserVO user) {
iLearnService.deletePost(postId, user);
}
//--------------------------------- 留言 ---------------------------------
@ApiOperation("留言")
@PostMapping("/message/create")
public long createMessage(@RequestBody @Validated LearnMessageCreateVO messageCreateVO, @RequestAttribute UserVO user) {
return iLearnService.createMessage(messageCreateVO, user);
}
@ApiOperation("分页查询留言")
@GetMapping("/{postId}/message/pagedQuery/postId")
public PageVO<LearnMessageVO> pagedQueryMessageByPostId(@PathVariable Long postId, LearnMessagePagedQueryVO queryVO) {
return iLearnService.pagedQueryMessageByPostId(postId, queryVO);
}
@ApiOperation("根据项目分页查询留言")
@GetMapping("/{project}/message/pagedQuery/project")
public PageVO<LearnMessageVO> pagedQueryMessageByProject(@PathVariable Project project, LearnMessagePagedQueryVO queryVO) {
return iLearnService.pagedQueryMessageByProject(project, queryVO);
}
@ApiOperation("删除留言(管理员)")
@DeleteMapping("/{messageId}/deleteMessage/admin")
public void adminDeleteMessage(@PathVariable Long messageId, @RequestAttribute UserVO user) {
iLearnService.adminDeleteMessage(messageId, user);
}
@ApiOperation("删除留言(用户删自己的)")
@DeleteMapping("/{messageId}/deleteMessage/user")
public void userDeleteMessage(@PathVariable Long messageId, @RequestAttribute UserVO user) {
iLearnService.userDeleteMessage(messageId, user);
}
// @ApiOperation("赞留言")
// @PutMapping("/{messageId}/like")
// public Integer likeMessage(@PathVariable Long messageId) {
// return iLearnService.likeMessage(messageId);
// }
//
// @ApiOperation("踩留言")
// @PutMapping("/{messageId}/unlike")
// public Integer unlikeMessage(@PathVariable Long messageId) {
// return iLearnService.unlikeMessage(messageId);
// }
//----------------------------------------- 评论 -----------------------------------------
@ApiOperation(value = "分页查询留言评论列表")
@GetMapping(path = "/{messageId}/comment")
public PageVO<LearnCommentVO> queryPagedComment(@PathVariable Long messageId, PageQueryVO queryVO) {
return iLearnService.pagedQueryComment(messageId, queryVO);
}
@ApiOperation(value = "查询留言回复列表")
@GetMapping(path = "/{messageId}/list")
public List<LearnCommentVO> queryCommentList(@PathVariable Long messageId) {
return iLearnService.queryCommentList(messageId);
}
@ApiOperation(value = "评论")
@PostMapping(path = "/{messageId}/comment")
public void comment(@PathVariable Long messageId,
@RequestBody @Validated(value = LearnCommentCreateCheck.class) LearnCreateVO commentCreateVO,
@ApiIgnore @RequestAttribute UserVO user) {
iLearnService.addComment(messageId, commentCreateVO, user);
}
@ApiOperation(value = "回复")
@PostMapping(path = "/{messageId}/{commentId}/comment")
public void comment(@PathVariable Long messageId, @PathVariable Long commentId,
@RequestBody @Validated(value = LearnCommentCreateCheck.class) LearnCreateVO postCreateVO,
@ApiIgnore @RequestAttribute UserVO user) {
iLearnService.addComment(messageId, commentId, postCreateVO, user);
}
@ApiOperation(value = "赞回复")
@PostMapping(path = "/comment/{commentId}/like")
public void likeComment(@PathVariable Long commentId, @ApiIgnore @RequestAttribute UserVO user) {
iLearnService.likeComment(commentId, user);
}
@ApiOperation(value = "踩回复")
@PostMapping(path = "/comment/{commentId}/unlike")
public void unlikeComment(@PathVariable Long commentId, @ApiIgnore @RequestAttribute UserVO user) {
iLearnService.unlikeComment(commentId, user);
}
@ApiOperation(value = "取消置顶-管理员操作")
@PutMapping(path = "/{postId}/unTop")
public void unTop(@PathVariable Long postId, @ApiIgnore @RequestAttribute UserVO user) {
iLearnService.unTop(postId, user);
}
@ApiOperation(value = "删除评论-管理员操作")
@DeleteMapping(path = "/{commentId}/deleteComment/admin")
public void adminDeleteComment(@PathVariable Long commentId, @ApiIgnore @RequestAttribute UserVO user) {
iLearnService.adminDeleteComment(commentId, user);
}
@ApiOperation(value = "删除评论-用户操作")
@DeleteMapping(path = "/{commentId}/deleteComment/user")
public void userDeleteComment(@PathVariable Long commentId, @ApiIgnore @RequestAttribute UserVO user) {
iLearnService.userDeleteComment(commentId, user);
}
}

View File

@ -0,0 +1,128 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.constants.RoleEnum;
import club.joylink.rtss.controller.advice.Role;
import club.joylink.rtss.services.ILessonService;
import club.joylink.rtss.services.student.IClassStudentUserService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.LessonQueryVO;
import club.joylink.rtss.vo.client.LessonTreeVO;
import club.joylink.rtss.vo.client.LessonVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.student.StudentClassVO;
import club.joylink.rtss.vo.client.validGroup.LessonUpdateNameAndRemarksCheck;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = { "课程数据管理接口" })
@RestController
@RequestMapping("/api/lesson")
public class LessonController {
private ILessonService iLessonService;
@Autowired
private IClassStudentUserService iClassStudentUserService;
@Autowired
public LessonController(ILessonService iLessonService) {
this.iLessonService = iLessonService;
}
@ApiOperation(value = "获取课程实训树")
@GetMapping(path = "/{id}/tree")
public LessonTreeVO getLessonTrainingTree(@PathVariable Long id, @RequestAttribute UserVO user) {
return this.iLessonService.getLessonTree(id, user);
}
@ApiOperation(value = "获取课程详情")
@GetMapping(path="/{id}")
public LessonVO getLessonDetail(@PathVariable Long id, @RequestAttribute UserVO user) {
return this.iLessonService.getLessonDetail(id, user);
}
@ApiOperation(value = "获取课程列表")
@GetMapping(path = "")
public List<LessonVO> queryLessons(LessonQueryVO lessonQueryVO) {
return this.iLessonService.queryLessons(lessonQueryVO);
}
@ApiOperation(value = "根据班级获取关联课程列表")
@GetMapping(path = "/class/{classId}")
public List<LessonVO> queryLessons(@PathVariable Integer classId) {
return this.iClassStudentUserService.getLessonByClass(classId);
}
@ApiOperation(value = "根据课程获取关联班级信息列表")
@GetMapping(path = "/{lessonId}/classes")
public List<StudentClassVO> queryClassByLesson(@PathVariable Long lessonId) {
return this.iClassStudentUserService.getClassesByLesson(lessonId);
}
@ApiOperation(value = "获取课程列表")
@GetMapping(path = "/listOfMap")
public List<LessonVO> queryLessonsOfMap(Long mapId) {
return this.iLessonService.queryLessonsOfMap(mapId);
}
@ApiOperation(value = "分页获取已发布的课程")
@GetMapping(path = "/publishedLesson")
public PageVO<LessonVO> selectPagedPublishedLesson(LessonQueryVO queryVO) {
return iLessonService.selectPagedPublishedLesson(queryVO);
}
@Role(RoleEnum.SuperAdmin)
@ApiOperation(value = "删除已发布的课程")
@DeleteMapping(path = "/publishedLesson/{lessonId}")
public void deletePublishedLesson(@PathVariable Long lessonId, @RequestAttribute UserVO user) {
iLessonService.deletePublishedLesson(lessonId, user);
}
@Role(RoleEnum.LessonCreater)
@ApiOperation(value = "贵州装备教学实训删除正在使用的发布课程")
@DeleteMapping(path = "/usedLesson/{lessonId}")
public void deleteUsedLesson(@PathVariable Long lessonId, @RequestAttribute UserVO user) {
iLessonService.deleteUsedLesson(lessonId, user);
}
// @ApiOperation(value = "根据产品编码获取课程数据")
// @GetMapping(path = "/{mapId}/{prdId}/list")
// public List<LessonVO> getLessonListByPrd(@PathVariable Long mapId, @PathVariable Long prdId) {
// return this.iLessonService.getLessonListByMapAndPrd(mapId, prdId);
// }
@ApiOperation(value = "发布课程上线")
@PutMapping(path = "/{id}/onLine")
@Role({RoleEnum.Admin,RoleEnum.SuperAdmin})
public void onLine(@PathVariable Long id, @RequestAttribute UserVO user) {
this.iLessonService.onLine(id, user);
}
@ApiOperation(value = "发布课程下线")
@PutMapping(path = "/{id}/offLine")
@Role({RoleEnum.Admin,RoleEnum.SuperAdmin})
public void offLine(@PathVariable Long id, @RequestAttribute UserVO user) {
this.iLessonService.offLine(id, user);
}
@ApiOperation(value = "更新课程名称和简介")
@PutMapping(path = "/{id}/nameAndRemarks")
@Role({RoleEnum.Admin,RoleEnum.SuperAdmin})
public void updateNameAndRemarks(@PathVariable Long id,
@RequestBody @Validated(LessonUpdateNameAndRemarksCheck.class) LessonVO lessonVO,
@ApiIgnore @RequestAttribute UserVO user) {
this.iLessonService.updateNameAndRemarks(id, lessonVO.getName(), lessonVO.getRemarks(), user);
}
@ApiOperation(value = "生成默认课程和考试功能")
@PostMapping(path = "/generating")
public void generateLessonAndExam(@ApiIgnore @RequestAttribute UserVO user, @RequestBody List<Long> mapIds) {
iLessonService.generateLessonAndExam(mapIds, user);
}
}

View File

@ -0,0 +1,104 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.services.ILessonDraftService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.*;
import club.joylink.rtss.vo.client.validGroup.DraftLessonCreateCheck;
import club.joylink.rtss.vo.client.validGroup.DraftLessonCreateFromCheck;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = { "课程草稿数据管理接口" })
@RestController
@RequestMapping("/api/lessonDraft")
public class LessonDraftController {
@Autowired
private ILessonDraftService iLessonDraftService;
@ApiOperation(value = "分页查询个人课程草稿")
@GetMapping(path = "/{mapId}/list")
public PageVO<LessonVO> getLessonTree(@PathVariable Long mapId, PageQueryVO queryVO, @ApiIgnore @RequestAttribute UserVO user) {
return this.iLessonDraftService.queryPagedDraftLesson(mapId, queryVO, user);
}
@ApiOperation(value = "获取课程树")
@GetMapping(path = "/{lessonId}/tree")
public List<TreeNode> getLessonTree(@PathVariable Long lessonId, @ApiIgnore @RequestAttribute UserVO user) {
return this.iLessonDraftService.getLessonTree(lessonId, user);
}
@ApiOperation(value = "获取课程基本信息")
@GetMapping(path="/{id}")
public LessonVO getLesson(@PathVariable Long id) {
return this.iLessonDraftService.getLesson(id);
}
@ApiOperation(value = "创建课程信息")
@PostMapping(path = "")
public void createLesson(@RequestBody @Validated(value = DraftLessonCreateCheck.class) LessonVO lessonVo, @RequestAttribute UserVO user) {
this.iLessonDraftService.createLesson(lessonVo, user);
}
@ApiOperation(value = "从发布课程创建")
@PostMapping(path = "/createForm")
public void createFrom(@RequestBody @Validated(value = DraftLessonCreateFromCheck.class) LessonVO lessonVo, @RequestAttribute UserVO user) {
this.iLessonDraftService.createFrom(lessonVo, user);
}
@ApiOperation(value = "更新课程信息")
@PutMapping(path = "/{id}")
public void updateLesson(@PathVariable Long id, @RequestBody LessonVO lessonVo, @RequestAttribute UserVO user) {
this.iLessonDraftService.updateLesson(id, lessonVo, user);
}
@ApiOperation(value = "删除课程")
@DeleteMapping(path="/{id}")
public void deleteLesson(@PathVariable Long id) {
this.iLessonDraftService.deleteLesson(id);
}
@ApiOperation(value = "发布课程")
@PostMapping(path="/{id}/publish")
public void publishLesson(@PathVariable Long id, @RequestBody @Validated LessonPublishVO publishVO) {
this.iLessonDraftService.publishLesson(id, publishVO);
}
@ApiOperation(value = "获取课程章节信息")
@GetMapping(path="/chapter/{id}")
public LessonChapterVO getChapter(@PathVariable Long id) {
return this.iLessonDraftService.getChapter(id);
}
@ApiOperation(value = "创建课程章节")
@PostMapping(path="/{id}/chapter")
public void createChapter(@PathVariable Long id, @RequestBody @Validated LessonChapterVO chapterVo) {
chapterVo.setLessonId(id);
this.iLessonDraftService.createChapter(chapterVo);
}
@ApiOperation(value = "更新课程章节信息")
@PutMapping(path="/chapter/{id}")
public void updateChapter(@PathVariable Long id, @RequestBody @Validated LessonChapterVO chapterVo) {
this.iLessonDraftService.updateChapter(id, chapterVo);
}
@ApiOperation(value = "删除课程章节")
@DeleteMapping(path="/chapter/{id}")
public void updateChapter(@PathVariable Long id) {
this.iLessonDraftService.deleteChapter(id);
}
@ApiOperation(value = "拖拽排序")
@PutMapping(path="/dragSort")
public void dragSort(@RequestBody DragSortReqVO sortReq) {
this.iLessonDraftService.dragSort(sortReq);
}
}

View File

@ -0,0 +1,95 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.constants.Project;
import club.joylink.rtss.services.IAuthenticateService;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.LoginStatusVO;
import club.joylink.rtss.vo.client.LoginUserVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
@RestController
@RequestMapping("/api/login")
public class LoginController {
@Autowired
private IAuthenticateService iAuthenticateService;
@ApiOperation(value = "获取微信小程序登陆二维码")
@GetMapping(path = "/wmurl")
public LoginStatusVO getWmLoginUrl(@NotBlank String clientId, @NotBlank String secret,
Project project, @RequestParam(required = false) String deviceCode) {
return this.iAuthenticateService.getWmLoginUrl(clientId, secret, project, deviceCode);
}
@ApiOperation(value = "用户微信小程序扫登陆二维码")
@GetMapping(path = "/scan/wmLoginUrl")
public UserVO scanWmLoginQrCode(String code, String state) {
return this.iAuthenticateService.scanWmLoginQrCode(code, state);
}
@ApiOperation(value = "微信小程序确认登陆接口")
@PostMapping(path = "/wm")
public void wmConfirmLogin(String code, String state) {
this.iAuthenticateService.wmConfirmClientLogin(code, state);
}
@PostMapping()
public String loginWithPwd(@RequestBody @Validated LoginUserVO loginUser) {
return iAuthenticateService.loginWithPwd(loginUser);
}
@GetMapping("/preLogout")
public void preLogout(String token) {
this.iAuthenticateService.preLogout(token);
}
@GetMapping(path="/logout")
public void logout(String token) {
this.iAuthenticateService.logout(token);
}
@GetMapping(path="/checkStatus")
public LoginStatusVO checkStatus(@NotBlank String sessionId) {
return iAuthenticateService.checkStatus(sessionId);
}
/**
* 获取用户信息 - 通过token
* @param token
* @return
*/
@GetMapping(path = "/getUserInfo")
public UserVO getUserInfo(String token) {
LoginUserInfoVO loginUserInfoVO = this.iAuthenticateService.getLoginUserInfoByToken(token);
return loginUserInfoVO.getUserVO();
}
/**
* 获取用户登录信息包含登录的项目/客户端等
* @param token
* @return
*/
@GetMapping("/loginUserInfo")
public LoginUserInfoVO getLoginUserInfo(String token) {
return this.iAuthenticateService.getLoginUserInfoByToken(token);
}
@ApiOperation(value = "微信小程序code换取token")
@GetMapping(path = "/wm/token")
public String getTokenByWmCode(String code) {
return this.iAuthenticateService.getTokenByWmCode(code);
}
@ApiOperation(value = "token是否过期")
@GetMapping(path = "/{token}/isExpired")
public boolean isTokenExpired(@PathVariable String token) {
return this.iAuthenticateService.isTokenExpired(token);
}
}

View File

@ -0,0 +1,55 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.services.IMap3dModelService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.map.Map3dModelCreateVO;
import club.joylink.rtss.vo.client.map.Map3dModelUpdateVO;
import club.joylink.rtss.vo.client.map.Map3dModelVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags= {"地图3d模型数据管理接口"})
@RestController
@RequestMapping("/api/map3dModel")
@Slf4j
public class Map3dModelController {
@Autowired
private IMap3dModelService iMap3dModelService;
@ApiOperation(value = "获取所有有效地图3d模型数据")
@GetMapping(path = "/all")
public List<Map3dModelVO> findAllModels() {
return this.iMap3dModelService.findAllModels();
}
@GetMapping("")
public List<Map3dModelVO> query(String resourceType) {
return this.iMap3dModelService.query(resourceType);
}
@PutMapping("")
public void update(@Validated @RequestBody Map3dModelUpdateVO updateVO) {
this.iMap3dModelService.update(updateVO);
}
@ApiOperation(value = "创建地图3d模型数据")
@PostMapping("")
public void create(@RequestBody @Validated Map3dModelCreateVO createVO, @RequestAttribute UserVO user) {
iMap3dModelService.create(createVO, user);
}
@ApiOperation(value = "删除地图3d模型数据")
@DeleteMapping("/{id}/delete")
public void delete(@PathVariable Long id) {
iMap3dModelService.delete(id);
}
}

View File

@ -0,0 +1,103 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.services.IOperateService;
import club.joylink.rtss.vo.client.*;
import club.joylink.rtss.vo.client.validGroup.OperateBatchCreateCheck;
import club.joylink.rtss.vo.client.validGroup.OperateSignleCreateCheck;
import club.joylink.rtss.vo.client.validGroup.ValidList;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.NotBlank;
import java.util.List;
@Api(tags = { "操作管理接口" })
@RestController
@RequestMapping(path = "/api/operate")
public class OperateController {
private final IOperateService iOperateService;
@Autowired
public OperateController(IOperateService iOperateService) {
this.iOperateService = iOperateService;
}
@ApiOperation(value = "创建操作定义")
@PostMapping(path = "")
public void create(@RequestBody @Validated(value = {OperateSignleCreateCheck.class}) OperateDefinitionVO definitionVO) {
this.iOperateService.create(definitionVO);
}
@ApiOperation(value = "分页查询操作定义")
@GetMapping(path = "")
public PageVO<OperateDefinitionVO> queryPagedOperateDefinition(OperateDefinitionQueryVO queryVO) {
return this.iOperateService.queryPagedOperateDefinition(queryVO);
}
@ApiOperation(value = "修改操作定义")
@PutMapping(path = "/{id}")
public void updateDefinition(@PathVariable Long id, @RequestBody @Validated(value = {OperateSignleCreateCheck.class}) OperateDefinitionVO definitionVO) {
this.iOperateService.update(id, definitionVO);
}
@ApiOperation(value = "删除操作定义")
@DeleteMapping(path = "/{id}")
public void deleteDefinition(@PathVariable Long id) {
this.iOperateService.delete(id);
}
@ApiOperation(value = "创建操作步骤")
@PostMapping(path = "/{definitionId}/step")
public void createStep(@PathVariable Long definitionId, @RequestBody @Validated(value = {OperateSignleCreateCheck.class}) OperateStepVO stepVO) {
this.iOperateService.createStep(definitionId, stepVO);
}
@ApiOperation(value = "分页查询操作步骤")
@GetMapping(path = "/{definitionId}/step")
public PageVO<OperateStepVO> queryPagedOperateStep(@PathVariable Long definitionId, PageQueryVO queryVO) {
return this.iOperateService.queryPagedOperateStep(definitionId, queryVO);
}
@ApiOperation(value = "修改操作步骤")
@PutMapping(path = "/step/{id}")
public void updateStep(@PathVariable Long id, @RequestBody @Validated(value = {OperateSignleCreateCheck.class}) OperateStepVO stepVO) {
this.iOperateService.updateStep(id, stepVO);
}
@ApiOperation(value = "删除操作步骤")
@DeleteMapping(path = "/step/{id}")
public void deleteStep(@PathVariable Long id) {
this.iOperateService.deleteStep(id);
}
@ApiOperation(value = "获取实训类型下的操作类型")
@GetMapping(path = "/type")
public List<TreeNode> queryOperateType(Long mapId, String productType) {
return this.iOperateService.queryOperateTypes(mapId, productType);
}
@ApiOperation(value = "生成操作")
@PostMapping(path = "/{mapId}/generate")
public void generate(@PathVariable Long mapId,
@RequestBody @Validated(value = {OperateBatchCreateCheck.class}) ValidList<OperateDefinitionVO> definitionVOList) {
this.iOperateService.generate(mapId, definitionVOList);
}
@ApiOperation(value = "另存为")
@PostMapping(path = "/{mapId}/saveAs/{other}")
public void saveAs(@PathVariable @NotBlank Long mapId,
@PathVariable @NotBlank Long other) {
this.iOperateService.saveAs(mapId, other);
}
@ApiOperation(value = "查询占位数据列表")
@GetMapping(path = "/placeholder")
public List<OperatePlaceholderVO> queryPlaceholder(String trainingType) {
return this.iOperateService.queryPlaceholder(trainingType);
}
}

View File

@ -0,0 +1,40 @@
package club.joylink.rtss.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
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 club.joylink.rtss.services.IOrganizationService;
import club.joylink.rtss.vo.client.OrganizationVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@Api(tags = {"组织/企业管理接口"})
@RestController
@RequestMapping("/api/organization")
public class OrganizationController {
@Autowired
private IOrganizationService iOrganizationService;
@ApiOperation(value = "获取组织/企业数据")
@GetMapping(path = "")
public List<OrganizationVO> queryOrganization() {
List<OrganizationVO> list = this.iOrganizationService.queryOrganization();
return list;
}
@ApiOperation(value = "添加组织/企业")
@PostMapping(path = "")
public OrganizationVO create(@RequestBody @Validated OrganizationVO organization) {
OrganizationVO org = this.iOrganizationService.create(organization);
return org;
}
}

View File

@ -0,0 +1,115 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
import club.joylink.rtss.services.IReleaseReviewService;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.*;
import club.joylink.rtss.vo.client.runplan.RunPlanQueryVO;
import club.joylink.rtss.vo.client.runplan.RunPlanVO;
import club.joylink.rtss.vo.client.script.ScriptQueryVO;
import club.joylink.rtss.vo.client.script.ScriptVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = { "发布审核接口" })
@RestController
@RequestMapping("/api/review")
public class ReleaseReviewController {
@Autowired
private IReleaseReviewService iReleaseReviewService;
@ApiOperation(value = "分页获取待审核的草稿课程")
@GetMapping(path = "/query/lesson")
public PageVO<LessonVO> queryPendingReviewLesson(ReleaseReviewQueryVO queryVO){
return iReleaseReviewService.queryPendingReviewLesson(queryVO);
}
@ApiOperation(value = "发布课程")
@PostMapping(path="/{id}/publishLesson")
public void publishLesson(@PathVariable Long id, @RequestBody @Validated LessonPublishVO publishVO) {
iReleaseReviewService.publishLesson(id, publishVO);
}
@ApiOperation(value = "课程申请驳回")
@PostMapping(path = "/lesson/{id}")
public void rejectLesson(@PathVariable Long id, @RequestBody ReleaseReviewQueryVO queryVO){
iReleaseReviewService.rejectLesson(id,queryVO.getExplanation());
}
@ApiOperation(value = "用户申请发布课程或者撤销课程申请")
@GetMapping(path = "/lesson/releaseOrCancel/{id}/{status}")
public void applicationForReleaseOrCancelLesson(@PathVariable Long id,@PathVariable String status){
iReleaseReviewService.applicationForReleaseOrCancelLesson(id,status);
}
@ApiOperation(value = "预览课程")
@GetMapping(path = "/previewLesson/{id}")
public List<TreeNode> previewLesson(@PathVariable Long id){
return iReleaseReviewService.previewLesson(id);
}
//----------------------------------------
@ApiOperation(value = "分页获取待审核的草稿剧本")
@GetMapping(path = "/query/script")
public PageVO<ScriptVO> queryPendingReviewScript(ScriptQueryVO queryVO){
return iReleaseReviewService.queryPendingReviewScript(queryVO);
}
@ApiOperation(value = "发布剧本")
@PostMapping(path="/{id}/publishScript")
public void publishScript(@PathVariable Long id, @ApiIgnore @RequestAttribute UserVO user){
iReleaseReviewService.publishScript(id, user);
}
@ApiOperation(value = "剧本申请驳回")
@PostMapping(path = "/script/{id}")
public void rejectScript(@PathVariable Long id, @RequestBody @Validated ReleaseReviewVO releaseReviewVO){
iReleaseReviewService.rejectScript(id, releaseReviewVO);
}
//------------------------------------
@ApiOperation(value = "分页获取待审核的草稿运行图")
@GetMapping(path = "/query/runPlan")
public PageVO<RunPlanVO> queryPendingReviewRunPlan(RunPlanQueryVO queryVO){
return iReleaseReviewService.queryPendingReviewRunPlan(queryVO);
}
@ApiOperation(value = "发布运行图")
@PostMapping(path = "/{planId}/publishRunPlan")
public List<String> publishRunPlan(@PathVariable Long planId, @ApiIgnore @RequestAttribute UserVO user){
return iReleaseReviewService.publishRunPlan(planId, user);
}
@ApiOperation(value = "直接发布运行图")
@PostMapping(path = "/{planId}/directPublishRunPlan")
public List<String> directPublishRunPlan(@PathVariable Long planId, String runPlanName, @ApiIgnore @RequestAttribute UserVO user){
return iReleaseReviewService.directPublishRunPlan(planId, runPlanName, user);
}
@ApiOperation(value = "运行图申请驳回")
@PostMapping(path = "/runPlan/{id}")
public void rejectRunPlan(@PathVariable Long id,@RequestBody ReleaseReviewQueryVO queryVO){
iReleaseReviewService.rejectRunPlan(id,queryVO.getExplanation());
}
@ApiOperation(value = "用户申请发布运行图或者撤销运行图申请")
@GetMapping(path = "/runPlan/releaseOrCancel/{id}/{status}")
public void applicationForReleaseOrCancelRunPlan(@PathVariable Long id, @PathVariable String status){
iReleaseReviewService.applicationForReleaseOrCancelRunPlan(id,status);
}
@ApiOperation(value = "预览运行图")
@GetMapping(path = "/previewRunPlan/{planId}")
public String reviewRunPlan(@PathVariable Long planId,@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
LoginUserInfoVO loginUserInfoVO){
return iReleaseReviewService.previewRunPlan(planId,loginUserInfoVO);
}
}

View File

@ -0,0 +1,249 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.constants.RoleEnum;
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
import club.joylink.rtss.controller.advice.Role;
import club.joylink.rtss.services.IRunPlanDraftService;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.map.MapRoutingSectionVO;
import club.joylink.rtss.vo.client.map.MapRoutingVO;
import club.joylink.rtss.vo.client.map.newmap.MapStationParkingTimeVO;
import club.joylink.rtss.vo.client.map.newmap.MapStationRunLevelVO;
import club.joylink.rtss.vo.client.runplan.*;
import club.joylink.rtss.runplan.newdraw.RunPlanInput;
import club.joylink.rtss.vo.client.validGroup.RunPlanCreateCheck;
import club.joylink.rtss.vo.client.validGroup.RunPlanNameCheck;
import club.joylink.rtss.vo.client.validGroup.ValidList;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = {"运行计划草稿接口"})
@RestController
@RequestMapping("/api/runPlan/draft")
public class RunPlanDraftController {
@Autowired
private IRunPlanDraftService iRunPlanDraftService;
@ApiOperation(value = "创建运行图草稿")
@PostMapping(path = "")
public String create(@RequestBody @Validated(value = RunPlanCreateCheck.class) RunPlanVO runPlanVO,
@ApiIgnore @RequestAttribute UserVO user) {
return iRunPlanDraftService.create(runPlanVO, user);
}
@ApiOperation(value = "自动生成运行图车次数据")
@PostMapping(path = "/{id}")
public RunPlanEChartsDataVO create(@RequestBody @Validated RunPlanInput runPlanInput, @PathVariable Long id) {
return iRunPlanDraftService.createCommon(id,runPlanInput);
}
@ApiOperation(value = "修改运行图名称")
@PutMapping(path = "/{id}")
public void updateName(@PathVariable Long id, @RequestBody @Validated(value = RunPlanNameCheck.class) RunPlanVO runPlanVO,
@ApiIgnore @RequestAttribute UserVO user) {
iRunPlanDraftService.updateName(id, runPlanVO.getName(), user);
}
@ApiOperation(value = "从模板运行图创建")
@PostMapping(path = "/createFrom/{templateId}")
public String createFrom(@PathVariable Long templateId, @RequestBody @Validated(value = RunPlanNameCheck.class) RunPlanVO runPlanVO,
@ApiIgnore @RequestAttribute UserVO user) {
return iRunPlanDraftService.createFrom(templateId, runPlanVO.getName(), user);
}
@ApiOperation(value = "根据mapId查询运行图纵坐标车站节点")
@GetMapping(path = "/station/{mapId}")
public List selectOrdinateByMapId(@PathVariable Long mapId) {
return iRunPlanDraftService.selectOrdinateByMapId(mapId);
}
@ApiOperation(value = "查询运行图的数据绘制运行图")
@GetMapping(path = "/{planId}")
public RunPlanEChartsDataVO selectDiagramData(@PathVariable Long planId) {
return iRunPlanDraftService.selectDiagramData(planId);
}
@ApiOperation(value = "删除运行图")
@DeleteMapping(path = "/{planId}")
public void deleteDiagramDraftData(@PathVariable Long planId, @RequestAttribute UserVO user) {
iRunPlanDraftService.deleteDiagramDraftData(planId, user);
}
@ApiOperation(value = "运行图草稿发布")
@PostMapping(path = "/{planId}/publish")
public List<String> publish(@PathVariable Long planId, @RequestAttribute UserVO user) {
List<String> checkedList = this.dataCheck(planId);
if(CollectionUtils.isEmpty(checkedList)) {
iRunPlanDraftService.publish(planId, user);
}
return checkedList;
}
@ApiOperation(value = "导入真实运行图")
@PostMapping(path = "/{mapId}/prdPlan")
public void importPrdPlan(@PathVariable Long mapId,
@RequestBody @Validated ValidList<RunPlanImport> runPlanImportList,
@ApiIgnore @RequestAttribute UserVO user) {
this.iRunPlanDraftService.importRunPlan(mapId, runPlanImportList, user);
}
@ApiOperation(value = "查询地图下个人运行图列表")
@GetMapping(path = "/{mapId}/list")
public List<RunPlanVO> queryListByMapId(@PathVariable Long mapId, @RequestAttribute UserVO user) {
return this.iRunPlanDraftService.queryListByMapId(mapId, user);
}
@ApiOperation(value = "获取站间运行时间")
@GetMapping(path = "/{mapId}/stationRunning")
public List<MapStationRunningVO> getStationRunningDate(@PathVariable Long mapId, @ApiIgnore @RequestAttribute UserVO user) {
return this.iRunPlanDraftService.getStationRunningDate(mapId, user);
}
@ApiOperation(value = "设置站间运行时间")
@PutMapping(path = "/{mapId}/stationRunning")
public void setStationRunningTime(@PathVariable Long mapId,
@RequestBody List<RunPlanLevelVO> runPlanLevelVOList,
@ApiIgnore @RequestAttribute UserVO user) {
this.iRunPlanDraftService.setStationRunningTime(mapId, runPlanLevelVOList, user);
}
@ApiOperation(value = "获取地图原始站间运行等级")
@GetMapping(path = "/{mapId}/stationRunLevel")
public List<MapStationRunLevelVO> getStationRunningLevels(@PathVariable Long mapId) {
return this.iRunPlanDraftService.getStationRunLevel(mapId);
}
@ApiOperation(value = "获取地图原始车站停站时间")
@GetMapping(path = "/{mapId}/stationParkingTime")
public List<MapStationParkingTimeVO> getStationParkingTimes(@PathVariable Long mapId) {
return this.iRunPlanDraftService.getStationParkingTimeList(mapId);
}
@ApiOperation(value = "查询运行图服务号是否存在")
@GetMapping(path = "/{planId}/{serviceNumber}/service")
public boolean ifServerExists(@PathVariable Long planId, @PathVariable String serviceNumber) {
return this.iRunPlanDraftService.ifServerExists(planId, serviceNumber);
}
@ApiOperation(value = "查询交路列表")
@GetMapping(path = "/{planId}/routingList")
public List getRoutingList(@PathVariable Long planId) {
return this.iRunPlanDraftService.getRoutingList(planId);
}
@ApiOperation(value = "根据车次号查询交路")
@GetMapping(path = "/{planId}/routing")
public Object queryRoutingBySDTNumber(@PathVariable Long planId, String SDTNumber) {
return this.iRunPlanDraftService.queryRoutingBySDTNumber(planId, SDTNumber);
}
@ApiOperation(value = "根据交路查询交路区段列表")
@GetMapping(path = "/{planId}/{routingCode}/routingSectionList")
public List getRoutingSectionList(@PathVariable Long planId, @PathVariable String routingCode) {
return this.iRunPlanDraftService.getRoutingSectionList(planId, routingCode);
}
@ApiOperation(value = "增加计划")
@PostMapping(path = "/{planId}/service")
public void addRunPlanService(@PathVariable Long planId,
@RequestBody @Validated RunPlanServiceConfigVO serviceConfig,
@ApiIgnore @RequestAttribute UserVO user) {
this.iRunPlanDraftService.addRunPlanService(planId, serviceConfig, user);
}
@ApiOperation(value = "修改计划")
@PutMapping(path = "/{planId}/service/{serviceNumber}")
public void updateRunPlanService(@PathVariable Long planId,
@PathVariable String serviceNumber,
@RequestBody @Validated RunPlanServiceConfigVO serviceConfig,
@ApiIgnore @RequestAttribute UserVO user) {
this.iRunPlanDraftService.updateRunPlanService(planId, serviceNumber, serviceConfig, user);
}
@ApiOperation(value = "删除计划")
@DeleteMapping(path = "/{planId}/service/{serviceNumber}")
public void deleteRunPlanService(@PathVariable Long planId,
@PathVariable String serviceNumber,
@ApiIgnore @RequestAttribute UserVO user) {
this.iRunPlanDraftService.deleteRunPlanService(planId, serviceNumber, user);
}
@ApiOperation(value = "复制计划")
@PostMapping(path = "/{planId}/service/{serviceNumber}")
public void copyRunPlanService(@PathVariable Long planId,
@PathVariable String serviceNumber,
@RequestBody RunPlanServiceConfigVO serviceConfig,
@ApiIgnore @RequestAttribute UserVO user) {
this.iRunPlanDraftService.copyRunPlanService(planId, serviceNumber, serviceConfig, user);
}
@ApiOperation(value = "修改计划号")
@PutMapping(path = "/{planId}/service/{serviceNumber}/serviceNumber")
public void updateRunPlanService(@PathVariable Long planId, @PathVariable String serviceNumber, String newServiceNumber) {
this.iRunPlanDraftService.updateRunPlanServiceNumber(planId, serviceNumber, newServiceNumber);
}
@ApiOperation(value = "增加任务")
@PostMapping(path = "/{planId}/{serviceNumber}/trip")
public void addRunPlanTrip(@PathVariable Long planId, @PathVariable String serviceNumber,
@RequestBody @Validated RunPlanTripConfigVO tripConfig,
@ApiIgnore @RequestAttribute UserVO user) {
this.iRunPlanDraftService.addRunPlanTrip(planId, serviceNumber, tripConfig, user);
}
@ApiOperation(value = "修改任务")
@PutMapping(path = "/{planId}/trip/{SDTNumber}")
public void updateRunPlanTrip(@PathVariable Long planId, @PathVariable String SDTNumber,
@RequestBody @Validated RunPlanTripConfigVO tripConfig,
@ApiIgnore @RequestAttribute UserVO user) {
this.iRunPlanDraftService.updateRunPlanTrip(planId, SDTNumber, tripConfig, user);
}
@ApiOperation(value = "修改任务车次号")
@PutMapping(path = "/{planId}/trip/{SDTNumber}/tripNumber")
public void updateRunPlanTripNumber(@PathVariable Long planId, @PathVariable String SDTNumber,String tripNumber) {
this.iRunPlanDraftService.updateRunPlanTripNumber(planId, SDTNumber, tripNumber);
}
@ApiOperation(value = "删除任务")
@DeleteMapping(path = "/{planId}/trip/{SDTNumber}")
public void deleteRunPlanTrip(@PathVariable Long planId, @PathVariable String SDTNumber, boolean deleteBefore,
@ApiIgnore @RequestAttribute UserVO user) {
this.iRunPlanDraftService.deleteRunPlanTrip(planId, SDTNumber, deleteBefore, user);
}
//TODO
@ApiOperation(value = "有效性检查")
@GetMapping (path = "/{planId}/check")
public List<String> dataCheck(@PathVariable Long planId) {
return this.iRunPlanDraftService.dataCheck(planId);
}
//Temp use
@Role(RoleEnum.SuperAdmin)
@ApiOperation(value = "手动删除折返轨时刻数据")
@PutMapping(path = "/{planId}/removeTBTrackTripTime")
public void removeTBTrackTripTime(@PathVariable Long planId) {
this.iRunPlanDraftService.removeTBTrackTripTime(planId);
}
@ApiOperation(value = "运行图仿真测试")
@GetMapping (path = "/{planId}/simulation")
public String simulationCheck(@PathVariable Long planId, @ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
LoginUserInfoVO loginUserInfoVO) {
List<String> checkedList = this.dataCheck(planId);
if(CollectionUtils.isEmpty(checkedList)) {
return this.iRunPlanDraftService.simulationCheck(planId, loginUserInfoVO);
}
return null;
}
}

View File

@ -0,0 +1,172 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.services.rpTools.RunPlanToolsService;
import club.joylink.rtss.vo.client.rpTools.AreaVO;
import club.joylink.rtss.vo.client.rpTools.MapStationVO;
import club.joylink.rtss.vo.client.rpTools.MapVO;
import club.joylink.rtss.vo.client.rpTools.RunPlanConfigVO;
import club.joylink.rtss.vo.client.rpTools.RunPlanDataVO;
import club.joylink.rtss.vo.client.rpTools.RunPlanGroupVO;
import club.joylink.rtss.vo.client.rpTools.TripAddVO;
import club.joylink.rtss.vo.client.rpTools.TripChangeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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.RestController;
import java.util.List;
@Api(tags = "运行图工具接口")
@RestController
@RequestMapping(path = "/api/rpTools")
public class RunPlanToolsController {
@Autowired
private RunPlanToolsService runPlanToolsService;
@ApiOperation(value = "查询线路列表")
@GetMapping(path = "/map")
public List<MapVO> listMap() {
return runPlanToolsService.listMap();
}
@ApiOperation(value = "查询线路车站列表")
@GetMapping(path = "/{mapId}/station")
public List<MapStationVO> listMapStation(@PathVariable Long mapId) {
return runPlanToolsService.listMapStation(mapId);
}
@ApiOperation(value = "更新线路车站")
@PutMapping(path = "/station/{stationId}")
public void updateStation(@PathVariable Long stationId, @RequestBody MapStationVO stationVO) {
runPlanToolsService.updateStation(stationId, stationVO);
}
@ApiOperation(value = "查询运行图列表")
@GetMapping(path = "")
public List<RunPlanGroupVO> listRunPlan() {
return runPlanToolsService.listRunPlan();
}
@ApiOperation(value = "创建新运行图")
@PostMapping(path = "")
public Long create(@RequestBody @Validated RunPlanGroupVO groupVO) {
return runPlanToolsService.create(groupVO);
}
@ApiOperation(value = "获取运行图数据")
@GetMapping(path = "/{planId}")
public RunPlanDataVO getRunPlanECharts(@PathVariable Long planId) {
return runPlanToolsService.getRunPlanECharts(planId);
}
@ApiOperation(value = "获取运行图配置")
@GetMapping(path = "/{planId}/config")
public RunPlanConfigVO getRunPlanConfig(@PathVariable Long planId) {
return runPlanToolsService.getRunPlanConfig(planId);
}
@ApiOperation(value = "修改运行图配置")
@PutMapping(path = "/{planId}/config")
public void setRunPlanConfig(@PathVariable Long planId, @RequestBody RunPlanConfigVO configVO) {
runPlanToolsService.setRunPlanConfig(planId, configVO);
}
@ApiOperation(value = "编辑运行图")
@PutMapping(path = "/{planId}/edit")
public Boolean editPlan(@PathVariable Long planId) {
return runPlanToolsService.editPlan(planId);
}
@ApiOperation(value = "结束编辑")
@PutMapping(path = "/{planId}/endEdit")
public void endEdit(@PathVariable Long planId) {
runPlanToolsService.endEdit(planId);
}
@ApiOperation(value = "添加车次")
@PostMapping(path = "/{planId}/trip")
public void addTrip(@PathVariable Long planId, @RequestBody @Validated TripAddVO tripAddVO) {
runPlanToolsService.addTrip(planId, tripAddVO);
}
@ApiOperation(value = "修改站间运行时间")
@PutMapping(path = "/{planId}/{tripNo}/running")
public void changeArrivalTime(@PathVariable Long planId, @PathVariable Integer tripNo, @RequestBody @Validated TripChangeVO tripChangeVO) {
runPlanToolsService.changeRunningTime(planId, tripNo, tripChangeVO);
}
@ApiOperation(value = "修改停站时间")
@PutMapping(path = "/{planId}/{tripNo}/stop")
public void changeDepartureTime(@PathVariable Long planId, @PathVariable Integer tripNo, @RequestBody @Validated TripChangeVO tripChangeVO) {
runPlanToolsService.changeStopTime(planId, tripNo, tripChangeVO);
}
@ApiOperation(value = "平移服务")
@PutMapping(path = "/{planId}/{serviceNo}/service")
public void changeServiceTime(@PathVariable Long planId, @PathVariable Integer serviceNo, @RequestBody TripChangeVO tripChangeVO) {
runPlanToolsService.changeServiceTime(planId, serviceNo, tripChangeVO);
}
@ApiOperation(value = "修改折返时间")
@PutMapping(path = "/{planId}/{tripNo}/turnBack")
public void changeTurnBackTime(@PathVariable Long planId, @PathVariable Integer tripNo, @RequestBody TripChangeVO tripChangeVO) {
runPlanToolsService.changeTurnBackTime(planId, tripNo, tripChangeVO);
}
@ApiOperation(value = "删除车次")
@DeleteMapping(path = "/{planId}/{tripNo}/trip")
public void deleteTrip(@PathVariable Long planId, @PathVariable Integer tripNo) {
runPlanToolsService.deleteTrip(planId, tripNo);
}
@ApiOperation(value = "删除服务")
@DeleteMapping(path = "/{planId}/{serviceNo}/service")
public void deleteService(@PathVariable Long planId, @PathVariable Integer serviceNo) {
runPlanToolsService.deleteService(planId, serviceNo);
}
@ApiOperation(value = "添加施工区域")
@PostMapping(path = "/{planId}/area")
public void addArea(@PathVariable Long planId, @RequestBody @Validated AreaVO areaVO) {
runPlanToolsService.addArea(planId, areaVO);
}
@ApiOperation(value = "修改区域")
@PutMapping(path = "/{planId}/{areaNo}/area")
public void changeArea(@PathVariable Long planId, @PathVariable Integer areaNo, @RequestBody @Validated AreaVO areaVO) {
runPlanToolsService.changeArea(planId, areaNo, areaVO);
}
@ApiOperation(value = "修改区域文字")
@PutMapping(path = "/{planId}/{areaNo}/text")
public void changeAreaText(@PathVariable Long planId, @PathVariable Integer areaNo, @RequestBody AreaVO areaVO) {
runPlanToolsService.changeAreaText(planId, areaNo, areaVO);
}
@ApiOperation(value = "删除区域")
@DeleteMapping(path = "/{planId}/{areaNo}/area")
public void deleteArea(@PathVariable Long planId, @PathVariable Integer areaNo) {
runPlanToolsService.deleteArea(planId, areaNo);
}
@ApiOperation(value = "清除数据")
@PutMapping(path = "/{planId}/clear")
public void clear(@PathVariable Long planId) {
runPlanToolsService.clear(planId);
}
@ApiOperation(value = "删除运行图")
@DeleteMapping(path = "/{groupId}")
public void delete(@PathVariable Long groupId) {
runPlanToolsService.delete(groupId);
}
}

View File

@ -0,0 +1,92 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.services.ISchedulingPlanService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.scheduling.SchedulingCheckResult;
import club.joylink.rtss.vo.client.scheduling.SchedulingPlanVO;
import club.joylink.rtss.vo.client.scheduling.SchedulingTrainEditVO;
import club.joylink.rtss.vo.client.scheduling.TrainBaseInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.constraints.NotBlank;
import java.time.LocalDate;
import java.util.List;
@Api(tags = { "派班计划接口" })
@RestController
@RequestMapping(path = "/api/scheduling")
public class SchedulingPlanController {
@Autowired
private ISchedulingPlanService iSchedulingPlanService;
@ApiOperation(value = "创建派班计划仿真")
@PostMapping(path = "/simulation")
public String schedulingPlanSimulation(@RequestParam Long mapId,
@RequestParam String prdType,
@ApiIgnore @RequestAttribute UserVO user) {
return this.iSchedulingPlanService.schedulingPlanSimulation(mapId, prdType, user);
}
@ApiOperation(value = "查询某天的派班计划")
@GetMapping(path = "/{group}/day")
public SchedulingPlanVO findSchedulingPlanOfDay(@PathVariable @NotBlank String group,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate day,
@ApiIgnore @RequestAttribute UserVO user) {
return this.iSchedulingPlanService.findSchedulingPlan(group, day, user);
}
@ApiOperation(value = "生成某天的基础派班计划")
@PostMapping(path = "/{group}/generate")
public SchedulingPlanVO generateBaseSchedulingPlanOfDay(@PathVariable @NotBlank String group,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate day,
@ApiIgnore @RequestAttribute UserVO user) {
return this.iSchedulingPlanService.generateBaseSchedulingPlanOfDay(group, day, user);
}
@ApiOperation(value = "获取所有列车")
@GetMapping(path = "/{group}/train/all")
public List<TrainBaseInfoVO> getAllTrains(@PathVariable @NotBlank String group) {
return this.iSchedulingPlanService.getAllTrains(group);
}
@ApiOperation(value = "检查派班计划冲突")
@PostMapping(path = "/{group}/check")
public SchedulingCheckResult checkConflict(@PathVariable @NotBlank String group,
@Validated @RequestBody List<SchedulingTrainEditVO> editVOList) {
return this.iSchedulingPlanService.checkConflict(group, editVOList);
}
@ApiOperation(value = "保存派班计划数据")
@PostMapping(path = "/{group}/save")
public void saveSchedulingPlan(@PathVariable @NotBlank String group,
@Validated @RequestBody List<SchedulingTrainEditVO> editVOList) {
this.iSchedulingPlanService.saveSchedulingPlan(group, editVOList);
}
@ApiOperation(value = "删除派班计划,并重新生成基础计划")
@DeleteMapping(path = "/{group}/rebuild")
public SchedulingPlanVO deleteAndRebuildSchedulingPlan(@PathVariable @NotBlank String group,
@RequestParam @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate day,
@ApiIgnore @RequestAttribute UserVO user) {
return this.iSchedulingPlanService.deleteAndRebuildSchedulingPlan(group, day, user);
}
@ApiOperation(value = "生成地图通用派班计划")
@PostMapping(path = "/common/generate")
public void generateMapCommonSchedulingPlan(Long mapId, @ApiIgnore @RequestAttribute UserVO user) {
this.iSchedulingPlanService.generateMapCommonSchedulingPlan(mapId, user);
}
@ApiOperation(value = "生成所有已发布地图的通用派班计划", hidden = true)
@PostMapping(path = "/common/generate/all")
public void generateCommonSchedulingPlan(@ApiIgnore @RequestAttribute UserVO user) {
this.iSchedulingPlanService.generateCommonSchedulingPlan(user);
}
}

View File

@ -0,0 +1,42 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.services.IScriptService;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.script.ScriptQueryVO;
import club.joylink.rtss.vo.client.script.ScriptVO;
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;
import javax.validation.constraints.NotNull;
@Api(tags = { "仿真剧本接口" })
@RestController
@RequestMapping(path = "/api/script")
public class ScriptController {
@Autowired
private IScriptService iScriptService;
@ApiOperation(value = "分页查询上线的剧本")
@GetMapping(path = "/paging/online")
public PageVO<ScriptVO> pagingQueryOnlineScript(ScriptQueryVO scriptQueryVO) {
return iScriptService.pagingQueryOnlineScript(scriptQueryVO);
}
@ApiOperation(value = "通过id查询剧本详细信息")
@GetMapping(path = "/{id}/detail")
public ScriptVO getDetailInfoById(@PathVariable @NotNull Long id) {
return iScriptService.getDetailForClientById(id);
}
// @ApiOperation(value = "分页查询已经发布的剧本")
// @GetMapping(path = "/paging/published")
// public PageVO<ScriptVO> queryPublishedScript(ScriptQueryVO queryVO){
// return iScriptService.queryPublishedScript(queryVO);
// }
}

View File

@ -0,0 +1,83 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.simulation.cbtc.script.ScriptUpdateVO;
import club.joylink.rtss.entity.ScriptDraftWithBLOBs;
import club.joylink.rtss.services.IScriptDraftService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageQueryVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.script.ScriptNewVO;
import club.joylink.rtss.vo.client.script.ScriptVO;
import club.joylink.rtss.vo.client.validGroup.ScriptCreateCheck;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@Api(tags = { "草稿剧本接口" })
@RestController
@RequestMapping(path = "/api/script/draft")
public class ScriptDraftController {
@Autowired
private IScriptDraftService iScriptDraftService;
@ApiOperation(value = "分页查询地图下个人的剧本列表")
@GetMapping(path = "/{mapId}/list")
public PageVO<ScriptVO> listByMapIdOfUser(@PathVariable Long mapId, PageQueryVO queryVO,
@ApiIgnore @RequestAttribute UserVO user) {
return iScriptDraftService.queryPagedScript(mapId, user, queryVO);
}
@ApiOperation(value = "创建剧本")
@PostMapping(path = "")
public String createScript(@RequestBody @Validated(value = ScriptCreateCheck.class) ScriptVO scriptVO,
@ApiIgnore @RequestAttribute UserVO user) {
return iScriptDraftService.createScript(scriptVO, user);
}
@ApiOperation(value = "通过id查询剧本基础信息")
@GetMapping(path = "/{id}")
public ScriptNewVO getBasicInfoById(@PathVariable Long id) {
return iScriptDraftService.getBasicInfo(id);
}
@ApiOperation(value = "修改剧本基本信息")
@PutMapping(path = "/{id}")
public void updateScriptBasicInfo(@PathVariable Long id, @RequestBody @Validated ScriptUpdateVO updateVO,
@ApiIgnore @RequestAttribute UserVO user) {
iScriptDraftService.updateScriptInfo(id, updateVO, user);
}
@ApiOperation(value = "根据id删除剧本")
@DeleteMapping(path = "/{id}")
public void deleteScriptById(@PathVariable Long id, @ApiIgnore @RequestAttribute UserVO user) {
iScriptDraftService.deleteScript(id, user);
}
@ApiOperation(value = "剧本发布")
@PutMapping(path = "/{id}/publish")
public void publish(@PathVariable Long id, @RequestBody String name, @RequestAttribute UserVO user){
iScriptDraftService.publish(id, name, user);
}
@ApiOperation(value = "剧本撤销发布")
@PutMapping(path = "/{id}/retract")
public void retract(@PathVariable Long id, @RequestAttribute UserVO user){
iScriptDraftService.retract(id, user);
}
@ApiOperation("导出剧本数据")
@GetMapping("/{id}/export")
public ScriptDraftWithBLOBs export(@PathVariable Long id) {
return iScriptDraftService.export(id);
}
@ApiOperation("导入剧本数据")
@PostMapping("/{mapId}/import")
public void importFromJson(@PathVariable Long mapId, String name, @RequestBody ScriptDraftWithBLOBs scriptDraft, @RequestAttribute UserVO user) {
iScriptDraftService.importFromJson(mapId, name, scriptDraft, user);
}
}

View File

@ -0,0 +1,40 @@
package club.joylink.rtss.controller;
import com.joylink.base.exception.BusinessException;
import com.joylink.base.exception.constant.ExceptionMapping;
import club.joylink.rtss.services.ISimulationService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.SimulationVO;
import club.joylink.rtss.vo.client.simulation.SimulationPageQueryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.constraints.NotBlank;
@Api(tags = { "仿真管理接口" })
@RestController
@RequestMapping(path = "/api/simulation/manage")
public class SimulationManageOldController {
@Autowired
private ISimulationService iSimulationService;
@ApiOperation(value = "分页查询存在的仿真")
@GetMapping(path = "/page")
public PageVO<SimulationVO> pageQueryExistSimulations(SimulationPageQueryVO queryVO, @ApiIgnore @RequestAttribute UserVO user) {
if(!user.isAdmin()) return null;
return this.iSimulationService.pageQueryExistSimulations(queryVO);
}
@ApiOperation(value = "结束仿真")
@DeleteMapping(path = "/{group}")
public void overSimulation(@PathVariable @NotBlank String group, @ApiIgnore @RequestAttribute UserVO user) {
if(!user.isSuperAdmin()) throw new BusinessException(ExceptionMapping.ROLE_OPERATION_REFUSE);
this.iSimulationService.adminForceClearSimulation(group);
}
}

View File

@ -0,0 +1,69 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.services.ISimulationRecordService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageQueryVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.SimulationRecordVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@Api(tags = { "仿真记录管理接口" })
@RestController
@RequestMapping(path = "/api/simulationRecord")
public class SimulationRecordController {
@Autowired
private ISimulationRecordService iSimulationRecordService;
@ApiOperation(value = "分页查询仿真记录")
@GetMapping(path = "")
public PageVO<SimulationRecordVO> queryPagedRecord(PageQueryVO queryVO) {
return this.iSimulationRecordService.queryPagedRecord(queryVO);
}
@ApiOperation(value = "回放")
@GetMapping(path = "/{id}/playBack")
public void playBack(@PathVariable Long id, @RequestAttribute @ApiIgnore UserVO user) {
this.iSimulationRecordService.playBack(id, user);
}
@ApiOperation(value = "设置播放速度")
@PutMapping(path = "/{id}/playSpeed")
public void setPlaySpeed(@PathVariable Long id, float playSpeed, @RequestAttribute @ApiIgnore UserVO user) {
this.iSimulationRecordService.setPlaySpeed(id, playSpeed, user);
}
@ApiOperation(value = "暂停")
@PutMapping(path = "/{id}/pause")
public void pause(@PathVariable Long id, @RequestAttribute @ApiIgnore UserVO user) {
this.iSimulationRecordService.pause(id, user);
}
@ApiOperation(value = "播放")
@PutMapping(path = "/{id}/play")
public void play(@PathVariable Long id, @RequestAttribute @ApiIgnore UserVO user) {
this.iSimulationRecordService.play(id, user);
}
@ApiOperation(value = "设置播放时间点")
@PutMapping(path = "/{id}/playTime")
public void setPlayTime(@PathVariable Long id, Long offsetSeconds, @RequestAttribute @ApiIgnore UserVO user) {
this.iSimulationRecordService.setPlayTime(id, offsetSeconds, user);
}
@ApiOperation(value = "结束")
@PutMapping(path = "/{id}/over")
public void over(@PathVariable Long id, @RequestAttribute @ApiIgnore UserVO user) {
this.iSimulationRecordService.over(id, user);
}
@ApiOperation(value = "删除记录")
@DeleteMapping(path = "/{id}")
public void delete(@PathVariable Long id, @RequestAttribute @ApiIgnore UserVO user) {
this.iSimulationRecordService.delete(id, user);
}
}

View File

@ -0,0 +1,62 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.constants.RoleEnum;
import club.joylink.rtss.controller.advice.Role;
import club.joylink.rtss.services.notice.ISystemNoticeService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.notice.SysNoticePageQueryVO;
import club.joylink.rtss.vo.client.notice.SystemNoticeVO;
import club.joylink.rtss.vo.client.notice.UserSysnoticeUnreadVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = {"系统通知接口"})
@RestController
@RequestMapping(path = "api/v1/sysNotice")
public class SysNoticeController {
@Autowired
private ISystemNoticeService systemNoticeService;
@ApiOperation(value = "通知")
@PostMapping
@Role(RoleEnum.SuperAdmin)
public void notice(@ApiIgnore @RequestAttribute UserVO user, String noticeType, @RequestBody @Validated SystemNoticeVO sysNotice) {
sysNotice.setCreator(user.getId());
systemNoticeService.notice(sysNotice, noticeType);
}
@ApiOperation(value = "分页查询通知")
@GetMapping(path = "/paging")
public PageVO<SystemNoticeVO> pagingQuery(SysNoticePageQueryVO pageQueryVO) {
return systemNoticeService.pagingQuerySysNotice(pageQueryVO);
}
@ApiOperation(value = "删除通知")
@DeleteMapping
@Role(RoleEnum.SuperAdmin)
public void deleteSysNotice(@RequestBody List<Long> sysNoticeIds) {
systemNoticeService.deleteSysNotice(sysNoticeIds);
}
@ApiOperation(value = "用户查询未读通知")
@GetMapping(path = "/unread")
public UserSysnoticeUnreadVO loadCompetitionPaper(@ApiIgnore @RequestAttribute UserVO user) {
return systemNoticeService.getUserRelUnreadNotice(user);
}
@ApiOperation(value = "用户设置已读未读")
@PutMapping(path = "/read")
public void getCompetitionPaper(@ApiIgnore @RequestAttribute UserVO user, @RequestBody List<Long> sysNoticeIds, @RequestParam(defaultValue = "true",required = false) boolean read) {
systemNoticeService.setUserSysNoticeReadStatus(user, sysNoticeIds, read);
}
}

View File

@ -0,0 +1,48 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.services.ITaskService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.TaskListVO;
import club.joylink.rtss.vo.client.TaskQueryVO;
import club.joylink.rtss.vo.client.TaskVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@Api(tags = { "任务接口" })
@RestController
@RequestMapping(path = "/api/task")
public class TaskController {
@Autowired
private ITaskService iTaskService;
@ApiOperation(value = "分页查询任务数据")
@GetMapping(path = "")
public PageVO<TaskListVO> queryPagedTask(TaskQueryVO queryVO) {
return this.iTaskService.queryPagedTask(queryVO);
}
@ApiOperation(value = "创建任务")
@PostMapping(path = "")
public void createTask(@RequestBody @Validated TaskVO taskVO, @ApiIgnore @RequestAttribute UserVO user) {
this.iTaskService.createTask(taskVO, user);
}
@ApiOperation(value = "开始任务")
@PostMapping(path = "/{id}/execute")
public void start(@PathVariable Long id) {
this.iTaskService.execute(id);
}
@ApiOperation(value = "取消任务")
@PostMapping(path = "/{id}/cancel")
public void cancel(@PathVariable Long id) {
this.iTaskService.cancel(id);
}
}

View File

@ -0,0 +1,145 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.constants.RoleEnum;
import club.joylink.rtss.controller.advice.Role;
import club.joylink.rtss.services.ISysUserService;
import club.joylink.rtss.services.local.UserGenerateService;
import club.joylink.rtss.services.student.IClassStudentUserService;
import club.joylink.rtss.vo.UserQueryVO;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.UserConfigVO;
import club.joylink.rtss.vo.client.UserSubscribeVO;
import club.joylink.rtss.vo.client.map.MapVO;
import club.joylink.rtss.vo.client.student.ExportStudentInfo;
import club.joylink.rtss.vo.client.student.ImportStudentInfo;
import club.joylink.rtss.vo.client.student.StudentClassVO;
import club.joylink.rtss.vo.client.student.StudentInfoExportParam;
import club.joylink.rtss.vo.client.user.WeChatBindStatusVO;
import club.joylink.rtss.vo.user.UserGenerateConfigVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.constraints.NotBlank;
import java.util.List;
@Api(tags = { "用户配置接口" })
@RestController
@RequestMapping("/api/user")
public class UserController {
@Autowired
private ISysUserService iSysUserService;
@Autowired
private UserGenerateService userGenerateService;
@Autowired
private IClassStudentUserService iClassStudentUserService;
@ApiOperation(value = "更新用户配置")
@PostMapping(path = "/config")
public void saveUserConfig(@RequestBody @Validated List<UserConfigVO> userConfigVOList, @RequestAttribute @ApiIgnore UserVO user) {
this.iSysUserService.saveUserConfig(user.getId(), userConfigVOList);
}
@ApiOperation(value = "获取用户配置")
@GetMapping(path = "/config")
public List<UserConfigVO> getUserConfig(@RequestAttribute @ApiIgnore UserVO user) {
return this.iSysUserService.getUserConfig(user.getId());
}
@Role({RoleEnum.SuperAdmin})
@ApiOperation(value = "生成线下环境用户")
@PostMapping(path = "/generate/offline")
public void generateOfflineUsers(@RequestBody @Validated UserGenerateConfigVO generateConfigVO,
@RequestAttribute @ApiIgnore UserVO user) {
this.userGenerateService.generateOfflineUser(generateConfigVO, user);
}
@Role({RoleEnum.Admin, RoleEnum.SuperAdmin})
@ApiOperation(value = "分页获取用户数据")
@GetMapping(path = "")
public PageVO<UserVO> queryPagedUser(UserQueryVO queryVO) {
return this.iSysUserService.queryPagedUser(queryVO);
}
@Role(RoleEnum.SuperAdmin)
@ApiOperation(value = "修改用户角色")
@PutMapping(path = "/{id}/role")
public void updateUserRole(@PathVariable Long id, @RequestBody UserVO userVO, @RequestAttribute @ApiIgnore UserVO user) {
this.iSysUserService.updateUserRole(id, user.getId(), userVO);
}
@Role(RoleEnum.SuperAdmin)
@ApiOperation(value = "修改用户单位")
@PutMapping(path = "/{id}/company")
public void updateUserCompany(@PathVariable Long id, @RequestBody UserVO userVO, @RequestAttribute @ApiIgnore UserVO user) {
this.iSysUserService.updateUserCompany(id, user.getId(), userVO);
}
@Role(RoleEnum.SuperAdmin)
@ApiOperation(value = "管理员修改用户信息")
@PutMapping(path = "/{id}/info")
public void updateUserInfo(@PathVariable Long id, @RequestBody UserVO userVO, @RequestAttribute @ApiIgnore UserVO user) {
this.iSysUserService.updateUserInfo(id, user.getId(), userVO);
}
@ApiOperation(value = "修改用户密码")
@PutMapping(path = "/{id}/password")
public void updateUserPassword(@PathVariable Long id, @RequestBody UserVO userVO, @RequestAttribute @ApiIgnore UserVO user) {
this.iSysUserService.updateUserPassword(id, userVO.getPassword());
}
@ApiOperation(value = "获取微信小程序绑定二维码")
@GetMapping(path = "/bind/wm/url")
public WeChatBindStatusVO getWeChatBindUrl(@RequestAttribute @ApiIgnore UserVO user) {
return this.iSysUserService.getWeChatBindUrl(user);
}
@ApiOperation(value = "用户绑定微信小程序")
@PutMapping(path = "/bind/wm")
public void userBindWm(String code, Long userId) {
this.iSysUserService.userBindWm(code, userId);
}
@ApiOperation(value = "微信小程用户绑定单位")
@PutMapping(path = "/bind/company")
public void userBindCompany(Long userId, Integer companyId) {
this.iSysUserService.userBindCompany(userId, companyId);
}
@ApiOperation(value = "获取用户总数量")
@GetMapping(path = "/amount")
public int getUserAmount() {
return iSysUserService.getUserAmount();
}
@ApiOperation(value = "分页获取用户数据(模糊查询)")
@GetMapping(path = "/fuzzy")
public List<UserVO> fuzzyQueryPagedUser(@NotBlank(message = "参数不能为空") String fuzzyParam) {
return this.iSysUserService.fuzzyQueryPagedUser(fuzzyParam);
}
@ApiOperation(value="贵州装备制造导入学生信息接口")
@PostMapping(path="/project/{projectCode}/import/student")
public void importStudents(@PathVariable String projectCode, @Validated @RequestBody ImportStudentInfo importStudentInfo, @RequestAttribute @ApiIgnore UserVO user){
this.iClassStudentUserService.importStudentInfos(projectCode, importStudentInfo, user);
}
@ApiOperation(value="贵州装备制造导出学生信息及成绩接口")
@PutMapping(path="/project/{projectCode}/export/student")
public List<ExportStudentInfo> importStudents(@PathVariable String projectCode, @Validated @RequestBody StudentInfoExportParam infoExportParam){
return this.iClassStudentUserService.studentInfoStatistics(infoExportParam);
}
@ApiOperation(value="贵州装备制造查询对应的班级")
@GetMapping(path="/project/{projectCode}/classes")
public List<StudentClassVO> getClasses(@PathVariable String projectCode){
return this.iClassStudentUserService.getClassesByProjectCode(projectCode);
}
}

View File

@ -0,0 +1,71 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import club.joylink.rtss.services.IUserExamService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import springfox.documentation.annotations.ApiIgnore;
@Api(tags = { "用户考试接口" })
@RestController
@RequestMapping("/api/userExam")
public class UserExamController {
@Autowired
private IUserExamService iUserExamService;
@ApiOperation(value = "生成用户考试实例")
@GetMapping(path = "/{examId}/generate")
public UserExamVO generateExamInstance(@PathVariable long examId, @ApiIgnore @RequestAttribute UserVO user) {
return this.iUserExamService.generateExamInstance(examId, user);
}
@ApiOperation(value = "获取用户考试实例")
@GetMapping(path = "/{id}")
public UserExamVO getExamInstance(@PathVariable long id, @ApiIgnore @RequestAttribute UserVO user) {
return this.iUserExamService.getExamInstance(id, user);
}
@ApiOperation(value = "完成考试题目")
@PutMapping(path = "/finish")
public void finish(@RequestBody @Validated UserExamQuestionsVO userExamQuestionsVO,
@ApiIgnore @RequestAttribute UserVO user) {
this.iUserExamService.finish(userExamQuestionsVO, user);
}
@ApiOperation(value = "提交考试")
@PutMapping(path = "/{id}/submit")
public UserExamVO submit(@PathVariable long id, @ApiIgnore @RequestAttribute UserVO user) {
return this.iUserExamService.submit(id, user);
}
@ApiOperation(value = "放弃考试")
@PutMapping(path = "/{id}/abandon")
public void abandon(@PathVariable long id, @ApiIgnore @RequestAttribute UserVO user) {
this.iUserExamService.abandon(id, user);
}
@ApiOperation(value = "分页查询用户考试数据")
@GetMapping(path = "/list")
public PageVO<UserExamListVO> queryPagedUserExam(UserExamQueryVO queryVO) {
return this.iUserExamService.queryPagedUserExam(queryVO);
}
@ApiOperation(value = "修改用户考试数据")
@PutMapping(path = "/{id}")
public void updateUserExam(@PathVariable Long id, @RequestBody UserExamVO userExamVO, @ApiIgnore @RequestAttribute UserVO user) {
this.iUserExamService.updateUserExam(id, userExamVO, user);
}
@ApiOperation(value = "删除用户考试数据")
@DeleteMapping(path = "/{id}")
public void queryPagedUserExam(@PathVariable Long id, @ApiIgnore @RequestAttribute UserVO user) {
this.iUserExamService.deleteUserExam(id, user);
}
}

View File

@ -0,0 +1,104 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.services.ISysUserService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.user.MobileInfoVO;
import club.joylink.rtss.vo.client.user.UpdateEmailVO;
import club.joylink.rtss.vo.client.user.UpdateMobileVO;
import club.joylink.rtss.vo.client.user.UpdatePasswordVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = { "用户信息接口" })
@RestController
@RequestMapping("/api/userinfo")
public class UserInfoController {
@Autowired
private ISysUserService iSysUserService;
@ApiOperation(value = "根据姓名或电话号查询用户")
@GetMapping(path="/nameOrMobile")
public List<UserVO> queryUserByNameOrMobile(String query) {
List<UserVO> list = this.iSysUserService.queryUserByNameOrMobile(query);
return list;
}
@ApiOperation(value = "根据用户id获取用户信息")
@GetMapping(path = "/{id}")
public UserVO getUserBaseInfoById(@PathVariable Long id) {
return this.iSysUserService.getUserBaseInfoById(id);
}
@ApiOperation(value = "修改用户信息")
@PutMapping(path = "/{id}")
public void modify(@PathVariable Long id, @RequestBody UserVO userInfo, String vdcode) {
this.iSysUserService.modify(id, userInfo, vdcode);
}
@ApiOperation(value = "微信关注事件")
@GetMapping(path = "/wxsubscribe")
public void wxSubscribe(@RequestParam String wxId) {
iSysUserService.wxSubscribeEventHandle(wxId);
}
@ApiOperation(value = "批量修改用户的openId为unionId")
@PutMapping(path = "/batchchange/unionid")
public void batchChangeOpenId2UnionId() {
this.iSysUserService.batchChangeOpenId2UnionId();
}
@ApiOperation(value = "更新用户真实姓名")
@PutMapping(path = "/{id}/name")
public void updateName(@PathVariable Long id, String name) {
this.iSysUserService.updateUserName(id, name);
}
@ApiOperation(value = "更新用户昵称")
@PutMapping(path = "/{id}/nickname")
public void updateNickname(@PathVariable Long id, String nickname) {
this.iSysUserService.updateNickname(id, nickname);
}
@ApiOperation(value = "用户上传头像")
@PostMapping(path = "/{id}/avatar")
public void uploadAvatar(@PathVariable Long id, @RequestBody UserVO userVO) {
this.iSysUserService.updateAvatar(id, userVO.getAvatarPath());
}
@ApiOperation(value = "发送手机验证码")
@PostMapping(path = "/mobile/code")
public String sendMobileValidCode(@RequestBody MobileInfoVO mobileInfoVO) {
return this.iSysUserService.sendMobileValidCode(mobileInfoVO);
}
@ApiOperation(value = "发送邮箱验证码")
@PostMapping(path = "/email/code")
public String sendEmailValidCode(String email) {
return this.iSysUserService.sendEmailValidCode(email);
}
@ApiOperation(value = "更新用户手机号")
@PutMapping(path = "/{id}/mobile")
public void updateMobile(@PathVariable Long id, @RequestBody @Validated UpdateMobileVO updateMobileVO) {
this.iSysUserService.updateMobile(id, updateMobileVO);
}
@ApiOperation(value = "更新用户邮箱")
@PutMapping(path = "/{id}/email")
public void updateEmail(@PathVariable Long id, @RequestBody @Validated UpdateEmailVO updateEmailVO) {
this.iSysUserService.updateEmail(id, updateEmailVO);
}
@ApiOperation(value = "更新用户登陆密码")
@PutMapping(path = "/{id}/password")
public void updatePassword(@PathVariable Long id, @RequestBody @Validated UpdatePasswordVO updatePasswordVO) {
this.iSysUserService.updatePassword(id, updatePasswordVO);
}
}

View File

@ -0,0 +1,79 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.services.IUserPermissionService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.permission.DistributeSelectVO;
import club.joylink.rtss.vo.client.permission.PermissionQueryVO;
import club.joylink.rtss.vo.client.userPermission.UserPermissionVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = { "用户权限管理" })
@RestController
@RequestMapping("/api/userPermission")
public class UserPermissionController {
@Autowired
private IUserPermissionService iUserPermissionService;
@ApiOperation(value = "分页获取用户权限数据")
@GetMapping(path="")
public PageVO<UserPermissionVO> queryPagedPermission(PermissionQueryVO queryVO,@RequestAttribute @ApiIgnore UserVO user) {
return this.iUserPermissionService.queryPagedPermission(queryVO);
}
@ApiOperation(value = "设置用户权限状态")
@PutMapping(path = "/{id}/status")
public void invalid(@PathVariable Long id) {
this.iUserPermissionService.setInvalid(id);
}
@ApiOperation(value = "获取用户可以分发的权限")
@GetMapping(path="/getAvailableUserPermission")
public List<UserPermissionVO> findAvailablePermission(DistributeSelectVO distributeSelectVO, @RequestAttribute @ApiIgnore UserVO user) {
return this.iUserPermissionService.findUserPermissionVOListThatCanDistribute(distributeSelectVO,user);
}
@ApiOperation(value = "分页获取个人权限数据")
@GetMapping(path = "/my")
public PageVO<UserPermissionVO> queryMyPermission(PermissionQueryVO queryVO, @RequestAttribute @ApiIgnore UserVO user) {
return this.iUserPermissionService.queryMyPermission(user, queryVO);
}
@ApiOperation(value = "设置用户权限所有者")
@PutMapping(path = "/{id}/owner")
public void setPermissionOwner(@PathVariable Long id, @RequestBody UserVO owner, @RequestAttribute @ApiIgnore UserVO user) {
this.iUserPermissionService.setPermissionOwner(id, owner, user);
}
@ApiOperation(value = "用户数据统计")
@GetMapping(path = "/statistic")
public PageVO<UserPermissionVO> userPermissionStatistic(PermissionQueryVO queryVO) {
return iUserPermissionService.userPermissionStatistic(queryVO);
}
@ApiOperation(value = "用户权限转增归属")
@GetMapping(path = "/gotUserList")
public PageVO<UserPermissionVO> distributeTo(PermissionQueryVO queryVO) {
return iUserPermissionService.distributeTo(queryVO);
}
@ApiOperation(value = "回收用户权限到权限分发中")
@PutMapping(path = "/{id}/back")
public void restorePermissionToDistribute(@PathVariable Long id) {
iUserPermissionService.restorePermissionToDistribute(id);
}
@ApiOperation(value = "")
@GetMapping(path = "/personal")
public List<UserPermissionVO> queryPersonalUserPermission(@RequestAttribute @ApiIgnore UserVO user) {
return iUserPermissionService.queryPersonalUserPermission(user);
}
}

View File

@ -0,0 +1,98 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.services.IUserSimulationStatService;
import club.joylink.rtss.services.IUserUsageStatsService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.UsageTotalStatsVO;
import club.joylink.rtss.vo.client.UserRankStatsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = { "用户使用数据统计接口" })
@RestController
@RequestMapping(path = "/api/stats")
public class UserUsageStatsController {
@Autowired
private IUserUsageStatsService iUserUsageStatsService;
@Autowired
private IUserSimulationStatService iUserSimulationStatService;
@ApiOperation(value = "课程列表")
@GetMapping(path = "/lesson/list")
public List<UserRankStatsVO> queryLessonList(@RequestAttribute UserVO user) {
return this.iUserUsageStatsService.queryLessonList(user);
}
@ApiOperation(value = "课程统计排名")
@GetMapping(path = "/lesson/{lessonId}/rank")
public List<UserRankStatsVO> lessonRank(@PathVariable Long lessonId, @RequestAttribute UserVO user) {
return this.iUserUsageStatsService.lessonRank(lessonId, user);
}
@ApiOperation(value = "个人课程实训数据统计")
@GetMapping(path = "/lesson/{lessonId}/stats")
public List<UserRankStatsVO> lessonPersonalStats(@PathVariable Long lessonId, @RequestAttribute UserVO user) {
return this.iUserUsageStatsService.personalLessonStats(lessonId, user);
}
@ApiOperation(value = "查询参与考试的课程列表")
@GetMapping(path = "/exam/lessonList")
public List<UserRankStatsVO> queryExamLessonList(@ApiIgnore @RequestAttribute UserVO user) {
return this.iUserUsageStatsService.queryExamLessonList(user);
}
@ApiOperation(value = "查询参与考试的试题列表")
@GetMapping(path = "/exam/{lessonId}/list")
public List<UserRankStatsVO> queryExamList(@PathVariable Long lessonId, @ApiIgnore @RequestAttribute UserVO user) {
return this.iUserUsageStatsService.queryExamList(lessonId, user);
}
@ApiOperation(value = "考试排名")
@GetMapping(path = "/exam/{examId}/rank")
public List<UserRankStatsVO> examRank(@PathVariable long examId, @ApiIgnore @RequestAttribute UserVO user) {
return this.iUserUsageStatsService.examRank(examId, user);
}
@ApiOperation(value = "个人考试数据统计")
@GetMapping(path = "/exam/{examId}/stats")
public List<UserRankStatsVO> examPersonalStats(@PathVariable long examId, @ApiIgnore @RequestAttribute UserVO user) {
return this.iUserUsageStatsService.examPersonalStats(examId, user);
}
@ApiOperation(value = "查询参与仿真的地图列表")
@GetMapping(path = "/simulation/mapList")
public List<UserRankStatsVO> querySimulationMapList(@ApiIgnore @RequestAttribute UserVO user) {
return iUserSimulationStatService.querySimulationMapList(user);
}
@ApiOperation(value = "查询参与仿真的产品列表")
@GetMapping(path = "/simulation/{mapId}/prdList")
public List<UserRankStatsVO> querySimulationPrdList(@PathVariable Long mapId, @ApiIgnore @RequestAttribute UserVO user) {
return iUserSimulationStatService.querySimulationPrdList(mapId, user);
}
@ApiOperation(value = "仿真时长排名")
@GetMapping(path = "/simulation/{mapId}/{prdType}/rank")
public List<UserRankStatsVO> simulationRank(@PathVariable Long mapId, @PathVariable String prdType, @ApiIgnore @RequestAttribute UserVO user) {
return iUserSimulationStatService.simulationRank(mapId, prdType, user);
}
@ApiOperation(value = "个人仿真数据统计")
@GetMapping(path = "/simulation/{mapId}/stats")
public List<UserRankStatsVO> simulationPersonalStats(@PathVariable Long mapId, @ApiIgnore @RequestAttribute UserVO user) {
return iUserSimulationStatService.simulationPersonalStats(mapId, user);
}
@ApiOperation(value = "统计各系统总时长")
@GetMapping(path = "/total")
public List<UsageTotalStatsVO> totalSimulationDuration(boolean filter) {
return iUserUsageStatsService.totalDuration(filter);
}
}

View File

@ -0,0 +1,33 @@
package club.joylink.rtss.controller;
import club.joylink.rtss.simulation.cbtc.command.VoiceCommandBO;
import club.joylink.rtss.services.IVoiceCommandService;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@Api(tags = "语音指令接口")
@RestController
@RequestMapping("/api/voiceCommand")
public class VoiceCommandController {
@Autowired
private IVoiceCommandService iVoiceCommandService;
@ApiOperation("添加语音指令")
@PostMapping("")
public void create(VoiceCommandBO command) {
iVoiceCommandService.create(command);
}
@ApiOperation("查询所有语音指令")
@GetMapping("")
public List<VoiceCommandBO> getAll() {
return iVoiceCommandService.getAll();
}
}

View File

@ -0,0 +1,19 @@
package club.joylink.rtss.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/wxauth")
public class WxAuthenticateController {
// @Autowired
// private IAuthenticateService iAuthenticateService;
//
// @ApiOperation(value = "根据微信小程序code获取用户信息")
// @GetMapping(path = "/micro")
// public UserVO getUserInfoByWMCode(String wmCode) {
// return this.iAuthenticateService.getUserInfoByWMCode(wmCode);
// }
}

View File

@ -0,0 +1,55 @@
package club.joylink.rtss.controller.advice;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.LoginSessionManager;
import club.joylink.rtss.vo.LoginUserInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Objects;
/**
* 权限验证拦截器
* @author sheng
*
*/
@Component
@Slf4j
public class AuthenticateInterceptor implements HandlerInterceptor {
public static final String LOGIN_USER_KEY = "user";
public static final String LOGIN_INFO_KEY = "loginInfo";
@Autowired
private LoginSessionManager loginSessionManager;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
// String host = request.getHeader("Host");
// String forwardedHost = request.getHeader("X-Forwarded-Host");
// String forwardedFor = request.getHeader("X-Forwarded-For");
// log.debug(String.format("host:[%s], forwardedHost:[%s], forwardedFor:[%s]", host, forwardedHost, forwardedFor));
String realIp = request.getHeader("X-Real-IP");
log.debug(String.format("request[Method: '%s', RealIp: [%s], RemoteAddr: '%s', RequestURI: '%s']",
request.getMethod(), realIp, request.getRemoteAddr(), request.getRequestURI()));
// 登陆权限验证
if(RequestMethod.OPTIONS.name().equals(request.getMethod())) return true;
String token = request.getHeader("X-Token");
BusinessExceptionAssertEnum.NOT_LOGIN.assertTrue(StringUtils.hasText(token));
LoginUserInfoVO loginUserInfoVO = null;
// token获取登陆用户
loginUserInfoVO = this.loginSessionManager.getLoginInfoByToken(token);
request.setAttribute(LOGIN_USER_KEY, loginUserInfoVO.getUserVO());
request.setAttribute(LOGIN_INFO_KEY, loginUserInfoVO);
return true;
}
}

View File

@ -0,0 +1,82 @@
package club.joylink.rtss.controller.advice;
import club.joylink.rtss.exception.BusinessException;
import club.joylink.rtss.simulation.cbtc.exception.SimulationException;
import club.joylink.rtss.vo.CommonJsonResponse;
import club.joylink.rtss.vo.ResponseConsts;
import lombok.extern.slf4j.Slf4j;
import org.springframework.core.MethodParameter;
import org.springframework.http.MediaType;
import org.springframework.http.server.ServerHttpRequest;
import org.springframework.http.server.ServerHttpResponse;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
import java.util.List;
@ControllerAdvice
@Slf4j
public class CommonResponseBody implements ResponseBodyAdvice {
@Override
public boolean supports(MethodParameter returnType, Class converterType) {
return returnType.getMethod() != null && !returnType.getMethod().getReturnType().getSimpleName().equals("CommonJsonResponse");
}
@Override
public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType,
Class selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) {
if(body instanceof CommonJsonResponse) {
return body;
}
if(request.getURI().getPath().startsWith("/swagger")) {
return body;
}
if (request.getURI().getPath().equals("/api/userinfo/ifRegisted")) {
return body;
}
if (request.getURI().getPath().equals("/api/userinfo/identity")) {
return body;
}
CommonJsonResponse commonJsonResponse = CommonJsonResponse.newSuccessResponse(body);
if(returnType.getMethod().getReturnType().equals(String.class) || body instanceof String) {
return commonJsonResponse.toJSONString();
}
return commonJsonResponse;
}
@ExceptionHandler(Exception.class)
@ResponseBody
public CommonJsonResponse handleException(Exception e) {
if(e instanceof MethodArgumentNotValidException) {
// 参数验证异常处理
MethodArgumentNotValidException validException = (MethodArgumentNotValidException) e;
List<ObjectError> errorList = validException.getBindingResult().getAllErrors();
StringBuffer sb = new StringBuffer();
errorList.forEach(error ->
sb.append(error.getCodes()[0]).append(" : ").append(error.getDefaultMessage()).append("; "));
log.error("【参数校验异常】{}", e);
return CommonJsonResponse.newErrorResponse(ResponseConsts.VALIDATE_ERROR.getCode(), sb.toString());
} if(e instanceof BusinessException) {
club.joylink.rtss.exception.BusinessException be = (club.joylink.rtss.exception.BusinessException) e;
log.error("【业务异常】{}", e);
return CommonJsonResponse.newErrorResponse(be.getCode(), be.getVoMessage());
} else if(e instanceof MissingServletRequestParameterException) {
log.error("【接口参数异常】", e);
return CommonJsonResponse.newErrorResponse(ResponseConsts.VALIDATE_ERROR.getCode(), "接口参数异常");
} else if (e instanceof SimulationException) {
club.joylink.rtss.simulation.cbtc.exception.SimulationException simulationException = (club.joylink.rtss.simulation.cbtc.exception.SimulationException) e;
log.error("【仿真系统异常】{}", e);
return CommonJsonResponse.newErrorResponse(simulationException.getCode(), simulationException.getMessage());
}
log.error("【系统异常】{}", e);
return CommonJsonResponse.newErrorResponse();
}
}

View File

@ -0,0 +1,36 @@
package club.joylink.rtss.controller.advice;
import club.joylink.rtss.configuration.configProp.OtherConfig;
import club.joylink.rtss.constants.SystemEnv;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.services.license.LicenseService;
import club.joylink.rtss.vo.license.LicenseVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Slf4j
@Component
public class LicenseInterceptor implements HandlerInterceptor {
@Autowired
private OtherConfig otherConfig;
@Autowired
private LicenseService licenseService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
if (SystemEnv.isLocalEnv(otherConfig.getEnv())) {
log.debug(String.format("本地部署许可证验证"));
LicenseVO license = this.licenseService.getLicense();
BusinessExceptionAssertEnum.LICENSE_EXPIRED.assertNotTrue(license.isExpire(), "本地license已过期");
log.debug("本地许可证有效");
}
return true;
}
}

View File

@ -0,0 +1,58 @@
package club.joylink.rtss.controller.advice;
import java.io.Serializable;
@SuppressWarnings("serial")
public class RequestInfo implements Serializable {
private String url;
private String methodType;
private String ip;
private String classMethod;
private String args;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getMethodType() {
return methodType;
}
public void setMethodType(String methodType) {
this.methodType = methodType;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getClassMethod() {
return classMethod;
}
public void setClassMethod(String classMethod) {
this.classMethod = classMethod;
}
public String getArgs() {
return args;
}
public void setArgs(String args) {
this.args = args;
}
}

View File

@ -0,0 +1,15 @@
package club.joylink.rtss.controller.advice;
import club.joylink.rtss.constants.RoleEnum;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(value = ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Role {
RoleEnum[] value();
}

View File

@ -0,0 +1,50 @@
package club.joylink.rtss.controller.advice;
import club.joylink.rtss.constants.BusinessConsts;
import club.joylink.rtss.constants.RoleEnum;
import club.joylink.rtss.exception.BusinessExceptionAssertEnum;
import club.joylink.rtss.vo.UserVO;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Aspect
@Component
public class RoleAspect {
@Before("execution(public * club.joylink.rtss.controller.*.*(..)) && @annotation(club.joylink.rtss.controller.advice.Role)")
public void doBefore(JoinPoint joinPoint) {
ServletRequestAttributes sra = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
assert sra != null;
UserVO userVO = (UserVO) sra.getRequest().getAttribute(BusinessConsts.LOGIN_USER_KEY);
// 没有登录时
if (Objects.isNull(userVO)) {
return;
}
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
Role roleAnnotation = method.getAnnotation(Role.class);
List<String> roles = Arrays.stream(roleAnnotation.value()).map(RoleEnum::getRole).collect(Collectors.toList());
// 判断用户角色和注解角色是否有交集
boolean hasRole = false;
for (String role : roles) {
for (String userRole : userVO.getRoles()) {
if (role.equals(userRole)) {
hasRole = true;
break;
}
}
}
BusinessExceptionAssertEnum.INSUFFICIENT_PERMISSIONS.assertTrue(hasRole);
}
}

View File

@ -0,0 +1,54 @@
package club.joylink.rtss.controller.cache;
import club.joylink.rtss.services.cache.ICacheService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageQueryVO;
import club.joylink.rtss.vo.client.PageVO;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@RestController
@RequestMapping(path = "/api/cache")
public class CacheController {
@Autowired
private ICacheService iCacheService;
@DeleteMapping(path = "/{key}")
public void remove(@PathVariable String key) {
this.iCacheService.remove(key);
}
@GetMapping(path = "/heartBeat")
public boolean heartBeat(@ApiIgnore @RequestAttribute UserVO user) {
return true;
}
@GetMapping(path = "/keys")
public PageVO<CacheKey> getCacheKey(String key, PageQueryVO queryVO) {
Stream<String> stream = iCacheService.getKeys().stream();
if (StringUtils.hasText(key)) {
stream = stream.filter(k -> k.contains(key));
}
List<String> collect = stream.sorted().collect(Collectors.toList());
List<CacheKey> list = collect.stream().skip(queryVO.getPageSize() * (queryVO.getPageNum() - 1))
.limit(queryVO.getPageSize())
.map(CacheKey::new)
.collect(Collectors.toList());
return new PageVO<>(queryVO.getPageNum(), queryVO.getPageSize(), collect.size(), list);
}
@Getter
@AllArgsConstructor
class CacheKey{
String key;
}
}

View File

@ -0,0 +1,149 @@
package club.joylink.rtss.controller.competition;
import com.fasterxml.jackson.annotation.JsonView;
import club.joylink.rtss.simulation.cbtc.script.ScriptBO;
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
import club.joylink.rtss.entity.CompetitionWithBLOBs;
import club.joylink.rtss.services.completition.ICompetitionPracticalService;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.competition.CompetitionPagedQueryVO;
import club.joylink.rtss.vo.client.competition.CompetitionResult;
import club.joylink.rtss.vo.client.competition.CompetitionVO;
import club.joylink.rtss.vo.client.competition.OperationStatisticVO;
import club.joylink.rtss.vo.client.validGroup.competition.CompetitionUpdateCheck;
import club.joylink.rtss.vo.view.OperationStatisticAnswerView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**
* 竞赛实操内容管理
*/
@Api(tags = {"竞赛实操内容管理"})
@RestController
@RequestMapping(path = "/api/v1/competitionPractical")
public class CompetitionPracticalController {
@Autowired
private ICompetitionPracticalService iCompetitionPracticalService;
@ApiOperation("分页查询竞赛场景信息")
@GetMapping("")
public PageVO<CompetitionVO> pagedQueryCompetition(CompetitionPagedQueryVO queryVO) {
return iCompetitionPracticalService.pagedQueryCompetition(queryVO);
}
@ApiOperation("查询竞赛场景信息列表")
@GetMapping("/list")
public List<CompetitionVO> getCompetitionList() {
return iCompetitionPracticalService.getCompetitionList();
}
@ApiOperation("新增竞赛场景")
@PostMapping("")
public void createCompetition(@RequestBody @Validated CompetitionVO competitionVO) {
iCompetitionPracticalService.createCompetition(competitionVO);
}
@ApiOperation("更新竞赛场景基础信息")
@PutMapping("")
public void updateCompetition(@RequestBody @Validated(CompetitionUpdateCheck.class) CompetitionVO competitionVO) {
iCompetitionPracticalService.updateCompetition(competitionVO);
}
@ApiOperation("删除竞赛场景")
@DeleteMapping("/{id}")
public void deleteCompetition(@PathVariable Long id) {
iCompetitionPracticalService.deleteCompetition(id);
}
@ApiOperation("获取场景详细信息")
@GetMapping("/detail/{id}")
public CompetitionVO getDetail(@PathVariable Long id) {
return iCompetitionPracticalService.getDetail(id);
}
@ApiOperation("保存数据")
@PostMapping("/detail")
public void saveDetail(@RequestBody @Validated(value = CompetitionUpdateCheck.class) CompetitionVO competitionVO) {
iCompetitionPracticalService.saveDetail(competitionVO);
}
@ApiOperation("导出")
@GetMapping("/{id}/export")
public CompetitionWithBLOBs export(@PathVariable Long id) {
return iCompetitionPracticalService.export(id);
}
@ApiOperation("导入")
@PostMapping("/{scriptId}/import")
public void importFromJson(@PathVariable Long scriptId, String name, @RequestBody CompetitionWithBLOBs competition) {
iCompetitionPracticalService.importFromJson(scriptId, name, competition);
}
/* ------------------------- 竞赛运行相关 ------------------------- */
@ApiOperation("加载竞赛场景")
@PutMapping("/load/{group}/{id}")
public void loadCompetition(@PathVariable String group, @PathVariable Long id,
@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO userInfo) {
iCompetitionPracticalService.loadCompetition(group, id, userInfo);
}
@ApiOperation("小程序加载竞赛场景")
@PutMapping("/load/{id}")
public String createSimulationAndLoadCompetition(@PathVariable Long id,
@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO userInfo) {
return iCompetitionPracticalService.createSimulationAndLoadCompetition(id, userInfo);
}
@ApiOperation("开始竞赛实操")
@PutMapping("/start/{group}")
public void start(@PathVariable String group, String memberId, ScriptBO.Mode mode,
@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO userInfo) {
iCompetitionPracticalService.start(group, memberId, mode, userInfo);
}
@ApiOperation("获取运营统计数据")
@GetMapping("/detail/os/{group}")
@JsonView(OperationStatisticAnswerView.class)
public OperationStatisticVO getOperationStatistic(@PathVariable String group) {
return iCompetitionPracticalService.getOperationStatistic(group);
}
@ApiOperation("提交运营统计答案")
@PutMapping("/detail/os/{group}")
public void submit(@PathVariable String group, @RequestBody OperationStatisticVO operationStatisticVO) {
iCompetitionPracticalService.submit(group, operationStatisticVO);
}
@ApiOperation("结束竞赛实操")
@PutMapping("/finish/{group}")
public CompetitionResult finish(@PathVariable String group, @RequestBody OperationStatisticVO operationStatisticVO, @RequestAttribute UserVO user) {
return iCompetitionPracticalService.finish(group, operationStatisticVO, user);
}
@ApiOperation("退出场景")
@PutMapping("/exit/{group}")
public void exit(@PathVariable String group, @RequestAttribute UserVO user) {
iCompetitionPracticalService.exit(group, user);
}
@ApiOperation("完成操作类动作(小程序专用)")
@PutMapping("/{group}/finish/operation/{actionId}")
public void finishAction(@PathVariable String group, @PathVariable String actionId, @RequestAttribute UserVO user) {
iCompetitionPracticalService.finishOperationAction(group, actionId, user);
}
@ApiOperation("语音播放完毕")
@PutMapping("/{group}/audio/over/{conversationMessageId}")
public void audioOver(@PathVariable String group, @PathVariable String conversationMessageId, @RequestAttribute UserVO user) {
iCompetitionPracticalService.audioOver(group, conversationMessageId, user);
}
}

View File

@ -0,0 +1,37 @@
package club.joylink.rtss.controller.competition;
import club.joylink.rtss.services.completition.CompetitionUserLikeManager;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.competition.CompetitionUserLikesVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.constraints.PositiveOrZero;
@Api(tags = "竞赛用户点赞")
@RestController
@RequestMapping(path = "/api/v1/likes")
public class CompetitionUserLikesController {
@Autowired
private CompetitionUserLikeManager likeManager;
@ApiOperation(value = "获取各用户点赞数和已点赞用户")
@GetMapping(path = "/project/{projectCode}")
public CompetitionUserLikesVO getUserLikes(@PathVariable String projectCode, @ApiIgnore @RequestAttribute UserVO user) {
return likeManager.getUserLikes(user.getId(), projectCode);
}
@ApiOperation(value = "点赞")
@PostMapping(path = "/project/{projectCode}")
public void like(@ApiIgnore @RequestAttribute UserVO user, @PathVariable String projectCode, @PositiveOrZero @RequestParam Long like) {
likeManager.like(projectCode, user.getId(), like);
}
}

View File

@ -0,0 +1,67 @@
package club.joylink.rtss.controller.competition;
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
import club.joylink.rtss.services.completition.IRaceQuestionsRuleService;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.competition.TheoryQuestionRuleQueryVO;
import club.joylink.rtss.vo.client.competition.TheoryQuestionsRuleVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = {"出题规则"})
@RestController
@RequestMapping("/api/questionsRule")
public class RaceQuestionsRuleController {
@Autowired
private IRaceQuestionsRuleService iRaceQuestionsRuleService;
@ApiOperation(value = "添加规则")
@PostMapping
public TheoryQuestionsRuleVO create(@RequestBody @Validated TheoryQuestionsRuleVO ruleVO,
@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginUserInfoVO) {
ruleVO.setProjectCode(loginUserInfoVO.getProject().name());
TheoryQuestionsRuleVO vo = this.iRaceQuestionsRuleService.create(ruleVO);
return vo;
}
@ApiOperation(value = "获取规则列表")
@GetMapping
public List<TheoryQuestionsRuleVO> queryAll() {
List<TheoryQuestionsRuleVO> list = this.iRaceQuestionsRuleService.queryRules();
return list;
}
@ApiOperation(value = "分页获取规则列表")
@GetMapping("paging")
public PageVO<TheoryQuestionsRuleVO> pagingQueryRules(TheoryQuestionRuleQueryVO queryVO,@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY) LoginUserInfoVO loginInfo) {
queryVO.setProjectCode(loginInfo.getProject().name());
PageVO<TheoryQuestionsRuleVO> list = this.iRaceQuestionsRuleService.pagingQueryRules(queryVO);
return list;
}
@ApiOperation(value = "删除规则")
@DeleteMapping("{id}")
public void delete(@PathVariable Integer id) {
this.iRaceQuestionsRuleService.deleteById(id);
}
@ApiOperation(value = "查询规则内容")
@GetMapping("{id}")
public TheoryQuestionsRuleVO get(@PathVariable Integer id) {
return this.iRaceQuestionsRuleService.getById(id);
}
@ApiOperation(value = "更改规则内容")
@PutMapping("{id}")
public TheoryQuestionsRuleVO get(@PathVariable Integer id, @RequestBody @Validated TheoryQuestionsRuleVO ruleVO) {
return this.iRaceQuestionsRuleService.update(id, ruleVO);
}
}

View File

@ -0,0 +1,103 @@
package club.joylink.rtss.controller.competition;
import club.joylink.rtss.constants.RoleEnum;
import club.joylink.rtss.controller.advice.Role;
import club.joylink.rtss.services.completition.IRaceTheoryService;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.competition.ProjectTheoryAnswerVO;
import club.joylink.rtss.vo.client.question.QuestionVO;
import club.joylink.rtss.vo.client.race.RaceResultDetailVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
/**竞赛理论试题管理*/
@Api(tags = {"竞赛理论试题管理"})
@RestController
@RequestMapping(path = "api/v1/competitionTheory")
public class RaceTheoryController {
@Autowired
private IRaceTheoryService iRaceTheoryService;
// /**查询竞赛理论题
// * @return*/
// @ApiOperation(value = "查询本竞赛用的理论")
// @GetMapping(path = "/competition/{competitionId}")
// public TheoryQuestionVO getCompetitionTheory(@ApiIgnore @RequestAttribute UserVO user, @PathVariable Long competitionId) {
//
// return iRaceTheoryService.getCompetitionTheory(user.getId(), competitionId);
// }
//
// /**提交理论成绩*/
// @ApiOperation(value = "提交理论")
// @PostMapping(path = "/submit")
// public void submitTheoryQuestion(@ApiIgnore @RequestAttribute UserVO user, @Validated @RequestBody CompetitionTheoryAnswerVO answerVO) {
// iRaceTheoryService.submitTheoryQuestion(user, answerVO);
//
// }
//
// /**参赛者查询理论题作答结果
// * @return*/
// @ApiOperation(value = "查询理论题作答结果")
// @GetMapping(path = "/result/competition/{competitionId}")
// public List<RaceResultVO> getTheoryAnswerResult(@PathVariable Long competitionId, @ApiIgnore @RequestAttribute UserVO user) {
// return iRaceTheoryService.getTheoryAnswerResult(competitionId, user);
// }
//
// /**参赛者查询理论题作答详情
// * @return*/
// @ApiOperation(value = "查询当前人员理论题作答详情")
// @GetMapping(path = "/detail/competition/{competitionId}")
// public List<RaceResultDetailVO> getTheoryAnswerDetails(@PathVariable Long competitionId, @ApiIgnore @RequestAttribute UserVO user) {
// return iRaceTheoryService.getTheoryAnswerDetails(competitionId, user);
// }
//
// /**裁判查询理论题作答详情
// * @return*/
// @ApiOperation(value = "裁判查询参赛者理论题作答详情")
// @GetMapping(path = "/detail/competition/{competitionId}/raceUser/{raceUserId}")
// public List<RaceResultDetailVO> getContestantTheoryAnswerDetails(@PathVariable Long competitionId,@PathVariable Long raceUserId, @ApiIgnore @RequestAttribute UserVO user) {
// return iRaceTheoryService.getContestantTheoryAnswerDetails(competitionId, raceUserId);
// }
//------------------------------------ 项目理论题部分----------------------------------------
/**获取项目理论题*/
@ApiOperation(value = "获取项目理论题")
@GetMapping(path = "/project/{projectCode}")
public List<QuestionVO> getProjectTheory(String mode, @PathVariable String projectCode, @RequestAttribute LoginUserInfoVO loginInfo, @ApiIgnore @RequestAttribute UserVO user) {
return iRaceTheoryService.getProjectTheory(mode, projectCode, user.getCompanyId(), user);
}
/**根据练习或者考试提交理论题、计算分数*/
@ApiOperation(value = "提交试卷")
@PostMapping(path = "/project/{projectCode}/submit")
public List<RaceResultDetailVO> submitProjectTheory(@PathVariable String projectCode, @RequestBody ProjectTheoryAnswerVO theoryAnswers, @RequestAttribute LoginUserInfoVO loginInfo,@ApiIgnore @RequestAttribute UserVO user) {
return iRaceTheoryService.submitProjectTheory(user, projectCode, user.getCompanyId(), theoryAnswers);
}
/**获取作答详情*/
/**评分*/
/**获取成绩*/
/**清除理论考试结果*/
@ApiOperation(value = "清除理论考试结果")
@DeleteMapping(path = "/project/{projectCode}")
@Role(RoleEnum.SuperAdmin)
public void submitProjectTheory(@PathVariable String projectCode, @RequestParam(required = false) Integer companyId) {
iRaceTheoryService.deleteRaceTheoryResult(projectCode, companyId);
}
/**
* 评分员获取考生理论考试结果详情
*/
@ApiOperation(value = "评分员获取考生理论考试结果详情")
@GetMapping(path = "/project/{projectCode}/result/detail")
public List<RaceResultDetailVO> getTheoryAnswerDetails(@PathVariable String projectCode, @RequestParam(required = false) Integer companyId, Long id) {
return iRaceTheoryService.getTheoryResultDetails(projectCode, companyId, id);
}
}

View File

@ -0,0 +1,38 @@
package club.joylink.rtss.controller.competition;
import club.joylink.rtss.services.completition.IRaceQuestionMocksStatsService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.competition.UserQuestionStatsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = "项目题库用户答题统计")
@RestController
@RequestMapping(path = "/api/question/mocksStatistics")
public class UserAnswerStatsController {
@Autowired
private IRaceQuestionMocksStatsService statsService;
@ApiOperation(value = "查询某用户小程序测试历史成绩")
@GetMapping(path = "/project/{projectCode}")
public List<UserQuestionStatsVO> getQuestionProgress(Long userId,@PathVariable String projectCode, @ApiIgnore @RequestAttribute UserVO user) {
return statsService.getHistoryScores(userId,user, projectCode);
}
@ApiOperation(value = "查询历史成绩排名")
@GetMapping(path = "ranking/project/{projectCode}")
public List<UserQuestionStatsVO> getQuestionProgress(@PathVariable String projectCode) {
return statsService.getHistoryScoresRanking( projectCode);
}
}

View File

@ -0,0 +1,51 @@
package club.joylink.rtss.controller.competition;
import club.joylink.rtss.services.completition.IUserQuestionProgressService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.competition.RaceQuestionProgressVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.constraints.PositiveOrZero;
@Api(tags = "项目题库用户答题进度接口")
@RestController
@RequestMapping(path = "/api/questionProgress")
public class UserQuestionProgressController {
@Autowired
private IUserQuestionProgressService progressService;
@ApiOperation(value = "获取用户答题进展")
@GetMapping(path = "/project/{projectCode}")
public RaceQuestionProgressVO getQuestionProgress(@PathVariable String projectCode, @ApiIgnore @RequestAttribute UserVO user) {
return progressService.getQuestionProgress(user.getId(), projectCode, user.getCompanyId());
}
@ApiOperation(value = "更新答题进度")
@PostMapping(path = "/project/{projectCode}")
public void addQuestionProgress(@ApiIgnore @RequestAttribute UserVO user, @PathVariable String projectCode, @PositiveOrZero @RequestParam Long index) {
progressService.addQuestionProgress(user.getId(), projectCode, user.getCompanyId(),index);
}
/**添加错题*/
@ApiOperation(value = "添加错题")
@PostMapping(path = "incorrect/project/{projectCode}")
public void addIncorrectQuestion(@ApiIgnore @RequestAttribute UserVO user, @PathVariable String projectCode, @PositiveOrZero @RequestParam Long id) {
progressService.addIncorrectQuestion(user.getId(), projectCode, user.getCompanyId(),id);
}
/**删除错题*/
@ApiOperation(value = "删除错题")
@DeleteMapping(path = "incorrect/project/{projectCode}")
public void deleteIncorrectQuestion(@ApiIgnore @RequestAttribute UserVO user, @PathVariable String projectCode, @PositiveOrZero @RequestParam Long id) {
progressService.deleteIncorrectQuestion(user.getId(), projectCode,user.getCompanyId(), id);
}
}

View File

@ -0,0 +1,101 @@
package club.joylink.rtss.controller.competition.question;
import club.joylink.rtss.constants.Project;
import club.joylink.rtss.services.completition.question.IQuestionBankService;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.competition.TheoryQuestionCountVO;
import club.joylink.rtss.vo.client.question.QuestionOptionVO;
import club.joylink.rtss.vo.client.question.QuestionQueryVO;
import club.joylink.rtss.vo.client.question.QuestionVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = "题库管理接口")
@RestController
@RequestMapping(path = "/api/questionBank")
public class QuestionBankController {
@Autowired
private IQuestionBankService iQuestionBankService;
@ApiOperation(value = "分页查询题目")
@GetMapping(path = "/questions/paging")
public PageVO<QuestionVO> pagingQueryQuestions(@RequestAttribute LoginUserInfoVO loginInfo, QuestionQueryVO queryVO) {
queryVO.setProjectCode(loginInfo.getProject().name());
return iQuestionBankService.pagingQueryQuestions(queryVO);
}
@ApiOperation(value = "查询题目列表")
@GetMapping(path = "/questions")
public List<QuestionVO> queryQuestions(@RequestAttribute LoginUserInfoVO loginInfo,QuestionQueryVO queryVO) {
queryVO.setProjectCode(loginInfo.getProject().name());
return iQuestionBankService.queryQuestions(queryVO);
}
@ApiOperation(value = "获取题目信息")
@GetMapping(path = "/questions/{questionId}")
public QuestionVO getQuestion(@PathVariable Long questionId) {
return iQuestionBankService.getQuestion(questionId);
}
@ApiOperation(value = "添加题目")
@PostMapping(path = "/questions")
public void addQuestion(@Validated @RequestBody QuestionVO questionVO,@RequestAttribute LoginUserInfoVO loginInfo,
@ApiIgnore @RequestAttribute UserVO user) {
questionVO.setProjectCode(loginInfo.getProject().name());
iQuestionBankService.addQuestion(questionVO, user);
}
@ApiOperation(value = "导入项目或单位试题库")
@PostMapping(path = "/questions/import")
public void importProjectQuestion(@Validated @RequestBody List<QuestionVO> questions,@RequestAttribute LoginUserInfoVO loginInfo,
@ApiIgnore @RequestAttribute UserVO user, @RequestParam(required = false, name = "id") Integer companyId) {
iQuestionBankService.importProjectQuestion(questions, loginInfo.getProject().name(), companyId,user);
}
@ApiOperation(value = "更新题目")
@PutMapping(path = "/questions/{questionId}")
public void updateQuestion(@PathVariable Long questionId, @RequestAttribute LoginUserInfoVO loginInfo,@RequestBody QuestionVO questionVO) {
questionVO.setProjectCode(loginInfo.getProject().name());
iQuestionBankService.updateQuestion(questionId, questionVO);
}
@ApiOperation(value = "删除题目")
@DeleteMapping(path = "/questions/{questionId}")
public void deleteQuestion(@PathVariable Long questionId) {
iQuestionBankService.deleteQuestion(questionId);
}
@ApiOperation(value = "根据题目查询选项")
@GetMapping(path = "/questions/{questionId}/options")
public List<QuestionOptionVO> getOptionsByQuestionId(@PathVariable Long questionId) {
return iQuestionBankService.getOptionsByQuestionId(questionId);
}
@ApiOperation(value = "根据题型获取题目数量")
@GetMapping(path = "/number")
public Integer getNumberUnderKnowledgeAndType(@RequestAttribute LoginUserInfoVO loginInfo, String type, Integer companyId) {
return iQuestionBankService.getNumberWithType(type, loginInfo.getProject().name(), companyId);
}
@ApiOperation(value = "获取题型数量")
@GetMapping(path = "/type/number")
public List<TheoryQuestionCountVO> getNumberUnderKnowledgeAndType(@RequestAttribute LoginUserInfoVO loginInfo, @RequestParam(required = false) Integer companyId) {
String projectCode = Project.isDefault(loginInfo.getProject()) ? null : loginInfo.getProject().name();
return iQuestionBankService.countNumByType(projectCode, companyId);
}
}

View File

@ -0,0 +1,116 @@
package club.joylink.rtss.controller.draft;
import java.util.List;
import club.joylink.rtss.vo.client.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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.RestController;
import club.joylink.rtss.services.ISysDictionaryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@Api(value="数据字典controller", tags= {"数据字典管理接口"})
@RestController
@RequestMapping("/api/dictionary")
public class DictionaryController {
private final ISysDictionaryService iSysDictionaryService;
@Autowired
public DictionaryController(ISysDictionaryService iSysDictionaryService) {
this.iSysDictionaryService = iSysDictionaryService;
}
@ApiOperation(value="字典目录分页查询")
@GetMapping(path="/list")
public PageVO<DictionaryVO> queryDic(DictionaryQueryVO queryVO) {
return this.iSysDictionaryService.queryPage(queryVO);
}
@ApiOperation(value="创建字典目录")
@PostMapping(path="/create")
public void createDic(@RequestBody @Validated DictionaryVO dicVo) {
this.iSysDictionaryService.createDic(dicVo);
}
@ApiOperation(value="校验字典目录编码是否已经存在")
@GetMapping(path="/checkExistByCode")
public boolean checkExistByCode(String code) {
return this.iSysDictionaryService.checkByCode(code);
}
@ApiOperation(value="根据id获取对象")
@GetMapping(path="/{id}")
public DictionaryVO getData(@PathVariable Long id) {
return this.iSysDictionaryService.queryData(id);
}
@ApiOperation(value="更新字典目录信息")
@PutMapping(path="/update/{id}")
public void updateDic(@PathVariable Long id, @RequestBody @Validated DictionaryVO dicVo) {
this.iSysDictionaryService.updateDic(id, dicVo);
}
@ApiOperation(value="删除字典目录")
@DeleteMapping(path="/delete/{id}")
public void deleteDic(@PathVariable Long id) {
this.iSysDictionaryService.deleteDic(id);
}
@ApiOperation(value="查询字典目录对应明细数据列表")
@GetMapping(path="/{id}/detail/list")
public PageVO<DictionaryDetailVO> queryDicDetail(@PathVariable(name="id") Long dicId, DictionaryDetailQueryVO queryVO) {
return this.iSysDictionaryService.queryDetailPage(dicId, queryVO);
}
@ApiOperation(value="创建字典明细")
@PostMapping(path="/{id}/detail/create")
public void createDicDetail(@PathVariable(name="id") Long dicId, @RequestBody @Validated DictionaryDetailVO detailVo) {
detailVo.setDicId(dicId);
this.iSysDictionaryService.createDicDetail(detailVo);
}
@ApiOperation(value="校验字典明细编码是否存在")
@GetMapping(path="/{id}/detail/checkExistByCode")
public boolean checkDetailExistByCode(@PathVariable(name="id") @ApiParam(name="id", value="字典目录id") Long dicId,
String code) {
return this.iSysDictionaryService.checkDetailByCode(dicId, code);
}
@ApiOperation(value="根据id获取对象")
@GetMapping(path="/{id}/detail/{detailId}")
public DictionaryDetailVO getDetailData(@PathVariable(name="id") Long dicId, @PathVariable(name="detailId") Long id) {
return this.iSysDictionaryService.getDetailData(dicId, id);
}
@ApiOperation(value="更新字典明细信息")
@PutMapping(path="/{id}/detail/update/{detailId}")
public void updateDicDetail(@PathVariable(name="id") Long dicId, @PathVariable(name="detailId") Long id, @RequestBody @Validated DictionaryDetailVO detailVo) {
detailVo.setDicId(dicId);
this.iSysDictionaryService.updateDicDetail(id, detailVo);
}
@ApiOperation(value="删除字典明细")
@DeleteMapping(path="/{id}/detail/delete/{detailId}")
public void deleteDicDetail(@PathVariable(name="id") Long dicId, @PathVariable(name="detailId") Long id) {
this.iSysDictionaryService.deleteDicDetail(id);
}
@ApiOperation(value="根据字典code获取字典明细列表")
@GetMapping(path="/getDetailListByCode")
public List<DictionaryDetailVO> getDicDetailListByCode(String code) {
return this.iSysDictionaryService.getDicDetailListByDicCode(code);
}
}

View File

@ -0,0 +1,76 @@
package club.joylink.rtss.controller.draft;
import club.joylink.rtss.services.draftData.DraftIbpService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.ibp.IbpCopyVO;
import club.joylink.rtss.vo.client.ibp.IbpCreateVO;
import club.joylink.rtss.vo.client.ibp.IbpQueryVO;
import club.joylink.rtss.vo.client.ibp.IbpVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@Api(value="草稿IBP盘接口")
@RestController
@RequestMapping("/api/draftIbp")
public class DraftIbpController {
@Autowired
private DraftIbpService draftIbpService;
@ApiOperation(value = "查询用户草稿IBP盘绘制数据列表")
@GetMapping("/list/user")
public PageVO<IbpVO> queryUserDraftIbpList(IbpQueryVO queryVO, @ApiIgnore @RequestAttribute UserVO user) {
return this.draftIbpService.queryUserDraftIbpList(queryVO, user);
}
@ApiOperation(value = "创建草稿IBP盘")
@PostMapping("")
public IbpVO createDraftIbp(@RequestBody @Validated IbpCreateVO ibpCreateVO,
@ApiIgnore @RequestAttribute UserVO user) {
return this.draftIbpService.create(ibpCreateVO, user);
}
@ApiOperation(value = "根据id查询IBP数据")
@GetMapping("/{id}")
public IbpVO getIbp(@PathVariable Long id) {
return this.draftIbpService.getById(id);
}
@ApiOperation(value = "更新草稿IBP盘基本信息")
@PutMapping("/{id}/basic")
public IbpVO updateDraftIbpBasicInfo(@PathVariable Long id,
@RequestBody @Validated IbpCreateVO ibpCreateVO,
@ApiIgnore @RequestAttribute UserVO user) {
return this.draftIbpService.updateBasicInfo(id, ibpCreateVO, user);
}
@ApiOperation(value = "更新草稿IBP盘绘图数据")
@PutMapping("/{id}/data")
public void updateDraftIbpDrawData(@PathVariable Long id, @RequestBody String drawData) {
this.draftIbpService.updateDrawData(id, drawData);
}
@ApiOperation(value = "发布IBP盘数据")
@PostMapping("/{id}/publish")
public void publish(@PathVariable Long id, @ApiIgnore @RequestAttribute UserVO user) {
this.draftIbpService.publish(id, user);
}
@ApiOperation(value = "根据id删除草稿IBP盘数据")
@DeleteMapping("/{id}/delete")
public void delete(@PathVariable Long id) {
this.draftIbpService.delete(id);
}
@ApiOperation("复制已有的IBP数据关联新的地图和车站")
@PostMapping("/copy")
public void copy(@Validated @RequestBody IbpCopyVO copyVO, @RequestAttribute UserVO user) {
this.draftIbpService.copyFromPublished(copyVO, user);
}
}

View File

@ -0,0 +1,602 @@
package club.joylink.rtss.controller.draft;
import club.joylink.rtss.vo.client.map.newmap.MapDestinationCodeDefinitionVO;
import club.joylink.rtss.services.IDraftMapService;
import club.joylink.rtss.services.draftData.DraftMapCiDataGenerator;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageQueryVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.TreeNode;
import club.joylink.rtss.vo.client.map.*;
import club.joylink.rtss.vo.client.map.newmap.*;
import club.joylink.rtss.vo.client.validGroup.DraftMapCreateCheck;
import club.joylink.rtss.vo.client.validGroup.DraftMapCreateFromCheck;
import club.joylink.rtss.vo.client.validGroup.DraftMapPublishCheck;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Api(tags = {"地图草稿数据管理接口"})
@RestController
@RequestMapping("/api/mapBuild")
@Slf4j
public class DraftMapController {
@Autowired
private IDraftMapService iDraftMapService;
@Autowired
private DraftMapCiDataGenerator draftMapCiDataGenerator;
/*-------------- 地图,绘图相关操作 ------------------*/
@ApiOperation(value = "获取地图草稿数据列表")
@GetMapping(path = "/list")
public List<DraftMapVO> list(Boolean drawWay, @ApiIgnore @RequestAttribute UserVO user) {
return iDraftMapService.list(drawWay, user);
}
@ApiOperation(value = "根据草稿地图id查询数据")
@GetMapping(path = "/findById/{draftMapId}")
public DraftMapVO findById(@PathVariable Long draftMapId) {
return iDraftMapService.findById(draftMapId);
}
@ApiOperation(value = "获取皮肤地图草稿树")
@GetMapping(path = "/tree")
public List<TreeNode> tree(@ApiIgnore @RequestAttribute UserVO user) {
return iDraftMapService.tree(user);
}
@ApiOperation(value = "新建地图草稿")
@PostMapping(path = "/create")
public String create(@RequestBody @Validated(value = DraftMapCreateCheck.class) DraftMapVO draftMapVo,
@ApiIgnore @RequestAttribute UserVO user) {
return iDraftMapService.create(draftMapVo, user);
}
@ApiOperation(value = "修改地图草稿信息")
@PutMapping(path = "/{id}")
public void update(@PathVariable Long id, @RequestBody @Validated(value = DraftMapCreateCheck.class) DraftMapVO draftMapVo,
@ApiIgnore @RequestAttribute UserVO user) {
iDraftMapService.update(id, draftMapVo, user);
}
@ApiOperation(value = "地图草稿另存为")
@PostMapping(path = "/{id}/saveAs")
public String saveAs(@PathVariable Long id, @RequestBody DraftMapVO vo) {
return iDraftMapService.saveAs(id, vo.getName());
}
@ApiOperation(value = "查询地图及对应数据")
@GetMapping(path = "/{id}/mapDataDetail")
public Object getMapShapeData(@PathVariable Long id) {
return iDraftMapService.getMapShapeData(id);
}
/**
* 保存地图元素信息
*/
@ApiOperation(value = "保存地图草稿对象数据")
@PostMapping(path = "/{id}/saveElements")
public void saveMapElsDetail(@PathVariable Long id, @RequestBody String shapeData) {
iDraftMapService.saveMapElsDetail(id, shapeData);
}
@ApiOperation(value = "清除原联锁数据,生成新的联锁数据并保存")
@PostMapping(path = "/{id}/ci/generateAndSave")
public CiGenerateResultVO generateAndSaveCiData(@PathVariable Long id) {
return this.draftMapCiDataGenerator.generate(id);
}
@ApiOperation(value = "草稿地图导出")
@GetMapping(path = "/{id}/export")
public MapVO export(@PathVariable Long id, @ApiIgnore @RequestAttribute UserVO user) {
return this.iDraftMapService.export(id);
}
@ApiOperation(value = "地图数据导入")
@PostMapping(path = "/import")
public void importFrom(@RequestBody MapVO mapVO, @ApiIgnore @RequestAttribute UserVO user) {
iDraftMapService.importFrom(mapVO, user);
}
@ApiOperation(value = "从发布的地图新建地图草稿")
@PostMapping(path = "/createFrom")
public void createFrom(@RequestBody @Validated(value = DraftMapCreateFromCheck.class) DraftMapVO draftMapVO,
@ApiIgnore @RequestAttribute UserVO user) {
iDraftMapService.createFrom(draftMapVO.getId(), draftMapVO.getName(), user);
}
/**
* 删除地图草稿
*/
@ApiOperation(value = "删除地图草稿")
@DeleteMapping(path = "/delete/{id}")
public void deleteMap(@PathVariable Long id, @RequestAttribute UserVO user) {
iDraftMapService.deleteMap(id, user);
}
@ApiOperation(value = "数据校验")
@GetMapping(path = "/{id}/checkData")
public List<String> checkData(@PathVariable Long id) {
return iDraftMapService.checkData(iDraftMapService.getMapData(id));
}
@ApiOperation(value = "发布")
@PostMapping(path = "/{id}/publish")
public List<String> publish(@PathVariable Long id, @RequestBody @Validated(value = DraftMapPublishCheck.class) DraftMapVO draftMapVO,
@ApiIgnore @RequestAttribute UserVO user) {
MapDataVO mapData = iDraftMapService.getMapData(id);
List<String> list = iDraftMapService.checkData(mapData);
if (Objects.nonNull(list) && list.isEmpty()) {
iDraftMapService.publish(id, draftMapVO, user, mapData);
}
return list;
}
@ApiOperation(value = "发布地图3D数据")
@PostMapping(path = "/{id}/publish/3d")
public void publish3DData(@PathVariable Long id,
@RequestBody @Validated(value = DraftMapPublishCheck.class) DraftMapVO draftMapVO,
@ApiIgnore @RequestAttribute UserVO user) {
this.iDraftMapService.publish3DData(id, draftMapVO, user);
}
/*-------------- 联动道岔 ------------------*/
@ApiOperation(value = "创建联动道岔关系")
@PostMapping(path = "/switchCoupled")
public void createSwitchCoupled(@RequestBody MapSwitchCoupledVO vo) {
iDraftMapService.createSwitchCoupled(vo);
}
@ApiOperation(value = "查询地图的联动道岔关系列表")
@GetMapping(path = "/{mapId}/switchCoupled")
public PageVO<MapSwitchCoupledVO> selectSwitchCoupled(@PathVariable Long mapId, MapSwitchCoupledQueryVO queryVO) {
return iDraftMapService.selectSwitchCoupled(mapId, queryVO);
}
@ApiOperation(value = "删除联动道岔关系")
@DeleteMapping(path = "/switchCoupled/{coupleId}")
public void delSwitchCoupledById(@PathVariable Long coupleId) {
iDraftMapService.delSwitchCoupled(coupleId);
}
/*-------------- 信号机接近区段 ------------------*/
@ApiOperation(value = "创建信号机接近区段")
@PostMapping(path = "/approachSection")
public void createApproachSection(@RequestBody @Validated MapSignalApproachSectionVO approachSectionVO) {
this.iDraftMapService.createApproachSection(approachSectionVO);
}
@ApiOperation(value = "分页查询信号机接近区段列表")
@GetMapping(path = "/{mapId}/approachSection/paging")
public PageVO<MapSignalApproachSectionVO> queryPagedApproachSection(
@PathVariable Long mapId,
MapApproachSectionQueryVO queryVO) {
return this.iDraftMapService.queryPagedApproachSection(mapId, queryVO);
}
@ApiOperation(value = "根据id查询信号机接近区段")
@GetMapping(path = "/approachSection/{id}")
public MapSignalApproachSectionVO getApproachSectionById(@PathVariable Long id) {
return this.iDraftMapService.getApproachSectionById(id);
}
@ApiOperation(value = "更新信号机接近区段")
@PutMapping(path = "/approachSection/{id}")
public void updateApproachSection(@PathVariable Long id, @RequestBody @Validated MapSignalApproachSectionVO approachSectionVO) {
this.iDraftMapService.updateApproachSection(id, approachSectionVO);
}
@ApiOperation(value = "删除信号机接近区段")
@DeleteMapping(path = "/approachSection/{id}")
public void deleteApproachSection(@PathVariable Long id) {
this.iDraftMapService.deleteApproachSection(id);
}
/*-------------- 自动信号 ------------------*/
@ApiOperation(value = "创建自动信号")
@PostMapping(path = "/autoSignal")
public void createAutoSignal(@RequestBody @Validated MapAutoSignalVO autoSignalVO) {
iDraftMapService.createAutoSignal(autoSignalVO);
}
@ApiOperation(value = "分页获取自动信号")
@GetMapping(path = "/{mapId}/autoSignal")
public PageVO<MapAutoSignalVO> queryPagedAutoSignal(@PathVariable Long mapId, MapAutoSignalQueryVO queryVO) {
return iDraftMapService.queryPagedAutoSignal(mapId, queryVO);
}
@ApiOperation(value = "获取自动信号")
@GetMapping(path = "/autoSignal/{autoSignalId}")
public MapAutoSignalVO getAutoSignal(@PathVariable Long autoSignalId) {
return iDraftMapService.getAutoSignal(autoSignalId);
}
@ApiOperation(value = "更新自动信号")
@PutMapping(path = "/autoSignal/{autoSignalId}")
public void updateAutoSignal(@PathVariable Long autoSignalId, @RequestBody @Validated MapAutoSignalVO autoSignalVO) {
iDraftMapService.updateAutoSignal(autoSignalId, autoSignalVO);
}
@ApiOperation(value = "删除自动信号")
@DeleteMapping(path = "/autoSignal/{autoSignalId}")
public void deleteAutoSignal(@PathVariable Long autoSignalId) {
iDraftMapService.deleteAutoSignal(autoSignalId);
}
/*!!!!!!!!!!!!!!!!!!!!!!! 新 自动信号 !!!!!!!!!!!!!!!!!!!!!!!!!!*/
@ApiOperation(value = "创建自动信号")
@PostMapping(path = "/autoSignalNew")
public void createAutoSignal(@RequestBody @Validated MapAutoSignalNewVO autoSignalVO) {
iDraftMapService.createAutoSignal(autoSignalVO);
}
@ApiOperation(value = "分页获取自动信号")
@GetMapping(path = "/{mapId}/autoSignalNew")
public PageVO<MapAutoSignalNewVO> queryPagedAutoSignalNew(@PathVariable Long mapId, MapAutoSignalQueryVO queryVO) {
return iDraftMapService.queryPagedAutoSignalNew(mapId, queryVO);
}
@ApiOperation(value = "获取自动信号")
@GetMapping(path = "/autoSignalNew/{autoSignalId}")
public MapAutoSignalNewVO getAutoSignalNew(@PathVariable Long autoSignalId) {
return iDraftMapService.getAutoSignalNew(autoSignalId);
}
@ApiOperation(value = "更新自动信号")
@PutMapping(path = "/autoSignalNew/{autoSignalId}")
public void updateAutoSignal(@PathVariable Long autoSignalId, @RequestBody @Validated MapAutoSignalNewVO autoSignalVO) {
iDraftMapService.updateAutoSignal(autoSignalId, autoSignalVO);
}
@ApiOperation(value = "删除自动信号")
@DeleteMapping(path = "/autoSignalNew/{autoSignalId}")
public void deleteAutoSignalNew(@PathVariable Long autoSignalId) {
iDraftMapService.deleteAutoSignal(autoSignalId);
}
/*-------------- 进路 ------------------*/
@ApiOperation(value = "创建进路")
@PostMapping(path = "/route")
public void createRoute(@RequestBody @Validated MapRouteVO routeVO) {
iDraftMapService.createRoute(routeVO);
}
@ApiOperation(value = "查询进路列表")
@GetMapping(path = "/{mapId}/route")
public PageVO<MapRouteVO> queryPagedRoute(@PathVariable Long mapId, MapRouteQueryVO queryVO) {
return iDraftMapService.queryPagedRoute(mapId, queryVO);
}
@ApiOperation(value = "查询进路数据明细")
@GetMapping(path = "/route/{routeId}")
public MapRouteVO getRouteDetail(@PathVariable Long routeId) {
return iDraftMapService.getRouteDetail(routeId);
}
@ApiOperation(value = "更新进路数据")
@PutMapping(path = "/route/{routeId}")
public void updateRoute(@PathVariable Long routeId, @RequestBody @Validated MapRouteVO routeVO) {
iDraftMapService.updateRoute(routeId, routeVO);
}
@ApiOperation(value = "删除进路")
@DeleteMapping(path = "/route/{routeId}")
public void deleteRoute(@PathVariable Long routeId) {
iDraftMapService.deleteRoute(routeId);
}
/*-------------- 新 进路 ------------------*/
@ApiOperation(value = "创建进路")
@PostMapping(path = "/routeNew")
public void createRoute(@RequestBody @Validated MapRouteNewVO routeVO) {
iDraftMapService.createRoute(routeVO);
}
@ApiOperation(value = "查询进路列表")
@GetMapping(path = "/{mapId}/routeNew")
public PageVO<MapRouteNewVO> queryPagedRouteNew(@PathVariable Long mapId, MapRouteQueryVO queryVO) {
return iDraftMapService.queryPagedRouteNew(mapId, queryVO);
}
@ApiOperation(value = "查询进路数据明细")
@GetMapping(path = "/routeNew/{routeId}")
public MapRouteNewVO getRouteDetailNew(@PathVariable Long routeId) {
return iDraftMapService.getRouteDetailNew(routeId);
}
@ApiOperation(value = "更新进路数据")
@PutMapping(path = "/routeNew/{routeId}")
public void updateRoute(@PathVariable Long routeId, @RequestBody @Validated MapRouteNewVO routeVO) {
iDraftMapService.updateRoute(routeId, routeVO);
}
@ApiOperation(value = "删除进路")
@DeleteMapping(path = "/routeNew/{routeId}")
public void deleteRouteNew(@PathVariable Long routeId) {
iDraftMapService.deleteRoute(routeId);
}
/*-------------- 延续保护 ------------------*/
@ApiOperation(value = "创建延续保护")
@PostMapping(path = "/overlap")
public void createOverlap(@RequestBody @Validated MapOverlapVO mapOverlapVO) {
this.iDraftMapService.createOverlap(mapOverlapVO);
}
@ApiOperation(value = "分页查询延续保护列表")
@GetMapping(path = "/{mapId}/overlap/paging")
public PageVO<MapOverlapVO> queryPagedOverlap(
@PathVariable Long mapId,
MapOverlapQueryVO queryVO) {
return this.iDraftMapService.queryPagedOverlap(mapId, queryVO);
}
@ApiOperation(value = "根据id查询延续保护")
@GetMapping(path = "/overlap/{id}")
public MapOverlapVO getOverlapById(@PathVariable Long id) {
return this.iDraftMapService.getOverlapById(id);
}
@ApiOperation(value = "更新延续保护")
@PutMapping(path = "/overlap/{id}")
public void updateOverlap(@PathVariable Long id, @RequestBody @Validated MapOverlapVO mapOverlapVO) {
this.iDraftMapService.updateOverlap(id, mapOverlapVO);
}
@ApiOperation(value = "删除延续保护")
@DeleteMapping(path = "/overlap/{id}")
public void deleteOverlap(@PathVariable Long id) {
this.iDraftMapService.deleteOverlap(id);
}
/*-------------- 自动折返 ------------------*/
@ApiOperation(value = "创建自动折返")
@PostMapping(path = "/autoReentry")
public void createAutoReentry(@RequestBody @Validated MapAutoReentryVO mapAutoReentryVO) {
this.iDraftMapService.createAutoReentry(mapAutoReentryVO);
}
@ApiOperation(value = "分页查询自动折返列表")
@GetMapping(path = "/{mapId}/autoReentry/paging")
public PageVO<MapAutoReentryVO> queryPagedAutoReentry(
@PathVariable Long mapId,
MapAutoReentryQueryVO queryVO) {
return this.iDraftMapService.queryPagedAutoReentry(mapId, queryVO);
}
@ApiOperation(value = "查询根据折返轨分组的自动折返列表")
@GetMapping(path = "/{mapId}/autoReentry/group/reentryTrack")
public Map<String, List<MapAutoReentryVO>> queryAutoReentrysGroupByReentryTrack(
@PathVariable Long mapId) {
return this.iDraftMapService.queryAutoReentrysGroupByReentryTrack(mapId);
}
@ApiOperation(value = "根据id查询自动折返")
@GetMapping(path = "/autoReentry/{id}")
public MapAutoReentryVO getAutoReentryById(@PathVariable Long id) {
return this.iDraftMapService.getAutoReentryById(id);
}
@ApiOperation(value = "更新自动折返")
@PutMapping(path = "/autoReentry/{id}")
public void updateAutoReentry(@PathVariable Long id, @RequestBody @Validated MapAutoReentryVO mapAutoReentryVO) {
this.iDraftMapService.updateAutoReentry(id, mapAutoReentryVO);
}
@ApiOperation(value = "删除自动折返")
@DeleteMapping(path = "/autoReentry/{id}")
public void deleteAutoReentry(@PathVariable Long id) {
this.iDraftMapService.deleteAutoReentry(id);
}
/*-------------- 路径单元 ------------------*/
@ApiOperation(value = "获取路径单元列表")
@GetMapping(path = "/{mapId}/routeUnit")
public PageVO<MapRouteUnitVO> getRouteUnitList(@PathVariable Long mapId, MapRouteUnitQueryVO queryVO) {
return iDraftMapService.getRouteUnitList(mapId, queryVO);
}
@ApiOperation(value = "创建路径单元")
@PostMapping(path = "/routeUnit")
public void createRouteUnit(@RequestBody @Validated MapRouteUnitVO mapRouteUnitVO) {
iDraftMapService.createRouteUnit(mapRouteUnitVO);
}
@ApiOperation(value = "获取路径单元")
@GetMapping(path = "/routeUnit/{routeUnitId}")
public MapRouteUnitVO getRouteUnit(@PathVariable Long routeUnitId) {
return iDraftMapService.getRouteUnit(routeUnitId);
}
@ApiOperation(value = "更新路径单元")
@PutMapping(path = "/routeUnit/{routeUnitId}")
public void updateRouteUnit(@PathVariable Long routeUnitId, @RequestBody @Validated MapRouteUnitVO mapRouteUnitVO) {
iDraftMapService.updateRouteUnit(routeUnitId, mapRouteUnitVO);
}
@ApiOperation(value = "删除路径单元")
@DeleteMapping(path = "/routeUnit/{routeUnitId}")
public void deleteRouteUnit(@PathVariable Long routeUnitId) {
iDraftMapService.deleteRouteUnit(routeUnitId);
}
/*-------------- 交路 ------------------*/
@ApiOperation(value = "创建交路")
@PostMapping(path = "/routing")
public void createRouting(@RequestBody @Validated MapRoutingVO routingVO) {
iDraftMapService.createRouting(routingVO);
}
@ApiOperation(value = "分页获取交路")
@GetMapping(path = "/{mapId}/routing")
public PageVO<MapRoutingVO> queryPagedRouting(@PathVariable Long mapId, PageQueryVO queryVO) {
return iDraftMapService.queryPagedRouting(mapId, queryVO);
}
@ApiOperation(value = "获取交路")
@GetMapping(path = "/routing/{routingId}")
public MapRoutingVO getRouting(@PathVariable Long routingId) {
return iDraftMapService.getRouting(routingId);
}
@ApiOperation(value = "更新交路")
@PutMapping(path = "/routing/{routingId}")
public void updateRouting(@PathVariable Long routingId, @RequestBody @Validated MapRoutingVO routingVO) {
iDraftMapService.updateRouting(routingId, routingVO);
}
@ApiOperation(value = "删除交路")
@DeleteMapping(path = "/routing/{routingId}")
public void deleteRouting(@PathVariable Long routingId) {
iDraftMapService.deleteRouting(routingId);
}
/*-------------- 新 交路 ------------------*/
@ApiOperation(value = "创建交路,可同时创建回路")
@PostMapping(path = "/routingData")
public void createRoutingData(@RequestBody @Validated MapRoutingDataVO routingVO) {
iDraftMapService.createRoutingData(routingVO);
}
@ApiOperation(value = "生成交路区段数据")
@PutMapping(path = "/routingData/generate")
public MapRoutingDataVO generateRoutingData(@RequestBody @Validated MapRoutingDataVO routingVO) {
return iDraftMapService.generateRoutingData(routingVO);
}
@ApiOperation(value = "分页获取交路")
@GetMapping(path = "/{mapId}/routingData")
public PageVO<MapRoutingDataVO> queryPagedRoutingData(@PathVariable Long mapId, MapRoutingDataQueryVO queryVO) {
return iDraftMapService.queryPagedRoutingData(mapId, queryVO);
}
@ApiOperation(value = "获取交路详情")
@GetMapping(path = "/routingData/{routingId}")
public MapRoutingDataVO getRoutingData(@PathVariable Long routingId) {
return iDraftMapService.getRoutingData(routingId);
}
@ApiOperation(value = "更新交路")
@PutMapping(path = "/routingData/{routingId}")
public void updateRoutingData(@PathVariable Long routingId, @RequestBody @Validated MapRoutingDataVO routingVO) {
iDraftMapService.updateRoutingData(routingId, routingVO);
}
@ApiOperation(value = "删除交路")
@DeleteMapping(path = "/routingData/{routingId}")
public void deleteRoutingData(@PathVariable Long routingId) {
iDraftMapService.deleteRouting(routingId);
}
/*-------------- 新 车站区段停站时间 ------------------*/
@ApiOperation(value = "创建车站区段停站时间")
@PostMapping(path = "/stationParkTime")
public void createStationParkTime(@RequestBody @Validated MapStationParkingTimeVO parkingTimeVO) {
iDraftMapService.createStationParkTime(parkingTimeVO);
}
@ApiOperation(value = "分页车站区段停站时间")
@GetMapping(path = "/{mapId}/stationParkTime")
public PageVO<MapStationParkingTimeVO> queryPagedStationParkTime(@PathVariable Long mapId, MapParkTimeQueryVO queryVO) {
return iDraftMapService.queryPagedStationParkTime(mapId, queryVO);
}
@ApiOperation(value = "获取车站区段停站时间")
@GetMapping(path = "/stationParkTime/{id}")
public MapStationParkingTimeVO getStationParkTime(@PathVariable Long id) {
return iDraftMapService.getStationParkTime(id);
}
@ApiOperation(value = "更新车站区段停站时间")
@PutMapping(path = "/stationParkTime/{id}")
public void updateStationParkTime(@PathVariable Long id, @RequestBody @Validated MapStationParkingTimeVO parkingTimeVO) {
iDraftMapService.updateStationParkTime(id, parkingTimeVO);
}
@ApiOperation(value = "删除车站区段停站时间")
@DeleteMapping(path = "/stationParkTime/{id}")
public void deleteStationParkTime(@PathVariable Long id) {
iDraftMapService.deleteStationParkTime(id);
}
/*-------------- 3d ------------------*/
@ApiOperation(value = "创建地图3d数据")
@PostMapping(path = "/3dMapData")
public Map3dDataVO create3dMapData(@RequestBody @Validated Map3dDataVO mapData3D, @RequestAttribute UserVO user) {
return iDraftMapService.create3dMapData(mapData3D, user);
}
@ApiOperation(value = "通过地图id获取地图3d数据")
@GetMapping(path = "/3dMapData/{mapId}")
public Map3dDataVO get3dMapDataByMapId(@PathVariable Long mapId) {
return iDraftMapService.find3dMapDataByMapId(mapId);
}
@ApiOperation(value = "更新保存地图3d数据")
@PutMapping(path = "/3dMapData/{map3dId}")
public void update3dMapData(@PathVariable Long map3dId, @RequestBody @Validated Map3dDataVO mapData3D) {
iDraftMapService.update3dMapData(map3dId, mapData3D);
}
/*-------------- 目的地码 ------------------*/
@ApiOperation(value = "保存目的地码")
@PostMapping("/{mapId}/destinationCodeDefinition")
public void saveOperationDefinitions(@PathVariable Long mapId, @RequestBody @Validated MapDestinationCodeDefinitionVO operationDefinitionVO) {
iDraftMapService.saveOperationDefinitions(mapId, operationDefinitionVO);
}
@ApiOperation(value = "根据地图id和code获取目的地码")
@GetMapping("/{mapId}/{code}/destinationCodeDefinition")
public MapDestinationCodeDefinitionVO getOperationDefinitions(@PathVariable Long mapId, @PathVariable String code) {
return iDraftMapService.getOperationDefinitions(mapId, code);
}
@ApiOperation("分页获取目的地码")
@GetMapping("/{mapId}/destinationCodeDefinition")
public PageVO<MapDestinationCodeDefinitionVO> queryPagedOperationDefinitions(@PathVariable Long mapId, MapDestinationCodeDefinitionQueryVO queryVO) {
return iDraftMapService.pagedQueryOperationDefinitions(mapId, queryVO);
}
@ApiOperation("更新目的地码")
@PutMapping("/{mapId}/destinationCodeDefinition")
public void updateOperationDefinition(@PathVariable Long mapId, @RequestBody MapDestinationCodeDefinitionVO definitionVO) {
iDraftMapService.updateOperationDefinition(mapId, definitionVO);
}
@ApiOperation("删除目的地码")
@DeleteMapping("/{mapId}/{code}/destinationCodeDefinition")
public void deleteOperationDefinition(@PathVariable Long mapId, @PathVariable String code){
iDraftMapService.deleteOperationDefinition(mapId, code);
}
@ApiOperation(value = "处理信号机显示方向")
@PutMapping(path = "/handle/signal/directionshow")
public void handleSignalDirectionShowType() {
this.iDraftMapService.handleSignalDirectionShowType();
}
}

View File

@ -0,0 +1,40 @@
package club.joylink.rtss.controller.draft;
import club.joylink.rtss.services.draftData.DraftMapDataHandleService;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@Api(tags = {"草稿地图数据处理接口"})
@RestController
@RequestMapping("/api/draftMap/handle")
public class DraftMapDataHandleController {
@Autowired
private DraftMapDataHandleService draftMapDataHandleService;
@PutMapping("/{mapId}/routeRelationDataLose")
public void handleRouteRelationDataLose(@PathVariable Long mapId) {
this.draftMapDataHandleService.handleRouteRelationDataLose(mapId);
}
@PutMapping("/{mapId}/signalTypeAndInterlockArea")
public void handleSignalTypeAndInterlockArea(@PathVariable Long mapId) {
this.draftMapDataHandleService.handleSignalTypeAndInterlockArea(mapId);
}
@PutMapping("/{mapId}/sectionRelStation")
public void handleSectionRelStation(@PathVariable Long mapId) {
this.draftMapDataHandleService.handleSectionRelStation(mapId);
}
@PutMapping("/{mapId}/calculateSectionLen")
public void calculateSectionLen(@PathVariable Long mapId) {
this.draftMapDataHandleService.calculateSectionLen(mapId);
}
}

View File

@ -0,0 +1,58 @@
package club.joylink.rtss.controller.draft;
import club.joylink.rtss.services.draftData.DraftMapFlankProtectionService;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.newmap.MapRouteFlankProtectionNewVO;
import club.joylink.rtss.vo.client.map.newmap.MapRouteFlankProtectionQueryVO;
import club.joylink.rtss.vo.client.map.newmap.validate.RunLevelCreateCheck;
import club.joylink.rtss.vo.client.map.newmap.validate.RunLevelUpdateCheck;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Api(tags = {"草稿地图侧防管理接口"})
@RestController
@RequestMapping("/api/draftMap/flankProtection")
@Slf4j
public class DraftMapFlankProtectionController {
@Autowired
private DraftMapFlankProtectionService draftMapFlankProtectionService;
@ApiOperation(value = "新建进路侧防")
@PostMapping(path = "")
public void create(@RequestBody @Validated MapRouteFlankProtectionNewVO flankProtectionNewVO) {
this.draftMapFlankProtectionService.create(flankProtectionNewVO);
}
@ApiOperation(value = "查询进路侧防列表")
@GetMapping(path = "/{mapId}/paging")
public PageVO<MapRouteFlankProtectionNewVO> pagingQueryFlankProtection(@PathVariable Long mapId,
MapRouteFlankProtectionQueryVO queryVO) {
return this.draftMapFlankProtectionService.pagingQueryFlankProtections(mapId, queryVO);
}
@ApiOperation(value = "查询进路侧防明细")
@GetMapping(path = "/{id}")
public MapRouteFlankProtectionNewVO getRouteDetailNew(@PathVariable Long id) {
return this.draftMapFlankProtectionService.getById(id);
}
@ApiOperation(value = "更新进路侧防数据")
@PutMapping(path = "/{id}")
public void update(@PathVariable Long id, @RequestBody @Validated MapRouteFlankProtectionNewVO flankProtectionNewVO) {
this.draftMapFlankProtectionService.update(id, flankProtectionNewVO);
}
@ApiOperation(value = "删除进路侧防")
@DeleteMapping(path = "/{id}")
public void delete(@PathVariable Long id) {
this.draftMapFlankProtectionService.delete(id);
}
}

View File

@ -0,0 +1,45 @@
package club.joylink.rtss.controller.draft;
import club.joylink.rtss.entity.DraftMapRunPlan;
import club.joylink.rtss.services.IDraftMapRunPlanService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.runplan.RunPlanEChartsDataVO;
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("/api/draftMap/runPlan")
public class DraftMapRunPlanController {
@Autowired
private IDraftMapRunPlanService iDraftMapRunPlanService;
@ApiOperation(value = "根据草稿地图id查询草稿地图运行图")
@GetMapping("/findByDraftMapId/{draftMapId}")
public List<DraftMapRunPlan> findByDraftMapId(@PathVariable Long draftMapId){
return iDraftMapRunPlanService.findByDraftMapId(draftMapId);
}
@ApiOperation(value = "根据草稿运行图id查询数据绘制运行图")
@GetMapping("/selectDiagramData/{planId}")
public RunPlanEChartsDataVO selectDiagramData(@PathVariable Long planId){
return iDraftMapRunPlanService.selectDiagramData(planId);
}
@ApiOperation(value = "运行图仿真测试")
@GetMapping("/simulationCheck/{planId}")
public String simulationCheck(@PathVariable Long planId, @RequestAttribute UserVO user){
return iDraftMapRunPlanService.simulationCheck(planId,user);
}
@ApiOperation(value = "根据草稿地图id查询车站")
@GetMapping("/selectMapStation/{draftMapId}")
public List selectMapStation(@PathVariable Long draftMapId){
return iDraftMapRunPlanService.selectMapStation(draftMapId);
}
}

View File

@ -0,0 +1,73 @@
package club.joylink.rtss.controller.draft;
import club.joylink.rtss.services.draftData.DraftMapRunLevelService;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.map.newmap.MapRunLevelQueryVO;
import club.joylink.rtss.vo.client.map.newmap.MapStationRunLevelVO;
import club.joylink.rtss.vo.client.map.newmap.validate.RunLevelCreateCheck;
import club.joylink.rtss.vo.client.map.newmap.validate.RunLevelUpdateCheck;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@Api(tags = {"草稿地图运行等级管理接口"})
@RestController
@RequestMapping("/api/draftMap/runLevel")
@Slf4j
public class DraftMapStationRunLevelController {
@Autowired
private DraftMapRunLevelService draftMapRunLevelService;
@ApiOperation(value = "根据地图交路区段生成站间运行等级")
@PostMapping(path = "/generate/routing/{routingId}")
public void generate(@PathVariable Long routingId) {
this.draftMapRunLevelService.generate(routingId);
}
@ApiOperation(value = "根据地图交路一键生成生成所有站间运行等级")
@PostMapping(path = "/generate/routing")
public void autoGenerate(Long mapId) {
this.draftMapRunLevelService.autoGenerate(mapId);
}
@ApiOperation(value = "根据地图起始-终点车站站台区段生成站间运行等级")
@PostMapping(path = "/generate")
public MapStationRunLevelVO generate(@RequestBody @Validated MapStationRunLevelVO runLevelVO) {
return this.draftMapRunLevelService.generate(runLevelVO);
}
@ApiOperation(value = "新建站间运行等级")
@PostMapping(path = "")
public void createRoute(@RequestBody @Validated(RunLevelCreateCheck.class) MapStationRunLevelVO runLevelVO) {
this.draftMapRunLevelService.create(runLevelVO);
}
@ApiOperation(value = "查询站间运行等级列表")
@GetMapping(path = "/{mapId}/listAll")
public PageVO<MapStationRunLevelVO> queryPagedRouteNew(@PathVariable Long mapId, MapRunLevelQueryVO queryVO) {
return this.draftMapRunLevelService.queryAllRunLevels(mapId, queryVO);
}
@ApiOperation(value = "查询站间运行等级明细")
@GetMapping(path = "/{id}")
public MapStationRunLevelVO getRouteDetailNew(@PathVariable Long id) {
return this.draftMapRunLevelService.getById(id);
}
@ApiOperation(value = "更新站间运行等级数据")
@PutMapping(path = "/{id}")
public void updateRoute(@PathVariable Long id, @RequestBody @Validated(RunLevelUpdateCheck.class) MapStationRunLevelVO runLevelVO) {
this.draftMapRunLevelService.update(id, runLevelVO);
}
@ApiOperation(value = "删除站间运行等级")
@DeleteMapping(path = "/{id}")
public void deleteRouteNew(@PathVariable Long id) {
this.draftMapRunLevelService.delete(id);
}
}

View File

@ -0,0 +1,11 @@
package club.joylink.rtss.controller.draft;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = {"发布地图用户运行计划接口"})
@RestController
@RequestMapping("/api/plan")
public class DraftPlanController {
}

View File

@ -0,0 +1,37 @@
package club.joylink.rtss.controller.iscs;
import club.joylink.rtss.services.IIscsService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.iscs.IscsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@Api(tags = {"iscs数据"})
@RestController
@RequestMapping("/api/v1/iscs")
@Slf4j
public class IscsController {
@Autowired
private IIscsService iscsService;
/**
* 保存地图元素信息
*/
@ApiOperation(value = "保存iscs数据")
@PostMapping(path = "saveElements")
public void saveIscsData(@RequestBody IscsVO iscsVO ,@ApiIgnore @RequestAttribute UserVO user) {
iscsService.saveIscsData(iscsVO);
}
@ApiOperation(value = "根据条件获取iscs数据")
@GetMapping
public IscsVO getIscsDataBy(IscsVO iscsVO, @ApiIgnore @RequestAttribute UserVO user) {
return this.iscsService.getIscsDataBy(iscsVO);
}
}

View File

@ -0,0 +1,64 @@
package club.joylink.rtss.controller.license;
import club.joylink.rtss.services.license.LicenseService;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.license.LicenseCreateCheck;
import club.joylink.rtss.vo.license.LicenseQueryVO;
import club.joylink.rtss.vo.license.LicenseVO;
import club.joylink.rtss.vo.license.LicenseValidateCheck;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Objects;
@Api(tags = {"许可证服务接口"})
@RestController
@RequestMapping(path = "/api/license")
public class LicenseController {
@Autowired
private LicenseService licenseService;
@ApiOperation("创建新的license")
@PostMapping("")
public void createLicense(@RequestBody @Validated(LicenseCreateCheck.class) LicenseVO licenseVO) {
this.licenseService.createLicense(licenseVO);
}
@ApiOperation("分页查询license数据列表")
@GetMapping("/pagingQuery")
public PageVO<LicenseVO> pagedQuery(LicenseQueryVO queryVO) {
return this.licenseService.pagedQuery(queryVO);
}
@ApiOperation("设置失效(不可用)")
@PutMapping("/{id}/invalidating")
public void invalidating(@PathVariable Long id) {
this.licenseService.invalidating(id);
}
@ApiOperation("本地部署第一次使用连接互联网访问joylink服务验证license")
@PostMapping("/validate")
public boolean validateLicense(@RequestBody @Validated(LicenseValidateCheck.class) LicenseVO licenseVO) {
return this.licenseService.validateLicense(licenseVO.getLicense());
}
@ApiOperation("连接互联网验证license成功后将license证书保存到本地部署服务器")
@PostMapping("/local")
public void saveLocalLicense(@RequestBody @Validated(LicenseValidateCheck.class) LicenseVO licenseVO) {
this.licenseService.saveLocalLicense(licenseVO.getLicense());
}
@ApiOperation("获取本地已经保存的license")
@GetMapping("/local")
public String getLocalLicense() {
LicenseVO license = this.licenseService.getLicense();
if (Objects.nonNull(license)) {
return license.generateLicense();
}
return "";
}
}

View File

@ -0,0 +1,45 @@
package club.joylink.rtss.controller.om;
import club.joylink.rtss.services.LoginSessionManager;
import club.joylink.rtss.vo.client.WebSocketMessageType;
import club.joylink.rtss.vo.client.factory.SocketMessageFactory;
import club.joylink.rtss.vo.client.pushMessage.CommonMessageVO;
import club.joylink.rtss.websocket.StompMessageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
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 javax.validation.Valid;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Api(value = "推送消息管理controller", tags = "推送消息管理接口")
@Slf4j
@RestController
@RequestMapping("/api/pushMessage")
public class PushMessageController {
@Autowired
private StompMessageService stompMessageService;
@Autowired
private LoginSessionManager loginSessionManager;
@ApiOperation(value = "触发消息推送", httpMethod = "POST")
@RequestMapping(method = RequestMethod.POST)
public void pushMessage(@ApiParam(name = "传入对象", type = "json", value = "传入json格式", required = true) @Valid @RequestBody CommonMessageVO commonMessageVO) {
log.info("****触发消息推送********");
List<Long> userIdList = this.loginSessionManager.getAllLoginUserIds();
Set<String> allSubscribers = userIdList.stream().map(id -> String.valueOf(id)).collect(Collectors.toSet());
this.stompMessageService.sendToUser(allSubscribers,
SocketMessageFactory.buildBasic(WebSocketMessageType.BROADCAST, commonMessageVO));
}
}

View File

@ -0,0 +1,111 @@
package club.joylink.rtss.controller.permission;
import club.joylink.rtss.services.IGoodsService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.GoodsTryVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.goods.GoodsQueryVO;
import club.joylink.rtss.vo.client.goods.GoodsUpdateVO;
import club.joylink.rtss.vo.client.goods.GoodsVO;
import club.joylink.rtss.vo.client.permission.PermissionQueryVO;
import club.joylink.rtss.vo.client.permission.PermissionSelectVO;
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;
@Api(tags = {"商品管理接口"})
@RestController
@RequestMapping(path = "/api/goods")
public class GoodsController {
@Autowired
private IGoodsService iGoodsService;
@ApiOperation(value = "分页查询商品")
@GetMapping(path = "")
public PageVO<GoodsVO> queryPagedGoods(GoodsQueryVO queryVO) {
return iGoodsService.queryPagedGoods(queryVO);
}
@ApiOperation(value = "查询指定权限的商品")
@GetMapping(path = "/detail")
public PageVO<GoodsVO> queryPagedGoodsByPermission(PermissionQueryVO queryVO) {
return iGoodsService.queryPagedGoodsByPermission(queryVO);
}
@ApiOperation(value = "查询商品详情")
@GetMapping(path = "/{id}")
public GoodsVO selectById(@PathVariable long id) {
return iGoodsService.selectById(id);
}
@ApiOperation(value = "获取有效商品列表")
@GetMapping(path = "/list")
public List<GoodsVO> selectValidGoodsList() {
return iGoodsService.selectValidGoodsList();
}
// @ApiOperation(value = "创建商品")
// @PostMapping(path = "")
// public GoodsVO createGoods(@RequestBody @Validated(value = {CreateGoodsCheck.class}) GoodsCreateVO createVO, @ApiIgnore @RequestAttribute UserVO user) {
// return iGoodsService.createGoods(createVO, user);
// }
//
// @ApiOperation(value = "批量创建商品")
// @PostMapping(path = "/create/list")
// public List<GoodsVO> createManyGoods(@RequestBody @Validated(value = {CreateGoodsCheck.class}) List<GoodsCreateVO> createVOList, @ApiIgnore @RequestAttribute UserVO user) {
// return iGoodsService.createManyGoods(createVOList, user);
// }
//
// @ApiOperation(value = "通过关联权限创建权限包商品")
// @PostMapping(path = "/create/package")
// public GoodsVO createGoodsByRelPermissions(@RequestBody @Validated(value = {CreateGoodsByPermissionPackageCheck.class}) GoodsCreateVO createVO, @ApiIgnore @RequestAttribute UserVO user) {
// return iGoodsService.createGoodsByRelPermissions(createVO, user);
// }
@ApiOperation(value = "更新商品")
@PutMapping(path = "/{id}")
public void updateGoods(@PathVariable Long id, @RequestBody GoodsUpdateVO updateVO, @RequestAttribute UserVO user) {
iGoodsService.updateGoods(id, updateVO, user);
}
// @ApiOperation(value = "删除商品")
// @DeleteMapping(path = "/{id}")
// public void deleteGoods(@PathVariable long id) {
// iGoodsService.deleteGoods(id);
// }
@ApiOperation(value = "更新试用时间")
@PutMapping(path = "/{id}/tryUse")
public void tryUse(@PathVariable Long id, @RequestBody Map<String, Long> map, @RequestAttribute UserVO user) {
this.iGoodsService.tryUse(id, map, user);
}
@ApiOperation(value = "获取试用时长")
@GetMapping(path = "/tryUse")
public GoodsTryVO getTryUseTime(PermissionSelectVO permissionSelectVO, @RequestAttribute UserVO user) {
return this.iGoodsService.getTryUseTime(permissionSelectVO, user);
}
@ApiOperation(value = "切换商品是否可用")
@PutMapping(path = "/{id}/status")
public void toggleGoodsStatus(@PathVariable long id) {
iGoodsService.toggleGoodsStatus(id);
}
@ApiOperation(value = "根据权限id查询商品")
@GetMapping(path = "/permissionId")
public GoodsVO selectGoodsByPermissionId(Long permissionId) {
return iGoodsService.selectGoodsByPermissionId(permissionId);
}
@ApiOperation(value = "根据权限ids查询权限包商品")
@GetMapping(path = "/permissionIds")
public GoodsVO findGoodsByPermissionIds(Long[] ids) {
return iGoodsService.findGoodsByPermissionIds(ids);
}
}

View File

@ -0,0 +1,135 @@
package club.joylink.rtss.controller.permission;
import club.joylink.rtss.services.IOrderService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.order.OrderCreateVO;
import club.joylink.rtss.vo.client.order.OrderDetailVO;
import club.joylink.rtss.vo.client.order.OrderVO;
import club.joylink.rtss.vo.client.permission.OrderQueryVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = { "订单管理接口" })
@RestController
@RequestMapping("/api/order")
public class OrderController {
@Autowired
private IOrderService iOrderService;
@ApiOperation(value = "分页获取订单")
@GetMapping(path = "")
public PageVO<OrderVO> queryPagedOrders(OrderQueryVO queryVO) {
return this.iOrderService.queryPagedOrders(queryVO);
}
@ApiOperation(value = "分页获取订单(销售员)")
@GetMapping(path = "/seller")
public PageVO<OrderVO> queryPagedOrders(OrderQueryVO queryVO, @RequestAttribute @ApiIgnore UserVO user) {
return this.iOrderService.queryPagedOrders(queryVO, user);
}
@ApiOperation(value = "创建订单")
@PostMapping(path="")
public String createOrder(@RequestBody @Validated OrderCreateVO createVO, @RequestAttribute @ApiIgnore UserVO user) {
return this.iOrderService.createOrder(createVO, user);
}
@ApiOperation(value = "获取订单详情")
@GetMapping(path = "/{id}")
public List<OrderDetailVO> getOrderDetail(@PathVariable Long id) {
return this.iOrderService.getOrderDetail(id);
}
// -----------未完成接口------------
@ApiOperation(value = "订单支付")
@GetMapping(path = "/{id}/{payType}/pay")
public String pay(@PathVariable long id, @PathVariable String payType) {
return this.iOrderService.pay(id, payType);
}
@ApiOperation(value = "订单提交")
@PostMapping(path = "/submit")
public OrderCreateVO submit(@RequestBody OrderCreateVO orderCreateVO, @RequestAttribute UserVO user) {
return this.iOrderService.submit(orderCreateVO, user);
}
@ApiOperation(value = "计算订单总价")
@GetMapping(path = "/price")
public Float computeTotal(Long goodsId, Integer goodsAmount, Integer monthAmount) {
return this.iOrderService.compute(goodsId, goodsAmount, monthAmount);
}
@ApiOperation(value = "订单取消支付")
@PutMapping(path = "/{id}/cancelPay")
public void cancelPay(@PathVariable Long id, @RequestAttribute UserVO user) {
this.iOrderService.cancelPay(id, user);
}
/*
@ApiOperation(value = "创建订单")
@PostMapping(path="")
public void createOrder(@RequestBody @Validated OrderCreateVO order, @RequestAttribute @ApiIgnore UserVO user) {
this.iOrderService.createOrder(order, user);
}
*/
/**
* 快速生成订单
* @param order
* @param user
* @return 返回生成的订单id
*//*
@PostMapping(path = "/quicklyGenerateOrder")
public String quicklyGenerateOrder(@RequestBody OrderJsonVO order,@RequestAttribute UserVO user){
return this.iOrderService.quicklyGenerateOrder(order,user);
}
@ApiOperation(value = "计算订单总价")
@GetMapping(path = "/price")
public Float computeTotal(Long goodsId, Integer goodsAmount, Integer monthAmount) {
return this.iOrderService.compute(goodsId, goodsAmount, monthAmount);
}
@ApiOperation(value = "订单提交")
@PostMapping(path = "/submit")
public OrderCreateVO submit(@RequestBody OrderCreateVO orderCreateVO, @RequestAttribute UserVO user) {
return this.iOrderService.submit(orderCreateVO, user);
}
@ApiOperation(value = "订单支付")
@GetMapping(path = "/{id}/{payType}/pay")
public String pay(@PathVariable long id, @PathVariable String payType) {
return this.iOrderService.pay(id, payType);
}
// @ApiOperation(value = "订单支付完成,为用户生成权限,测试分发权限使用,先数据库修改订单状态")
// @GetMapping(path = "/{code}/{totalfee}/completePay")
// public SaleOrder completePay(@PathVariable String code,@PathVariable int totalfee) throws PayException {
// return this.iOrderService.completePay(code,totalfee,"03");
// }
@ApiOperation(value = "订单取消支付")
@PutMapping(path = "/{id}/cancelPay")
public void cancelPay(@PathVariable Long id, @RequestAttribute UserVO user) {
this.iOrderService.cancelPay(id, user);
}
@ApiOperation(value = "查询订单")
@GetMapping(path = "/{id}")
public OrderCreateVO get(@PathVariable long id) {
return this.iOrderService.get(id);
}
*/
}

View File

@ -0,0 +1,65 @@
package club.joylink.rtss.controller.permission;
import club.joylink.rtss.services.IPermissionService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.permission.PermissionQueryVO;
import club.joylink.rtss.vo.client.permission.PermissionUpdateVO;
import club.joylink.rtss.vo.client.permission.PermissionVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
@Api(tags = {"权限管理接口"})
@RestController
@RequestMapping("/api/permission")
public class PermissionController {
@Autowired
private IPermissionService iPermissionService;
@ApiOperation(value = "分页获取权限数据")
@GetMapping(path = "")
public PageVO<PermissionVO> queryPagedPermission(PermissionQueryVO queryVO) {
return iPermissionService.queryPagedPermission(queryVO);
}
@ApiOperation(value = "查询权限详情")
@GetMapping(path = "/{id}")
public PermissionVO getDetailWithSub(@PathVariable Long id) {
return iPermissionService.getById(id);
}
@ApiOperation(value = "查询包权限详情")
@GetMapping(path = "/{id}/package")
public PageVO<PermissionVO> getPackageDetail(@PathVariable Long id, PermissionQueryVO queryVO) {
return iPermissionService.getPackageDetail(id, queryVO);
}
// @ApiOperation(value = "创建权限")
// @PostMapping(path = "")
// public String create(@RequestBody @Validated PermissionCreateVO createVO, @RequestAttribute @ApiIgnore UserVO user) {
// return iPermissionService.create(createVO, user);
// }
@ApiOperation(value = "更新权限")
@PutMapping(path = "/{id}")
public void updatePermission(@PathVariable Long id, @RequestBody PermissionUpdateVO updateVO,
@RequestAttribute @ApiIgnore UserVO user) {
iPermissionService.updatePermission(id, updateVO, user);
}
@ApiOperation(value = "一键生成权限")
@PostMapping(path = "/{mapId}/generate")
public void generatePermission(@PathVariable Long mapId, @RequestAttribute @ApiIgnore UserVO user) {
iPermissionService.generatePermission(mapId, user);
}
@ApiOperation(value = "真·一键生成权限")
@PostMapping(path = "/realGenerate")
public void realGenerate(@RequestAttribute @ApiIgnore UserVO user) {
iPermissionService.realGenerate(user);
}
}

View File

@ -0,0 +1,239 @@
package club.joylink.rtss.controller.permission;
import club.joylink.rtss.services.IPermissionDistributeService;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.order.OrderCreateVO;
import club.joylink.rtss.vo.client.permission.DistributeSelectVO;
import club.joylink.rtss.vo.client.permissionDistribute.DistributeVO;
import club.joylink.rtss.vo.client.permissionDistribute.PermissionDistributeQueryVO;
import club.joylink.rtss.vo.client.userPermission.UserPermissionDistributeVO;
import club.joylink.rtss.vo.client.userPermission.UserPermissionVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = {"权限分发管理接口"})
@RestController
@RequestMapping("/api/distribute")
public class PermissionDistributeController {
@Autowired
private IPermissionDistributeService permissionDistributeService;
@ApiOperation(value = "分页查询权限分发数据")
@GetMapping(path = "")
public PageVO<DistributeVO> queryPagedDistribute(PermissionDistributeQueryVO queryVO) {
return this.permissionDistributeService.queryPagedDistribute(queryVO);
}
@ApiOperation(value = "生成打包分发二维码")
@GetMapping(path = "/package/qrCode")
public String generateQrCode(Long id) {
return this.permissionDistributeService.generateQrCode(id);
}
@ApiOperation(value = "权限分发立即失效")
@GetMapping(path = "/{id}/invalid")
public void immediateInvalid(@PathVariable Long id) {
permissionDistributeService.immediateInvalid(id);
}
@ApiOperation(value = "从订单分发权限,获取权限分发二维码")
@GetMapping(path = "/{orderCode}/distribute")
public String givePermission(@PathVariable String orderCode, @RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.distributeFromOrder(orderCode, user);
}
@ApiOperation(value = "权限获取")
@GetMapping(path = "/getPermission")
public void getPermission(Long state, @RequestAttribute @ApiIgnore UserVO user) {
this.permissionDistributeService.getUserPermission(state, user);
}
@ApiOperation(value = "快速生成权限分发")
@PostMapping(path = "/createQuickly")
public String createQuickly(@RequestBody OrderCreateVO orderCreateVO, @RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.createQuickly(orderCreateVO, user);
}
@ApiOperation(value = "微信小程序扫码获取权限")
@GetMapping(path = "/permission")
public List<UserPermissionVO> wmGetPermission(String code, Long id) {
return this.permissionDistributeService.wmGetPermission(code, id);
}
@ApiOperation(value = "用户权限转增分发打包生成权限")
@PostMapping(path = "/packageUserPermission")
public String packageUserPermission(@RequestBody @Validated UserPermissionDistributeVO userPermissionAndAmountVO, @RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.distributeFromUserPermission(userPermissionAndAmountVO, user);
}
@ApiOperation(value = "查询个人权限分发列表")
@GetMapping(path = "/personal")
public List<DistributeVO> queryPersonalDistributeList(@RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.queryPersonalDistributeList(user);
}
@ApiOperation(value = "查询权限分发领取用户列表")
@GetMapping(path = "/{id}/users")
public List<UserPermissionVO> queryDistributeGetUsers(@PathVariable Long id, @RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.queryDistributeGetUsers(id, user);
}
@ApiOperation(value = "回收权限分发到用户权限中")
@PutMapping(path = "/{id}/restore")
public void restore(@PathVariable Long id) {
this.permissionDistributeService.restoreDistributeToUserPermission(id);
}
@ApiOperation(value = "查询权限分发包详情")
@GetMapping(path = "/package/{id}/detail")
public PageVO<DistributeVO> queryPackageDetail(@PathVariable Long id,
PermissionDistributeQueryVO queryVO) {
return permissionDistributeService.queryPackageDetail(id, queryVO);
}
/*------------------未实现接口-------------------*/
@ApiOperation(value = "权限分发")
@PostMapping(path="/distribute")
public String distributePermission(@RequestBody @Validated DistributeSelectVO distributeSelectVO,
@RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.distributePermission(distributeSelectVO, user);
}
@ApiOperation(value = "权限转赠")
@PostMapping(path="/transfer")
public String transferPermission(@RequestBody @Validated DistributeSelectVO distributeSelectVO,
@RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.transferPermission(distributeSelectVO, user);
}
@ApiOperation(value = "处理旧数据是否包")
@PutMapping(path = "/package")
public void handleOldDataColumnPackage() {
this.permissionDistributeService.handleOldDataColumnPackage();
}
/*
@ApiOperation(value = "处理旧数据是否包")
@PutMapping(path = "/package")
public void handleOldDataColumnPackage() {
this.permissionDistributeService.handleOldDataColumnPackage();
}
@ApiOperation(value = "从订单分发权限,获取二维码")
@PostMapping(path = "/{orderCode}/distribute")
public String givePermission(@PathVariable String orderCode, @RequestBody PermissionTransVO transVO,
@RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.getDistributeQrCodeFromOrder(orderCode, transVO.getDistribute(), user);
}
@ApiOperation(value = "用户权限转增分发打包生成权限")
@PostMapping(path = "/packageUserPermission")
public String packageUserPermission(@RequestBody @Validated UserPermissionDistributeVO userPermissionAndAmountVO, @RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.packageUserPermission(userPermissionAndAmountVO, user);
}
@ApiOperation(value = "权限分发")
@PostMapping(path="/distribute")
public String distributePermission(@RequestBody @Validated DistributeParamVO distributeParamVO,
@RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.distributePermission(distributeParamVO, user);
}
@ApiOperation(value = "权限转赠")
@PostMapping(path="/transfer")
public String transferPermission(@RequestBody @Validated DistributeParamVO distributeParamVO,
@RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.transferPermission(distributeParamVO, user);
}
*/
/**
* 从权限分发主键获取权限
* @param state
* @param user
* @return
*//*
@ApiOperation(value = "权限获取")
@GetMapping(path = "/getPermission")
public List<UserPermissionVO> getPermission(Long state, @RequestAttribute @ApiIgnore UserVO user) {
return this.permissionDistributeService.getUserPermission(state, user);
}
@ApiOperation(value = "微信小程序扫码获取权限")
@GetMapping(path = "/permission")
public List<UserPermissionVO> wmGetPermission(String wmCode, Long id) {
return this.permissionDistributeService.wmGetPermission(wmCode, id);
}
@ApiOperation(value = "分页查询权限分发数据")
@GetMapping(path = "")
public PageVO<PermissionDistributeListVO> queryPagedDistribute(PermissionDistributeQueryVO queryVO) {
return this.permissionDistributeService.queryPagedDistribute(queryVO);
}
@ApiOperation(value = "权限回收")
@PutMapping(path = "/{id}/restore")
public void restore(@PathVariable Long id) {
this.permissionDistributeService.restoreDistributeToUserPermission(id);
}
@ApiOperation(value = "权限分发打包详情")
@GetMapping(path = "/package/{id}/detail")
public PageVO<PermissionDistributeListVO> getPackageDetail(@PathVariable Long id, PermissionDistributeQueryVO queryVO) {
return this.permissionDistributeService.getPackageDetail(id, queryVO);
}
@ApiOperation(value = "生成打包分发二维码")
@GetMapping(path = "/package/qrCode")
public String generateQrCode(Long id) {
return this.permissionDistributeService.generateQrCode(id);
}
@ApiOperation(value = "获取权限分发详情")
@GetMapping(path = "/{id}")
public Object getDetail(@PathVariable Long id) {
return this.permissionDistributeService.getDetail(id);
}
@ApiOperation(value = "查询个人权限分发列表")
@GetMapping(path = "/personal")
public List<PermissionDistributeListVO> queryPersonalDistributeList(@RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.queryPersonalDistributeList(user);
}
@ApiOperation(value = "查询权限分发领取用户列表")
@GetMapping(path = "/{id}/users")
public List<UserPermissionVO> queryDistributeGetUsers(@PathVariable Long id, @RequestAttribute @ApiIgnore UserVO user) {
return permissionDistributeService.queryDistributeGetUsers(id, user);
}
@ApiOperation(value = "回收用户权限到权限分发中")
@PutMapping(path = "/{id}/back")
public void restorePermissionToDistribute(@PathVariable Long id,
@RequestBody @Validated UserPermissionVO userPermissionVO,
@RequestAttribute @ApiIgnore UserVO user) {
permissionDistributeService.restorePermissionToDistribute(id, userPermissionVO, user);
}
@ApiOperation(value = "权限分发立即失效")
@GetMapping(path = "/{id}/invalid")
public void immediateInvalid(@PathVariable String id) {
permissionDistributeService.immediateInvalid(id);
}
*/
}

View File

@ -0,0 +1,184 @@
package club.joylink.rtss.controller.project;
import club.joylink.rtss.constants.ProjectDeviceType;
import club.joylink.rtss.controller.advice.AuthenticateInterceptor;
import club.joylink.rtss.services.project.DeviceService;
import club.joylink.rtss.vo.LoginUserInfoVO;
import club.joylink.rtss.vo.UserVO;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.project.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@Api(tags = {"项目设备管理接口(新)"})
@RestController
@RequestMapping(path = "/api/device")
public class DeviceController {
@Autowired
private DeviceService deviceService;
@ApiOperation(value = "分页查询项目设备")
@GetMapping("/paging")
public PageVO<ProjectDeviceVO> pagingQuery(ProjectDevicePageQueryVO queryVO,
@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
LoginUserInfoVO userLoginInfo) {
return this.deviceService.pagingQuery(queryVO, userLoginInfo);
}
@ApiOperation(value = "项目设备编号是否已经存在")
@GetMapping("/exist/{code}")
public boolean isDeviceCodeExist(@PathVariable String code,
@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
LoginUserInfoVO userLoginInfo) {
return this.deviceService.isDeviceCodeExist(userLoginInfo.getProject(), code);
}
@ApiOperation(value = "新建项目设备")
@PostMapping("")
public String create(@RequestBody @Validated ProjectDeviceVO deviceVO,
@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
LoginUserInfoVO userLoginInfo) {
return this.deviceService.create(deviceVO, userLoginInfo);
}
@ApiOperation(value = "获取设备详情(包含配置信息)")
@GetMapping("/{id}")
public ProjectDeviceVO getDeviceDetailInfoById(@PathVariable Long id) {
return this.deviceService.getDeviceDetailInfoById(id);
}
@ApiOperation(value = "添加/修改道岔设备网关映射配置")
@PutMapping("/{id}/config/plcgateway")
public void updatePlcGatewayConfig(@PathVariable Long id, @RequestBody @Validated PlcGatewayConfigVO configVO) {
this.deviceService.updatePlcGatewayConfig(id, configVO);
}
@ApiOperation(value = "添加/修改道岔设备网关映射配置")
@PutMapping("/{id}/config/switch")
public void updateSwitchConfig(@PathVariable Long id, @RequestBody @Validated SwitchConfigVO configVO) {
this.deviceService.updateSwitchConfig(id, configVO);
}
@ApiOperation(value = "添加/修改信号机设备网关映射配置")
@PutMapping("/{id}/config/signal")
public void updateSignalConfig(@PathVariable Long id, @RequestBody @Validated SignalConfigVO configVO) {
this.deviceService.updateSignalConfig(id, configVO);
}
@ApiOperation(value = "添加/修改屏蔽门设备网关映射配置")
@PutMapping("/{id}/config/psc")
public void updatePscConfig(@PathVariable Long id, @RequestBody @Validated PscConfigVO configVO) {
this.deviceService.updatePscConfig(id, configVO);
}
@ApiOperation(value = "添加/修改屏蔽门设备网关映射配置")
@PutMapping("/{id}/config/psd")
public void updatePsdConfig(@PathVariable Long id, @RequestBody @Validated PsdConfigVO configVO) {
this.deviceService.updatePsdConfig(id, configVO);
}
@ApiOperation(value = "添加/修改屏蔽门设备网关映射配置")
@PutMapping("/{id}/config/psl")
public void updatePslConfig(@PathVariable Long id, @RequestBody @Validated PslConfigVO configVO) {
this.deviceService.updatePslConfig(id, configVO);
}
@ApiOperation(value = "添加/修改屏蔽门设备网关映射配置")
@PutMapping("/{id}/config/ibp")
public void updateIbpConfig(@PathVariable Long id, @RequestBody @Validated IbpConfigVO configVO) {
this.deviceService.updateIbpConfig(id, configVO);
}
@ApiOperation(value = "添加/修改虚拟IBP盘配置")
@PutMapping("/{id}/config/vribp")
public void updateVrIbpConfig(@PathVariable Long id, @RequestBody @Validated VrIbpConfigVO configVO) {
this.deviceService.updateVrIbpConfig(id, configVO);
}
@ApiOperation(value = "添加/修改现地工作站配置")
@PutMapping("/{id}/config/lw")
public void updateLwConfig(@PathVariable Long id, @RequestBody @Validated LwConfigVO configVO) {
this.deviceService.updateLwConfig(id, configVO);
}
@ApiOperation(value = "添加/修改大屏工作站配置")
@PutMapping("/{id}/config/lsw")
public void updateLswConfig(@PathVariable Long id, @RequestBody @Validated LswConfigVO configVO) {
this.deviceService.updateLswConfig(id, configVO);
}
@ApiOperation(value = "添加/修改CCTV工作站配置")
@PutMapping("/{id}/config/cctv")
public void updateCctvConfig(@PathVariable Long id, @RequestBody @Validated RelationLoginConfigVO configVO) {
this.deviceService.updateCctvConfig(id, configVO);
}
@ApiOperation(value = "添加/修改电子沙盘工作站配置")
@PutMapping("/{id}/config/sandbox")
public void updateSandboxConfig(@PathVariable Long id, @RequestBody @Validated RelationLoginConfigVO configVO) {
this.deviceService.updateSandboxConfig(id, configVO);
}
@ApiOperation(value = "添加/修改虚拟屏蔽门工作站配置")
@PutMapping("/{id}/config/vrpsd")
public void updateVrpsdConfig(@PathVariable Long id, @RequestBody @Validated VrpsdConfigVO configVO) {
this.deviceService.updateVrpsdConfig(id, configVO);
}
@ApiOperation(value = "添加/修改现地综合监控工作站配置")
@PutMapping("/{id}/config/iscslw")
public void updateIscsLwConfig(@PathVariable Long id, @RequestBody @Validated RelationLoginConfigVO configVO) {
this.deviceService.updateIscsLwConfig(id, configVO);
}
@ApiOperation(value = "添加/修改中心综合监控工作站配置")
@PutMapping("/{id}/config/iscscw")
public void updateIscsCwConfig(@PathVariable Long id, @RequestBody @Validated RelationLoginConfigVO configVO) {
this.deviceService.updateIscsCwConfig(id, configVO);
}
@ApiOperation(value = "添加/修改联锁工作站配置")
@PutMapping("/{id}/config/ilw")
public void updateIlwConfig(@PathVariable Long id, @RequestBody @Validated RelationLoginConfigVO configVO) {
this.deviceService.updateIlwConfig(id, configVO);
}
@ApiOperation(value = "删除设备")
@DeleteMapping("/{id}")
public void delete(@PathVariable Long id) {
this.deviceService.delete(id);
}
@ApiOperation(value = "查询某个类型的所有设备")
@GetMapping("/{type}/all")
public List<ProjectDeviceVO> queryByType(@PathVariable ProjectDeviceType type,
@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_INFO_KEY)
LoginUserInfoVO userLoginInfo) {
return this.deviceService.queryByType(type, userLoginInfo.getProject());
}
//
// @ApiOperation(value = "查询项目下的所有设备")
// @GetMapping("/project")
// public List<ProjectDeviceVO> queryByProjectCode(String projectCode, String group) {
// return this.iProjectDeviceService.queryByProjectCode(projectCode, group);
// }
@PostMapping("/xty/addOrUpdate")
public void addOrUpdateXtyDeviceConfig(@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
UserVO userVO) {
this.deviceService.addOrUpdateXtyDeviceConfig(userVO);
}
@PostMapping("/gzb/addOrUpdate")
public void addOrUpdateGzbDeviceConfig(@ApiIgnore @RequestAttribute(name = AuthenticateInterceptor.LOGIN_USER_KEY)
UserVO userVO) {
this.deviceService.addOrUpdateGzbDeviceConfig(userVO);
}
}

View File

@ -0,0 +1,70 @@
package club.joylink.rtss.controller.publish;
import club.joylink.rtss.services.ICommandService;
import club.joylink.rtss.vo.client.CommandCopyVO;
import club.joylink.rtss.vo.client.CommandDefinitionQueryVO;
import club.joylink.rtss.vo.client.CommandDefinitionVO;
import club.joylink.rtss.vo.client.PageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.util.List;
@Api(tags = {"指令管理接口"})
@RestController
@RequestMapping(path = "/api/cmd")
public class CommandController {
@Autowired
private ICommandService iCommandService;
@ApiOperation(value = "创建指令")
@RequestMapping(method = RequestMethod.POST)
public void createCommand(@Valid @RequestBody CommandDefinitionVO commandDefinitionVO) {
iCommandService.addDefinition(commandDefinitionVO);
}
@ApiOperation(value = "修改指令")
@RequestMapping(method = RequestMethod.PUT)
public void updateCommand(@Valid @RequestBody CommandDefinitionVO commandDefinitionVO) {
iCommandService.updateDefinition(commandDefinitionVO);
}
@ApiOperation(value = "code按条件分页查询指令可根据线路过滤结果")
@RequestMapping(method = RequestMethod.GET)
public PageVO<CommandDefinitionVO> selectCommands(String lineCode, CommandDefinitionQueryVO commandDefinitionQueryVO) {
return iCommandService.queryPagedDefinitions(lineCode, commandDefinitionQueryVO);
}
@ApiOperation(value = "根据线路查询指令,可根据仿真角色过滤")
@RequestMapping(path="line/{lineCode}",method = RequestMethod.GET)
public List<CommandDefinitionVO> selectCommands(@NotBlank @PathVariable String lineCode,String prdType,String simulationRole) {
return iCommandService.queryDefinitions(lineCode,prdType, simulationRole);
}
@ApiOperation(value = "根据指令id查询信息")
@RequestMapping(path = "{id}",method = RequestMethod.GET)
public CommandDefinitionVO selectCommandById(@PathVariable Long id) {
return iCommandService.queryDefinitionById(id);
}
@ApiOperation(value = "根据id删除指令")
@RequestMapping(path = "{id}", method = RequestMethod.DELETE)
public void deleteCommand(@PathVariable Long id) {
iCommandService.deleteDefinition(id);
}
@ApiOperation("复制指令")
@PostMapping("/copy")
public void copy(@RequestBody @Validated CommandCopyVO copyVO) {
iCommandService.copy(copyVO);
}
}

View File

@ -0,0 +1,42 @@
package club.joylink.rtss.controller.publish;
import club.joylink.rtss.services.publishData.IbpService;
import club.joylink.rtss.vo.client.PageVO;
import club.joylink.rtss.vo.client.ibp.IbpQueryVO;
import club.joylink.rtss.vo.client.ibp.IbpVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
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(value="发布IBP盘数据接口")
@RestController
@RequestMapping("/api/ibp")
public class IbpController {
@Autowired
private IbpService ibpService;
@ApiOperation(value = "分页查询发布的IBP数据基本信息")
@GetMapping("/list")
public PageVO<IbpVO> pagingQueryIbpList(IbpQueryVO queryVO) {
return this.ibpService.pagingQueryIbpList(queryVO);
}
@ApiOperation(value = "根据id查询IBP数据")
@GetMapping("/{id}")
public IbpVO getIbp(@PathVariable Long id) {
return this.ibpService.getById(id);
}
@ApiOperation(value = "根据线路编码和车站编码查询IBP数据")
@GetMapping("/query")
public IbpVO getBy(@Validated IbpQueryVO queryVO) {
return this.ibpService.getBy(queryVO);
}
}

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