Commit 19f59c55 by 涂亚平

start...

0 parents
Showing with 19258 additions and 0 deletions
No preview for this file type
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/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/
### VS Code ###
.vscode/
assets/
logs/
\ No newline at end of file
/*
* 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();
}
}
No preview for this file type
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
#!/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 "$@"
@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%
<?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.7.RELEASE</version>
<relativePath/>
</parent>
<groupId>com.zhongzhi</groupId>
<artifactId>zhongzhi</artifactId>
<version>1.0</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<java.version>1.8</java.version>
<mybatis-plus.version>3.3.0</mybatis-plus.version>
<generator.version>3.3.2</generator.version>
<swagger2.version>2.9.2</swagger2.version>
<fastjson.version>1.2.58</fastjson.version>
<jhash.version>2.0.0</jhash.version>
<poi-ooxml.version>3.13</poi-ooxml.version>
<dysmsapi.version>1.1.0</dysmsapi.version>
<sdk-core.version>4.0.1</sdk-core.version>
<lang3.version>3.9</lang3.version>
<druid.version>1.1.22</druid.version>
<itext-asian.version>5.2.0</itext-asian.version>
<itextpdf.version>5.4.1</itextpdf.version>
<java-jwt.version>3.10.3</java-jwt.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</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-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mybatis-plus.version}</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>${generator.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>${swagger2.version}</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>${swagger2.version}</version>
</dependency>
<dependency>
<groupId>com.amdelamar</groupId>
<artifactId>jhash</artifactId>
<version>${jhash.version}</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>${poi-ooxml.version}</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
<version>${dysmsapi.version}</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-core</artifactId>
<version>${sdk-core.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${lang3.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-asian</artifactId>
<version>${itext-asian.version}</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>${itextpdf.version}</version>
</dependency>
<dependency>
<groupId>com.auth0</groupId>
<artifactId>java-jwt</artifactId>
<version>${java-jwt.version}</version>
</dependency>
<!-- 阿里云 对象存储oss -->
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.15.0</version>
</dependency>
<dependency>
<groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java</artifactId>
<version>3.1.64</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>fluent-hc</artifactId>
<version>4.5.13</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>central</id>
<name>aliyun maven</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<build>
<finalName>zhongzhi</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
package com.zhongzhi;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RestController;
@RestController
@MapperScan(basePackages = {"com.zhongzhi.dao"})
@SpringBootApplication
public class ZhongzhiApplication {
public static void main(String[] args) {
SpringApplication.run(ZhongzhiApplication.class, args);
}
}
\ No newline at end of file
package com.zhongzhi.common.configure;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
@Data
@Component
@ConfigurationProperties(prefix = "sms")
public class AliyunSmsProperties {
private String product;
private String domain;
private String accessKeyId;
private String accessKeySecret;
private String cpcode;
private String excode;
private String key;
private String rcsapi;
}
package com.zhongzhi.common.configure;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.zhongzhi.common.handler.MetaHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class MybatisPlusConfig {
/**
* 分页
*
* @return
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor page = new PaginationInterceptor();
page.setDialectType(DbType.MYSQL.getDb());
return page;
}
/**
* 自动填充功能
*
* @return
*/
@Bean
public GlobalConfig globalConfig() {
GlobalConfig globalConfig = new GlobalConfig();
globalConfig.setMetaObjectHandler(new MetaHandler());
return globalConfig;
}
}
\ No newline at end of file
package com.zhongzhi.common.configure;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.Map;
/**
* <p>
* 读取状态码
* </p>
*
* @author DengMin
* @date Created in 2020/08/24
*/
@Component
@ConfigurationProperties(prefix = "c")
@PropertySource(value = "classpath:code.properties", encoding = "UTF-8")
public class RemoteProperties {
private static Map<Integer, String> codeMessage = new HashMap<>();
public static String getMessage(Integer code) {
return codeMessage.get(code);
}
public Map<Integer, String> getCodeMessage() {
return codeMessage;
}
public void setCodeMessage(Map<Integer, String> codeMessage) {
RemoteProperties.codeMessage = codeMessage;
}
}
\ No newline at end of file
package com.zhongzhi.common.configure;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* <p>
* swagger2
* </p>
*
* @author DengMin
* @since 2020/12/8
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.pathMapping("/")
.select()
.apis(RequestHandlerSelectors.basePackage("com.zhongzhi.controller"))
.paths(PathSelectors.any())
.build()
.apiInfo(new ApiInfoBuilder()
.title("中职双创系统")
.description("接口文档")
.version("1.0")
.build());
}
}
package com.zhongzhi.common.configure;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @author: tuyp
* @create: 2020-06-01 16:46
*/
@Component
@Data
@ConfigurationProperties(prefix = "vod")
public class VODConfig {
private String appId;
private String secretId;
private String secretKey;
private String api;
private String region;
private Integer classId;
}
package com.zhongzhi.common.configure;
import com.zhongzhi.common.interceptor.AuthenticationInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
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;
import org.springframework.web.servlet.config.annotation.*;
/**
* @author DengMin
* @date 2020/07/06
**/
@Configuration
public class WebConfig extends WebMvcConfigurationSupport {
@Autowired
private AuthenticationInterceptor authenticationInterceptor;
/**
* 跨域支持
*
* @param registry
*/
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
.allowCredentials(true)
.allowedOrigins("*")
.allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS")
.maxAge(3600);
}
@Bean
public CorsFilter corsFilter() {
CorsConfiguration config = new CorsConfiguration();
config.setMaxAge(3600L);
config.addAllowedOrigin("*");
config.addAllowedMethod("*");
config.addAllowedHeader("*");
UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();
configSource.registerCorsConfiguration("/**", config);
return new CorsFilter(configSource);
}
/**
* Swagger
*
* @param registry
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/**")
.addResourceLocations("classpath:/static/");
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
super.addResourceHandlers(registry);
}
/**
* 鉴权
*
* @param registry
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(authenticationInterceptor)
.excludePathPatterns("/static/*")
.addPathPatterns("/**");
}
}
\ No newline at end of file
package com.zhongzhi.common.constant;
import lombok.Getter;
@Getter
public enum Code {
USERNAMENOTFOUND(1001, "用户不存在"),
BADCREDENTIALS(1002, "账户或者密码错误"),
ACCOUNTEXPIRED(1003, "账户过期"),
LOCKEDEXCEPTION(1004, "账户已锁定"),
DISABLEDEXCEPTION(1005, "账户已禁用"),
ACCESSDENIED(1006, "无权限访问"),
AUTHENTICATION(1007, "身份验证异常"),
NOHANDLERFOUND(1008, "找不到相应的视图处理器"),
PARAM_INVALID(1009, "参数不合法"),
TOKEN_EXCEPTION(1010, "无效的令牌"),
TOKEN_EXPIRED(1011, "令牌已过期"),
TOKEN_VERIFICATION_FAILED(1012, "令牌验证失败"),
OSS_ERROR(1013, "OSS文件上传异常"),
Network_ERROR(9000, "网络请求失败"),
SERVER_INTERNAL_ERROR(99999, "服务器内部错误"),
;
private final Integer code;
private final String message;
Code(Integer code, String message) {
this.code = code;
this.message = message;
}
}
package com.zhongzhi.common.constant;
/**
* <p>
* 团队成员类型
* </p>
*
* @author DengMin
* @since 2021/6/9
*/
public class MemberType {
/*
团队负责人只能有一个且是项目申请人
*/
public static final String PRINCIPAL = "团队负责人";
public static final String TEAM_MEMBER = "团队成员";
public static final String MENTOR = "指导教师";
}
package com.zhongzhi.common.constant;
import org.apache.commons.lang3.StringUtils;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class PDFCheckBox {
public static String getType(String type, String projectGroup) {
if (StringUtils.isBlank(type) &&
projectGroup.equals(ProjectType.TECHNOLOGY_INNOVATION_GROUP)) {
return "□方案设计类 □模型创意类 □虚拟演示类";
} else if (StringUtils.isBlank(type) &&
projectGroup.equals(ProjectType.CULTURAL_CREATIVE_GROUP)) {
return "□服装与服饰类设计 □视觉传达类 □产品设计类";
}
String[] typeT = {"方案设计类", "模型创意类", "虚拟演示类"};
String typeValue = "";
if (projectGroup.equals(ProjectType.TECHNOLOGY_INNOVATION_GROUP)) {
List<String> typeList = Arrays.stream(typeT).collect(Collectors.toList());
List<String> str = Arrays.stream(type.split(",")).collect(Collectors.toList());
for (String s : typeList) {
if (str.contains(s)) {
typeValue += "■" + s + " ";
} else {
typeValue += "□" + s + " ";
}
}
return typeValue;
} else if (projectGroup.equals(ProjectType.CULTURAL_CREATIVE_GROUP)) {
if (type.equals("服装与服饰类设计")) {
return "■服装与服饰类设计 □视觉传达类 □产品设计类";
} else if (type.equals("视觉传达类")) {
return "□服装与服饰类设计 ■视觉传达类 □产品设计类";
} else if (type.equals("产品设计类")) {
return "□服装与服饰类设计 □视觉传达类 ■产品设计类";
} else {
return "□服装与服饰类设计 □视觉传达类 □产品设计类";
}
}
return "";
}
public static String getRoadshow( String projectGroup) {
if (projectGroup.equals(ProjectType.TECHNOLOGY_INNOVATION_GROUP)) {
return "□模型展示 □数字化演示" +
" □PPT演示 □其他";
} else if (projectGroup.equals(ProjectType.CULTURAL_CREATIVE_GROUP)) {
return "□物化产品展示 □作品模型展示" +
" □数字化演示 □PPT演示 □其他";
}
String[] roadshowT = {"模型展示", "数字化演示", "PPT演示", "其他"};
String[] roadshowC = {"物化产品展示", "作品模型展示", "数字化演示", "PPT演示", "其他"};
// List<String> str = Arrays.stream(roadshow.split(",")).collect(Collectors.toList());
String roadshowValue = "";
if (projectGroup.equals(ProjectType.TECHNOLOGY_INNOVATION_GROUP)) {
List<String> roadshowTList = Arrays.stream(roadshowT).collect(Collectors.toList());
for (String s : roadshowTList) {
// if (str.contains(s)) {
// roadshowValue += "■" + s + " ";
// } else {
// roadshowValue += "□" + s + " ";
// }
}
return roadshowValue;
} else if (projectGroup.equals(ProjectType.CULTURAL_CREATIVE_GROUP)) {
List<String> roadshowCList = Arrays.stream(roadshowC).collect(Collectors.toList());
for (String s : roadshowCList) {
// if (str.contains(s)) {
// roadshowValue += "■" + s + " ";
// } else {
// roadshowValue += "□" + s + " ";
// }
}
return roadshowValue;
}
return "";
}
}
package com.zhongzhi.common.constant;
/**
* <p>
* 平台标识
* </p>
*
* @author DengMin
* @since 2021/6/9
*/
public class Platform {
/*
学生端
*/
public static final String student = "student";
/*
院校端
*/
public static final String school = "school";
/*
中心端
*/
public static final String center = "center";
/*
评审端
*/
public static final String review = "review";
}
package com.zhongzhi.common.constant;
public class ProjectProgress {
public static final String REGISTERED = "已注册公司";
public static final String UNREGISTERED = "创意设计阶段";
}
package com.zhongzhi.common.constant;
/**
* <p>
* 项目评审状态
* </p>
*
* @author DengMin
* @since 2021/6/9
*/
public class ProjectReview {
/**
* 评分状态(对于评分)
*/
public static final String SUBMITTED = "已评审";
public static final String TO_SCORE = "待评审";
/**
* 评审状态(对于项目)
*/
public static final String TO_REVIEWED = "待评审";
public static final String ASSIGNED = "已分配";
public static final String UNASSIGNED = "未分配";
public static final String REVIEW = "已评审";
}
package com.zhongzhi.common.constant;
/**
* <p>
* 项目进度
* </p>
*
* @author DengMin
* @since 2021/6/9
*/
public class ProjectSchedule {
//报名阶段
public static final String REGISTER = "报名阶段";
// 校内赛
public static final String SCHOOL_REVIEW = "校级申请项目";
// public static final String PRELIMINARY_REVIEW = "市级初赛项目";
public static final String SEMI_FINAL_REVIEW = "市级复赛项目";
public static final String FINAL_REVIEW = "市级决赛项目";
}
package com.zhongzhi.common.constant;
/**
* <p>
* 项目状态
* </p>
*
* @author DengMin
* @since 2021/6/9
*/
public class ProjectStatus {
// public static final String TO_REVIEW = "";
public static final String UN_SUBMITTED = "填写中";
public static final String WITHDRAWN = "已撤回";
public static final String SCHOOL_NOT_PASSED = "不予提交市级复赛";
public static final String REGISTER_NOT_PASSED = "报名不通过";
public static final String PRELIMINARY_NOT_PASSED = "不予提交市级初赛";
public static final String REMATCH_WINNING_AWARD = "市级优胜奖";
public static final String REMATCH_SILVER_AWARD = "市级银奖";
public static final String REMATCH_BRONZE_AWARD = "市级铜奖";
public static final String REMATCH_FINALS_GOLD_AWARD = "市级金奖";
}
package com.zhongzhi.common.constant;
/**
* <p>
* 项目组别
* </p>
*
* @author DengMin
* @since 2021/6/9
*/
public class ProjectType {
/**
* 赛道
*/
public static final String MAIN_TRACK = "主赛道";
public static final String SEED_TRACK = "种子赛道";
public static final String VOCATIONAL = "职教赛道";
/**
* 组别
*/
public static final String TECHNOLOGY_INNOVATION_GROUP = "科技创新";
public static final String CULTURAL_CREATIVE_GROUP = "文化创意";
public static final String VOCATIONAL_GROUP = "高职";
public static final String SECONDARY_GROUP = "中职";
}
package com.zhongzhi.common.constant;
public class SMSTemplate {
/*
项目进度通知
*/
public static final String PROJECT_PROGRESS = "2760175";
/*
项目提交通知
*/
public static final String PROJECT_SUBMIT = "270159";
/*
评审邀请通知 old
*/
public static final String REVIEW_INVITATION_OLD = "2765806";
/**
*
*/
public static final String REVIEW_INVITATION_NEW = "2939771";
/*
撤销评审项目通知
*/
public static final String CANCEL_REVIEW = "229303";
}
package com.zhongzhi.common.constant;
/**
* <p>
* 短信标识
* </p>
*
* @author DengMin
* @since 2021/6/9
*/
public class SmsCode {
/**
* 平台:student(学生端)、school(院校端)、center(中心端)、review(评审端)
*/
public static final String student = "student";
public static final String school = "school";
public static final String center = "center";
public static final String review = "review";
/**
* 行为标识:register(注册标识)、login(登录标识)
*/
public static final String register = "register";
public static final String login = "login";
}
package com.zhongzhi.common.exception;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.zhongzhi.common.configure.RemoteProperties;
import com.zhongzhi.common.constant.Code;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.vo.ResponseVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.validation.BindException;
import org.springframework.web.HttpRequestMethodNotSupportedException;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.NoHandlerFoundException;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {
/**
* 自定义异常
*
* @param e
* @return
*/
@ExceptionHandler(value = HttpException.class)
public ResponseVO<T> handlerException(HttpServletRequest request, HttpException e) {
String message = RemoteProperties.getMessage(e.getCode());
if (StringUtils.isBlank(message)) {
message = e.getMessage();
}
String url = request.getRequestURI();
return ResponseData.generateCreatedResponse(e.getCode(), message, url);
}
/**
* 404
*
* @param request
* @return
*/
@ExceptionHandler(value = NoHandlerFoundException.class)
public ResponseVO<T> NoHandlerFoundException(HttpServletRequest request) {
String url = request.getRequestURI();
return ResponseData.generateCreatedResponse(Code.NOHANDLERFOUND.getCode(), Code.NOHANDLERFOUND.getMessage(), url);
}
/**
* 请求方式错误
*
* @param request
* @return
*/
@ExceptionHandler(value = HttpRequestMethodNotSupportedException.class)
public ResponseVO<T> HttpRequestMethodNotSupportedException(HttpServletRequest request) {
String url = request.getRequestURI();
return ResponseData.generateCreatedResponse(Code.NOHANDLERFOUND.getCode(), Code.NOHANDLERFOUND.getMessage(), url);
}
/**
* 参数不合法
*
* @param e
* @return
*/
@ExceptionHandler(MethodArgumentNotValidException.class)
public ResponseVO<T> validateException(MethodArgumentNotValidException e) {
final List<String> errList = new ArrayList<>();
e.getBindingResult().getAllErrors().stream().forEach(x -> {
errList.add(x.getDefaultMessage());
});
return ResponseData.generateCreatedResponse(Code.PARAM_INVALID.getCode(), Code.PARAM_INVALID.getMessage(), errList.toString());
}
/**
* JSON 序列化异常
*
* @param e
* @return
*/
@ExceptionHandler(HttpMessageNotReadableException.class)
public ResponseVO<T> exceptionHandler(HttpMessageNotReadableException e) {
log.error(e.getMessage());
return ResponseData.generateCreatedResponse(Code.PARAM_INVALID.getCode(), Code.PARAM_INVALID.getMessage() + ":{" + e.getMessage() + "}");
}
/**
* 校验异常
*
* @param e
* @return
*/
@ExceptionHandler(BindException.class)
public ResponseVO<T> BindException(BindException e) {
final List<String> errList = new ArrayList<>();
e.getBindingResult().getAllErrors().stream().forEach(x -> {
errList.add(x.getDefaultMessage());
});
return ResponseData.generateCreatedResponse(Code.PARAM_INVALID.getCode(), Code.PARAM_INVALID.getMessage(), errList.toString());
}
/**
* 服务器内部错误
*
* @return
*/
@ExceptionHandler(value = Exception.class)
public ResponseVO<T> serverInternalError(Exception e, HttpServletRequest request) {
String url = request.getRequestURI();
log.error("path:" + url);
log.error("error:"+ e.getClass());
log.error("error message:"+ e.getLocalizedMessage() + e.getStackTrace()[0] + System.getProperty("line.separator"));
return ResponseData.generateCreatedResponse(Code.SERVER_INTERNAL_ERROR.getCode(), Code.SERVER_INTERNAL_ERROR.getMessage(), url);
}
}
\ No newline at end of file
package com.zhongzhi.common.exception;
import com.zhongzhi.common.configure.RemoteProperties;
/**
* 异常处理
*
* @author DengMin
* @date 2020/08/12
**/
public class HttpException extends RuntimeException {
private Integer code;
private String message;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
@Override
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public HttpException(Integer code) {
super(RemoteProperties.getMessage(code));
String message = RemoteProperties.getMessage(code);
this.message = message;
this.code = code;
}
public HttpException(Integer code, String message) {
this.message = message;
this.code = code;
}
}
package com.zhongzhi.common.generator;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.generator.AutoGenerator;
import com.baomidou.mybatisplus.generator.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.*;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import com.zhongzhi.model.base.BaseModel;
import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;
import java.util.Scanner;
/**
* <p>
* 项目生成器
* </p>
*
* @author DengMin
*/
public class CodeGenerator {
public static String scanner(String tip) {
StringBuilder help = new StringBuilder();
help.append("1.生成全部表 2.输入需要生成表名");
System.out.println(help);
Scanner scanner = new Scanner(System.in);
Integer ipt = Integer.valueOf(scanner.next());
if (ipt == 1) {
return "";
} else if (ipt == 2) {
StringBuilder help1 = new StringBuilder();
help1.append("请输入" + tip + ":");
System.out.println(help1);
Scanner scanner1 = new Scanner(System.in);
if (scanner1.hasNext()) {
String name = scanner1.next();
if (StringUtils.isNotEmpty(name)) {
return name;
}
}
throw new MybatisPlusException("请输入正确的" + tip + "!");
}
return scanner(tip);
}
public static void main(String[] args) {
final ResourceBundle rb = ResourceBundle.getBundle("mybatis-generator");
// 代码生成器
AutoGenerator mpg = new AutoGenerator();
// 全局配置
GlobalConfig gc = new GlobalConfig();
gc.setOutputDir(System.getProperty("user.dir") + rb.getString("outputDir"));
gc.setOpen(false);
gc.setBaseResultMap(true);
gc.setBaseColumnList(true);
gc.setAuthor(rb.getString("author"));
gc.setMapperName("%sMapper");
gc.setEntityName("%sDO");
gc.setServiceName("%sService");
gc.setServiceImplName("%sServiceImpl");
gc.setControllerName("%sController");
mpg.setGlobalConfig(gc);
// 数据源配置
DataSourceConfig dsc = new DataSourceConfig();
dsc.setDbType(DbType.MYSQL);
dsc.setUrl(rb.getString("url"));
dsc.setDriverName(rb.getString("driverName"));
dsc.setUsername(rb.getString("userName"));
dsc.setPassword(rb.getString("password"));
mpg.setDataSource(dsc);
// 包配置
PackageConfig pc = new PackageConfig();
pc.setParent(rb.getString("setParent"));
pc.setController("controller");
pc.setService("service");
pc.setServiceImpl("service.impl");
pc.setEntity("model");
pc.setMapper("mapper");
mpg.setPackageInfo(pc);
// 自定义配置
InjectionConfig cfg = new InjectionConfig() {
@Override
public void initMap() {
// to do nothing
}
};
List<FileOutConfig> focList = new ArrayList<>();
focList.add(new FileOutConfig("/templates/mapper.xml.ftl") {
@Override
public String outputFile(TableInfo tableInfo) {
// 自定义输入文件名称
return System.getProperty("user.dir") + rb.getString("mapperPath") + tableInfo.getMapperName() + StringPool.DOT_XML;
}
});
cfg.setFileOutConfigList(focList);
mpg.setCfg(cfg);
mpg.setTemplate(new TemplateConfig().setXml(null));
// 策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setNaming(NamingStrategy.underline_to_camel);
strategy.setColumnNaming(NamingStrategy.underline_to_camel);
strategy.setSuperEntityClass(BaseModel.class);
strategy.setEntityLombokModel(true);
strategy.setRestControllerStyle(true);
String[] tables = scanner("表名,多个英文逗号分割").split(",");
if (StringUtils.isNotBlank(tables[0])) {
strategy.setInclude(tables);
}
strategy.setControllerMappingHyphenStyle(true);
mpg.setStrategy(strategy);
mpg.setTemplateEngine(new FreemarkerTemplateEngine());
mpg.execute();
}
}
package com.zhongzhi.common.handler;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
/**
* 填充配置
*
* @author DengMin
* @date 2020/07/21
**/
@Component
public class MetaHandler implements MetaObjectHandler {
@Override
public void insertFill(MetaObject metaObject) {
this.setFieldValByName("createTime", LocalDateTime.now(), metaObject);
}
@Override
public void updateFill(MetaObject metaObject) {
this.setFieldValByName("updateTime", LocalDateTime.now(), metaObject);
}
}
package com.zhongzhi.common.interceptor;
import com.auth0.jwt.interfaces.Claim;
import com.zhongzhi.common.constant.Code;
import com.zhongzhi.common.constant.SmsCode;
import com.zhongzhi.common.exception.HttpException;
import com.zhongzhi.common.utils.JwtUtil;
import com.zhongzhi.common.utils.Localstorage;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.model.AdministerDO;
import com.zhongzhi.model.CollegesDictDO;
import com.zhongzhi.model.ProjectJudgeDO;
import com.zhongzhi.model.StudentDO;
import com.zhongzhi.service.AdministerService;
import com.zhongzhi.service.CollegesDictService;
import com.zhongzhi.service.ProjectJudgeService;
import com.zhongzhi.service.StudentService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Map;
/**
* <p>
* 鉴权拦截器
* </p>
*
* @author DengMin
* @since 2021/4/26
*/
@Component
public class AuthenticationInterceptor implements HandlerInterceptor {
@Autowired
private StudentService studentService;
@Autowired
private AdministerService administerService;
@Autowired
private CollegesDictService collegesDictService;
@Autowired
private ProjectJudgeService projectJudgeService;
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
if (!(handler instanceof HandlerMethod)) {
return true;
}
HandlerMethod handlerMethod = (HandlerMethod) handler;
Method method = handlerMethod.getMethod();
LoginRequired methodAnnotation = method.getAnnotation(LoginRequired.class);
if (methodAnnotation != null) {
String authorization = request.getHeader("Authorization");
if (StringUtils.isBlank(authorization)) {
throw new HttpException(Code.TOKEN_EXCEPTION.getCode(), Code.TOKEN_EXCEPTION.getMessage());
}
String token = authorization;
if (authorization.startsWith("Bearer")) {
token = authorization.replace("Bearer ", "");
}
if (token == null || JwtUtil.isExpired(token) || !JwtUtil.verifyToken(token)) {
throw new HttpException(Code.TOKEN_EXCEPTION.getCode(), Code.TOKEN_EXCEPTION.getMessage());
}
Map<String, Claim> claimMap = JwtUtil.getClaims(token);
if (claimMap != null) {
String[] role = methodAnnotation.value();
String type = claimMap.get("type").asString();
if (role.length > 0) {
if (Arrays.asList(role).contains(type)) {
if (SmsCode.student.equals(type)) {
StudentDO studentDO = studentService.getById(claimMap.get("id").asLong());
if (studentDO != null) {
Localstorage.setUser(studentDO, type);
return true;
} else {
Localstorage.remove();
throw new HttpException(Code.USERNAMENOTFOUND.getCode(), Code.USERNAMENOTFOUND.getMessage());
}
} else if (SmsCode.center.equals(type)) {
AdministerDO administerDO = administerService.getById(claimMap.get("id").asLong());
if (administerDO != null) {
Localstorage.setUser(administerDO, type);
return true;
} else {
Localstorage.remove();
throw new HttpException(Code.USERNAMENOTFOUND.getCode(), Code.USERNAMENOTFOUND.getMessage());
}
} else if (SmsCode.school.equals(type)) {
CollegesDictDO collegesDictDO = collegesDictService.getById(claimMap.get("id").asLong());
if (collegesDictDO != null) {
Localstorage.setUser(collegesDictDO, type);
return true;
} else {
Localstorage.remove();
throw new HttpException(Code.USERNAMENOTFOUND.getCode(), Code.USERNAMENOTFOUND.getMessage());
}
} else if (SmsCode.review.equals(type)) {
ProjectJudgeDO projectJudgeDO = projectJudgeService.getById(claimMap.get("id").asLong());
if (projectJudgeDO != null) {
Localstorage.setUser(projectJudgeDO, type);
return true;
} else {
Localstorage.remove();
throw new HttpException(Code.USERNAMENOTFOUND.getCode(), Code.USERNAMENOTFOUND.getMessage());
}
}
}
throw new HttpException(Code.ACCESSDENIED.getCode(), Code.ACCESSDENIED.getMessage());
}
}
}
return true;
}
}
package com.zhongzhi.common.utils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.zhongzhi.common.configure.AliyunSmsProperties;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;
import com.zhongzhi.common.constant.SMSTemplate;
import com.zhongzhi.common.exception.HttpException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.Map;
/**
* <p>
* 阿里云短信
* </p>
*
* @author DengMin
* @since 2021/1/27
*/
@Slf4j
@Component
public class AliyunSmsUtil {
@Autowired
private AliyunSmsProperties aliyunSmsProperties;
/**
* 阿里云短信 -- 验证码
* @param phone
* @param code
* @return
*/
public SendSmsResponse send(String phone, int code) {
try {
System.setProperty("sun.net.client.defaultConnectTimeout", "10000");
System.setProperty("sun.net.client.defaultReadTimeout", "10000");
//初始化acsClient,暂不支持region化
IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunSmsProperties.getAccessKeyId(), aliyunSmsProperties.getAccessKeySecret());
DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", aliyunSmsProperties.getProduct(), aliyunSmsProperties.getDomain());
IAcsClient acsClient = new DefaultAcsClient(profile);
//组装请求对象-具体描述见控制台-文档部分内容
SendSmsRequest request = new SendSmsRequest();
//必填:待发送手机号
request.setPhoneNumbers(phone);
//必填:短信签名-可在短信控制台中找到
request.setSignName("双创平台");
//必填:短信模板-可在短信控制台中找到
request.setTemplateCode("SMS_229640297");
//可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为
request.setTemplateParam("{\"code\":\"" + code + "\"}");
//hint 此处可能会抛出异常,注意catch
SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
if (sendSmsResponse != null && sendSmsResponse.getCode().equals("OK")) {
return sendSmsResponse;
}
throw new Exception(sendSmsResponse.getMessage());
} catch (Exception e) {
log.error("---短信发送失败:" + e);
throw new HttpException(10011);
}
}
public static void main(String[] args) {
// AliyunSmsUtil.sendNew("15201936167",000123);
}
/**
* 三网平台短信
* @param msg
* @param phone
* @param templateId
*/
public void sendTemplateMsg(String msg, String phone, String templateId) {
Map<String, Object> map = new HashMap<>();
try {
map.put("cpcode", aliyunSmsProperties.getCpcode());
map.put("msg", msg);
map.put("mobiles", phone);
map.put("excode", aliyunSmsProperties.getExcode());
map.put("templetid", templateId);
String md5source = aliyunSmsProperties.getCpcode() + msg + phone + aliyunSmsProperties.getExcode() + templateId + aliyunSmsProperties.getKey();
map.put("sign", makeMD5(new String(md5source.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8)).toLowerCase());
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> responseEntity = restTemplate.postForEntity(aliyunSmsProperties.getRcsapi(), map, String.class);
String body = responseEntity.getBody();
JSONObject object = JSON.parseObject(body);
if (Integer.valueOf(object.get("resultcode").toString()) != 0) {
log.error(object.get("resultmsg").toString());
}
} catch (Exception e) {
e.printStackTrace();
}
}
// /**
// * 三网平台短信 新版本 https://flaginfo-cloud.yuque.com/staff-rozzgq/ofcpak
// * @param msg
// * @param phone
// * @param templateId
// */
// public static void sendTemplateMsgNew(String msg, String phone, String templateId) {
// String info = null;
// try{
// HttpClient httpclient = new HttpClient();
// PostMethod post = new PostMethod("https://opassapi.infocloud.cc/sms/Api/SendGBK.do");//
// post.getParams().setParameter(HttpMethodParams.HTTP_CONTENT_CHARSET,"gb2312");
// post.addParameter("SpCode", templateId);
// post.addParameter("LoginName", "7db124d0baf189d1e485350xxx");
// post.addParameter("Password", "3df50b24fb8288b9da99d16bf527e9dbf13659748534dca6e0820xxx");
// post.addParameter("MessageContent", msg);
// post.addParameter("UserNumber", phone);
// post.addParameter("SerialNumber", "");
// post.addParameter("f", "1");
// httpclient.executeMethod(post);
// info = new String(post.getResponseBody(),"gbk");
// System.out.println(info);
// }catch (Exception e) {
// e.printStackTrace();
// }
// }
public void sendTemplateMsgP(String msg, String phone, String templateId) {
Map<String, Object> map = new HashMap<>();
try {
map.put("cpcode", aliyunSmsProperties.getCpcode());
map.put("msg", msg);
map.put("mobiles", phone);
map.put("excode", aliyunSmsProperties.getExcode());
map.put("templetid", templateId);
String md5source = aliyunSmsProperties.getCpcode() + msg + phone + aliyunSmsProperties.getExcode() + templateId + aliyunSmsProperties.getKey();
map.put("sign", makeMD5(new String(md5source.getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8)).toLowerCase());
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> responseEntity = restTemplate.postForEntity(aliyunSmsProperties.getRcsapi(), map, String.class);
String body = responseEntity.getBody();
JSONObject object = JSON.parseObject(body);
if (Integer.valueOf(object.get("resultcode").toString()) != 0) {
log.error(object.get("resultmsg").toString());
}
} catch (Exception e) {
e.printStackTrace();
}
}
public String makeMD5(String plainText) {
String re_md5 = "";
try {
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(plainText.getBytes(StandardCharsets.UTF_8));
byte[] b = md.digest();
int i;
StringBuffer buf = new StringBuffer();
for (int offset = 0; offset < b.length; offset++) {
i = b[offset];
if (i < 0) {
i += 256;
}
if (i < 16) {
buf.append("0");
}
buf.append(Integer.toHexString(i));
}
re_md5 = buf.toString().toLowerCase();
} catch (Exception e) {
e.printStackTrace();
}
return re_md5;
}
// public static String getByteString( byte[] buff_out )
// {
// StringBuffer strBuf = new StringBuffer(buff_out.length * 3);
// strBuf.append("Length[");
// strBuf.append(buff_out.length);
// strBuf.append("];Content[");
// for ( int i = 0 ; i < buff_out.length ; ++i ) {
// int l = buff_out[i] & 0x0F;
// int h = (buff_out[i] & 0xF0) >> 4;
//
// char ll = (char) (l > 9 ? 'a' + l - 10 : '0' + l);
// char hh = (char) (h > 9 ? 'a' + h - 10 : '0' + h);
//
// strBuf.append(hh);
// strBuf.append(ll);
// strBuf.append(" ");
// }
// strBuf.append("]");
// return strBuf.toString().toUpperCase();
// }
}
\ No newline at end of file
package com.zhongzhi.common.utils;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
@Component
public class ApplicationContextUtil implements ApplicationContextAware {
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
ApplicationContextUtil.applicationContext = applicationContext;
}
public static <T> T getBean(Class<T> clazz) {
return applicationContext.getBean(clazz);
}
public static <T> T getBean(String name) {
return (T) applicationContext.getBean(name);
}
}
package com.zhongzhi.common.utils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import java.text.SimpleDateFormat;
import java.time.*;
import java.util.Date;
/**
* Date格式工具
*
* @author DengMin
* @date 2020/08/03
**/
public class DateFormatUtil {
public final static String FMT_sdf14_L = "yyyy-MM-dd HH:mm:ss";
public final static String FMT_sdf_yMd = "yyyy-MM-dd";
public final static String FMT_sdf_Hm = "H:mm";
public final static String cron = "s m H d M ? yyyy";
/**
* Date转String,自定义格式
*
* @param date
* @param pattern
* @return
*/
public static String format(Date date, String pattern) {
try {
if (date == null) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return sdf.format(date);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* String转Date,自定义格式
*
* @param date
* @param pattern
* @return
*/
public static Date parse(String date, String pattern) {
try {
if (StringUtils.isBlank(date)) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return sdf.parse(date);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* LocalDate转Date
*
* @param localDate
* @return
*/
public static Date localDateToDate(LocalDate localDate) {
if (localDate == null) {
return null;
}
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
return Date.from(zonedDateTime.toInstant());
}
/**
* LocalDate转String
*
* @param localDate
* @return
*/
public static String localDateToString(LocalDate localDate) {
if (localDate == null) {
return null;
}
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
return format(Date.from(zonedDateTime.toInstant()), FMT_sdf_yMd);
}
public static Date localDateTimeToDate(LocalDateTime localDateTime) {
if (localDateTime == null) {
return null;
}
return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
}
/**
* date转localDate
*
* @param date
* @return
*/
public static LocalDate dateTOLocalDate(Date date) {
if (date == null) {
return null;
}
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
}
/**
* String转LocalDate
*
* @param date
* @return
*/
public static LocalDate localDateParse(String date) {
if (StringUtils.isBlank(date)) {
return null;
}
return LocalDate.parse(date);
}
/**
* 时间戳转LocalDate
*
* @param timestamp
* @return
*/
public static LocalDate timestampTOLocalDate(Long timestamp) {
return Instant.ofEpochMilli(timestamp).atZone(ZoneOffset.ofHours(0)).toLocalDate();
}
/**
* 时间字符串转Cron
*
* @param date
* @return
*/
public static String getCron(String date) {
try {
Date d = parse(date, FMT_sdf14_L);
SimpleDateFormat sdf = new SimpleDateFormat(cron);
return sdf.format(d);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 时间戳转日期字符串
*
* @param timestamp 时间戳
* @return 日期字符串
* @author ALiang
*/
public static String timestampToDateString(Long timestamp) {
Date date = new Date(timestamp);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(FMT_sdf14_L);
return simpleDateFormat.format(date);
}
/**
* Date转LocalTime
*
* @param date
* @return
*/
public static LocalTime dateToLocalTime(Date date) {
Instant instant = date.toInstant();
ZoneId zoneId = ZoneId.systemDefault();
LocalTime localTime = instant.atZone(zoneId).toLocalTime();
return localTime;
}
public static LocalDateTime dateToLocalDateTime(Date date) {
Instant instant = date.toInstant();
ZoneId zoneId = ZoneId.systemDefault();
LocalDateTime localDateTime = instant.atZone(zoneId).toLocalDateTime();
return localDateTime;
}
}
package com.zhongzhi.common.utils;
import java.lang.annotation.*;
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ExcelColumn {
String value() default "";
int col() default 1;
}
package com.zhongzhi.common.utils;
import com.zhongzhi.common.exception.HttpException;
import com.zhongzhi.vo.ExcelFieldVO;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.formula.functions.T;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Component
public class ExcelUtil {
private final static String EXCEL2003 = "xls";
private final static String EXCEL2007 = "xlsx";
public static <T> List<T> readExcel(Class<T> cls, MultipartFile file) {
String fileName = file.getOriginalFilename();
if (!fileName.matches("^.+\\.(?i)(xls)$") && !fileName.matches("^.+\\.(?i)(xlsx)$")) {
throw new HttpException(10800);
}
Workbook workbook = null;
List<T> list = new ArrayList<>();
try {
InputStream stream = file.getInputStream();
if (fileName.endsWith(EXCEL2003)) {
workbook = new HSSFWorkbook(stream);
} else if (fileName.endsWith(EXCEL2007)) {
workbook = new XSSFWorkbook(stream);
}
if (workbook != null) {
Map<String, List<Field>> classMap = new HashMap<>();
List<Field> fields = Stream.of(cls.getDeclaredFields()).collect(Collectors.toList());
fields.forEach(field -> {
ExcelColumn annotation = field.getAnnotation(ExcelColumn.class);
if (annotation != null) {
String value = annotation.value();
if (StringUtils.isBlank(value)) {
return;
}
if (!classMap.containsKey(value)) {
classMap.put(value, new ArrayList<>());
}
field.setAccessible(true);
classMap.get(value).add(field);
}
});
boolean title = true;
Map<Integer, List<Field>> reflectionMap = new HashMap<>();
Sheet sheet = workbook.getSheetAt(0);
for (int i = 0; i <= sheet.getLastRowNum(); i++) {
Row row = sheet.getRow(i);
if (title) {
for (int j = 0; j <= row.getLastCellNum(); j++) {
Cell cell = row.getCell(j);
if (cell != null) {
String cellValue = cell.getStringCellValue();
if (StringUtils.isNotBlank(cellValue)) {
if (classMap.containsKey(cellValue)) {
reflectionMap.put(j, classMap.get(cellValue));
} else {
throw new HttpException(10802);
}
}
}
}
title = false;
} else {
if (row == null) {
continue;
}
boolean isBlank = true;
T t = cls.newInstance();
for (int j = 0; j <= row.getLastCellNum(); j++) {
if (reflectionMap.containsKey(j)) {
List<Field> fieldList = reflectionMap.get(j);
for (Field field : fieldList) {
Cell cell = row.getCell(j);
Class<?> type = field.getType();
Object cellValue = getCellValue(cell, type);
if (cellValue != null) {
isBlank = false;
}
handleField(t, cellValue, field);
}
}
}
if (!isBlank) {
list.add(t);
}
}
}
}
} catch (InstantiationException | IOException | IllegalAccessException e) {
e.printStackTrace();
}
return list;
}
public static <T> void writeExcel(String title, List<ExcelFieldVO> fields, List<Map> list) {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletResponse response = servletRequestAttributes.getResponse();
Workbook wb = new XSSFWorkbook();
Sheet sheet = wb.createSheet();
AtomicInteger ai = new AtomicInteger();
{
sheet.addMergedRegion(new CellRangeAddress(0,0, 0, 6));
Row t = sheet.createRow(ai.getAndIncrement());
AtomicInteger tat = new AtomicInteger();
Cell tcl = t.createCell(tat.getAndIncrement());
CellStyle style = wb.createCellStyle();
style.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);
Font f = wb.createFont();
f.setFontHeightInPoints((short) 13);
f.setBoldweight(Font.BOLDWEIGHT_NORMAL);
style.setFont(f);
tcl.setCellStyle(style);
tcl.setCellValue(title);
Row row = sheet.createRow(ai.getAndIncrement());
AtomicInteger at = new AtomicInteger();
fields.forEach(field -> {
Cell cell = row.createCell(at.getAndIncrement());
CellStyle cellStyle = wb.createCellStyle();
cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
Font font = wb.createFont();
font.setBoldweight(Font.BOLDWEIGHT_NORMAL);
cellStyle.setFont(font);
cell.setCellStyle(cellStyle);
cell.setCellValue(field.getName());
});
if (list != null) {
for (Map map : list) {
Row r = sheet.createRow(ai.getAndIncrement());
AtomicInteger a = new AtomicInteger();
fields.forEach(field -> {
Object value = map.get(field.getField());
Cell cell = r.createCell(a.getAndIncrement());
if (value != null) {
cell.setCellValue(value.toString());
}
});
}
}
sheet.autoSizeColumn(1);
String fileName = String.valueOf(new Date().getTime());
buildExcelDocument(fileName + "." + EXCEL2007, wb, response);
}
}
public static <T> void writeExcel(List<ExcelFieldVO> fields, List<Map> list) {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletResponse response = servletRequestAttributes.getResponse();
Workbook wb = new XSSFWorkbook();
Sheet sheet = wb.createSheet();
AtomicInteger ai = new AtomicInteger();
{
Row row = sheet.createRow(ai.getAndIncrement());
AtomicInteger at = new AtomicInteger();
fields.forEach(field -> {
Cell cell = row.createCell(at.getAndIncrement());
CellStyle cellStyle = wb.createCellStyle();
cellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex());
Font font = wb.createFont();
font.setBoldweight(Font.BOLDWEIGHT_BOLD);
cellStyle.setFont(font);
cell.setCellStyle(cellStyle);
cell.setCellValue(field.getName());
});
if (list != null) {
list.forEach(map -> {
Row r = sheet.createRow(ai.getAndIncrement());
AtomicInteger a = new AtomicInteger();
fields.forEach(field -> {
Object value = map.get(field.getField());
Cell cell = r.createCell(a.getAndIncrement());
if (value != null) {
cell.setCellValue(value.toString());
}
});
});
for (int i = 0; i < list.size(); i++) {
sheet.autoSizeColumn(i);
}
}
String fileName = String.valueOf(new Date().getTime());
buildExcelDocument(fileName + "." + EXCEL2007, wb, response);
}
}
public static List<ExcelFieldVO> getField(Class cls) {
List<Field> fields = Stream.of(cls.getDeclaredFields()).collect(Collectors.toList());
List<ExcelFieldVO> list = new ArrayList<>();
fields.forEach(field -> {
ExcelFieldVO excelFieldVO = new ExcelFieldVO();
ExcelColumn annotation = field.getAnnotation(ExcelColumn.class);
if (annotation != null) {
String value = annotation.value();
if (StringUtils.isBlank(value)) {
return;
}
excelFieldVO.setField(field.getName());
excelFieldVO.setName(value);
field.setAccessible(true);
list.add(excelFieldVO);
}
});
return list;
}
private static void buildExcelDocument(String fileName, Workbook wb, HttpServletResponse response) {
try {
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "utf-8"));
response.flushBuffer();
wb.write(response.getOutputStream());
} catch (IOException e) {
e.printStackTrace();
}
}
private static Object getCellValue(Cell cell, Class<?> type) {
if (cell == null) {
return null;
}
if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
if (DateUtil.isCellDateFormatted(cell)) {
if ("h:mm".equals(cell.getCellStyle().getDataFormatString()) || "hh:mm".equals(cell.getCellStyle().getDataFormatString())) {
return DateFormatUtil.format(cell.getDateCellValue(), DateFormatUtil.FMT_sdf_Hm);
}
return cell.getDateCellValue();
} else {
if (type != null) {
if (type == String.class) {
cell.setCellType(Cell.CELL_TYPE_STRING);
return cell.getStringCellValue();
} else {
return cell.getNumericCellValue();
}
} else {
cell.setCellType(Cell.CELL_TYPE_STRING);
return cell.getStringCellValue();
}
}
} else if (cell.getCellType() == Cell.CELL_TYPE_STRING) {
return cell.getStringCellValue();
} else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) {
return cell.getCellFormula();
} else if (cell.getCellType() == Cell.CELL_TYPE_BLANK) {
return "";
} else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN) {
return String.valueOf(cell.getBooleanCellValue());
} else {
return cell;
}
}
private static <T> void handleField(T t, Object value, Field field) {
try {
Class<?> type = field.getType();
if (type == null || type == void.class || value == null) {
return;
}
if (type == Object.class) {
field.set(t, value);
} else if (type.getSuperclass() == null || type.getSuperclass() == Number.class) {
if (type == BigDecimal.class) {
field.set(t, new BigDecimal(value.toString()));
} else {
field.set(t, value);
}
} else if (type == Boolean.class) {
field.set(t, BooleanUtils.toBoolean(value.toString()));
} else if (type == Date.class || type == LocalTime.class || type == LocalDateTime.class) {
if (type == Date.class) {
field.set(t, value);
} else if (type == LocalTime.class) {
if (value != null && value != "") {
field.set(t, DateFormatUtil.dateToLocalTime(DateFormatUtil.parse(value.toString(), DateFormatUtil.FMT_sdf_yMd)));
}
} else if (type == LocalDateTime.class) {
if (value != null && value != "") {
field.set(t, DateFormatUtil.dateToLocalDateTime(DateFormatUtil.parse(value.toString(), DateFormatUtil.FMT_sdf_yMd)));
}
}
} else if (type == String.class) {
field.set(t, value.toString());
} else {
Constructor<?> constructor = type.getConstructor(String.class);
field.set(t, constructor.newInstance(value));
}
} catch (Exception e) {
e.printStackTrace();
throw new HttpException(10801);
}
}
}
package com.zhongzhi.common.utils;
import javax.servlet.http.HttpServletRequest;
import java.net.InetAddress;
import java.net.UnknownHostException;
public class IpAddressUtil {
public static String getIpAddress(HttpServletRequest request) {
String ipAddress = request.getHeader("x-forwarded-for");
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("Proxy-Client-IP");
}
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getHeader("WL-Proxy-Client-IP");
}
if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
ipAddress = request.getRemoteAddr();
if (ipAddress.equals("127.0.0.1") || ipAddress.equals("0:0:0:0:0:0:0:1")) {
InetAddress inet = null;
try {
inet = InetAddress.getLocalHost();
} catch (UnknownHostException e) {
e.printStackTrace();
}
ipAddress = inet.getHostAddress();
}
}
if (ipAddress != null && ipAddress.length() > 15) {
if (ipAddress.indexOf(",") > 0) {
ipAddress = ipAddress.substring(0, ipAddress.indexOf(","));
}
}
return ipAddress;
}
}
package com.zhongzhi.common.utils;
import com.auth0.jwt.JWT;
import com.auth0.jwt.JWTVerifier;
import com.auth0.jwt.algorithms.Algorithm;
import com.auth0.jwt.interfaces.Claim;
import java.util.Date;
import java.util.Map;
/**
* <p>
* Token工具
* </p>
*
* @author DengMin
* @since 2021/4/14
*/
public class JwtUtil {
private static final Long EXPIRE_TIME = 24 * 60 * 60 * 1000L;
private static final String SECRET = "PBKDF2SHA256:64000:18:24:N:GFHZ6Y0PTEUDYCJI3K6SOOXWYEKPOZED:WBWFJMX5DF252E0HR3BF3P/D";
/**
* 生成Token
*
* @param id
* @return
*/
public static String generateToken(Long id, String type) {
Date expireDate = new Date(System.currentTimeMillis() + EXPIRE_TIME);
return JWT.create()
.withClaim("id", id)
.withClaim("type", type)
.withAudience()
.withExpiresAt(expireDate)
.withIssuedAt(new Date())
.sign(Algorithm.HMAC256(SECRET));
}
/**
* 检验token是否正确
*
* @param token
* @return
*/
public static boolean verifyToken(String token) {
try {
Algorithm algorithm = Algorithm.HMAC256(SECRET);
JWTVerifier verifier = JWT.require(algorithm).build();
verifier.verify(token);
return true;
} catch (Exception e) {
return false;
}
}
/**
* 获取用户自定义Claim集合
*
* @param token
* @return
*/
public static Map<String, Claim> getClaims(String token) {
Algorithm algorithm = Algorithm.HMAC256(SECRET);
JWTVerifier verifier = JWT.require(algorithm).build();
Map<String, Claim> claims = verifier.verify(token).getClaims();
return claims;
}
/**
* 获取过期时间
*
* @param token
* @return
*/
public static Date getExpiresAt(String token) {
Algorithm algorithm = Algorithm.HMAC256(SECRET);
return JWT
.require(algorithm)
.build()
.verify(token)
.getExpiresAt();
}
/**
* 验证token是否失效
*
* @param token
* @return true: 过期, false: 没过期
*/
public static boolean isExpired(String token) {
try {
final Date expiration = getExpiresAt(token);
return expiration.before(new Date());
} catch (Exception e) {
return true;
}
}
}
package com.zhongzhi.common.utils;
import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@RestController
public class Localstorage {
private static final ThreadLocal<Object> local = ThreadLocal.withInitial(() -> null);
private static ConcurrentHashMap<String, Object> map = new ConcurrentHashMap<>();
public static void setUser(Object obj, String type) {
// Map<String, Object> map = new HashMap<>();
map.put("user", obj);
map.put("type", type);
Localstorage.local.set(map);
}
public static Map<String, Object> getMap() {
return (Map<String, Object>) Localstorage.local.get();
}
public static Object getUser() {
// Map<String, Object> map = (Map<String, Object>) Localstorage.local.get();
return map.get("user");
}
public static void remove() {
Localstorage.local.remove();
}
}
package com.zhongzhi.common.utils;
import java.lang.annotation.*;
/**
* <p>
* 自定义验证登陆注解
* </p>
*
* @author DengMin
* @since 2020/12/18
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface LoginRequired {
String[] value();
}
\ No newline at end of file
package com.zhongzhi.common.utils;
import com.itextpdf.text.*;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPCell;
import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import com.zhongzhi.common.constant.PDFCheckBox;
import com.zhongzhi.common.constant.ProjectType;
import com.zhongzhi.common.exception.HttpException;
import com.zhongzhi.dto.member.MentorDTO;
import com.zhongzhi.dto.member.TeamMemberDTO;
import com.zhongzhi.model.MatchDictDO;
import com.zhongzhi.vo.project.SeedTrackProjectVO;
import com.zhongzhi.vo.project.VocationalProjectVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@Slf4j
@Component
public class PDFUtil {
static BaseFont baseFont;
{
try {
baseFont = BaseFont.createFont("https://zhongzhi-cms.oss-cn-shanghai.aliyuncs.com/STSONG.TTF", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);
} catch (Exception e) {
e.printStackTrace();
}
}
public static void create(String projectMatch, MatchDictDO matchDictDO, String projectGroup, SeedTrackProjectVO seedTrackProjectVO) {
try {
ByteArrayOutputStream bao = new ByteArrayOutputStream();
Document document = new Document(PageSize.A4, 20, 20, 20, 20);
PdfWriter.getInstance(document, bao);
document.open();
Paragraph t1 = new Paragraph(projectMatch + "年"+matchDictDO.getMatchName(), new Font(baseFont, 16, Font.BOLD));
t1.setAlignment(Element.ALIGN_CENTER);
document.add(t1);
Paragraph t2 = new Paragraph("“" + projectGroup + "”组参赛作品申报表", new Font(baseFont, 16, Font.BOLD));
t2.setAlignment(Element.ALIGN_CENTER);
document.add(t2);
document.add(new Paragraph(" "));
PdfPTable table = new PdfPTable(13);
PDFUtil.tableStyle(new PdfPTable(13), new int[13]);
PdfPCell cell;
Paragraph name = new Paragraph("参赛作品名称", new Font(PDFUtil.baseFont, 10));
name.setAlignment(Element.ALIGN_CENTER);
cell = new PdfPCell(name);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(8);
cell.setPaddingBottom(8);
table.addCell(cell);
Paragraph nameValue = new Paragraph(seedTrackProjectVO.getProjectName() == null ? "" : seedTrackProjectVO.getProjectName(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(nameValue);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(11);
cell.setPadding(5);
table.addCell(cell);
Paragraph type = new Paragraph("类别(请打√可多选)", new Font(PDFUtil.baseFont, 10));
type.setAlignment(Element.ALIGN_CENTER);
cell = new PdfPCell(type);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph typeValue = new Paragraph(PDFCheckBox.getType(seedTrackProjectVO.getClassification(), projectGroup), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(typeValue);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(11);
cell.setPadding(5);
table.addCell(cell);
Paragraph leader = new Paragraph("团队负责人", new Font(PDFUtil.baseFont, 10));
leader.setAlignment(Element.ALIGN_CENTER);
cell = new PdfPCell(leader);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setRowspan(3);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph leaderName = new Paragraph("姓名", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(leaderName);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph leaderNameValue = new Paragraph(seedTrackProjectVO.getName() == null ? "" : seedTrackProjectVO.getName(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(leaderNameValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph school = new Paragraph("就读学校", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(school);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph schoolValue = new Paragraph(seedTrackProjectVO.getSchool() == null ? "" : seedTrackProjectVO.getSchool(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(schoolValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(7);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph grade = new Paragraph("年级", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(grade);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph gradeValue = new Paragraph(seedTrackProjectVO.getGrade() == null ? "" : seedTrackProjectVO.getGrade(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(gradeValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph major = new Paragraph("就读专业", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(major);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph majorValue = new Paragraph(seedTrackProjectVO.getMajor() == null ? "" : seedTrackProjectVO.getMajor(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(majorValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(7);
table.addCell(cell);
Paragraph sex = new Paragraph("性别", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(sex);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph sexValue = new Paragraph(seedTrackProjectVO.getSex() == null ? "" : seedTrackProjectVO.getSex(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(sexValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph studentNo = new Paragraph("学籍号", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(studentNo);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph studentNoValue = new Paragraph(seedTrackProjectVO.getStudentNo() == null ? "" : seedTrackProjectVO.getStudentNo() + "", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(studentNoValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(4);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph telephone = new Paragraph("手机", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(telephone);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph telephoneValue = new Paragraph(seedTrackProjectVO.getTelephone() == null ? "" : seedTrackProjectVO.getTelephone(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(telephoneValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
for (int i = 0; i <= 3; i++) {
TeamMemberDTO teamMemberDTO = new TeamMemberDTO();
if (seedTrackProjectVO.getTeamMember() != null &&
i <= seedTrackProjectVO.getTeamMember().size() - 1) {
teamMemberDTO = seedTrackProjectVO.getTeamMember().get(i);
}
Paragraph partner = new Paragraph("合作者" + (i + 1), new Font(PDFUtil.baseFont, 10));
partner.setAlignment(Element.ALIGN_CENTER);
cell = new PdfPCell(partner);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setRowspan(3);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerName = new Paragraph("姓名", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerName);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerNameValue = new Paragraph(teamMemberDTO.getTeamName() == null ? "" : teamMemberDTO.getTeamName(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerNameValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerSchool = new Paragraph("就读学校", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerSchool);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerSchoolValue = new Paragraph(teamMemberDTO.getSchool() == null ? "" : teamMemberDTO.getSchool(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerSchoolValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(7);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerGrade = new Paragraph("年级", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerGrade);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerGradeValue = new Paragraph(teamMemberDTO.getGrade() == null ? "" : teamMemberDTO.getGrade(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerGradeValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerMajor = new Paragraph("就读专业", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerMajor);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerMajorValue = new Paragraph(teamMemberDTO.getMajor() == null ? "" : teamMemberDTO.getMajor(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerMajorValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(7);
table.addCell(cell);
Paragraph partnerSex = new Paragraph("性别", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerSex);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerSexValue = new Paragraph(teamMemberDTO.getSex() == null ? "" : teamMemberDTO.getSex(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerSexValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerStudentNo = new Paragraph("学籍号", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerStudentNo);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerStudentNoValue = new Paragraph(teamMemberDTO.getStudentNo() == null ? "" : teamMemberDTO.getStudentNo() + "", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerStudentNoValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(4);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerTelephone = new Paragraph("手机", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerTelephone);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerTelephoneValue = new Paragraph(teamMemberDTO.getTeamTelephone() == null ? "" : teamMemberDTO.getTeamTelephone(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerTelephoneValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
}
for (int i = 0; i <= 1; i++) {
MentorDTO mentorDTO = new MentorDTO();
if (seedTrackProjectVO.getMentor() != null &&
i <= seedTrackProjectVO.getMentor().size() - 1) {
mentorDTO = seedTrackProjectVO.getMentor().get(i);
}
Paragraph partner = new Paragraph("指导老师", new Font(PDFUtil.baseFont, 10));
partner.setAlignment(Element.ALIGN_CENTER);
cell = new PdfPCell(partner);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setRowspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerGrade = new Paragraph("姓名", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerGrade);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerGradeValue = new Paragraph(mentorDTO.getTeacherName() == null ? "" : mentorDTO.getTeacherName(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerGradeValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerMajor = new Paragraph("工作单位", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerMajor);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerMajorValue = new Paragraph(mentorDTO.getCompany() == null ? "" : mentorDTO.getCompany(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerMajorValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(7);
table.addCell(cell);
Paragraph partnerSex = new Paragraph("职称", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerSex);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerSexValue = new Paragraph(mentorDTO.getPositionTitle() == null ? "" : mentorDTO.getPositionTitle(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerSexValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerStudentNo = new Paragraph("职务", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerStudentNo);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerStudentNoValue = new Paragraph(mentorDTO.getPosition() == null ? "" : mentorDTO.getPosition(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerStudentNoValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(4);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerTelephone = new Paragraph("手机", new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerTelephone);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(1);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph partnerTelephoneValue = new Paragraph(mentorDTO.getTelephone() == null ? "" : mentorDTO.getTelephone(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(partnerTelephoneValue);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
}
if (projectGroup.equals(ProjectType.TECHNOLOGY_INNOVATION_GROUP)) {
Paragraph idea = new Paragraph("创意构思(约200字,阐述创意灵感,是如何想到这项创意设计的)", new Font(PDFUtil.baseFont, 10));
idea.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(idea);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_TOP);
cell.setColspan(13);
cell.setBorderWidthBottom(0);
table.addCell(cell);
Paragraph ideaValue = new Paragraph(seedTrackProjectVO.getProjectCreativity() == null ? "" : seedTrackProjectVO.getProjectCreativity(), new Font(PDFUtil.baseFont, 10));
ideaValue.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(ideaValue);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_TOP);
cell.setColspan(13);
cell.setFixedHeight(100);
cell.setBorderWidthBottom(0);
cell.setBorderWidthTop(0);
table.addCell(cell);
Paragraph design = new Paragraph("科学设计(约300字,阐述这项创意的科学原理、设计思路和实施途径,可通过哪些方式和步骤来实现它)", new Font(PDFUtil.baseFont, 10));
design.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(design);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_TOP);
cell.setColspan(13);
cell.setBorderWidthBottom(0);
table.addCell(cell);
Paragraph designValue = new Paragraph(seedTrackProjectVO.getScientificPrinciple() == null ? "" : seedTrackProjectVO.getScientificPrinciple(), new Font(PDFUtil.baseFont, 10));
designValue.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(designValue);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_TOP);
cell.setColspan(13);
cell.setFixedHeight(100);
cell.setBorderWidthTop(0);
table.addCell(cell);
Paragraph n = new Paragraph();
cell = new PdfPCell(n);
cell.setColspan(13);
cell.setBorderWidthTop(0);
cell.setBorderWidthLeft(0);
cell.setBorderWidthRight(0);
cell.setBorderWidthBottom(0);
cell.setFixedHeight(50);
table.addCell(cell);
Paragraph prospects = new Paragraph("应用前景(约200字,阐述如果这项创意设计得以实现,有哪些实用价值,它能为生活带来哪些便利)", new Font(PDFUtil.baseFont, 10));
prospects.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(prospects);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_TOP);
cell.setColspan(13);
cell.setBorderWidthBottom(0);
table.addCell(cell);
Paragraph prospectsValue = new Paragraph(seedTrackProjectVO.getApplicationProspect() == null ? "" : seedTrackProjectVO.getApplicationProspect(), new Font(PDFUtil.baseFont, 10));
prospectsValue.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(prospectsValue);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_TOP);
cell.setColspan(13);
cell.setFixedHeight(100);
cell.setBorderWidthTop(0);
table.addCell(cell);
} else if (projectGroup.equals(ProjectType.CULTURAL_CREATIVE_GROUP)) {
Paragraph idea = new Paragraph("设计背景、思路(200字内)", new Font(PDFUtil.baseFont, 10));
idea.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(idea);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_TOP);
cell.setColspan(13);
cell.setBorderWidthBottom(0);
table.addCell(cell);
Paragraph ideaValue = new Paragraph(seedTrackProjectVO.getProjectCreativity() == null ? "" : seedTrackProjectVO.getProjectCreativity(), new Font(PDFUtil.baseFont, 10));
ideaValue.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(ideaValue);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_TOP);
cell.setColspan(13);
cell.setFixedHeight(100);
cell.setBorderWidthBottom(0);
cell.setBorderWidthTop(0);
table.addCell(cell);
Paragraph design = new Paragraph("介绍及创新点(约300字,阐述产品定位与功能、产品的材料与工艺、产品特色与应用、产品创新点)", new Font(PDFUtil.baseFont, 10));
design.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(design);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_TOP);
cell.setColspan(13);
cell.setBorderWidthBottom(0);
table.addCell(cell);
Paragraph designValue = new Paragraph(seedTrackProjectVO.getProjectIntro() == null ? "" : seedTrackProjectVO.getProjectIntro(), new Font(PDFUtil.baseFont, 10));
designValue.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(designValue);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_TOP);
cell.setColspan(13);
cell.setFixedHeight(100);
cell.setBorderWidthTop(0);
table.addCell(cell);
Paragraph n = new Paragraph();
cell = new PdfPCell(n);
cell.setColspan(13);
cell.setBorderWidthTop(0);
cell.setBorderWidthLeft(0);
cell.setBorderWidthRight(0);
cell.setBorderWidthBottom(0);
cell.setFixedHeight(50);
table.addCell(cell);
}
// Paragraph roadshow = new Paragraph("路演拟采用表现形式(请打√)", new Font(PDFUtil.baseFont, 10));
// roadshow.setAlignment(Element.ALIGN_CENTER);
// cell = new PdfPCell(roadshow);
// cell.setHorizontalAlignment(Element.ALIGN_CENTER);
// cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
// cell.setColspan(2);
// cell.setFixedHeight(100);
// table.addCell(cell);
// Paragraph roadshowValue = new Paragraph(PDFCheckBox.getRoadshow(projectGroup), new Font(PDFUtil.baseFont, 10));
// roadshowValue.setAlignment(Element.ALIGN_CENTER);
// cell = new PdfPCell(roadshowValue);
// cell.setHorizontalAlignment(Element.ALIGN_CENTER);
// cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
// cell.setColspan(11);
// cell.setFixedHeight(100);
// table.addCell(cell);
if (projectGroup.equals(ProjectType.TECHNOLOGY_INNOVATION_GROUP)) {
Paragraph restrict = new Paragraph("创意实施或试验所受条件的限制(请打√)", new Font(PDFUtil.baseFont, 10));
restrict.setAlignment(Element.ALIGN_CENTER);
cell = new PdfPCell(restrict);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setRowspan(4);
cell.setFixedHeight(100);
table.addCell(cell);
String[] rc = {"有创意,但还没时间开展实验探究", "创意实施需要得到外界的设备或设施的支持", "创意实施在技术与设施上目前还有未能突破的难点"};
List<String> restriction = Arrays.stream(rc).collect(Collectors.toList());
List<String> restrictionValue = Arrays.stream(seedTrackProjectVO.getRestriction().split(",")).collect(Collectors.toList());
int i = 0;
for (String s : restriction) {
i++;
if (restrictionValue.contains(s)) {
Paragraph roadshowValue1 = new Paragraph("■" + s, new Font(PDFUtil.baseFont, 10));
roadshowValue1.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(roadshowValue1);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(11);
cell.setBorderWidthLeft(0);
cell.setBorderWidthTop(0);
cell.setBorderWidthBottom(0);
cell.setPaddingLeft(20);
if (i == 1) {
cell.setPaddingTop(20);
}
table.addCell(cell);
} else {
Paragraph roadshowValue1 = new Paragraph("□" + s, new Font(PDFUtil.baseFont, 10));
roadshowValue1.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(roadshowValue1);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(11);
cell.setBorderWidthLeft(0);
cell.setBorderWidthTop(0);
cell.setBorderWidthBottom(0);
cell.setPaddingLeft(20);
if (i == 1) {
cell.setPaddingTop(20);
}
table.addCell(cell);
}
}
Paragraph roadshowValue4 = new Paragraph("(请在创意设计中具体说明) ", new Font(PDFUtil.baseFont, 10));
roadshowValue4.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(roadshowValue4);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setBorderWidthLeft(0);
cell.setBorderWidthTop(0);
cell.setPaddingLeft(20);
cell.setPaddingBottom(30);
cell.setColspan(11);
table.addCell(cell);
}
Paragraph confirm = new Paragraph("团队负责人确认事宜", new Font(PDFUtil.baseFont, 10));
confirm.setAlignment(Element.ALIGN_CENTER);
cell = new PdfPCell(confirm);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setRowspan(4);
table.addCell(cell);
Paragraph condition1 = new Paragraph("1.承诺参赛作品为原创作品。", new Font(PDFUtil.baseFont, 10));
condition1.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(condition1);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setPaddingTop(20);
cell.setPaddingLeft(20);
cell.setColspan(11);
cell.setBorderWidthTop(0);
cell.setBorderWidthBottom(0);
cell.setBorderWidthLeft(0);
table.addCell(cell);
Paragraph condition2 = new Paragraph("2.申报者有公开发表自己作品的权力,同时也同意无偿提供项目内容,由大赛组委会进行展示并收入汇编。", new Font(PDFUtil.baseFont, 10));
condition2.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(condition2);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setPaddingLeft(20);
cell.setColspan(11);
cell.setBorderWidthTop(0);
cell.setBorderWidthBottom(0);
cell.setBorderWidthLeft(0);
table.addCell(cell);
Paragraph signature = new Paragraph("团队负责人签名:", new Font(PDFUtil.baseFont, 10));
signature.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(signature);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setPaddingTop(30);
cell.setPaddingBottom(10);
cell.setPaddingLeft(8);
cell.setColspan(11);
cell.setBorderWidthTop(0);
cell.setBorderWidthBottom(0);
cell.setBorderWidthLeft(0);
table.addCell(cell);
Paragraph date = new Paragraph("年 月 日", new Font(PDFUtil.baseFont, 10));
date.setAlignment(Element.ALIGN_RIGHT);
cell = new PdfPCell(date);
cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(11);
cell.setPaddingRight(30);
cell.setPaddingBottom(20);
cell.setBorderWidthTop(0);
cell.setBorderWidthBottom(0);
cell.setBorderWidthLeft(0);
table.addCell(cell);
Paragraph opinion = new Paragraph("推荐学校意见", new Font(PDFUtil.baseFont, 10));
opinion.setAlignment(Element.ALIGN_CENTER);
cell = new PdfPCell(opinion);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setRowspan(3);
table.addCell(cell);
Paragraph opinionValue = new Paragraph("", new Font(PDFUtil.baseFont, 10));
opinionValue.setAlignment(Element.ALIGN_LEFT);
cell = new PdfPCell(opinionValue);
cell.setHorizontalAlignment(Element.ALIGN_LEFT);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(11);
cell.setPadding(5);
cell.setBorderWidthLeft(0);
cell.setBorderWidthBottom(0);
cell.setFixedHeight(70);
table.addCell(cell);
Paragraph stamp = new Paragraph("(盖章)", new Font(PDFUtil.baseFont, 10));
stamp.setAlignment(Element.ALIGN_CENTER);
cell = new PdfPCell(stamp);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setBorderWidthTop(0);
cell.setBorderWidthLeft(0);
cell.setBorderWidthBottom(0);
cell.setColspan(11);
table.addCell(cell);
Paragraph opinionDate = new Paragraph("年 月 日", new Font(PDFUtil.baseFont, 10));
opinionDate.setAlignment(Element.ALIGN_RIGHT);
cell = new PdfPCell(opinionDate);
cell.setHorizontalAlignment(Element.ALIGN_RIGHT);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setPaddingRight(20);
cell.setBorderWidthTop(0);
cell.setBorderWidthLeft(0);
cell.setColspan(11);
table.addCell(cell);
document.add(table);
document.close();
bao.close();
renderPdf(bao.toByteArray(), String.valueOf(System.currentTimeMillis()), "pdf");
} catch (Exception e) {
// log.error("---PDF创建异常: " + e);
e.printStackTrace();
throw new HttpException(10010);
}
}
public static void createProjectPDF(List<VocationalProjectVO> result, String schoolName,String deadline,String matchName) {
try {
ByteArrayOutputStream bao = new ByteArrayOutputStream();
Document document = new Document(PageSize.A4, 20, 20, 20, 20);
PdfWriter.getInstance(document, bao);
document.open();
Paragraph t1 = new Paragraph("附件2:", new Font(baseFont, 14, Font.BOLD));
t1.setAlignment(Element.ALIGN_LEFT);
document.add(t1);
document.add(new Paragraph(" "));
Paragraph t3 = new Paragraph(matchName, new Font(baseFont, 14, Font.BOLD));
t3.setAlignment(Element.ALIGN_CENTER);
document.add(t3);
Paragraph teamName = new Paragraph("市级复赛项目申报汇总表" , new Font(baseFont, 14, Font.BOLD));
teamName.setAlignment(Element.ALIGN_CENTER);
document.add(teamName);
document.add(new Paragraph(" "));
Paragraph collegeName = new Paragraph("学校名称: "+ schoolName +" (盖学校公章)" , new Font(baseFont, 12, Font.BOLD));
teamName.setAlignment(Element.ALIGN_LEFT);
document.add(collegeName);
document.add(new Paragraph(" "));
//开始画表
PdfPTable table = new PdfPTable(26);
table.setTotalWidth(560);
table.setLockedWidth(true);
// PDFUtil.tableStyle(new PdfPTable(22), new int[22]);
PdfPCell cell;
Paragraph teacherTitle = new Paragraph("序号", new Font(PDFUtil.baseFont, 10,Font.BOLD));
cell = new PdfPCell(teacherTitle);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph name = new Paragraph("项目名称", new Font(PDFUtil.baseFont, 10,Font.BOLD));
cell = new PdfPCell(name);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(4);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph projectType = new Paragraph("赛道组别", new Font(PDFUtil.baseFont, 10,Font.BOLD));
cell = new PdfPCell(projectType);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(3);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph leader = new Paragraph("负责人姓名", new Font(PDFUtil.baseFont, 10,Font.BOLD));
cell = new PdfPCell(leader);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(3);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph phone = new Paragraph("负责人手机", new Font(PDFUtil.baseFont, 10,Font.BOLD));
cell = new PdfPCell(phone);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(3);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph leaderName = new Paragraph("成员姓名", new Font(PDFUtil.baseFont, 10,Font.BOLD));
cell = new PdfPCell(leaderName);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(8);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
Paragraph teacher = new Paragraph("指导教师", new Font(PDFUtil.baseFont, 10,Font.BOLD));
cell = new PdfPCell(teacher);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(3);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
for (int i = 0; i < result.size(); i++) {
//序号
Paragraph partner = new Paragraph(""+ (i + 1), new Font(PDFUtil.baseFont, 10));
partner.setAlignment(Element.ALIGN_CENTER);
cell = new PdfPCell(partner);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(2);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
//项目名称
Paragraph userName = new Paragraph(result.get(i).getProjectName()== null ? "" : result.get(i).getProjectName(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(userName);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(4);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
//组别
Paragraph memberInfo = new Paragraph(result.get(i).getProjectProgress() == null ? "" : result.get(i).getProjectProgress(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(memberInfo);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(3);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
//负责人姓名
Paragraph leaderNameTmp = new Paragraph(result.get(i).getName() == null ? "" : result.get(i).getName(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(leaderNameTmp);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(3);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
//负责人手机
Paragraph leaderPhoneTmp = new Paragraph(result.get(i).getTelephone() == null ? "" : result.get(i).getTelephone(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(leaderPhoneTmp);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(3);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
//member
Paragraph memberName = new Paragraph(result.get(i).getTeamMember() == null ? "" : result.get(i).getTeamMember(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(memberName);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(8);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
//指导教师
Paragraph zhidaojiaoshi = new Paragraph(result.get(i).getMentor() == null ? "" : result.get(i).getMentor(), new Font(PDFUtil.baseFont, 10));
cell = new PdfPCell(zhidaojiaoshi);
cell.setHorizontalAlignment(Element.ALIGN_CENTER);
cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setColspan(3);
cell.setPaddingTop(5);
cell.setPaddingBottom(5);
table.addCell(cell);
}
document.add(table);
Paragraph blank = new Paragraph("", new Font(baseFont, 32, Font.BOLD));
blank.setAlignment(Element.ALIGN_LEFT);
document.add(blank);
document.add(new Paragraph(" "));
Paragraph thirdPart = new Paragraph("备注: 纸质盖章版请于"+deadline+"前快递到组委会办公室" +
"(冠生园路401号2号楼208室 周欢老师收,联系电话 021-64822115),逾期视为放弃比赛。", new Font(baseFont, 12, Font.NORMAL));
document.add(thirdPart);
document.add(new Paragraph(" "));
document.close();
bao.close();
renderPdf(bao.toByteArray(), String.valueOf(System.currentTimeMillis()), "pdf");
} catch (Exception e) {
log.error("---PDF创建异常: " + e);
e.printStackTrace();
throw new HttpException(10010);
}
}
public static void tableStyle(PdfPTable table, int[] cellsWidth) throws DocumentException {
table.setWidths(cellsWidth);
table.setWidthPercentage(100);
table.getDefaultCell().setHorizontalAlignment(Element.ALIGN_CENTER);
table.getDefaultCell().setVerticalAlignment(Element.ALIGN_MIDDLE);
table.getDefaultCell().setFixedHeight(30);
table.getDefaultCell().setBackgroundColor(BaseColor.BLUE);
table.getDefaultCell().setPadding(0);
table.getDefaultCell().setBorderWidth(0);
}
/**
* 流化下载
*
* @param bytes
* @param filename
*/
public static void renderPdf(final byte[] bytes, final String filename, String type) {
ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletResponse response = servletRequestAttributes.getResponse();
initResponseHeader(response, "application/" + type);
setFileDownloadHeader(response, filename, "." + type);
if (null != bytes) {
try {
response.getOutputStream().write(bytes);
response.getOutputStream().flush();
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
}
}
/**
* 分析并设置contentType与headers.
*/
private static HttpServletResponse initResponseHeader(HttpServletResponse response, final String contentType, final String... headers) {
// 分析headers参数
String encoding = "utf-8";
boolean noCache = true;
for (String header : headers) {
String headerName = StringUtils.substringBefore(header, ":");
String headerValue = StringUtils.substringAfter(header, ":");
if (StringUtils.equalsIgnoreCase(headerName, "utf-8")) {
encoding = headerValue;
} else if (StringUtils.equalsIgnoreCase(headerName, "no-cache")) {
noCache = Boolean.parseBoolean(headerValue);
} else {
throw new IllegalArgumentException(headerName + "不是一个合法的header类型");
}
}
// 设置headers参数
String fullContentType = contentType + ";charset=" + encoding;
response.setContentType(fullContentType);
if (noCache) {
// Http 1.0 header
response.setDateHeader("Expires", 0);
response.addHeader("Pragma", "no-cache");
// Http 1.1 header
response.setHeader("Cache-Control", "no-cache");
}
return response;
}
/**
* 设置让浏览器弹出下载对话框的Header.
*
* @param
*/
public static void setFileDownloadHeader(HttpServletResponse response, String fileName, String fileType) {
try {
// 中文文件名支持
String encodedfileName = new String(fileName.getBytes(StandardCharsets.UTF_8), "ISO8859-1");
response.setHeader("Content-Disposition", "attachment; filename=\"" + encodedfileName + fileType + "\"");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
}
package com.zhongzhi.common.utils;
import java.util.Date;
import java.util.Random;
public class RandomUtil {
public static int getCode() {
return (int) ((Math.random() * 9 + 1) * 100000);
}
public static String randomPass(Integer count) {
StringBuffer stringBuffer = new StringBuffer();
Random random = new Random(new Date().getTime());
String flag = type[random.nextInt(type.length)];
int length = count;
for (int i = 0; i < length; i++) {
switch (flag) {
case "word":
stringBuffer.append(word[random.nextInt(word.length)]);
break;
case "num":
stringBuffer.append(num[random.nextInt(num.length)]);
break;
case "symbol":
stringBuffer.append(symbol[random.nextInt(symbol.length)]);
break;
default:
break;
}
flag = type[random.nextInt(type.length)];
}
return stringBuffer.toString();
}
public final static String[] type = {
"word", "num", "symbol"
};
public final static String[] word = {
"a", "b", "c", "d", "e", "f", "g",
"h", "j", "k", "m", "n",
"p", "q", "r", "s", "t",
"u", "v", "w", "x", "y", "z",
"A", "B", "C", "D", "E", "F", "G",
"H", "J", "K", "M", "N",
"P", "Q", "R", "S", "T",
"U", "V", "W", "X", "Y", "Z"
};
public final static String[] num = {
"1", "2", "3", "4", "5", "6", "7", "8", "9"
};
public final static String[] symbol = {
"!", "@", "#", "$", "%", "&"
};
}
package com.zhongzhi.common.utils;
import com.zhongzhi.common.configure.RemoteProperties;
import com.zhongzhi.vo.ResponseVO;
import lombok.Data;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
/**
* 返回数据
*
* @author DengMin
* @date 2019/08/27 13:57
**/
@Data
@EnableConfigurationProperties(RemoteProperties.class)
public class ResponseData {
public static <T> ResponseVO<T> generateCreatedResponse(int code) {
return (ResponseVO<T>) ResponseVO.builder()
.code(code)
.message(RemoteProperties.getMessage(code))
.build();
}
public static <T> ResponseVO<T> generateCreatedResponse(int code, String message) {
return (ResponseVO<T>) ResponseVO.builder()
.code(code)
.message(message)
.build();
}
public static <T> ResponseVO<T> generateCreatedResponse(int code, T data) {
return (ResponseVO<T>) ResponseVO.builder()
.code(code)
.message(RemoteProperties.getMessage(code))
.data(data)
.build();
}
public static <T> ResponseVO<T> generateCreatedResponse(int code, String message, T data) {
return (ResponseVO<T>) ResponseVO.builder()
.code(code)
.message(message)
.data(data)
.build();
}
public static <T> ResponseVO<T> generateCreatedResponse(int code, String message, String path) {
return (ResponseVO<T>) ResponseVO.builder()
.code(code)
.message(message)
.path(path)
.build();
}
}
\ No newline at end of file
package com.zhongzhi.common.utils;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.HmacAlgorithms;
import org.apache.commons.codec.digest.HmacUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse;
import org.apache.http.HttpVersion;
import org.apache.http.client.fluent.Request;
import org.apache.http.entity.ContentType;
import springfox.documentation.service.ApiKey;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;
/***
* 短信发送工具类
*/
@Slf4j
public class SMSSendUtils {
/**
* 短信平台接口配置中申请,替换为企业自己的API_KEY
*/
private static String API_KEY = "01b0312e7d016d2af41a47e5ba2c2748";
/**
* 短信平台接口配置中申请,替换为企业自己的SECRET_KEY
*/
private static String SECRET_KEY = "bd985a3772ca3b362f8b049a3017b6edac604815e34be96631513e29afbcac47";
private static final String DOMAIN = "https://opassapi.infocloud.cc/";
private static final String MESSAGE_SEND="message/send";
private static final String MESSAGE_SEND_BATCH = "message/sendBatch";
public static String SMS_API_KEY = "sms.api.key";
public static String SMS_SECRET_KEY = "sms.secret.key";
public static final int CONNECT_TIMEOUT= 30_000;
public static final int SOCKET_TIMEOUT = 15_000;
private static ReentrantLock lock = new ReentrantLock(true);
private static AtomicBoolean init = new AtomicBoolean(false);
static void init(){
// String apiKey = API_KEY;
// String secretKey = SECRET_KEY;
// System.setProperty(SMSSendUtils.SMS_API_KEY,API_KEY);
// System.setProperty(SMSSendUtils.SMS_SECRET_KEY,SECRET_KEY);
// if(StringUtils.isAnyEmpty(apiKey,secretKey)){
// throw new NullPointerException("短信发送apiKey、secretKey不能为空。\n解决方式:\n1.代码设置。" +
// "System.setProperty(SMSSendUtils.SMS_API_KEY,\"从短信平台接口配置中获取\");" +
// "System.setProperty(SMSSendUtils.SMS_SECRET_KEY,\"从短信平台接口配置中获取\");\n" +
// "2.启动配置。java -Dsms.api.key=xx -Dsms.secret.key=xxx");
// }
// API_KEY = apiKey;
// SECRET_KEY = secretKey;
}
private SMSSendUtils(){}
/**
* 短信发送。无参短信模板内容发送,即所有手机号接收到的短信内容一样
* @param templateCode
* @param phones 手机号。手机号最大个数限制1000
* @return
*/
public static HttpResponse send(String templateCode, String ...phones) throws IOException {
return send(templateCode,null,phones);
}
/**
* 短信发送。不同手机号对应相同的短信模板变量值,即所有手机号接收到的短信内容一样
* @param templateCode
* @param params 模板参数变量值
* @param phones 手机号。手机号最大个数限制1000
* @return
*/
public static HttpResponse send(String templateCode, LinkedList<String> params, String ... phones) throws IOException {
//手机号先去重,然后再转换
return sendBatch(templateCode,params!=null&&!params.isEmpty()?JSON.toJSONString(params):null,Arrays.stream(phones).collect(Collectors.toSet()).stream().collect(Collectors.joining(",")), false);
}
/**
* 短信发送
* @param templateCode 模板ID
* @param paramsJson 模板参数
* @param phonesJson 手机号
* @param batch true:使用MESSAGE_SEND_BATCH接口发送;false:使用MESSAGE_SEND接口发送
* @return HttpResponse
* @throws IOException
*/
private static HttpResponse sendBatch(String templateCode,String paramsJson,String phonesJson,boolean batch) throws IOException {
if(StringUtils.isAnyEmpty(templateCode)){
throw new NullPointerException("模板id或手机号不能为空");
}
Map<String, Object> headers = getHeaders();
Map<String, Object> bodyParams = new HashMap<>(4);
if(batch){
if(StringUtils.isAnyEmpty(paramsJson)){
throw new NullPointerException("短信发送所有手机号接收到的短信内容不一样时,模板参数值不能为空");
}
bodyParams.put("phonesJson", phonesJson);
//模板变量内容
bodyParams.put("templateParamJson", paramsJson);
}else{
bodyParams.put("phones", phonesJson);
//模板变量内容
if(StringUtils.isNotEmpty(paramsJson)) {
bodyParams.put("templateParam", paramsJson);
}
}
bodyParams.put("templateCode", templateCode);
//排序
// bd985a3772ca3b362f8b049a3017b6edac604815e34be96631513e29afbcac47
SortedMap<String, Object> sortedMap = new TreeMap<>(bodyParams);
headers.forEach((k, v) -> sortedMap.put(k, v));
//生成签名
headers.put("x-sign", getSignature(SECRET_KEY, sortedMap, HmacAlgorithms.HMAC_SHA_224));
Request request = Request.Post(DOMAIN+(batch?MESSAGE_SEND_BATCH:MESSAGE_SEND))
.version(HttpVersion.HTTP_1_1)
//设置连接超时
.connectTimeout(CONNECT_TIMEOUT)
//设置文本读取超时
.socketTimeout(SOCKET_TIMEOUT);
headers.forEach((k,v)->request.addHeader(k,String.valueOf(v)));
return request.bodyString(JSON.toJSONString(bodyParams), ContentType.APPLICATION_JSON)
.execute()
.returnResponse();
}
private static Map<String, Object> getHeaders(){
if(init.get()==false){
lock.lock();
try {
if(init.get()==false) {
init.set(true);
init();
}
}catch (Exception e){
throw e;
}finally {
lock.unlock();
}
}
Map<String, Object> headers = new HashMap<>();
headers.put("x-api-key", API_KEY);
headers.put("x-sign-method", HmacAlgorithms.HMAC_SHA_224.getName());
headers.put("x-nonce", getRandomNickname(10));
headers.put("x-timestamp", String.valueOf(System.currentTimeMillis()));
return headers;
}
/**
* 签名生成
* @param secret
* @param sortedMap
* @param hmacAlgorithms
* @return
*/
private static String getSignature(String secret, SortedMap<String, Object> sortedMap, HmacAlgorithms hmacAlgorithms) {
// 将参数拼接为字符串
// e.g. "key1=value1&key2=value2"
StringBuffer plainText = new StringBuffer();
for (Map.Entry<String, Object> entry : sortedMap.entrySet()) {
plainText.append(entry.getKey() + "=" + entry.getValue());
plainText.append("&");
}
if(StringUtils.isNotEmpty(plainText)) {
plainText.deleteCharAt(plainText.length() - 1);
}
log.info("\n加密方式:{} \n排序后的请求参数:{}",hmacAlgorithms.getName(),plainText);
return new HmacUtils(hmacAlgorithms, secret).hmacHex(plainText.toString());
}
/**
* 随机数生成
* @param length
* @return
*/
private static String getRandomNickname(int length) {
String val = "";
Random random = new Random();
for (int i = 0; i < length; i++) {
// 输出字母还是数字
String charOrNum = random.nextInt(2) % 2 == 0 ? "char" : "num";
// 字符串
if ("char".equalsIgnoreCase(charOrNum)) {
// 取得大写字母还是小写字母
int choice = random.nextInt(2) % 2 == 0 ? 65 : 97;
val += (char) (choice + random.nextInt(26));
} else if ("num".equalsIgnoreCase(charOrNum)) { // 数字
val += String.valueOf(random.nextInt(10));
}
}
return val;
}
}
package com.zhongzhi.common.utils;
import sun.misc.BASE64Encoder;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
/**
* @author: tuyp
* @create: 2020-07-29 12:42
*/
public class Signature {
private String secretId;
private String secretKey;
private long currentTime;
private int random;
private int signValidDuration;
private int classId;
private static final String HMAC_ALGORITHM = "HmacSHA1";
private static final String CONTENT_CHARSET = "UTF-8";
public static byte[] byteMerger(byte[] byte1, byte[] byte2) {
byte[] byte3 = new byte[byte1.length + byte2.length];
System.arraycopy(byte1, 0, byte3, 0, byte1.length);
System.arraycopy(byte2, 0, byte3, byte1.length, byte2.length);
return byte3;
}
public String getUploadSignature() throws Exception {
String strSign = "";
String contextStr = "";
long endTime = (currentTime + signValidDuration);
contextStr += "secretId=" + java.net.URLEncoder.encode(secretId, "utf8");
contextStr += "&currentTimeStamp=" + currentTime;
contextStr += "&expireTime=" + endTime;
contextStr += "&random=" + random;
contextStr += "&classId=" + classId;
try {
Mac mac = Mac.getInstance(HMAC_ALGORITHM);
SecretKeySpec secretKey = new SecretKeySpec(this.secretKey.getBytes(CONTENT_CHARSET), mac.getAlgorithm());
mac.init(secretKey);
byte[] hash = mac.doFinal(contextStr.getBytes(CONTENT_CHARSET));
byte[] sigBuf = byteMerger(hash, contextStr.getBytes(StandardCharsets.UTF_8));
strSign = base64Encode(sigBuf);
strSign = strSign.replace(" ", "").replace("\n", "").replace("\r", "");
} catch (Exception e) {
throw e;
}
return strSign;
}
private String base64Encode(byte[] buffer) {
BASE64Encoder encoder = new BASE64Encoder();
return encoder.encode(buffer);
}
public void setSecretId(String secretId) {
this.secretId = secretId;
}
public void setSecretKey(String secretKey) {
this.secretKey = secretKey;
}
public void setCurrentTime(long currentTime) {
this.currentTime = currentTime;
}
public void setRandom(int random) {
this.random = random;
}
public void setSignValidDuration(int signValidDuration) {
this.signValidDuration = signValidDuration;
}
public void setClassId(int classId){this.classId = classId;}
}
package com.zhongzhi.common.utils;
import java.lang.annotation.*;
/**
* <p>
* 自定义日志注解
* </p>
*
* @author DengMin
* @since 2020/12/18
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface SysLog {
String value() default "";
}
package com.zhongzhi.common.utils;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
import com.tencentcloudapi.common.profile.HttpProfile;
import com.tencentcloudapi.vod.v20180717.VodClient;
import com.tencentcloudapi.vod.v20180717.models.*;
import com.zhongzhi.common.configure.VODConfig;
import com.zhongzhi.common.exception.HttpException;
import org.springframework.stereotype.Component;
/**
* <p>
* 腾讯云 - 云点播API
* </p>
*
* @author DengMin
* @since 2022/8/1
*/
@Component
public class VodUtil {
private static String endpoint = "vod.tencentcloudapi.com";
/**
* 根据视频模版进行转码
* @param vodCode
* @return
*/
public static ProcessMediaResponse processMedia(VODConfig vodConfig, String vodCode) {
try {
//上传后直接转码
Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey());
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint(endpoint);
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
VodClient client = new VodClient(cred, "", clientProfile);
ProcessMediaRequest processMediaRequest = new ProcessMediaRequest();
MediaProcessTaskInput mediaProcessTaskInput1 = new MediaProcessTaskInput();
TranscodeTaskInput[] transcodeTaskInputs1 = new TranscodeTaskInput[1];
TranscodeTaskInput transcodeTaskInput1 = new TranscodeTaskInput();
transcodeTaskInput1.setDefinition(100030L);
transcodeTaskInputs1[0] = transcodeTaskInput1;
mediaProcessTaskInput1.setTranscodeTaskSet(transcodeTaskInputs1);
processMediaRequest.setMediaProcessTask(mediaProcessTaskInput1);
processMediaRequest.setFileId(vodCode);
return client.ProcessMedia(processMediaRequest);
} catch (Exception ex) {
throw new HttpException(50001);
}
}
/**
* 删除腾讯云上原视频
* @param vodCode
*/
public static void deleteMedia(VODConfig vodConfig, String vodCode) {
try {
//删除原视频
Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey());
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint(endpoint);
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
VodClient client = new VodClient(cred, "", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
DeleteMediaRequest req = new DeleteMediaRequest();
req.setFileId(vodCode);
// 返回的resp是一个DeleteMediaResponse的实例,与请求对象对应
client.DeleteMedia(req);
} catch (TencentCloudSDKException e) {
throw new HttpException(99999, e.getMessage());
}
}
/**
* 云点播域名的CDN统计数据
* @param vodConfig
* @param DataType
* @param startTime
* @param endTime
* @return
*/
public static StatDataItem[] DescribeCDNStatDetails(VODConfig vodConfig, String DataType, String startTime, String endTime) {
try {
Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey());
// 实例化一个http选项,可选的,没有特殊需求可以跳过
HttpProfile httpProfile = new HttpProfile();
httpProfile.setEndpoint(endpoint);
// 实例化一个client选项,可选的,没有特殊需求可以跳过
ClientProfile clientProfile = new ClientProfile();
clientProfile.setHttpProfile(httpProfile);
// 实例化要请求产品的client对象,clientProfile是可选的
VodClient client = new VodClient(cred, "", clientProfile);
// 实例化一个请求对象,每个接口都会对应一个request对象
DescribeCDNUsageDataRequest req = new DescribeCDNUsageDataRequest();
req.setStartTime(startTime);
req.setEndTime(endTime);
req.setDataType(DataType);
// 返回的resp是一个DescribeCDNUsageDataResponse的实例,与请求对象对应
DescribeCDNUsageDataResponse resp = client.DescribeCDNUsageData(req);
// 返回的resp是一个DescribeCDNStatDetailsResponse的实例,与请求对象对应
return resp.getData();
} catch (TencentCloudSDKException e) {
e.printStackTrace();
throw new HttpException(99999, e.getMessage());
}
}
}
package com.zhongzhi.controller;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.administer.AdministerPageDTO;
import com.zhongzhi.dto.administer.LoginDTO;
import com.zhongzhi.model.AdministerDO;
import com.zhongzhi.service.AdministerService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 中心管理账户表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@RestController
@Api(tags = "中心管理账户")
@RequestMapping("/administer")
public class AdministerController {
@Autowired
private AdministerService administerService;
@PostMapping(value = "/login")
@ApiOperation("中心端 --- 登录:手机号/telephone, code/验证码")
public ResponseVO login(@RequestBody LoginDTO loginDTO) {
return ResponseData.generateCreatedResponse(0, administerService.login(loginDTO));
}
@PostMapping(value = "/getAdministerPage")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 成员管理分页查询:listItem/角色、 username/搜索名称、pageNo/当前页数、pageSize/每页显示条数")
public ResponseVO getAdministerPage(@RequestBody AdministerPageDTO administerPageDTO) {
return ResponseData.generateCreatedResponse(0, administerService.getAdministerPage(administerPageDTO));
}
@PostMapping(value = "/createAdminister")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 新增成员:username/名称、telephone/手机号、avatar/头像、role/角色")
public ResponseVO createAdminister(@RequestBody AdministerDO administerDO) {
administerService.save(administerDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/updateAdminister")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 编辑成员:id/成员ID、username/名称、telephone/手机号、avatar/头像、role/角色")
public ResponseVO updateAdminister(@RequestBody AdministerDO administerDO) {
administerService.updateById(administerDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/deleteById")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 删除成员:id/成员ID")
public ResponseVO delete(@RequestBody AdministerDO administerDO) {
administerService.removeById(administerDO.getId());
return ResponseData.generateCreatedResponse(0);
}
}
package com.zhongzhi.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 系统用户权限表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@RestController
@Api(tags = "用户权限")
@RequestMapping("/administerPermission")
public class AdministerPermissionController {
}
package com.zhongzhi.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.college.*;
import com.zhongzhi.dto.project.EditStatusDTO;
import com.zhongzhi.model.*;
import com.zhongzhi.service.CollegesDictService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.net.ResponseCache;
/**
* <p>
* 院校字典表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@RestController
@Api(tags = "就读院校")
@RequestMapping("/collegesDict")
public class CollegesDictController {
@Autowired
public CollegesDictService collegesDictService;
@PostMapping(value = "/getCollegesList")
@ApiOperation("查询所有就读院校: name/院校名称, education/学历")
public ResponseVO getCollegesList(@RequestBody CollegesDictDTO collegesDictDTO) {
QueryWrapper<CollegesDictDO> queryWrapper = new QueryWrapper();
if (StringUtils.isNotBlank(collegesDictDTO.getEducation())) {
if ("中职".equals(collegesDictDTO.getEducation())){
queryWrapper.lambda().eq(CollegesDictDO::getEducation, collegesDictDTO.getEducation());
}else {
queryWrapper.lambda().like(CollegesDictDO::getEducation, collegesDictDTO.getEducation());
}
}
if (StringUtils.isNotBlank(collegesDictDTO.getName())) {
queryWrapper.lambda().like(CollegesDictDO::getName, collegesDictDTO.getName());
}
queryWrapper.lambda().eq(CollegesDictDO::getLoginStatus,1);
return ResponseData.generateCreatedResponse(0, collegesDictService.list(queryWrapper));
}
@PostMapping(value = "/login")
@ApiOperation("院校端 --- 登录: account/账户, password/密码")
public ResponseVO login(@RequestBody LoginDTO loginDTO) {
return ResponseData.generateCreatedResponse(0, collegesDictService.login(loginDTO));
}
@PostMapping(value = "updateCollegeById")
@LoginRequired({Platform.center})
@ApiOperation("院校端 --- 更新院校信息: id/ID, account/账户,code/代码, name/名称, password/密码")
public ResponseVO updateCollegeById(@RequestBody CollegesDictDO collegesDictDO) {
collegesDictService.updateById(collegesDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "addContact")
@LoginRequired({Platform.school})
@ApiOperation("院校端 --- 新增联系人:leaderName/领导姓名、leaderPost/领导职务、leaderPhone/领导手机号、contactName/联系人姓名、contactPost/联系人职务、contactPhone/联系人手机号")
public ResponseVO addContact(@RequestBody CollegesDictDO collegesDictDO) {
collegesDictService.addContact(collegesDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/updatePwd")
@LoginRequired(Platform.school)
@ApiOperation("院校端 --- 修改密码: password/密码")
public ResponseVO updatePwd(@RequestBody UpdatePwdDTO updatePwdDTO) {
collegesDictService.updatePwd(updatePwdDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/projects")
@LoginRequired(Platform.school)
@ApiOperation("##院校端 --- 查看某个院校进决赛的项目(除去已经登记过的) matchId ")
public ResponseVO projects(@RequestBody ProjectDO projectDO) {
return ResponseData.generateCreatedResponse(0,collegesDictService.projects(projectDO));
}
@PostMapping("projectLeader")
@LoginRequired(Platform.school)
@ApiOperation("##院校端---自动带出负责人 projectId ")
public ResponseVO projectLeader(@RequestBody ProjectMemberDO projectMemberDO){
return ResponseData.generateCreatedResponse(0,collegesDictService.projectLeader(projectMemberDO));
}
@PostMapping("projectMembers")
@LoginRequired(Platform.school)
@ApiOperation("##院校端---进决赛的项目下的成员 projectId ")
public ResponseVO projectMembers(@RequestBody ProjectMemberDO projectMemberDO){
return ResponseData.generateCreatedResponse(0,collegesDictService.projectMembers(projectMemberDO));
}
@PostMapping("addProjectMember")
@LoginRequired({Platform.school})
@ApiOperation("##院校端---添加参赛人员 matchId studentIds[] 人员id projectId matchId")
public ResponseVO addProjectMember(@RequestBody AddProjectMemberDTO addProjectMemberDTO)throws Exception{
collegesDictService.addProjectMember(addProjectMemberDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("removeProject")
@LoginRequired({Platform.school,Platform.center})
@ApiOperation("##院校端---移除参赛人员 projectId matchId")
public ResponseVO removeProject(@RequestBody AddProjectMemberDTO addProjectMemberDTO)throws Exception{
collegesDictService.removeProject(addProjectMemberDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("addObservations")
@LoginRequired(Platform.school)
@ApiOperation("##院校端---添加观摩人员/学校领队 matchId memberType 观摩人员/学校领队/车 userName 人名/车牌号 telephone idCardType idCard")
public ResponseVO addObservations(@RequestBody FinalMatchMemberDO finalMatchMemberDO)throws Exception {
collegesDictService.addObservations(finalMatchMemberDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("updateObservations")
@LoginRequired({Platform.school,Platform.center})
@ApiOperation("##院校端---修改观摩人员 matchId id userName telephone idCardType idCard")
public ResponseVO updateObservations(@RequestBody FinalMatchMemberDO finalMatchMemberDO)throws Exception{
collegesDictService.updateObservations(finalMatchMemberDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("deleteObservations")
@LoginRequired({Platform.school,Platform.center})
@ApiOperation("##院校端---删除观摩人员 id matchId ")
public ResponseVO deleteObservations(@RequestBody FinalMatchMemberDO finalMatchMemberDO)throws Exception{
collegesDictService.deleteObservations(finalMatchMemberDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("registerMembers")
@LoginRequired({Platform.school,Platform.center})
@ApiOperation("##查看已登记的参赛人员 collegeId matchId ")
public ResponseVO registerMembers(@RequestBody RegisterMembersDTO registerMembersDTO){
return ResponseData.generateCreatedResponse(0,collegesDictService.registerMembers(registerMembersDTO));
}
@PostMapping("otherMembers")
@LoginRequired({Platform.school,Platform.center})
@ApiOperation("##查看已登记的其他人员 collegeId matchId")
public ResponseVO otherMembers(@RequestBody RegisterMembersDTO registerMembersDTO){
return ResponseData.generateCreatedResponse(0,collegesDictService.otherMembers(registerMembersDTO));
}
@PostMapping("cars")
@LoginRequired({Platform.school,Platform.center})
@ApiOperation("##查看已登记的车辆 collegeId matchId")
public ResponseVO cars(@RequestBody RegisterMembersDTO registerMembersDTO){
return ResponseData.generateCreatedResponse(0,collegesDictService.cars(registerMembersDTO));
}
@PostMapping("details")
@LoginRequired({Platform.school,Platform.center})
@ApiOperation("##截至时间+最近一次更新时间 id matchId ")
public ResponseVO details(@RequestBody RegisterMembersDTO registerMembersDTO){
return ResponseData.generateCreatedResponse(0,collegesDictService.detail(registerMembersDTO));
}
@PostMapping("schools")
@LoginRequired(Platform.center)
@ApiOperation("##这届登记的院校+人员数 matchId name")
public ResponseVO schools(@RequestBody RegisterMembersDTO registerMembersDTO){
return ResponseData.generateCreatedResponse(0,collegesDictService.schools(registerMembersDTO));
}
@PostMapping("exportList")
@LoginRequired(Platform.center)
@ApiOperation("##导出总名单 id 届数id collegeId")
public ResponseVO exportList(@RequestBody FinalMatchMemberDO finalMatchMemberDO){
collegesDictService.exportList(finalMatchMemberDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getCollegesPage")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 院校名录分页查询: name/搜索名称, pageNo/当前页数, pageSize/每页显示条数")
public ResponseVO getCollegesPage(@RequestBody CollegesPageDTO collegesPageDTO) {
return ResponseData.generateCreatedResponse(0, collegesDictService.getCollegesPage(collegesPageDTO));
}
@PostMapping(value = "/createColleges")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 新建院校: name/搜索名称, code/院校代码、 phone/手机号")
public ResponseVO createColleges(@RequestBody CollegesDictDO collegesDictDO) {
collegesDictService.createColleges(collegesDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/delete")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 删除院校: id/院校ID")
public ResponseVO delete(@RequestBody CollegesDictDO collegesDictDO) {
collegesDictService.removeById(collegesDictDO.getId());
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/importColleges")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 导入院校:file/文件(数据格式:Form-Data)")
public ResponseVO importColleges(MultipartFile file) {
return ResponseData.generateCreatedResponse(0, collegesDictService.importColleges(file));
}
@PostMapping(value = "/downloadErrorData")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 下载导入失败院校数据:errorData/失败数据")
public ResponseVO downloadErrorData(@RequestBody DownloadErrorDataDTO downloadErrorDataDTO) {
collegesDictService.downloadErrorData(downloadErrorDataDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getAwardedListPage")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 查询获奖情况:matchId/赛事年份ID、projectGroup/项目组别(科技创新、红色文创、高职、中职)、name/搜索名称、pageNo/当前页数、pageSize/每页显示条数")
public ResponseVO getAwardedList(@RequestBody AwardedListDTO awardedListDTO) {
return ResponseData.generateCreatedResponse(0, collegesDictService.getAwardedList(awardedListDTO));
}
@PostMapping(value = "/exportAwardedList")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 导出获奖情况:matchId/赛事年份ID")
public void exportAwardedList(@RequestBody AwardedListDTO awardedListDTO) {
collegesDictService.exportAwardedList(awardedListDTO);
}
@PostMapping(value = "/exportCollege")
@LoginRequired(Platform.center)
@ApiOperation("导出院校名录")
public ResponseVO exportCollege() {
collegesDictService.exportCollege();
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "updateAllLoginStatus")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 更新所有登录状态:loginStatus/状态(0:关闭,1:开启)")
public ResponseVO updateAllLoginStatus(@RequestBody LoginStatusDTO loginStatusDTO) {
collegesDictService.updateAllLoginStatus(loginStatusDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "batchUpdateLoginStatus")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 批量更新登录状态:ids/院校ID(数组)、loginStatus/状态(0:关闭,1:开启)")
public ResponseVO batchUpdateLoginStatus(@RequestBody LoginStatusDTO loginStatusDTO) {
collegesDictService.batchUpdateLoginStatus(loginStatusDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "updateLoginStatus")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 更新登录状态:id/院校ID、loginStatus/状态(0:关闭,1:开启)")
public ResponseVO updateLoginStatus(@RequestBody LoginStatusDTO loginStatusDTO) {
collegesDictService.updateLoginStatus(loginStatusDTO);
return ResponseData.generateCreatedResponse(0);
}
}
package com.zhongzhi.controller;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.course.CoursesDTO;
import com.zhongzhi.model.CourseDictDO;
import com.zhongzhi.service.CourseDictService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2022-11-14
*/
@RestController
@RequestMapping("/courseDict")
@Api(tags = "课程字典表")
public class CourseDictController {
@Autowired
private CourseDictService courseDictService;
@PostMapping("addCourse")
@ApiOperation("添加课程 courseName")
public ResponseVO addCourse(@RequestBody CourseDictDO courseDictDO) {
courseDictService.addCourse(courseDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("updateCourse")
@ApiOperation("编辑课程 id courseName")
public ResponseVO updateCourse(@RequestBody CourseDictDO courseDictDO){
courseDictService.updateCourse(courseDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("courses")
@ApiOperation("查询所有课程(+视频数量) pageSize pageNo courseName")
public ResponseVO courses(@RequestBody CoursesDTO coursesDTO){
return ResponseData.generateCreatedResponse(0,courseDictService.courses(coursesDTO));
}
@PostMapping("deleteCourse")
@ApiOperation("删除某个课程 id 课程id")
public ResponseVO deleteCourse(@RequestBody CourseDictDO courseDictDO){
courseDictService.deleteCourse(courseDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("courseVods")
@ApiOperation("课程+视频")
public ResponseVO courseVods(@RequestBody CourseDictDO courseDictDO){
return ResponseData.generateCreatedResponse(0,courseDictService.courseVods(courseDictDO));
}
}
package com.zhongzhi.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2024-07-12
*/
@RestController
@RequestMapping("/final-match-member-do")
public class FinalMatchMemberController {
}
package com.zhongzhi.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 届数表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@RestController
@Api(tags = "赛事届数")
@RequestMapping("/fundDict")
public class FundDictController {
}
package com.zhongzhi.controller;
import com.zhongzhi.service.ItemFieldDictService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 行业领域字典表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@RestController
@Api(tags = "行业领域")
@RequestMapping("/itemFieldDict")
public class ItemFieldDictController {
@Autowired
public ItemFieldDictService itemFieldDictService;
}
package com.zhongzhi.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.model.MajorDictDO;
import com.zhongzhi.service.MajorDictService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 专业字典表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@RestController
@Api(tags = "就读专业")
@RequestMapping("/majorDict")
public class MajorDictController {
@Autowired
private MajorDictService majorDictService;
@PostMapping(value = "/getMajorList")
@ApiOperation("查询全部就读专业: major/专业名称、education/学历、code/院校代码")
public ResponseVO getMajorList(@RequestBody MajorDictDO majorDictDO) {
return ResponseData.generateCreatedResponse(0, majorDictService.list(new QueryWrapper<MajorDictDO>()
.lambda()
.eq(StringUtils.isNotBlank(majorDictDO.getEducation()), MajorDictDO::getEducation, majorDictDO.getEducation())
.eq(StringUtils.isNotBlank(majorDictDO.getCode()), MajorDictDO::getCode, majorDictDO.getCode())
.like(StringUtils.isNotBlank(majorDictDO.getMajor()), MajorDictDO::getMajor, majorDictDO.getMajor())));
}
}
package com.zhongzhi.controller;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.project.ProjectListPageDTO;
import com.zhongzhi.model.MatchCollegePdfDO;
import com.zhongzhi.service.MatchCollegePdfService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2024-06-25
*/
@RestController
@RequestMapping("/matchCollegePdf")
@Api(tags = "pdf")
public class MatchCollegePdfController {
@Autowired
private MatchCollegePdfService matchCollegePdfService;
@PostMapping("uploadPdf")
@ApiOperation("上传盖章pdf attachment matchId fileName")
@LoginRequired(Platform.school)
public ResponseVO uploadPdf(@RequestBody MatchCollegePdfDO matchCollegePdfDO) {
matchCollegePdfService.uploadPdf(matchCollegePdfDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("dropPdf")
@ApiOperation("删除盖章pdf matchId")
@LoginRequired(Platform.school)
public ResponseVO dropPdf(@RequestBody MatchCollegePdfDO matchCollegePdfDO) {
matchCollegePdfService.dropPdf (matchCollegePdfDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("queryPdfStatus")
@ApiOperation("查看pdf matchId")
@LoginRequired(Platform.school)
public ResponseVO queryPdfStatus(@RequestBody MatchCollegePdfDO matchCollegePdfDO) {
return ResponseData.generateCreatedResponse(0, matchCollegePdfService.queryPdfStatus (matchCollegePdfDO));
}
}
package com.zhongzhi.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.constant.ProjectType;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.match.MatchDictDTO;
import com.zhongzhi.dto.match.SelectListPageDTO;
import com.zhongzhi.model.MatchDictDO;
import com.zhongzhi.service.MatchDictService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 赛事年份管理 前端控制器
* </p>
*
* @author DengMin
* @since 2021-05-17
*/
@RestController
@Api(tags = "赛事年份管理")
@RequestMapping("/match")
public class MatchDictController {
@Autowired
private MatchDictService matchDictService;
@PostMapping(value = "/getMainTrackMatch")
@LoginRequired({Platform.school, Platform.center, Platform.student})
@ApiOperation("查询主赛道启用赛事年份")
public ResponseVO getMainTrackMatch() {
return ResponseData.generateCreatedResponse(0, matchDictService.getMainTrackMatch());
}
@PostMapping(value = "/getSeedTrackMatch")
@LoginRequired({Platform.school, Platform.center, Platform.student})
@ApiOperation("查询种子赛道启用赛事年份")
public ResponseVO getSeedTrackMatch() {
return ResponseData.generateCreatedResponse(0, matchDictService.getSeedTrackMatch());
}
@PostMapping(value = "/getMatch")
@ApiOperation("查询启用种子赛事年份")
public ResponseVO getMatch() {
return ResponseData.generateCreatedResponse(0, matchDictService.getMatch());
}
@PostMapping(value = "/getVocationalMatch")
@ApiOperation("查询启用职教赛事年份")
public ResponseVO getVocationalMatch() {
return ResponseData.generateCreatedResponse(0, matchDictService.getVocationalMatch());
}
@PostMapping("updateMatchDate")
@ApiOperation("修改届数 id registrationStart registrationDeadline")
public ResponseVO updateMatch(@RequestBody MatchDictDO matchDictDO){
matchDictService.updateMatchDate(matchDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("getMatchInfo")
@ApiOperation("查看某届数详情 id")
public ResponseVO getMatch(@RequestBody MatchDictDO matchDictDO){
return ResponseData.generateCreatedResponse(0,matchDictService.getMatch(matchDictDO));
}
@PostMapping(value = "/getMainTrackMatchPage")
@LoginRequired({Platform.center, Platform.school})
@ApiOperation("中心端/院校端 ---分页查询主赛道赛事年份:pageNo、pageSize")
public ResponseVO getMainTrackMatchPage(@RequestBody SelectListPageDTO selectListPageDTO) {
Page page = new Page(selectListPageDTO.getPageNo(), selectListPageDTO.getPageSize());
return ResponseData.generateCreatedResponse(0, matchDictService.page(page, new QueryWrapper<MatchDictDO>()
.lambda()
.eq(MatchDictDO::getMatchType, ProjectType.MAIN_TRACK)));
}
@PostMapping(value = "/getSeedTrackMatchPage")
@LoginRequired({Platform.center, Platform.school, Platform.review})
@ApiOperation("中心端/院校端 ---分页查询种子赛道赛事年份:pageNo、pageSize")
public ResponseVO getSeedTrackMatchPage(@RequestBody SelectListPageDTO selectListPageDTO) {
return ResponseData.generateCreatedResponse(0, matchDictService.getSeedTrackMatchPage(selectListPageDTO));
}
@PostMapping(value = "/createMainTrackMatch")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---创建主赛道赛事年份:matchName/名称、matchDate/年份、startTime/报名起始时间、endTime/报名结束时间、" +
"schedule:[{ scheduleTime/时间安排、explain/说明 }]")
public ResponseVO createMainTrackMatch(@RequestBody MatchDictDTO matchDictDTO) {
matchDictDTO.setMatchType(ProjectType.MAIN_TRACK);
matchDictService.createMatch(matchDictDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/createSeedTrackMatch")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---创建种子赛道赛事年份:matchName/名称、matchDate/年份、startTime/报名起始时间、endTime/报名结束时间、" +
"schedule:[{ scheduleTime/时间安排、explains/说明 }]")
public ResponseVO createSeedTrackMatch(@RequestBody MatchDictDTO matchDictDTO) {
matchDictDTO.setMatchType(ProjectType.SEED_TRACK);
matchDictService.createMatch(matchDictDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/createVocationalMatch")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---创建职教赛道赛事年份:matchName/名称、matchDate/年份、startTime/报名起始时间、endTime/报名结束时间、" +
"schedule:[{ scheduleTime/时间安排、explains/说明 }]")
public ResponseVO createVocationalMatch(@RequestBody MatchDictDTO matchDictDTO) {
matchDictDTO.setMatchType(ProjectType.VOCATIONAL);
matchDictService.createMatch(matchDictDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/updateMatch")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---编辑赛事年份:id/ID、matchName/名称、matchDate/年份、startTime/报名起始时间、endTime/报名结束时间、status/状态(1:启动,0:暂停)" +
"schedule:[{ id/时间安排ID、scheduleTime/时间安排、explains/说明 }]")
public ResponseVO updateMatch(@RequestBody MatchDictDTO matchDictDTO) {
matchDictService.updateMatch(matchDictDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/delete")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---删除赛事年份:id/ID")
public ResponseVO delete(@RequestBody MatchDictDO matchDictDO) {
matchDictService.removeById(matchDictDO.getId());
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getMainTrackMatchAll")
@LoginRequired({Platform.center, Platform.school, Platform.student, Platform.review})
@ApiOperation("中心端/学生端/院校端/审批端 ---查询全部主赛道赛事年份")
public ResponseVO getMainTrackMatchAll() {
return ResponseData.generateCreatedResponse(0, matchDictService.list(new QueryWrapper<MatchDictDO>()
.lambda()
.eq(MatchDictDO::getMatchType, ProjectType.MAIN_TRACK)));
}
@PostMapping(value = "/getSeedTrackMatchAll")
@LoginRequired({Platform.center, Platform.school, Platform.student, Platform.review})
@ApiOperation("中心端/学生端/院校端/审批端 ---查询全部种子赛道赛事年份")
public ResponseVO getSeedTrackMatchAll() {
return ResponseData.generateCreatedResponse(0, matchDictService.list(new QueryWrapper<MatchDictDO>()
.lambda()
.eq(MatchDictDO::getMatchType, ProjectType.SEED_TRACK)));
}
@PostMapping(value = "/getVocationalMatchAll")
@LoginRequired({Platform.center, Platform.school, Platform.student, Platform.review})
@ApiOperation("中心端/学生端/院校端/审批端 ---查询全部职教赛道赛事年份")
public ResponseVO getVocationalMatchAll() {
return ResponseData.generateCreatedResponse(0, matchDictService.list(new QueryWrapper<MatchDictDO>()
.lambda()
.eq(MatchDictDO::getMatchType, ProjectType.VOCATIONAL)));
}
/* 职教管理端 */
@PostMapping(value = "/getVocationalPage")
@LoginRequired({Platform.center, Platform.school, Platform.review})
@ApiOperation("中心端/院校端 ---分页查询职教赛道赛事年份:pageNo、pageSize")
public ResponseVO getVocationalPage(@RequestBody SelectListPageDTO selectListPageDTO) {
return ResponseData.generateCreatedResponse(0, matchDictService.getVocationalPage(selectListPageDTO));
}
}
\ No newline at end of file
package com.zhongzhi.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.constant.ProjectType;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.model.MatchDictDO;
import com.zhongzhi.model.MatchScheduleDO;
import com.zhongzhi.service.MatchDictService;
import com.zhongzhi.service.MatchScheduleService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 时间安排 前端控制器
* </p>
*
* @author DengMin
* @since 2021-05-27
*/
@RestController
@RequestMapping("/matchSchedule")
@Api(tags = "时间安排")
public class MatchScheduleController {
@Autowired
private MatchScheduleService matchScheduleService;
@Autowired
private MatchDictService matchDictService;
@PostMapping(value = "/getMatchSchedule")
@LoginRequired({Platform.student})
@ApiOperation("学生端 ---种子赛道查看时间安排:matchId/赛事年份ID")
public ResponseVO getMatchSchedule(@RequestBody MatchScheduleDO matchScheduleDO) {
MatchDictDO matchDictDO = matchDictService.getOne(new QueryWrapper<MatchDictDO>()
.lambda()
.eq(MatchDictDO::getId, matchScheduleDO.getMatchId())
.eq(MatchDictDO::getMatchType, ProjectType.SEED_TRACK)
.eq(MatchDictDO::getStatus, 1));
List<MatchScheduleDO> list = new ArrayList<>();
if (matchDictDO != null) {
list = matchScheduleService.list(new QueryWrapper<MatchScheduleDO>()
.lambda()
.eq(MatchScheduleDO::getMatchId, matchDictDO.getId()));
}
return ResponseData.generateCreatedResponse(0, list);
}
@PostMapping(value = "getVocationalMatchSchedule")
@LoginRequired({Platform.student})
@ApiOperation("学生端 ---职教赛道查看时间安排:matchId/赛事年份ID")
public ResponseVO getVocationalMatchSchedule(@RequestBody MatchScheduleDO matchScheduleDO) {
MatchDictDO matchDictDO = matchDictService.getOne(new QueryWrapper<MatchDictDO>()
.lambda()
.eq(MatchDictDO::getId, matchScheduleDO.getMatchId())
.eq(MatchDictDO::getMatchType, ProjectType.VOCATIONAL)
.eq(MatchDictDO::getStatus, 1));
List<MatchScheduleDO> list = new ArrayList<>();
if (matchDictDO != null) {
list = matchScheduleService.list(new QueryWrapper<MatchScheduleDO>()
.lambda()
.eq(MatchScheduleDO::getMatchId, matchDictDO.getId()));
}
return ResponseData.generateCreatedResponse(0, list);
}
}
package com.zhongzhi.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.DateFormatUtil;
import com.zhongzhi.common.utils.Localstorage;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.message.MessagePageDTO;
import com.zhongzhi.model.AdministerDO;
import com.zhongzhi.model.MessageDO;
import com.zhongzhi.service.MessageService;
import com.zhongzhi.vo.ResponseVO;
import com.zhongzhi.vo.message.MessageVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* <p>
* 通知消息表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-05-17
*/
@RestController
@Api(tags = "通知消息")
@RequestMapping("/message")
public class MessageController {
@Autowired
private MessageService messageService;
@PostMapping(value = "/getMessage")
@ApiOperation("查询通知")
public ResponseVO getMessage() {
List<MessageVO> messages = new ArrayList();
List<MessageDO> list = messageService.list(new QueryWrapper<MessageDO>()
.lambda()
.orderByDesc(MessageDO::getCreateTime));
for (MessageDO messageDO : list) {
MessageVO messageVO = new MessageVO();
BeanUtils.copyProperties(messageDO, messageVO);
messageVO.setReleaseTime(DateFormatUtil.format(messageDO.getReleaseTime(), DateFormatUtil.FMT_sdf_yMd));
messages.add(messageVO);
}
return ResponseData.generateCreatedResponse(0, messages);
}
@PostMapping(value = "/getMessageById")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 根据ID查询详情:id/ID")
public ResponseVO getMessageById(@RequestBody MessageDO messageDO) {
return ResponseData.generateCreatedResponse(0, messageService.getById(messageDO.getId()));
}
@PostMapping(value = "/getMessagePage")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---分页查询通知: pageNo/当前页数, pageSize/每页显示条数")
public ResponseVO getMessagePage(@RequestBody MessagePageDTO messagePageDTO) {
return ResponseData.generateCreatedResponse(0, messageService.getMessagePage(messagePageDTO));
}
@PostMapping(value = "/createMessage")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---创建通知: title/标题, content/内容, attachmentUrl/附件地址, releaseTime/发布时间, attachmentName/附件名称, attachmentType/附件类型")
public ResponseVO createMessage(@RequestBody MessageDO messageDO) {
messageService.createMessage(messageDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/updateMessage")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---编辑通知: id/ID, title/标题, content/内容, attachmentUrl/附件地址, attachmentName/附件名称, attachmentType/附件类型")
public ResponseVO updateMessage(@RequestBody MessageDO messageDO) {
messageService.updateById(messageDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/delete")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---删除通知: id/ID, ")
public ResponseVO delete(@RequestBody MessageDO messageDO) {
messageService.removeById(messageDO.getId());
return ResponseData.generateCreatedResponse(0);
}
}
package com.zhongzhi.controller;
import com.aliyun.oss.ClientException;
import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.OSSException;
import com.aliyun.oss.model.*;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.vo.ResponseVO;
import com.zhongzhi.vo.oss.GetSecretVO;
import com.zhongzhi.vo.oss.UploadFileVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
@Api(tags = "oss")
@RestController
@RequestMapping("/oss")
public class OssController {
public static final String keyId = "LTAI5tPAH7P7WQVeowo517BE";
public static final String secret = "0ueqhIfdAZyw5lWlBVSLpAxTtx37RY";
// @Value("${spring.profiles.active}")
// private String env;
@PostMapping("getSecret")
@ApiOperation("oss秘钥")
public ResponseVO getSecret() {
GetSecretVO getSecretVO = new GetSecretVO();
getSecretVO.setKey(keyId);
getSecretVO.setSecret(secret);
return ResponseData.generateCreatedResponse(0, getSecretVO);
}
// @PostMapping("uploadFile")
// @ApiOperation("上传文件 file")
// public ResponseVO uploadFile(@RequestParam("file") MultipartFile file) {
// // 创建OSSClient实例。
// OSS ossClient = new OSSClientBuilder().build("http://oss-cn-shanghai.aliyuncs.com", keyId, secret);
// UploadFileVO uploadFileVO = new UploadFileVO();
// try {
////
//// if (env.equals("test")) {
//// env = "ykhl-bigger-test";
//// }
//// if (env.equals("prod")) {
//// env = "ykhl-bigger";
//// }
//
//
// // 创建PutObjectRequest对象。
// PutObjectRequest putObjectRequest = new PutObjectRequest("zhongzhi-cms", System.currentTimeMillis() + "_" + file.getOriginalFilename(), file.getInputStream());
// // 设置该属性可以返回response。如果不设置,则返回的response为空。
// putObjectRequest.setProcess("true");
// // 创建PutObject请求。
// PutObjectResult result = ossClient.putObject(putObjectRequest);
// // 如果上传成功,则返回200。
//// System.out.println(result.getResponse().getUri());
// uploadFileVO.setUrl(result.getResponse().getUri());
// } catch (Exception oe) {
// oe.printStackTrace();
// } finally {
// if (ossClient != null) {
// ossClient.shutdown();
// }
// }
// return ResponseData.generateCreatedResponse(0, uploadFileVO);
// }
@PostMapping("uploadFile")
@ApiOperation("分片上传")
public ResponseVO fenpian(@RequestParam("file") MultipartFile file) {
UploadFileVO uploadFileVO = new UploadFileVO();
// Endpoint以华东1(杭州)为例,其它Region请按实际情况填写。
String endpoint = "http://oss-cn-beijing.aliyuncs.com";
// 阿里云账号AccessKey拥有所有API的访问权限,风险很高。强烈建议您创建并使用RAM用户进行API访问或日常运维,请登录RAM控制台创建RAM用户。
String accessKeyId = keyId;
String accessKeySecret = secret;
// 填写Bucket名称,例如examplebucket。
String bucketName = "mass-entrepreneurship";
// 填写Object完整路径,例如exampledir/exampleobject.txt。Object完整路径中不能包含Bucket名称。
String objectName = System.currentTimeMillis() + "_" + file.getOriginalFilename();
// 创建OSSClient实例。
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
try {
// 创建InitiateMultipartUploadRequest对象。
InitiateMultipartUploadRequest request = new InitiateMultipartUploadRequest(bucketName, objectName);
// 如果需要在初始化分片时设置请求头,请参考以下示例代码。
ObjectMetadata metadata = new ObjectMetadata();
//
metadata.setContentType(file.getContentType());
if ("pdf".equals(file.getContentType())){
metadata.setContentType("application/x-pcx");
}
metadata.setContentDisposition("inline");
// metadata.setHeader("x-oss-force-download", false);
request.setObjectMetadata(metadata);
// 返回uploadId,它是分片上传事件的唯一标识。您可以根据该uploadId发起相关的操作,例如取消分片上传、查询分片上传等。
// 初始化分片。
InitiateMultipartUploadResult upresult = ossClient.initiateMultipartUpload(request);
String uploadId = upresult.getUploadId();
// partETags是PartETag的集合。PartETag由分片的ETag和分片号组成。
List<PartETag> partETags = new ArrayList<PartETag>();
// 每个分片的大小,用于计算文件有多少个分片。单位为字节。
final long partSize = 1 * 1024 * 1024L; //1 MB。
// 根据上传的数据大小计算分片数。以本地文件为例,说明如何通过File.length()获取上传数据的大小。
// final File sampleFile = new File("D:\\localpath\\examplefile.txt");
// long fileLength = sampleFile.length();
// int partCount = (int) (fileLength / partSize);
// if (fileLength % partSize != 0) {
// partCount++;
// }
long fileLength = file.getSize();
int partCount = (int) (fileLength / partSize);
if (fileLength % partSize != 0) {
partCount++;
}
// 遍历分片上传。
for (int i = 0; i < partCount; i++) {
long startPos = i * partSize;
long curPartSize = (i + 1 == partCount) ? (fileLength - startPos) : partSize;
UploadPartRequest uploadPartRequest = new UploadPartRequest();
uploadPartRequest.setBucketName(bucketName);
uploadPartRequest.setKey(objectName);
uploadPartRequest.setUploadId(uploadId);
// 设置上传的分片流。
// 以本地文件为例说明如何创建FIleInputstream,并通过InputStream.skip()方法跳过指定数据。
InputStream instream = file.getInputStream();
instream.skip(startPos);
uploadPartRequest.setInputStream(instream);
// 设置分片大小。除了最后一个分片没有大小限制,其他的分片最小为100 KB。
uploadPartRequest.setPartSize(curPartSize);
// 设置分片号。每一个上传的分片都有一个分片号,取值范围是1~10000,如果超出此范围,OSS将返回InvalidArgument错误码。
uploadPartRequest.setPartNumber(i + 1);
// 每个分片不需要按顺序上传,甚至可以在不同客户端上传,OSS会按照分片号排序组成完整的文件。
UploadPartResult uploadPartResult = ossClient.uploadPart(uploadPartRequest);
// 每次上传分片之后,OSS的返回结果包含PartETag。PartETag将被保存在partETags中。
partETags.add(uploadPartResult.getPartETag());
}
// 创建CompleteMultipartUploadRequest对象。
// 在执行完成分片上传操作时,需要提供所有有效的partETags。OSS收到提交的partETags后,会逐一验证每个分片的有效性。当所有的数据分片验证通过后,OSS将把这些分片组合成一个完整的文件。
CompleteMultipartUploadRequest completeMultipartUploadRequest =
new CompleteMultipartUploadRequest(bucketName, objectName, uploadId, partETags);
// 如果需要在完成分片上传的同时设置文件访问权限,请参考以下示例代码。
// completeMultipartUploadRequest.setObjectACL(CannedAccessControlList.Private);
// 指定是否列举当前UploadId已上传的所有Part。仅在Java SDK为3.14.0及以上版本时,支持通过服务端List分片数据来合并完整文件时,将CompleteMultipartUploadRequest中的partETags设置为null。
// Map<String, String> headers = new HashMap<String, String>();
// 如果指定了x-oss-complete-all:yes,则OSS会列举当前UploadId已上传的所有Part,然后按照PartNumber的序号排序并执行CompleteMultipartUpload操作。
// 如果指定了x-oss-complete-all:yes,则不允许继续指定body,否则报错。
// headers.put("x-oss-complete-all","yes");
// completeMultipartUploadRequest.setHeaders(headers);
// 完成分片上传。
CompleteMultipartUploadResult completeMultipartUploadResult = ossClient.completeMultipartUpload(completeMultipartUploadRequest);
uploadFileVO.setUrl(completeMultipartUploadResult.getLocation().replace("http","https"));
System.out.println(completeMultipartUploadResult.getLocation());
} catch (OSSException oe) {
System.out.println("Caught an OSSException, which means your request made it to OSS, "
+ "but was rejected with an error response for some reason.");
System.out.println("Error Message:" + oe.getErrorMessage());
System.out.println("Error Code:" + oe.getErrorCode());
System.out.println("Request ID:" + oe.getRequestId());
System.out.println("Host ID:" + oe.getHostId());
} catch (ClientException ce) {
System.out.println("Caught an ClientException, which means the client encountered "
+ "a serious internal problem while trying to communicate with OSS, "
+ "such as not being able to access the network.");
System.out.println("Error Message:" + ce.getMessage());
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ossClient != null) {
ossClient.shutdown();
}
}
return ResponseData.generateCreatedResponse(0, uploadFileVO);
}
}
package com.zhongzhi.controller;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 权限表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@RestController
@Api(tags = "权限")
@RequestMapping("/permissions")
public class PermissionsController {
}
package com.zhongzhi.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 项目奖项 前端控制器
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@RestController
@RequestMapping("/project-award-do")
public class ProjectAwardController {
}
package com.zhongzhi.controller;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.constant.ProjectType;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.member.CreateProjectMemberDTO;
import com.zhongzhi.dto.project.*;
import com.zhongzhi.dto.review.ProjectReviewPageDTO;
import com.zhongzhi.dto.review.ProjectReviewScoreDTO;
import com.zhongzhi.model.ProjectDO;
import com.zhongzhi.service.ProjectService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 项目表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@RestController
@Api(tags = "项目")
@RequestMapping("/project")
public class ProjectController {
@Autowired
private ProjectService projectService;
@PostMapping(value = "/getProjectDetail")
@LoginRequired({Platform.student})
@ApiOperation("学生端(高职赛道、种子赛道通用) ---项目详情: id/项目ID")
public ResponseVO getProjectDetail(@RequestBody ProjectDO projectDO) {
return ResponseData.generateCreatedResponse(0, projectService.getProjectById(projectDO.getId()));
}
@PostMapping(value = "/getMainTrackProject")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---主赛道项目分页查询: matchId/赛事年份ID, pageNo/当前页数, pageSize/每页显示条数")
public ResponseVO getMainTrackProject(@RequestBody ProjectListPageDTO projectListPageDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getMainTrackProject(projectListPageDTO));
}
@PostMapping(value = "/getMainTrackProjectById")
@LoginRequired(Platform.student)
@ApiOperation("学生端---根据ID查询主赛道项目信息")
public ResponseVO getMainTrackProjectById() {
return ResponseData.generateCreatedResponse(0, projectService.getMainTrackProjectById());
}
@PostMapping(value = "/createMainTrackProject")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---保存主赛道项目信息: 项目logo/logoUri、项目名称/projectName、所在地/address、itemField/所属领域、项目概述/projectIntro、projectTransform/国家级重大、重点科研项目的科研成果转化项目" +
"学校科技成果转化/resultTransfer、参赛申报人为科技成果的完成人或所有人/competitionOwner、参赛申报人为科技成果的第一完成人或所有人/competitionFirst" +
"师生共创/bothInvention、项目进展/projectProgress(创意设计阶段,已注册公司)、公司名称/companyName、法人身份/legalPersonStatus、法人姓名/legalPersonName、职务/position、注册资金/registerFund" +
"注册时间/registerDate、注册省份/registerProvince、注册地址/registerAddress、统一社会信用代码/unifyCode" +
"股权结构/pos:[{ shareholderStatus/股东身份、shareholderName/股东名称、shareholdingRatio/持股比例 }]" +
"隐私设置/privacySetting(保密,公开)、materialsType/项目计划书类型、materialsSize/项目计划书大小、materialsName/项目计划书名称、materialsUrl/项目计划书地址" +
"vodUrl 视频地址")
public ResponseVO createMainTrackProject(@RequestBody CreateMainTrackProjectDTO createMainTrackProjectDTO) {
projectService.createMainTrackProject(createMainTrackProjectDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getProjectMemberById")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---根据项目ID查询主赛道团队成员")
public ResponseVO getProjectMemberById() {
return ResponseData.generateCreatedResponse(0, projectService.getProjectMemberById());
}
@PostMapping(value = "/createProjectMember")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---保存主赛道团队信息:name/姓名、school/就读学校、grade/年级、major/就读专业、sex/性别、studentNo/学籍号" +
"teamMember/团队成员:[{ teamName/姓名、school/就读学校、grade/年级、major/就读专业、sex/性别、studentNo/学籍号 }]" +
"mentor/指导老师:[{ teacherName/姓名、 company/工作单位、positionTitle/职称、position/职务、telephone/手机号}]")
public ResponseVO createProjectMember(@RequestBody CreateProjectMemberDTO createProjectMemberDTO) {
createProjectMemberDTO.setProjectGroup(ProjectType.MAIN_TRACK);
createProjectMemberDTO.setProjectType(ProjectType.MAIN_TRACK);
projectService.createProjectMember(createProjectMemberDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/withdrawn")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---撤回申请:id/项目ID")
public ResponseVO withdrawn(@RequestBody ProjectDO projectDO) {
projectService.withdrawn(projectDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/rollback")
// @LoginRequired(Platform.school)
@ApiOperation("院校端 ---上报撤回:id/项目ID")
public ResponseVO rollback(@RequestBody ProjectDO projectDO) {
projectService.rollback(projectDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getSeedTrackProject")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---种子赛道项目分页查询: matchId/年份ID, pageNo/当前页数, pageSize/每页显示条数")
public ResponseVO getSeedTrackProject(@RequestBody ProjectListPageDTO projectListPageDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getSeedTrackProject(projectListPageDTO));
}
@PostMapping(value = "/createSeedTrackProject")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---保存种子赛道项目信息: projectProgress:红色文创/科技创新 projectName/项目名称、projectGroup/组别、projectIntro/介绍及创新点、projectCreativity/设计背景、" +
"scientificPrinciple/科学设计、applicationProspect/应用前景、roadShowForm/路演形式、restriction/创意实施或实验所受条件的限制" +
"、materials/项目材料:[{ materialsType/项目计划书类型、materialsSize/项目计划书大小、materialsName/项目计划书名称、materialsUrl/项目计划书地址 }]")
public ResponseVO createSeedTrackProject(@RequestBody CreateSeedTrackProjectDTO createSeedTrackProjectDTO) {
projectService.createSeedTrackProject(createSeedTrackProjectDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getTechnologyProjectById")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---根据ID查询科技创新项目")
public ResponseVO getTechnologyProjectById() {
return ResponseData.generateCreatedResponse(0, projectService.getSeedTrackProjectById());
}
@PostMapping(value = "/getCulturalProjectById")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---根据ID查询红色文创项目")
public ResponseVO getCulturalProjectById() {
return ResponseData.generateCreatedResponse(0, projectService.getCulturalProjectById());
}
@PostMapping(value = "/uploadTechnologyProjectAttachment")
@LoginRequired(Platform.student)
@ApiOperation("学生端 --- 上传科技创新项目加盖公章的附件: printAttachment/附件地址, printAttachmentType/附件类型, printAttachmentName/附件名称")
public ResponseVO uploadTechnologyProjectAttachment(@RequestBody PrintAttachmentDTO printAttachmentDTO) {
printAttachmentDTO.setProjectGroup(ProjectType.TECHNOLOGY_INNOVATION_GROUP);
projectService.uploadPrintAttachment(printAttachmentDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/createTechnologyProjectMember")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---保存科技创新项目团队信息:name/姓名、school/就读学校、grade/年级、major/就读专业、sex/性别、idCard身份证 studentNo/学籍号 fiveYears" +
"teamMember/团队成员:[{ teamName/姓名、school/就读学校、grade/年级、major/就读专业、sex/性别、studentNo/学籍号 }]" +
"mentor/指导老师:[{ teacherName/姓名、 company/工作单位、positionTitle/职称、position/职务、telephone/手机号}]")
public ResponseVO createTechnologyProjectMember(@RequestBody CreateProjectMemberDTO createProjectMemberDTO) {
createProjectMemberDTO.setProjectGroup(ProjectType.TECHNOLOGY_INNOVATION_GROUP);
createProjectMemberDTO.setProjectType(ProjectType.SEED_TRACK);
projectService.createProjectMember(createProjectMemberDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getTechnologyProjectMember")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---查询科技创新项目团队信息")
public ResponseVO getTechnologyProjectMember() {
return ResponseData.generateCreatedResponse(0, projectService.getProjectMember(ProjectType.TECHNOLOGY_INNOVATION_GROUP));
}
@PostMapping(value = "/uploadCulturalProjectAttachment")
@LoginRequired(Platform.student)
@ApiOperation("学生端 --- 上传红色文创项目加盖公章的附件: printAttachment/附件地址, printAttachmentType/附件类型, printAttachmentName/附件名称")
public ResponseVO uploadCulturalProjectAttachment(@RequestBody PrintAttachmentDTO printAttachmentDTO) {
printAttachmentDTO.setProjectGroup(ProjectType.CULTURAL_CREATIVE_GROUP);
projectService.uploadPrintAttachment(printAttachmentDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/createCulturalProjectMember")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---保存红色文创项目团队信息:name/姓名、school/就读学校、grade/年级、major/就读专业、sex/性别、idCard 身份证 studentNo/学籍号 fiveYears" +
"teamMember/团队成员:[{ teamName/姓名、school/就读学校、grade/年级、major/就读专业、sex/性别、studentNo/学籍号 }]" +
"mentor/指导老师:[{ teacherName/姓名、 company/工作单位、positionTitle/职称、position/职务、telephone/手机号}]")
public ResponseVO createCulturalProjectMember(@RequestBody CreateProjectMemberDTO createProjectMemberDTO) {
createProjectMemberDTO.setProjectGroup(ProjectType.CULTURAL_CREATIVE_GROUP);
createProjectMemberDTO.setProjectType(ProjectType.SEED_TRACK);
projectService.createProjectMember(createProjectMemberDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getCulturalProjectMember")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---查询红色文创项目团队信息")
public ResponseVO getCulturalProjectMember() {
return ResponseData.generateCreatedResponse(0, projectService.getProjectMember(ProjectType.CULTURAL_CREATIVE_GROUP));
}
@PostMapping(value = "/getMainTrackProjectPage")
@LoginRequired(Platform.school)
@ApiOperation("院校端 --- 分页查询主赛道全部项目:matchId/赛事ID, projectSchedule/项目进度(全部项目传空字符串、校内赛、复赛、决赛), " +
"projectStatus/项目状态, itemField/领域, name/搜名称, pageNo/当前页数 、pageSize/每页显示条数")
public ResponseVO getMainTrackProjectPage(@RequestBody ProjectListPageDTO projectListPageDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getMainTrackProjectPage(projectListPageDTO));
}
@PostMapping(value = "/getMainTrackProjectDetail")
@LoginRequired({Platform.center, Platform.school, Platform.review})
@ApiOperation("学生端/中心端 ---查询主赛道项目详情:id/项目ID")
public ResponseVO getMainTrackProjectDetail(@RequestBody ProjectDO projectDO) {
return ResponseData.generateCreatedResponse(0, projectService.getMainTrackProjectDetail(projectDO.getId()));
}
@PostMapping(value = "/delete")
@LoginRequired({Platform.center, Platform.school})
@ApiOperation("中心端/院校端 --- 删除项目:id/项目ID")
public ResponseVO delete(@RequestBody ProjectDO projectDO) {
projectService.removeById(projectDO.getId());
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getSeedTrackProjectList")
@LoginRequired(Platform.school)
@ApiOperation("院校端 --- 分页查询种子赛道全部项目:matchId/赛事ID,projectGroup/项目组别(科技创新、红色文创)、projectSchedule/项目进度(全部项目传空字符串、校内赛、复赛、决赛), " +
"projectStatus/项目状态, itemField/领域, name/搜名称, pageNo/当前页数 、pageSize/每页显示条数")
public ResponseVO getSeedTrackProjectList(@RequestBody ProjectListPageDTO projectListPageDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getSeedTrackProjectList(projectListPageDTO));
}
@PostMapping(value = "/getSeedTrackProjectPage")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 分页查询种子赛道全部项目:matchId/赛事ID,projectGroup/项目组别(科技创新、红色文创)、projectSchedule/项目进度(全部项目传空字符串、校内赛、复赛、决赛), " +
"projectStatus/项目状态, itemField/领域, name/搜名称, pageNo/当前页数 、pageSize/每页显示条数 projectProgress")
public ResponseVO getSeedTrackProjectPage(@RequestBody ProjectListPageDTO projectListPageDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getSeedTrackProjectPage(projectListPageDTO));
}
@PostMapping(value = "/downloadTechnologyPDF")
@LoginRequired({Platform.student})
@ApiOperation("学生端 --- 种子赛道科技创新申请表下载")
public void downloadTechnologyPDF() {
projectService.downloadPDF(ProjectType.TECHNOLOGY_INNOVATION_GROUP);
}
@PostMapping(value = "/downloadCulturalPDF")
@LoginRequired({Platform.student})
@ApiOperation("学生端 --- 种子赛道红色文创申请表下载")
public void downloadCulturalPDF() {
projectService.downloadPDF(ProjectType.CULTURAL_CREATIVE_GROUP);
}
@PostMapping(value = "/getSeedTrackProjectDetail")
@LoginRequired({Platform.center, Platform.school, Platform.review})
@ApiOperation("中心端/院校端 --- 种子赛道项目详情:id/项目ID")
public ResponseVO getSeedTrackProjectDetail(@RequestBody ProjectDO projectDO) {
return ResponseData.generateCreatedResponse(0, projectService.getSeedTrackProjectDetail(projectDO.getId()));
}
@PostMapping(value = "/weedOut")
@LoginRequired({Platform.center, Platform.school})
@ApiOperation("院校端 --- 不予提交:id/项目ID")
public ResponseVO weedOut(@RequestBody ApproveDTO approveDTO) {
projectService.weedOut(approveDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/batchWeedOut")
@LoginRequired({Platform.center, Platform.school})
@ApiOperation("院校端 --- 批量不予提交:ids/项目ID")
public ResponseVO batchWeedOut(@RequestBody ApproveDTO approveDTO) {
projectService.batchWeedOut(approveDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/pass")
@LoginRequired({Platform.center, Platform.school})
@ApiOperation("中心端/院校端 --- (校内赛/初赛/复赛/决赛)通过:id/项目ID、" +
"projectStatus/1:市级复赛通过, 2:市级优胜奖,3/6:市级银奖,4:市级铜奖,5:市级金奖")
public ResponseVO pass(@RequestBody ApproveDTO approveDTO) {
projectService.pass(approveDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/batchPass")
@LoginRequired({Platform.center, Platform.school})
@ApiOperation("中心端/院校端 --- 批量(校内赛/初赛/复赛/决赛)通过:ids/项目ID、" +
"projectStatus/1:市级复赛通过, 2:市级优胜奖,3/6:市级银奖,4:市级铜奖,5:市级金奖")
public ResponseVO batchPass(@RequestBody ApproveDTO approveDTO) {
projectService.batchPass(approveDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getReviewList")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 评审列表:projectGroup/组别(科技创新、红色文创、主赛道)、projectName/搜索项目或院校、 projectStatus/项目状态(市级复赛、市级决赛)、projectReview/评审分配状态(已分配/未分配)、" +
"pageNo/当前页数、pageSize/每页显示条数")
public ResponseVO getReviewList(@RequestBody ReviewListDTO reviewListDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getReviewList(reviewListDTO));
}
@PostMapping(value = "/getProjectReviewNum")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 评审列表项目数量统计:matchId/赛事年份ID、projectProgress/组别(科技创新、文化创意), projectStatus/项目进度(市级复赛、市级决赛)")
public ResponseVO getProjectReviewNum(@RequestBody ReviewListDTO reviewListDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getProjectReviewNum(reviewListDTO));
}
@PostMapping(value = "/getProjectReviewAssignNum")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 评审分配项目数量统计:matchId/赛事年份ID、projectGroup/组别(科技创新、红色文创), projectStatus/项目进度(市级复赛、市级决赛)")
public ResponseVO getProjectReviewAssignNum(@RequestBody ReviewListDTO reviewListDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getProjectReviewAssignNum(reviewListDTO));
}
@PostMapping(value = "/getReviewProjectNum")
@LoginRequired({Platform.review})
@ApiOperation("评审端 --- 评审项目数量统计:matchId/赛事年份ID、projectGroup/组别(科技创新、红色文创), projectStatus/项目状态(市级复赛、市级决赛)")
public ResponseVO getReviewProjectNum(@RequestBody ReviewListDTO reviewListDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getReviewProjectNum(reviewListDTO));
}
@PostMapping(value = "/getExportProjectListField")
@LoginRequired({Platform.center, Platform.school})
@ApiOperation("中心端 --- 种子赛道项目字段")
public ResponseVO getExportProjectListField() {
return ResponseData.generateCreatedResponse(0, projectService.getExportProjectField());
}
@PostMapping(value = "/exportProjectCollegeList")
@LoginRequired({Platform.school})
@ApiOperation("院校端 --- 批量导出院校项目:matchId/赛事ID")
public void exportProjectCollegeList(@RequestBody ProjectCollegeListDTO projectCollegeListDTO) {
projectService.exportProjectCollegeList(projectCollegeListDTO);
}
@PostMapping(value = "/exportProjectList")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 批量导出种子赛道项目:matchId/赛事ID")
public void exportProjectList(@RequestBody ProjectCollegeListDTO projectCollegeListDTO) {
projectService.exportProjectList(projectCollegeListDTO);
}
@PostMapping(value = "/exportProjectAll")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 导出全部种子赛道项目:matchId/赛事ID, projectSchedule/项目进度,projectGroup/项目组别")
public void exportProjectAll(@RequestBody ProjectCollegeListDTO projectCollegeListDTO) {
projectService.exportProjectAll(projectCollegeListDTO);
}
@PostMapping(value = "/exportProjectAllProgress")
// @LoginRequired({Platform.center})
@ApiOperation("中心端 --- 导出全部种子赛道项目:matchId/赛事ID, projectSchedule/项目进度,projectGroup/项目组别 projectProgress 组别")
public void exportProjectAllProgress(@RequestBody ProjectCollegeListDTO projectCollegeListDTO) {
projectService.exportProjectAllProgress(projectCollegeListDTO);
}
@PostMapping(value = "/getExportProjectField")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 评审项目字段")
public ResponseVO getExportProjectField() {
return ResponseData.generateCreatedResponse(0, projectService.getExportProjectReviewField());
}
@PostMapping(value = "/exportProject")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 评审项目导出:matchId/赛事ID")
public ResponseVO exportProject(@RequestBody ReviewListDTO reviewListDTO) {
projectService.exportProjectReview(reviewListDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/exportProjectNew")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 评审项目导出:matchId/赛事ID")
public ResponseVO exportProjectNew(@RequestBody ReviewListDTO reviewListDTO) {
projectService.exportProjectNew(reviewListDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/exportProjectById")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 评审项目根据ID导出:id/ID")
public ResponseVO exportProjectById(@RequestBody ReviewListDTO reviewListDTO) {
projectService.exportProjectById(reviewListDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getProjectReviewPage")
@LoginRequired({Platform.review})
@ApiOperation("评审端 ---评审项目分页查询:matchId/赛事年份ID、projectSchedule/项目进度(复赛、决赛)、status/状态(待评审, 已评审)、projectGroup/项目组别、projectName/搜索名称、pageNo/当前页数、pageSize/每页显示条数")
public ResponseVO getProjectReviewPage(@RequestBody ProjectReviewPageDTO projectReviewPageDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getProjectReviewPage(projectReviewPageDTO));
}
@PostMapping(value = "/setScore")
@LoginRequired({Platform.review})
@ApiOperation("评审端 ---批量预评分:reviewScore[{ id/项目ID、score/分数 }] +" +
" --- 单个预评分:id/项目ID、score/分数")
public ResponseVO setScore(@RequestBody ProjectReviewScoreDTO projectReviewScoreDTO) {
projectService.setScore(projectReviewScoreDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/submitted")
@LoginRequired({Platform.review})
@ApiOperation("评审端 ---批量提交:ids:[项目ID]" +
" --- 提交评分:id/项目ID ")
public ResponseVO submitted(@RequestBody ProjectReviewScoreDTO projectReviewScoreDTO) {
projectService.submitted(projectReviewScoreDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "getCollegeDataOverview")
@LoginRequired({Platform.school})
@ApiOperation("院校端 --- 种子赛道数据概览")
public ResponseVO getCollegeDataOverview(@RequestBody DataOverviewDTO dataOverviewDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getCollegeDataOverview(dataOverviewDTO));
}
// @PostMapping(value = "getCollegeVocationalDataOverview")
// @LoginRequired({Platform.school})
// @ApiOperation("院校端 --- 职教赛道数据概览")
// public ResponseVO getCollegeVocationalDataOverview() {
// return ResponseData.generateCreatedResponse(0, projectService.getCollegeVocationalDataOverview());
// }
@PostMapping(value = "getDataOverview")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 数据概览")
public ResponseVO getDataOverview(@RequestBody DataOverviewDTO dataOverviewDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getVocationalDataOverview(dataOverviewDTO));
}
// @PostMapping(value = "getSeedTrackDataOverview")
// @LoginRequired({Platform.center})
// @ApiOperation("中心端 --- 种子赛道数据概览")
// public ResponseVO getSeedTrackDataOverview() {
// return ResponseData.generateCreatedResponse(0, projectService.getSeedTrackDataOverview());
// }
//
// @PostMapping(value = "getMainTrackDataOverview")
// @LoginRequired({Platform.center})
// @ApiOperation("中心端 --- 主赛道数据概览")
// public ResponseVO getMainTrackDataOverview() {
// return ResponseData.generateCreatedResponse(0, projectService.getMainTrackDataOverview());
// }
@PostMapping(value = "exportCollegeProject")
@LoginRequired({Platform.school})
@ApiOperation("院校端 --- 批量导出项目")
public ResponseVO exportCollegeProject(@RequestBody CollegeProjectDTO collegeProjectDTO) {
projectService.exportCollegeProject(collegeProjectDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "getProjectByStudentId")
@LoginRequired({Platform.student})
@ApiOperation("学生端 --- 项目查重:matchId/赛事ID, projectGroup/组别")
public ResponseVO getProjectByStudentId(@RequestBody StudentProjectDTO studentProjectDTO) {
projectService.getProjectByStudentId(studentProjectDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "getSeedTrackProjectNum")
@LoginRequired({Platform.center, Platform.school})
@ApiOperation("中心端/院校端 --- 项目数量: matchId/赛事ID、projectGroup/项目组别")
public ResponseVO getSeedTrackProjectNum(@RequestBody SeedTrackProjectNumDTO seedTrackProjectNumDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getSeedTrackProjectNum(seedTrackProjectNumDTO));
}
/* -- 职教接口(学生端) -- */
@PostMapping(value = "createVocationalProject")
@LoginRequired({ Platform.student })
@ApiOperation("学生端(职教)--创建职教项目:项目logo/logoUri、项目名称/projectName、所属领域/itemField、项目概述/projectIntro、国家级重大、重点科研项目的科研成果转化项目/projectTransform、" +
"学校科技成果转化/resultTransfer、参赛申报人为科技成果的完成人或所有人/competitionOwner、参赛申报人为科技成果的第一完成人或所有人/competitionFirst、师生共创/bothInvention、组别/projectProgress、项目进展/projectStage" +
"公司名称/companyName、法人姓名/legalPersonName、法人职务/position、注册资金/registerFund、注册时间/registerDate、注册省份/registerProvince、注册地址/registerAddress、统一社会信用代码/unifyCode、财务报表地址/financialStatement、是否获得投资/investment、" +
"ownership(股权结构): [{ shareholderStatus/股东身份、shareholderName/股东名称、shareholdingRatio/持股比例 }]" +
"隐私设置/privacySetting(保密,公开)、materialsType/项目计划书类型、materialsSize/项目计划书大小、materialsName/项目计划书名称、materialsUrl/项目计划书地址、项目PPT地址/projectPptUrl、项目TTP类型/projectPptType、项目PPT名称/projectPptName" +
"patent(获得专利): [{专利国别/country、公开号/publicationNumber、专利标题/patentTitle、专利类型/patentType、专利号/patentNumber、专利申请人/patentApplicants、获得时间/issuedTime、到期时间/expirationTime、发明人/inventor、其他发明人/otherInventors}]"+
"paper(论文发表): [{论文名称/paperTitle、发表期刊/publishedJournals、DOI号/doi、是否有共同/common、第一作者/firstAuthor、其他作者/otherAuthor}]"+
"award(奖项): [{奖项名称/awardTitle、获奖项目名称/awardProjectTitle、level/级别、获奖人/prizewinner、获奖时间/winningTime}]"+
"copyright(软件著作): [{软件名称/dynacomm、著作权人/copyrightOwner、权利获取方式/rightAcquisitionMethod、开发完成日期/developmentDate、开发发表日期/publishedDate、权利范围/interestField、登记号/registerNumber}]"+
"works(作品著作): [{作品名称/worksName、作者/author、创作完成日期/completionDate、首次发表日期/firstPublicationDate、作品类别/worksType、登记号/registerNumber}]" +
"trademark(商标): [{国际分类号/classificationNumber、商标名称/tradeName、注册人/registeredPerson、注册时间/registeredDate、有效日期/effectiveDate、商标编号/trademarkNumber}]" +
"vodUrl")
public ResponseVO createVocationalProject(@RequestBody CreateVocationalProjectDTO createVocationalProjectDTO) {
projectService.createVocationalProject(createVocationalProjectDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "updateVocationalProject")
@LoginRequired({ Platform.student })
@ApiOperation("学生端(职教)--修改职教项目:id/项目ID、项目logo/logoUri、所属领域/itemField、项目概述/projectIntro、国家级重大、重点科研项目的科研成果转化项目/projectTransform、" +
"学校科技成果转化/resultTransfer、参赛申报人为科技成果的完成人或所有人/competitionOwner、参赛申报人为科技成果的第一完成人或所有人/competitionFirst、师生共创/bothInvention、组别/projectProgress、项目进展/projectStage" +
"公司名称/companyName、法人姓名/legalPersonName、法人职务/position、注册资金/registerFund、注册时间/registerDate、注册省份/registerProvince、注册地址/registerAddress、统一社会信用代码/unifyCode、财务报表地址/financialStatement、是否获得投资/investment、" +
"ownership(股权结构): [{ shareholderStatus/股东身份、shareholderName/股东名称、shareholdingRatio/持股比例 }]" +
"隐私设置/privacySetting(保密,公开)、materialsType/项目计划书类型、materialsSize/项目计划书大小、materialsName/项目计划书名称、materialsUrl/项目计划书地址、项目PPT地址/projectPptUrl、项目TTP类型/projectPptType、项目PPT名称/projectPptName" +
"patent(获得专利): [{专利国别/country、公开号/publicationNumber、专利标题/patentTitle、专利类型/patentType、专利号/patentNumber、专利申请人/patentApplicants、获得时间/issuedTime、到期时间/expirationTime、发明人/inventor、其他发明人/otherInventors}]"+
"paper(论文发表): [{论文名称/paperTitle、发表期刊/publishedJournals、DOI号/doi、是否有共同/common、第一作者/firstAuthor、其他作者/otherAuthor}]"+
"award(奖项): [{奖项名称/awardTitle、获奖项目名称/awardProjectTitle、level/级别、获奖人/prizewinner、获奖时间/winningTime}]"+
"copyright(软件著作): [{软件名称/dynacomm、著作权人/copyrightOwner、权利获取方式/rightAcquisitionMethod、开发完成日期/developmentDate、开发发表日期/publishedDate、权利范围/interestField、登记号/registerNumber}]"+
"works(作品著作): [{作品名称/worksName、作者/author、创作完成日期/completionDate、首次发表日期/firstPublicationDate、作品类别/worksType、登记号/registerNumber}]" +
"trademark(商标): [{国际分类号/classificationNumber、商标名称/tradeName、注册人/registeredPerson、注册时间/registeredDate、有效日期/effectiveDate、商标编号/trademarkNumber}]")
public ResponseVO updateVocationalProject(@RequestBody CreateVocationalProjectDTO createVocationalProjectDTO) {
projectService.updateVocationalProject(createVocationalProjectDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "getVocationalProject")
@LoginRequired(Platform.student)
@ApiOperation("学生端 ---职教赛道项目分页查询: matchId/赛事届数ID ,pageNo/当前页数, pageSize/每页显示条数")
public ResponseVO getVocationalProject(@RequestBody ProjectListPageDTO projectListPageDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getVocationalProject(projectListPageDTO));
}
@PostMapping(value = "getVocationalProjectById")
@LoginRequired(Platform.student)
@ApiOperation("学生端(职教)--根据ID查询高职赛道项目信息")
public ResponseVO getVocationalProjectById() {
return ResponseData.generateCreatedResponse(0, projectService.getVocationalProjectById());
}
@PostMapping(value = "createVocationalMember")
@LoginRequired(Platform.student)
@ApiOperation("学生端(职教) ---保存职教赛道团队信息:name/姓名、school/就读学校、grade/年级、major/就读专业、sex/性别、studentNo/学籍号、email/邮箱 fiveYears" +
"teamMember/团队成员:[{ teamName/姓名、school/就读学校、grade/年级、major/就读专业、sex/性别、studentNo/学籍号 teamTelephone 手机号 }]" +
"mentor/指导老师:[{ teacherName/姓名、 company/工作单位、positionTitle/职称、position/职务、telephone/手机号 idCard}]")
public ResponseVO createVocationalMember(@RequestBody CreateProjectMemberDTO createProjectMemberDTO) {
projectService.createVocationalMember(createProjectMemberDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "updateVocationalMember")
@LoginRequired(Platform.student)
@ApiOperation("学生端(职教) ---保存职教赛道团队信息:id/项目ID、name/姓名、school/就读学校、grade/年级、major/就读专业、sex/性别、studentNo/学籍号、email/邮箱" +
"teamMember/团队成员:[{ teamName/姓名、school/就读学校、grade/年级、major/就读专业、sex/性别、studentNo/学籍号 }]" +
"mentor/指导老师:[{ teacherName/姓名、 company/工作单位、positionTitle/职称、position/职务、telephone/手机号}]")
public ResponseVO updateVocationalMember(@RequestBody CreateProjectMemberDTO createProjectMemberDTO) {
projectService.updateVocationalMember(createProjectMemberDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "getVocationalProjectMember")
@LoginRequired(Platform.student)
@ApiOperation("学生端(职教) ---查询职教项目团队信息")
public ResponseVO getVocationalProjectMember() {
return ResponseData.generateCreatedResponse(0, projectService.getProjectMember(ProjectType.VOCATIONAL));
}
/* -- 管理端 -- */
@PostMapping(value = "/getVocationalProjectPage")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 分页查询职教赛道项目管理:matchId/赛事ID,projectGroup/项目组别(高职、中职)、projectSchedule/项目进度(全部项目传空字符串、校内赛、市级初赛、市级复赛、市级决赛), " +
"projectStatus/项目状态, itemField/领域, name/搜名称, pageNo/当前页数 、pageSize/每页显示条数")
public ResponseVO getVocationalProjectPage(@RequestBody ProjectListPageDTO projectListPageDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getVocationalProjectPage(projectListPageDTO));
}
@PostMapping(value = "updateAllEditStatus")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 更新所有编辑状态:matchId/赛事ID、projectGroup/项目组别、projectSchedule/项目进度、editStatus/状态(0:关闭,1:开启)")
public ResponseVO updateAllEditStatus(@RequestBody EditStatusDTO editStatusDTO) {
projectService.updateAllEditStatus(editStatusDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "batchUpdateEditStatus")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 批量更新编辑状态:ids/项目ID(数组)、editStatus/状态(0:关闭,1:开启)")
public ResponseVO batchUpdateEditStatus(@RequestBody EditStatusDTO editStatusDTO) {
projectService.batchUpdateEditStatus(editStatusDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "updateEditStatus")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 更新编辑状态:id/项目ID、editStatus/状态(0:关闭,1:开启)")
public ResponseVO updateEditStatus(@RequestBody EditStatusDTO editStatusDTO) {
projectService.updateEditStatus(editStatusDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getVocationalReviewList")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 职教评审列表:projectGroup/组别、projectName/搜索项目或院校、 projectStatus/项目状态(市级初赛、市级复赛、市级决赛)、projectReview/评审分配状态(已分配/未分配)、" +
"pageNo/当前页数、pageSize/每页显示条数")
public ResponseVO getVocationalReviewList(@RequestBody ReviewListDTO reviewListDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getVocationalReviewList(reviewListDTO));
}
@PostMapping(value = "/getVocationalProjectDetail")
@LoginRequired({Platform.center, Platform.school, Platform.review})
@ApiOperation("中心端/院校端 --- 职教赛道项目详情:id/项目ID")
public ResponseVO getVocationalProjectDetail(@RequestBody ProjectDO projectDO) {
return ResponseData.generateCreatedResponse(0, projectService.getVocationalProjectDetail(projectDO.getId()));
}
/* -- 院校端 -- */
@PostMapping(value = "/getVocationalProjectList")
@LoginRequired(Platform.school)
@ApiOperation("院校端 --- 分页查询职教赛道项目:matchId/赛事ID,projectGroup/项目组别、projectSchedule/项目进度(全部项目传空字符串、校内赛、初赛、复赛、决赛), " +
"projectStatus/项目状态, itemField/领域, name/搜名称, pageNo/当前页数 、pageSize/每页显示条数")
public ResponseVO getVocationalProjectList(@RequestBody ProjectListPageDTO projectListPageDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getVocationalProjectList(projectListPageDTO));
}
@PostMapping(value = "getReviewVocationalNum")
@LoginRequired(Platform.review)
@ApiOperation("评审端 --- (职教)项目数量: matchId/赛事ID、projectGroup/项目组别、 projectSchedule/赛事状态 projectJudgeId")
public ResponseVO getReviewVocationalNum(@RequestBody ReviewVocationalNumDTO reviewVocationalNumDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getReviewVocationalNum(reviewVocationalNumDTO));
}
/* -- 评审端 -- */
@PostMapping(value = "/getVocationalProjectReviewPage")
@LoginRequired({Platform.review})
@ApiOperation("评审端 ---职教评审项目分页查询:matchId/赛事年份ID、projectSchedule/项目进度(初赛、复赛、决赛)、status/状态(待评审, 已评审)、projectGroup/项目组别、projectName/搜索名称、pageNo/当前页数、pageSize/每页显示条数")
public ResponseVO getVocationalProjectReviewPage(@RequestBody ProjectReviewPageDTO projectReviewPageDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getVocationalProjectReviewPage(projectReviewPageDTO));
}
@PostMapping(value = "getVocationalProjectNum")
@LoginRequired({Platform.center, Platform.school, Platform.review})
@ApiOperation("中心端/院校端 --- (职教)项目管理数量: matchId/赛事ID、projectGroup/项目组别")
public ResponseVO getVocationalProjectNum(@RequestBody SeedTrackProjectNumDTO seedTrackProjectNumDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getVocationalProjectNum(seedTrackProjectNumDTO));
}
@PostMapping(value = "/getVocationalReviewNum")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 职教评审列表(已评审 + 待评审)项目数量统计:matchId/赛事年份ID、projectGroup/组别(高职、中职), projectStatus/项目进度(校级申请项目、市级初赛项目、市级复赛项目、市级 决赛项目)")
public ResponseVO getVocationalReviewNum(@RequestBody ReviewListDTO reviewListDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getVocationalReviewNum(reviewListDTO));
}
@PostMapping(value = "/getVocationalAssignNum")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 职教评审分配(已分配 + 未分配)项目数量统计:matchId/赛事年份ID、projectGroup/组别(高职、中职), projectStatus/项目进度(校级申请项目、市级初赛项目、市级复赛项目、市级 决赛项目)")
public ResponseVO getVocationalAssignNum(@RequestBody ReviewListDTO reviewListDTO) {
return ResponseData.generateCreatedResponse(0, projectService.getVocationalAssignNum(reviewListDTO));
}
@PostMapping(value = "importVocationalProject")
@ApiOperation("中心端/院校端 --- 导出高职项目赛事: projectGroup/项目组别")
@LoginRequired({ Platform.center, Platform.school })
public void importVocationalProject(@RequestBody ImportVocationalProjectDTO importVocationalProjectDTO) {
projectService.importVocationalProject(importVocationalProjectDTO);
}
@PostMapping(value = "importProjectByGroup")
@ApiOperation("中心端/院校端 ---excel 数据预览导出市级初赛/市级复赛项目: projectGroup/项目组别")
@LoginRequired({ Platform.center, Platform.school })
public void importProjectByGroup(@RequestBody ImportVocationalProjectDTO importVocationalProjectDTO) {
projectService.importProjectByGroup(importVocationalProjectDTO);
}
@PostMapping("exportProjectByGroup")
@ApiOperation("中心端/院校端 ---pdf 数据预览导出市级初赛/市级复赛项目: projectGroup/项目组别 matchId")
// @LoginRequired({ Platform.center, Platform.school })
public void exportProjectByGroup(@RequestBody ImportVocationalProjectDTO importVocationalProjectDTO) {
projectService.exportProjectByGroup(importVocationalProjectDTO);
}
}
\ No newline at end of file
package com.zhongzhi.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 项目软件著作权 前端控制器
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@RestController
@RequestMapping("/project-copyright-do")
public class ProjectCopyrightController {
}
package com.zhongzhi.controller;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.administer.LoginDTO;
import com.zhongzhi.dto.judge.ProjectJudgePageDTO;
import com.zhongzhi.model.ProjectJudgeDO;
import com.zhongzhi.service.ProjectJudgeService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
/**
* <p>
* 项目评审员 前端控制器
* </p>
*
* @author DengMin
* @since 2021-05-28
*/
@RestController
@Api(tags = "评委")
@RequestMapping("/projectJudge")
public class ProjectJudgeController {
@Autowired
private ProjectJudgeService projectJudgeService;
@PostMapping(value = "/login")
@ApiOperation("评审端 --- 登录:telephone/手机号、code/验证码")
public ResponseVO login(@RequestBody LoginDTO loginDTO) {
return ResponseData.generateCreatedResponse(0, projectJudgeService.login(loginDTO));
}
@PostMapping(value = "/getProjectJudgePage")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---评委列表:username/姓名、status/状态、pageNo/当前页数、 pageSize/每页显示条数")
public ResponseVO getProjectJudgePage(@RequestBody ProjectJudgePageDTO projectJudgePageDTO) {
return ResponseData.generateCreatedResponse(0, projectJudgeService.getProjectJudgePage(projectJudgePageDTO));
}
@PostMapping(value = "/createProjectJudge")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---添加评委:username/姓名、telephone/手机号、 position/职位、unit/单位")
public ResponseVO createProjectJudge(@RequestBody ProjectJudgeDO projectJudgeDO) {
projectJudgeService.createProjectJudge(projectJudgeDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/updateProjectJudge")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---编辑评委:id/ID、username/姓名、telephone/手机号、 position/职位、unit/单位, status/状态(1:启用,0:禁用)")
public ResponseVO updateProjectJudge(@RequestBody ProjectJudgeDO projectJudgeDO) {
projectJudgeService.updateProjectJudge(projectJudgeDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/delete")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---删除评委:id/ID")
public ResponseVO delete(@RequestBody ProjectJudgeDO projectJudgeDO) {
projectJudgeService.removeById(projectJudgeDO.getId());
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/projectJudgesAssigned")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---已分配项目评委列表: matchId/赛事ID、projectGroup/组别、projectSchedule/进度")
public ResponseVO projectJudgesAssigned(@RequestBody ProjectJudgePageDTO projectJudgePageDTO) {
return ResponseData.generateCreatedResponse(0, projectJudgeService.projectJudgesAssigned(projectJudgePageDTO));
}
@PostMapping(value = "/downloadJudgeTemplate")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---下载导入评委模板")
public ResponseVO downloadJudgeTemplate() {
projectJudgeService.downloadTemplate();
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/importJudge")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---导入评委:file/文件(数据格式:Form-Data)")
public ResponseVO importJudge(MultipartFile file) {
projectJudgeService.importJudge(file);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/exportProjectJudge")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---导出评委")
public void exportProjectJudge() {
projectJudgeService.exportProjectJudge();
}
}
package com.zhongzhi.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 项目材料 前端控制器
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@RestController
@RequestMapping("/projectMaterials")
public class ProjectMaterialsController {
}
package com.zhongzhi.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 项目团队信息表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@RestController
@RequestMapping("/projectMember")
public class ProjectMemberController {
}
package com.zhongzhi.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 股权结构表 前端控制器
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@RestController
@RequestMapping("/projectOwnershipStructure")
public class ProjectOwnershipStructureController {
}
package com.zhongzhi.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 项目论文 前端控制器
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@RestController
@RequestMapping("/project-paper-do")
public class ProjectPaperController {
}
package com.zhongzhi.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 项目专利 前端控制器
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@RestController
@RequestMapping("/project-patent-do")
public class ProjectPatentController {
}
package com.zhongzhi.controller;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.review.CancelReviewDTO;
import com.zhongzhi.dto.review.ProjectReviewDTO;
import com.zhongzhi.dto.review.SetReviewDTO;
import com.zhongzhi.service.ProjectReviewService;
import com.zhongzhi.vo.ResponseVO;
import com.zhongzhi.vo.review.SendNoticeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 项目评审 前端控制器
* </p>
*
* @author DengMin
* @since 2021-05-18
*/
@RestController
@Api(tags = "项目评审")
@RequestMapping("/projectReview")
public class ProjectReviewController {
@Autowired
private ProjectReviewService projectReviewService;
@PostMapping(value = "/setReview")
@LoginRequired({Platform.center})
@ApiOperation("中心端 ---分配评审:[{projectId}]/项目ID、[{judgeId}]/评委ID、smsMessage/是否发送短信通知(0:不发送,1:发送)")
public ResponseVO setReview(@RequestBody SetReviewDTO setReviewDTO) {
projectReviewService.setReview(setReviewDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/sendNotice")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 发送通知评审:id/评委ID, matchId/赛事ID")
public ResponseVO sendNotice(@RequestBody SendNoticeVO sendNoticeVO) {
projectReviewService.sendNotice(sendNoticeVO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/cancelReview")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 撤销分配:projectId/项目ID、[{judgeId}]/评委ID、smsMessage/是否发送短信通知(0:不发送,1:发送)")
public ResponseVO cancelReview(@RequestBody CancelReviewDTO cancelReviewVO) {
projectReviewService.cancelReview(cancelReviewVO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/getProjectReview")
@LoginRequired({Platform.center})
@ApiOperation("中心端 --- 已分配项目评审员:projectId/项目ID")
public ResponseVO getProjectReview(@RequestBody ProjectReviewDTO projectReviewDTO) {
return ResponseData.generateCreatedResponse(0, projectReviewService.getProjectReview(projectReviewDTO));
}
}
package com.zhongzhi.controller;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.period.ProjectReviewPeriodDTO;
import com.zhongzhi.model.ProjectReviewPeriodDO;
import com.zhongzhi.service.ProjectReviewPeriodService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 评审时段 前端控制器
* </p>
*
* @author DengMin
* @since 2021-06-10
*/
@RestController
@Api(tags = "评审时段")
@RequestMapping("/projectReviewPeriod")
public class ProjectReviewPeriodController {
@Autowired
private ProjectReviewPeriodService projectReviewPeriodService;
@PostMapping(value = "/getProjectReviewPeriod")
@LoginRequired({Platform.center, Platform.school, Platform.review})
@ApiOperation("中心端(种子赛道、职教赛道) --- 查询评审时间:matchId/赛事年份ID、projectGroup/项目组别(科技创新组、红色文创组、高职、中职)、projectSchedule/项目进度(市级初赛、市级复赛、市级决赛)")
public ResponseVO getProjectReviewPeriod(@RequestBody ProjectReviewPeriodDTO projectReviewPeriodDTO) {
return ResponseData.generateCreatedResponse(0, projectReviewPeriodService.getProjectReviewPeriod(projectReviewPeriodDTO));
}
@PostMapping(value = "/updateProjectReviewPeriod")
@LoginRequired(Platform.center)
@ApiOperation("中心端 --- 修改评审时间:id/ID、matchId/赛事ID、projectGroup/项目组别、projectSchedule/项目进度、startTime/开始时间、endTime/结束时间")
public ResponseVO updateProjectReviewPeriod(@RequestBody ProjectReviewPeriodDO projectReviewPeriodDO) {
projectReviewPeriodService.updateProjectReviewPeriod(projectReviewPeriodDO);
return ResponseData.generateCreatedResponse(0);
}
}
package com.zhongzhi.controller;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.scheduleRecord.ProjectScheduleRecordDTO;
import com.zhongzhi.service.ProjectScheduleRecordService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 项目进度记录 前端控制器
* </p>
*
* @author DengMin
* @since 2021-06-02
*/
@RestController
@Api(tags = "项目进度记录")
@RequestMapping("/projectScheduleRecord")
public class ProjectScheduleRecordController {
@Autowired
private ProjectScheduleRecordService projectScheduleRecordService;
@PostMapping(value = "/getProjectScheduleRecord")
@ApiOperation("中心端 ---获奖情况")
@LoginRequired({Platform.center})
public ResponseVO getProjectScheduleRecord(@RequestBody ProjectScheduleRecordDTO projectScheduleRecordDTO) {
return ResponseData.generateCreatedResponse(0, projectScheduleRecordService.getProjectScheduleRecord(projectScheduleRecordDTO));
}
}
package com.zhongzhi.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 项目作品 前端控制器
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@RestController
@RequestMapping("/project-trademark-do")
public class ProjectTrademarkController {
}
package com.zhongzhi.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 项目作品 前端控制器
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@RestController
@RequestMapping("/project-works-do")
public class ProjectWorksController {
}
package com.zhongzhi.controller;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.model.AdministerDO;
import com.zhongzhi.model.SmsCodeDO;
import com.zhongzhi.service.SmsCodeService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 短信验证码 前端控制器
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@RestController
@Api(tags = "短信验证码")
@RequestMapping("/smsCode")
public class SmsCodeController {
@Autowired
private SmsCodeService smsCodeService;
@PostMapping(value = "/sendRegisterCode")
@ApiOperation("学生端 ---注册验证码:telephone/手机号")
public ResponseVO sendRegisterCode(@RequestBody SmsCodeDO smsCodeDO) {
smsCodeService.sendRegisterCode(smsCodeDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/sendStudentLoginCode")
@ApiOperation("学生端 ---登陆验证码:telephone/手机号")
public ResponseVO sendStudentLoginCode(@RequestBody SmsCodeDO smsCodeDO) {
smsCodeService.sendStudentLoginCode(smsCodeDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/sendAdministerLoginCode")
@ApiOperation("中心端 --- 中心端登陆验证码:telephone/手机号")
public ResponseVO sendAdministerLoginCode(@RequestBody AdministerDO administerDO) {
smsCodeService.sendAdministerLoginCode(administerDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "/sendJudgeLoginCode")
@ApiOperation("评审端 ---登陆验证码:telephone/手机号")
public ResponseVO sendJudgeLoginCode(@RequestBody SmsCodeDO smsCodeDO) {
smsCodeService.sendJudgeLoginCode(smsCodeDO);
return ResponseData.generateCreatedResponse(0);
}
}
package com.zhongzhi.controller;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.notice.SmsNoticeDTO;
import com.zhongzhi.dto.notice.SmsNoticePageDTO;
import com.zhongzhi.service.SmsNoticeService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 短信通知记录 前端控制器
* </p>
*
* @author DengMin
* @since 2022-04-15
*/
@RestController
@Api(tags = "短信通知")
@RequestMapping("/smsNotice")
public class SmsNoticeController {
@Autowired
private SmsNoticeService smsNoticeService;
@PostMapping(value = "batchSend")
@LoginRequired({Platform.center})
@ApiOperation("管理端 -- 批量发送短信:matchId/赛事年份ID、projectGroup/组别、projectSchedule/阶段、projectStatus/状态、name/搜索名称")
public ResponseVO batchSend(@RequestBody SmsNoticeDTO smsNoticeDTO) {
smsNoticeService.batchSend(smsNoticeDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "send")
@LoginRequired({Platform.center})
@ApiOperation("管理端 -- 发送短信:ids/项目ID(数组)")
public ResponseVO send(@RequestBody SmsNoticeDTO smsNoticeDTO) {
smsNoticeService.send(smsNoticeDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping(value = "getListByPage")
@LoginRequired({Platform.center})
@ApiOperation("管理端 -- 发送短信记录:date/日期、name/搜索名称、pageNo、pageSize")
public ResponseVO getListByPage(@RequestBody SmsNoticePageDTO smsNoticePageDTO) {
return ResponseData.generateCreatedResponse(0, smsNoticeService.getListByPage(smsNoticePageDTO));
}
}
\ No newline at end of file
package com.zhongzhi.controller;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.utils.LoginRequired;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.student.LoginDTO;
import com.zhongzhi.dto.student.RegisterDTO;
import com.zhongzhi.model.StudentDO;
import com.zhongzhi.service.StudentService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@RestController
@Api(tags = "学生")
@RequestMapping("/student")
public class StudentController {
@Autowired
private StudentService studentService;
@PostMapping(value = "/register")
@ApiOperation("注册:name/真实姓名, idCard/身份证, telephone/手机号, code/验证码, " +
"education/学历层次, school/就读院校, major/就读专业, enrollmentDate/入学年份, graduateDate/毕业年份")
public ResponseVO register(@RequestBody RegisterDTO registerDTO) {
return ResponseData.generateCreatedResponse(0, studentService.register(registerDTO));
}
@PostMapping(value = "/login")
@ApiOperation("登陆:telephone/手机号, code/验证码")
public ResponseVO login(@RequestBody LoginDTO loginDTO) {
return ResponseData.generateCreatedResponse(0, studentService.login(loginDTO));
}
@PostMapping(value = "updateStudentInfo")
@LoginRequired({ Platform.student })
@ApiOperation("登陆:id/ID, education/学历, college/就读院校, major/专业, enrollmentDate/入学年份, graduateDate/毕业年份")
public ResponseVO updateStudentInfo(@RequestBody StudentDO studentDO) {
studentService.updateStudentInfo(studentDO);
return ResponseData.generateCreatedResponse(0);
}
}
package com.zhongzhi.controller;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.course.ChangeOrdersDTO;
import com.zhongzhi.dto.course.VodsDTO;
import com.zhongzhi.model.CourseDictDO;
import com.zhongzhi.model.VodDictDO;
import com.zhongzhi.service.VodDictService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author DengMin
* @since 2022-11-14
*/
@RestController
@RequestMapping("/vodDict")
@Api(tags = "视频字典表")
public class VodDictController {
@Autowired
private VodDictService vodDictService;
@PostMapping("/signature")
@ApiOperation("获取签名")
public ResponseVO signature()throws Exception{
return ResponseData.generateCreatedResponse(0,vodDictService.signature());
}
@PostMapping("deleteVod")
@ApiOperation("删除视频 id")
public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO){
vodDictService.deleteVod(vodDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("addVod")
@ApiOperation("新增视频 courseId vodName vodUrl vodCode vodLength vodSize vodFormat coverPage")
public ResponseVO orderNo(@RequestBody VodDictDO vodDictDO){
vodDictService.addVod(vodDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("updateVod")
@ApiOperation("修改视频 id vodName vodName vodUrl vodCode vodLength vodSize vodFormat coverPage ")
public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO){
vodDictService.updateVod(vodDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("changeOrders")
@ApiOperation("排序 ids[]")
public ResponseVO changeOrders(@RequestBody ChangeOrdersDTO changeOrdersDTO){
vodDictService.changeOrders(changeOrdersDTO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("vods")
@ApiOperation("查询课程下的视频 courseId vodName")
public ResponseVO vods(@RequestBody VodsDTO vodsDTO){
return ResponseData.generateCreatedResponse(0, vodDictService.vods(vodsDTO));
}
@PostMapping("fourVods")
@ApiOperation("首页只查询4个视频 yearId ")
public ResponseVO fourVods(@RequestBody CourseDictDO courseDictDO){
return ResponseData.generateCreatedResponse(0,vodDictService.fourVods(courseDictDO));
}
}
package com.zhongzhi.controller;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.model.YearDictDO;
import com.zhongzhi.service.YearDictService;
import com.zhongzhi.vo.ResponseVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 年份字典表 前端控制器
* </p>
*
* @author DengMin
* @since 2023-04-11
*/
@RestController
@RequestMapping("/yearDict")
@Api(tags = "年份管理")
public class YearDictController {
@Autowired
private YearDictService yearDictService;
@PostMapping("queryYears")
@ApiOperation("查询年份")
public ResponseVO queryYears(){
return ResponseData.generateCreatedResponse(0,yearDictService.queryYears());
}
@PostMapping("updateYear")
@ApiOperation("编辑年份 id year status")
public ResponseVO updateYear(@RequestBody YearDictDO yearDictDO){
yearDictService.updateYear(yearDictDO);
return ResponseData.generateCreatedResponse(0);
}
@PostMapping("addYear")
@ApiOperation("添加年份 year status ")
public ResponseVO addYear(@RequestBody YearDictDO yearDictDO){
yearDictService.addYear(yearDictDO);
return ResponseData.generateCreatedResponse(0);
}
}
package com.zhongzhi.dao;
import com.zhongzhi.model.AdministerDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 中心管理账户表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Repository
public interface AdministerDAO extends BaseMapper<AdministerDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.AdministerPermissionDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 系统用户权限表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Repository
public interface AdministerPermissionDAO extends BaseMapper<AdministerPermissionDO> {
}
package com.zhongzhi.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.dto.college.ExportCollegeDTO;
import com.zhongzhi.model.CollegesDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongzhi.vo.college.AwardedListVO;
import com.zhongzhi.vo.college.CollegePageVO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 院校字典表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Repository
public interface CollegesDictDAO extends BaseMapper<CollegesDictDO> {
IPage<CollegePageVO> listPage(Page page, String name);
IPage<AwardedListVO> getAwardedList(Page page, String name);
List<AwardedListVO> getAwardedListAll();
}
package com.zhongzhi.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhongzhi.model.CourseDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongzhi.vo.course.CoursesVO;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-11-14
*/
@Repository
public interface CourseDictDAO extends BaseMapper<CourseDictDO> {
IPage<CoursesVO> courses(IPage page, String courseName,Long yearId);
}
package com.zhongzhi.dao;
import com.zhongzhi.model.FinalMatchMemberDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongzhi.vo.college.ExportListVO;
import com.zhongzhi.vo.college.RegisterMembersVO;
import com.zhongzhi.vo.college.SchoolsVO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author DengMin
* @since 2024-07-12
*/
@Repository
public interface FinalMatchMemberDAO extends BaseMapper<FinalMatchMemberDO> {
List<RegisterMembersVO> registerMembers(Long collegeId,Long matchId);
List<RegisterMembersVO> otherMembers(Long collegeId,Long matchId);
List<RegisterMembersVO> cars(Long collegeId,Long matchId);
String latestUpdateTime(Long collegeId);
List<SchoolsVO> schools(Long matchId,String name);
/**
* 导出名单
*/
List<ExportListVO> exportList(Long matchId,Long collegeId);
}
package com.zhongzhi.dao;
import com.zhongzhi.model.FundDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 届数表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Repository
public interface FundDictDAO extends BaseMapper<FundDictDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.ItemFieldDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 行业领域字典表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Repository
public interface ItemFieldDictDAO extends BaseMapper<ItemFieldDictDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.MajorDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 专业字典表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Repository
public interface MajorDictDAO extends BaseMapper<MajorDictDO> {
}
package com.zhongzhi.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongzhi.model.MatchCollegePdfDO;
import org.springframework.stereotype.Repository;
@Repository
public interface MatchCollegePdfMapper extends BaseMapper<MatchCollegePdfDO> {
}
package com.zhongzhi.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.model.MatchDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongzhi.vo.match.MatchDictVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 赛事年份管理 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-05-17
*/
@Repository
public interface MatchDictDAO extends BaseMapper<MatchDictDO> {
IPage<MatchDictVO> getSeedTrackMatchPage(Page page, String matchType);
List<MatchDictDO> getList(@Param("projectType") String projectType, @Param("projectGroup") String projectGroup);
}
package com.zhongzhi.dao;
import com.zhongzhi.model.MatchScheduleDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 时间安排 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-05-27
*/
@Repository
public interface MatchScheduleDAO extends BaseMapper<MatchScheduleDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.MessageDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 通知消息表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-05-17
*/
@Repository
public interface MessageDAO extends BaseMapper<MessageDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.PermissionsDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongzhi.vo.permission.PermissionVO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 权限表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Repository
public interface PermissionsDAO extends BaseMapper<PermissionsDO> {
List<PermissionVO> getPermissionById(Long id);
}
package com.zhongzhi.dao;
import com.zhongzhi.model.ProjectAwardDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 项目奖项 Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Repository
public interface ProjectAwardMapper extends BaseMapper<ProjectAwardDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.ProjectCopyrightDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 项目软件著作权 Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Repository
public interface ProjectCopyrightMapper extends BaseMapper<ProjectCopyrightDO> {
}
package com.zhongzhi.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.model.ProjectDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongzhi.vo.project.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 项目表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@Repository
public interface ProjectDAO extends BaseMapper<ProjectDO> {
IPage<ProjectPageVO> getListPage(Page page, Long matchId, Long proposerId, String projectType);
IPage<MainTrackProjectPageVO> getMainTrackProjectPage(Page page, Long matchId, String projectGroup, @Param("type") String type, @Param("projectType") String projectType,
String projectSchedule,
String projectStatus, String itemField, @Param("name") String name);
IPage<SeedTrackProjectPageVO> getSeedTrackProjectPage(Page page, Long matchId, String projectGroup, @Param("type") String type, @Param("projectType") String projectType,
@Param("school") String school, String projectSchedule,
String projectStatus, String itemField, @Param("name") String name,@Param("projectProgress") String projectProgress);
IPage<ReviewListVO> getReviewList(Page page, String projectName, String projectGroup, String projectReview, Long matchId, String projectStatus, String projectAssigned,String projectProgress);
IPage<ProjectPageVO> getProjectReviewPage(Page page, Long judgeId, Long matchId, String projectName, String projectSchedule, String projectReview, String projectGroup,String projectProgress);
List<ProjectDO> getProjectReviewList(Long id, Long matchId,String projectProgress);
List<ProjectDO> getProjectByCollege(Long matchId, @Param("name") String name, String projectProgress);
List<ProjectDO> getSeedTrackProjectList(Long matchId, String projectGroup, @Param("name") String name,@Param("projectProgress")String projectProgress);
List<ProjectDO> selectListByCollege(String projectType, String projectGroup, @Param("name") String name);
List<ProjectDO> getList(Long matchId, @Param("name") String name, String projectGroup);
List<SeedTrackProjectPageVO> getProjectList(Long matchId, String projectGroup, String projectSchedule, String projectStatus, @Param("name") String name);
List<ProjectDO> getListByJudgeId(Long matchId, String projectGroup, @Param("judgeId") Long judgeId);
List<ProjectDO> getProjectById(@Param("ids") Long[] ids);
List<ProjectDO> projects(Long matchId,Long collegeId,String college);
}
package com.zhongzhi.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.model.ProjectJudgeDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongzhi.vo.judge.ProjectJudgePageVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* <p>
* 项目评审员 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-05-28
*/
@Repository
public interface ProjectJudgeDAO extends BaseMapper<ProjectJudgeDO> {
IPage<ProjectJudgePageVO> getProjectJudgePage(Page page, String username, Integer status);
IPage<ProjectJudgePageVO> projectJudgesAssigned(Page page, @Param("matchId") Long matchId, @Param("projectGroup") String projectGroup, @Param("projectSchedule") String projectSchedule);
}
package com.zhongzhi.dao;
import com.zhongzhi.model.ProjectMaterialsDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 项目材料 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@Repository
public interface ProjectMaterialsDAO extends BaseMapper<ProjectMaterialsDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.ProjectMemberDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 项目团队信息表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@Repository
public interface ProjectMemberDAO extends BaseMapper<ProjectMemberDO> {
/**
* 团队成员
*/
List<ProjectMemberDO> projectMembers(Long projectId);
}
package com.zhongzhi.dao;
import com.zhongzhi.model.ProjectOwnershipStructureDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 股权结构表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@Repository
public interface ProjectOwnershipStructureDAO extends BaseMapper<ProjectOwnershipStructureDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.ProjectPaperDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 项目论文 Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Repository
public interface ProjectPaperMapper extends BaseMapper<ProjectPaperDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.ProjectPatentDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 项目专利 Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Repository
public interface ProjectPatentMapper extends BaseMapper<ProjectPatentDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.ProjectReviewDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongzhi.vo.judge.ProjectReviewVO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 项目评审 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-05-18
*/
@Repository
public interface ProjectReviewDAO extends BaseMapper<ProjectReviewDO> {
List<ProjectReviewVO> getList(String projectSchedule, Long projectId);
Integer selectCountByMatchId(Long judgeId, Long matchId);
Integer selectNotReviewCount(Long judgeId, Long matchId);
}
package com.zhongzhi.dao;
import com.zhongzhi.model.ProjectReviewPeriodDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 评审时段 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-06-10
*/
@Repository
public interface ProjectReviewPeriodMapper extends BaseMapper<ProjectReviewPeriodDO> {
}
package com.zhongzhi.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.model.ProjectScheduleRecordDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongzhi.vo.scheduleRecord.ProjectScheduleRecordVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* 项目进度记录 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-06-02
*/
@Repository
public interface ProjectScheduleRecordDAO extends BaseMapper<ProjectScheduleRecordDO> {
IPage<ProjectScheduleRecordVO> getProjectScheduleRecord(Page page, Long matchId, @Param("name") String name);
List<ProjectScheduleRecordDO> getList(Long matchId, String college, @Param("projectGroup") String projectGroup);
}
package com.zhongzhi.dao;
import com.zhongzhi.model.ProjectTrademarkDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 项目作品 Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Repository
public interface ProjectTrademarkMapper extends BaseMapper<ProjectTrademarkDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.ProjectWorksDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 项目作品 Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Repository
public interface ProjectWorksMapper extends BaseMapper<ProjectWorksDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.SmsCodeDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 短信验证码 Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Repository
public interface SmsCodeDAO extends BaseMapper<SmsCodeDO> {
SmsCodeDO getOneByTelePhone(String telephone, String type, String platform);
}
package com.zhongzhi.dao;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.model.SmsNoticeDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongzhi.vo.notice.SmsNoticeVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* <p>
* 短信通知记录 Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-04-15
*/
@Repository
public interface SmsNoticeMapper extends BaseMapper<SmsNoticeDO> {
IPage<SmsNoticeVO> getListByPage(Page page, @Param("date") String date, String name);
}
package com.zhongzhi.dao;
import com.zhongzhi.model.StudentDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* Mapper 接口
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Repository
public interface StudentDAO extends BaseMapper<StudentDO> {
}
package com.zhongzhi.dao;
import com.zhongzhi.model.CourseDictDO;
import com.zhongzhi.model.VodDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhongzhi.vo.course.VodsVO;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author DengMin
* @since 2022-11-14
*/
@Repository
public interface VodDictDAO extends BaseMapper<VodDictDO> {
List<VodsVO> vods(Long courseId,String vodName,Long yearId);
List<VodsVO> fourVods(CourseDictDO courseDictDO);
}
package com.zhongzhi.dao;
import com.zhongzhi.model.YearDictDO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* <p>
* 年份字典表 Mapper 接口
* </p>
*
* @author DengMin
* @since 2023-04-11
*/
@Repository
public interface YearDictDAO extends BaseMapper<YearDictDO> {
}
package com.zhongzhi.dto.administer;
import lombok.Data;
@Data
public class AdministerPageDTO {
private String listItem;
private String username;
private Integer pageNo;
private Integer pageSize;
}
package com.zhongzhi.dto.administer;
import lombok.Data;
@Data
public class LoginDTO {
private String telephone;
private String code;
}
package com.zhongzhi.dto.college;
import lombok.Data;
import java.util.List;
@Data
public class AddProjectMemberDTO {
private List<Long> studentIds;
private Long projectId;
private Long matchId;
}
package com.zhongzhi.dto.college;
import lombok.Data;
@Data
public class AwardedListDTO {
private Long matchId;
private String name;
private String projectGroup;
private Integer pageNo;
private Integer pageSize;
}
package com.zhongzhi.dto.college;
import com.zhongzhi.common.utils.ExcelColumn;
import lombok.Data;
@Data
public class CollegesDOT {
@ExcelColumn(col = 1, value = "学校代码")
private String code;
@ExcelColumn(col = 2, value = "院校名称")
private String name;
@ExcelColumn(col = 3, value = "联系方式")
private String phone;
@ExcelColumn(col = 4, value = "导入失败原因")
private String failReason;
}
package com.zhongzhi.dto.college;
import lombok.Data;
@Data
public class CollegesDictDTO {
private String name;
private String education;
}
package com.zhongzhi.dto.college;
import lombok.Data;
@Data
public class CollegesPageDTO {
private String name;
private Integer pageNo;
private Integer pageSize;
}
package com.zhongzhi.dto.college;
import lombok.Data;
import java.util.List;
@Data
public class DownloadErrorDataDTO {
private List<CollegesDOT> errorData;
}
package com.zhongzhi.dto.college;
import com.zhongzhi.common.utils.ExcelColumn;
import lombok.Data;
@Data
public class ExportCollegeDTO {
@ExcelColumn(col = 1, value = "学校代码")
private String code;
@ExcelColumn(col = 2, value = "学校名称")
private String name;
@ExcelColumn(col = 3 , value = "分管领导")
private String leaderName;
@ExcelColumn(col = 4 , value = "职务")
private String leaderPost;
@ExcelColumn(col = 5 , value = "手机号")
private String leaderPhone;
@ExcelColumn(col = 6 , value = "联系人姓名")
private String contactName;
@ExcelColumn(col = 7 , value = "职务")
private String contactPost;
@ExcelColumn(col = 8 , value = "手机号")
private String contactPhone;
@ExcelColumn(col = 9, value = "账户")
private String account;
@ExcelColumn(col = 10, value = "密码")
private String password;
@ExcelColumn(col = 11, value = "联系地址")
private String address;
}
package com.zhongzhi.dto.college;
import lombok.Data;
@Data
public class LoginDTO {
private String account;
private String password;
}
package com.zhongzhi.dto.college;
import lombok.Data;
@Data
public class LoginStatusDTO {
private Long[] ids;
private Long id;
private Integer loginStatus;
}
package com.zhongzhi.dto.college;
import lombok.Data;
@Data
public class RegisterMembersDTO {
private Long id;
private Long matchId;
private Long collegeId;
private String name;
}
package com.zhongzhi.dto.college;
import lombok.Data;
@Data
public class UpdatePwdDTO {
private String password;
}
package com.zhongzhi.dto.course;
import lombok.Data;
import java.util.List;
@Data
public class ChangeOrdersDTO {
private List<Long> ids;
}
package com.zhongzhi.dto.course;
import lombok.Data;
@Data
public class CoursesDTO {
private Integer pageSize;
private Integer pageNo;
private String courseName;
private Long yearId;
}
package com.zhongzhi.dto.course;
import lombok.Data;
@Data
public class VodsDTO {
private Long yearId;
private Long courseId;
private String vodName;
}
package com.zhongzhi.dto.judge;
import lombok.Data;
@Data
public class ProjectJudgePageDTO {
private Long matchId;
private String projectGroup;
private String projectSchedule;
private String username;
private Integer status;
private Integer pageNo;
private Integer pageSize;
}
package com.zhongzhi.dto.match;
import com.zhongzhi.model.MatchScheduleDO;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class MatchDictDTO {
private Long id;
/**
* 赛事名称
*/
private String matchName;
/**
* 赛事年份
*/
private String matchDate;
/**
* 报名开始时间
*/
private Date startTime;
/**
* 报名结束时间
*/
private Date endTime;
/**
* 类型
*/
private String matchType;
private Integer status;
/**
* 时间安排
*/
private List<MatchScheduleDO> schedule;
}
package com.zhongzhi.dto.match;
import lombok.Data;
@Data
public class SelectListPageDTO {
private Integer pageNo;
private Integer pageSize;
}
package com.zhongzhi.dto.member;
import lombok.Data;
import java.util.List;
@Data
public class CreateProjectMemberDTO {
private Long id;
/**
* 姓名
*/
private String name;
/**
* 就读学校
*/
private String school;
/**
* 年级
*/
private String grade;
/**
* 身份证
*/
private String idCard;
/**
* 就读专业
*/
private String major;
/**
* 性别
*/
private String sex;
/**
* 学籍号
*/
private String studentNo;
/**
* 手机号
*/
private String telephone;
/**
* 邮箱
*/
private String email;
/**
* 团队成员
*/
private List<TeamMemberDTO> teamMember;
/**
* 指导老师
*/
private List<MentorDTO> mentor;
/**
* 项目组别
*/
private String projectGroup;
/**
* 项目类型
*/
private String projectType;
private String fiveYears;
}
package com.zhongzhi.dto.member;
import lombok.Data;
@Data
public class MentorDTO {
private Long id;
/**
* 姓名
*/
private String teacherName;
/**
* 工作单位
*/
private String company;
/**
* 职称
*/
private String positionTitle;
/**
* 职务
*/
private String position;
/**
* 手机号
*/
private String telephone;
/**
* 身份证号
*/
private String idCard;
}
package com.zhongzhi.dto.member;
import lombok.Data;
@Data
public class TeamMemberDTO {
private Long id;
/**
* 姓名
*/
private String teamName;
/**
* 就读学校
*/
private String school;
/**
* 年级
*/
private String grade;
/**
* 就读专业
*/
private String major;
/**
* 性别
*/
private String sex;
/**
* 身份证号
*/
private String idCard;
/**
* 学籍号
*/
private String studentNo;
/**
* 手机号
*/
private String teamTelephone;
}
package com.zhongzhi.dto.message;
import lombok.Data;
@Data
public class MessagePageDTO {
private Integer pageNo;
private Integer pageSize;
}
package com.zhongzhi.dto.notice;
import lombok.Data;
import java.util.List;
@Data
public class SmsNoticeDTO {
private List<Long> ids;
private Long matchId;
private String projectGroup;
private String projectSchedule;
private String projectStatus;
private String name;
}
package com.zhongzhi.dto.notice;
import lombok.Data;
@Data
public class SmsNoticePageDTO {
private String date;
private String name;
private Integer pageNo;
private Integer pageSize;
}
package com.zhongzhi.dto.period;
import lombok.Data;
@Data
public class ProjectReviewPeriodDTO {
private Long matchId;
private String projectGroup;
private String projectSchedule;
private String projectProgress;
}
package com.zhongzhi.dto.project;
import lombok.Data;
import java.util.List;
@Data
public class ApproveDTO {
private List<Long> ids;
private Long id;
private Integer projectStatus;
}
package com.zhongzhi.dto.project;
import lombok.Data;
@Data
public class BatchRollbackDTO {
private Long[] ids;
}
package com.zhongzhi.dto.project;
import lombok.Data;
import java.util.List;
@Data
public class CollegeProjectDTO {
private List<Long> id;
}
package com.zhongzhi.dto.project;
import com.zhongzhi.model.ProjectOwnershipStructureDO;
import lombok.Data;
import java.util.List;
@Data
public class CreateMainTrackProjectDTO {
/**
* 所属领域
*/
private String itemField;
/**
* 项目LOGO
*/
private String logoUri;
/**
* 项目名称
*/
private String projectName;
/**
* 所在地址
*/
private String address;
/**
* 项目概述
*/
private String projectIntro;
/**
* 国家级重大、重点科研项目的科研成果转化项目
*/
private String projectTransform;
/**
* 学校科技成果转化
*/
private String resultTransfer;
/**
* 参赛申报人为科技成果的完成人或所有人
*/
private String competitionOwner;
/**
* 参赛申报人为科技成果的第一完成人或所有人
*/
private String competitionFirst;
/**
* 师生共创
*/
private String bothInvention;
/**
* 项目进展
*/
private String projectProgress;
/**
* 公司名称
*/
private String companyName;
/**
* 法人身份
*/
private String legalPersonStatus;
/**
* 法人姓名
*/
private String legalPersonName;
/**
* 职务
*/
private String position;
/**
* 注册资金
*/
private String registerFund;
/**
* 注册时间
*/
private String registerDate;
/**
* 注册省份
*/
private String registerProvince;
/**
* 注册地址
*/
private String registerAddress;
/**
* 统一社会信用代码
*/
private String unifyCode;
/**
* 股权结构
*/
private List<ProjectOwnershipStructureDO> po;
/**
* 隐私设置
*/
private String privacySetting;
/**
* 类型
*/
private String materialsType;
/**
* 大小
*/
private String materialsSize;
/**
* 名称
*/
private String materialsName;
/**
* 地址
*/
private String materialsUrl;
}
package com.zhongzhi.dto.project;
import com.zhongzhi.model.ProjectMaterialsDO;
import lombok.Data;
import java.util.List;
@Data
public class CreateSeedTrackProjectDTO {
private String projectName;
/**
* 组别
*/
private String projectGroup;
/**
* 红色文创组类别
*/
private String culClassification;
/**
* 科技组类别
*/
private List<String> classification;
/**
* 介绍及创新点
*/
private String projectIntro;
/**
* 设计背景
*/
private String projectCreativity;
/**
* 科学设计
*/
private String scientificPrinciple;
/**
* 应用前景
*/
private String applicationProspect;
/**
* 路演形式
*/
private List<String> roadShowForm;
/**
* 创意实施或实验所受条件的限制
*/
private List<String> restriction;
/**
* 项目材料
*/
private List<ProjectMaterialsDO> materials;
/**
* 红色文创/科技创新
*/
private String projectProgress;
}
package com.zhongzhi.dto.project;
import com.zhongzhi.model.ProjectAwardDO;
import com.zhongzhi.model.ProjectCopyrightDO;
import com.zhongzhi.model.ProjectOwnershipStructureDO;
import com.zhongzhi.model.ProjectPaperDO;
import com.zhongzhi.model.ProjectPatentDO;
import com.zhongzhi.model.ProjectTrademarkDO;
import com.zhongzhi.model.ProjectWorksDO;
import lombok.Data;
import java.util.List;
@Data
public class CreateVocationalProjectDTO {
private Long id;
/**
* 所属领域
*/
private String itemField;
/**
* 项目LOGO
*/
private String logoUri;
/**
* 项目名称
*/
private String projectName;
/**
* 项目概述
*/
private String projectIntro;
/**
* 国家级重大、重点科研项目的科研成果转化项目
*/
private String projectTransform;
/**
* 学校科技成果转化
*/
private String resultTransfer;
/**
* 参赛申报人为科技成果的完成人或所有人
*/
private String competitionOwner;
/**
* 参赛申报人为科技成果的第一完成人或所有人
*/
private String competitionFirst;
/**
* 师生共创
*/
private String bothInvention;
/**
* 项目进展
*/
private String projectProgress;
/**
* 隐私设置
*/
private String privacySetting;
/**
* 类型
*/
private String materialsType;
/**
* 大小
*/
private String materialsSize;
/**
* 名称
*/
private String materialsName;
/**
* 地址
*/
private String materialsUrl;
/**
* 项目PPT地址
*/
private String projectPptUrl;
/**
* 项目PPT类型
*/
private String projectPptType;
/**
* 项目PPT名称
*/
private String projectPptName;
private String projectStage;
// 公司信息
/**
* 公司名称
*/
private String companyName;
/**
* 法人姓名
*/
private String legalPersonName;
/**
* 职务
*/
private String position;
/**
* 注册资金
*/
private String registerFund;
/**
* 注册时间
*/
private String registerDate;
/**
* 注册省份
*/
private String registerProvince;
/**
* 注册地址
*/
private String registerAddress;
/**
* 统一社会信用代码
*/
private String unifyCode;
/**
* 财务报表
*/
private String financialStatement;
/**
* 项目是否获得投资
*/
private String investment;
private String vodUrl;
/**
* 股权结构
*/
private List<ProjectOwnershipStructureDO> ownership;
/**
* 专利
*/
private List<ProjectPatentDO> patent;
/**
* 论文
*/
private List<ProjectPaperDO> paper;
/**
* 奖项
*/
private List<ProjectAwardDO> award;
/**
* 软件著作权
*/
private List<ProjectCopyrightDO> copyright;
/**
* 作品著作
*/
private List<ProjectWorksDO> works;
/**
* 商标
*/
private List<ProjectTrademarkDO> trademark;
}
package com.zhongzhi.dto.project;
import lombok.Data;
@Data
public class DataOverviewDTO {
private String projectGroup;
private String projectType;
}
package com.zhongzhi.dto.project;
import lombok.Data;
@Data
public class EditStatusDTO {
private Long id;
private Long[] ids;
private Integer editStatus;
private Long matchId;
private String projectGroup;
private String projectSchedule;
}
package com.zhongzhi.dto.project;
import com.zhongzhi.vo.ExcelFieldVO;
import lombok.Data;
import java.util.List;
@Data
public class ExportDTO {
private Long matchId;
private List<ExcelFieldVO> fields;
}
package com.zhongzhi.dto.project;
import com.zhongzhi.common.utils.ExcelColumn;
import lombok.Data;
@Data
public class ExportProjectDTO {
@ExcelColumn(col = 1, value = "届数")
private String matchName;
@ExcelColumn(col = 2, value = "项目名称")
private String projectName;
@ExcelColumn(col = 3, value = "组别")
private String projectProgress;
@ExcelColumn(col = 4, value = "负责人")
private String name;
@ExcelColumn(col = 5, value = "院校")
private String college;
@ExcelColumn(col = 6, value = "学籍号")
private String studentNo;
@ExcelColumn(col = 7, value = "专业")
private String major;
@ExcelColumn(col = 8, value = "手机号")
private String telephone;
@ExcelColumn(col = 9, value = "团队成员")
private String teamMembers;
@ExcelColumn(col = 10, value = "指导老师")
private String teachers;
@ExcelColumn(col = 11, value = "项目阶段")
private String projectSchedule;
@ExcelColumn(col = 12, value = "项目状态")
private String projectStatus;
}
package com.zhongzhi.dto.project;
import lombok.Data;
@Data
public class ImportVocationalProjectDTO {
private String projectGroup;
private String college;
private String projectType;
private Long matchId;
}
package com.zhongzhi.dto.project;
import lombok.Data;
@Data
public class PrintAttachmentDTO {
private String printAttachment;
private String printAttachmentType;
private String printAttachmentName;
private String projectGroup;
}
package com.zhongzhi.dto.project;
import lombok.Data;
import java.util.List;
@Data
public class ProjectCollegeListDTO {
private List<Long> ids;
private String projectSchedule;
private String projectGroup;
private Long matchId;
private String projectProgress;
}
package com.zhongzhi.dto.project;
import lombok.Data;
@Data
public class ProjectListPageDTO {
private String projectSchedule;
private String projectStatus;
private String projectGroup;
private String itemField;
private String name;
private Long matchId;
private String projectProgress;
private Integer pageNo;
private Integer pageSize;
}
package com.zhongzhi.dto.project;
import com.zhongzhi.vo.ExcelFieldVO;
import lombok.Data;
import java.util.List;
@Data
public class ReviewListDTO {
private List<Long> id;
private List<ExcelFieldVO> fields;
private Long matchId;
private String projectGroup;
private String projectName;
private String projectReview;
private String projectStatus;
private Integer pageNo;
private Integer pageSize;
private Integer type;
private String projectAssigned;
private String projectSchedule;
private String projectProgress;
}
package com.zhongzhi.dto.project;
import lombok.Data;
@Data
public class ReviewVocationalNumDTO {
private Long matchId;
private String projectGroup;
private String projectStatus;
private Long projectJudgeId;
}
package com.zhongzhi.dto.project;
import lombok.Data;
@Data
public class SeedTrackProjectNumDTO {
private Long matchId;
private String projectGroup;
private String projectProgress;
}
package com.zhongzhi.dto.project;
import lombok.Data;
@Data
public class StudentProjectDTO {
private Long matchId;
private String projectGroup;
}
package com.zhongzhi.dto.projectJudge;
import com.zhongzhi.common.utils.ExcelColumn;
import lombok.Data;
@Data
public class ImportJudge {
@ExcelColumn(col = 1, value = "专家姓名")
private String username;
@ExcelColumn(col = 2, value = "单位")
private String unit;
@ExcelColumn(col = 3, value = "职位/职称")
private String position;
@ExcelColumn(col = 4, value = "手机号")
private String telephone;
@ExcelColumn(col = 5, value = "身份证号")
private String idCard;
@ExcelColumn(col = 6, value = "开户银行名称")
private String bankName;
@ExcelColumn(col = 7, value = "银行卡号")
private String bankCard;
}
package com.zhongzhi.dto.review;
import lombok.Data;
import java.util.List;
@Data
public class CancelReviewDTO {
private Long projectId;
private List<Long> judgeId;
private Integer smsMessage;
}
package com.zhongzhi.dto.review;
import lombok.Data;
@Data
public class ProjectReviewDTO {
private Long projectId;
}
package com.zhongzhi.dto.review;
import lombok.Data;
@Data
public class ProjectReviewPageDTO {
private Long matchId;
private String projectName;
private String projectGroup;
private String projectStatus;
private String projectSchedule;
private String projectProgress;
private String status;
private Integer pageNo;
private Integer pageSize;
}
package com.zhongzhi.dto.review;
import lombok.Data;
import java.util.List;
@Data
public class ProjectReviewScoreDTO {
private List<Long> ids;
private List<ReviewScoreDTO> reviewScore;
private Long id;
private Double score;
private String reviewOpinion;
}
package com.zhongzhi.dto.review;
import lombok.Data;
@Data
public class ReviewScoreDTO {
private Long id;
private Double score;
private String reviewOpinion;
}
package com.zhongzhi.dto.review;
import lombok.Data;
import java.util.List;
@Data
public class SetReviewDTO {
private List<Long> projectId;
private List<Long> judgeId;
private Integer smsMessage;
private Long matchId;
}
package com.zhongzhi.dto.review;
import lombok.Data;
import java.util.List;
@Data
public class SubmittedDTO {
private List<Long> id;
}
package com.zhongzhi.dto.scheduleRecord;
import lombok.Data;
@Data
public class ProjectScheduleRecordDTO {
private String name;
private Integer pageNo;
private Integer pageSize;
}
package com.zhongzhi.dto.student;
import lombok.Data;
@Data
public class LoginDTO {
private String telephone;
private String code;
}
package com.zhongzhi.dto.student;
import lombok.Data;
@Data
public class RegisterDTO {
private String name;
private String idCard;
private String telephone;
private String education;
private String school;
private String major;
private String enrollmentDate;
private String graduateDate;
private String code;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 中心管理账户表
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("administer")
public class AdministerDO extends BaseModel {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 手机号
*/
private String telephone;
/**
* 成员名称
*/
private String username;
/**
* 头像
*/
private String avatar;
/**
* 角色
*/
private String role;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 系统用户权限表
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("administer_permission")
public class AdministerPermissionDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 用户账户ID
*/
private Long administerId;
/**
* 角色ID
*/
private Long permissionId;
}
package com.zhongzhi.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 院校字典表
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("colleges_dict")
public class CollegesDictDO extends BaseModel {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 学校代码
*/
private String code;
/**
* 学历
*/
private String education;
/**
* 院校名称
*/
private String name;
/**
* 账户
*/
private String account;
/**
* 密码
*/
private String password;
/**
* 联系方式
*/
private String address;
/**
* 登陆时间
*/
private LocalDateTime loginTime;
private String leaderName;
private String leaderPost;
private String leaderPhone;
private String contactName;
private String contactPost;
private String contactPhone;
private Integer loginStatus;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author DengMin
* @since 2022-11-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("course_dict")
public class CourseDictDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private Long yearId;
private String courseName;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author DengMin
* @since 2024-07-12
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("final_match_member")
public class FinalMatchMemberDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private Long matchId;
/**
* 院校id
*/
private Long collegeId;
/**
* 项目id
*/
private Long projectId;
/**
* 人员id
*/
private Long memberId;
/**
* 人员类型
*/
private String memberType;
private Integer orderNo;
private String userName;
private String idCard;
private String idCardType;
private String telephone;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 届数表
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("fund_dict")
public class FundDictDO extends BaseModel {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 基金名称
*/
private String fundName;
/**
* 年份
*/
private String year;
/**
* 0:禁用 1:启用
*/
private Integer status;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 行业领域字典表
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("item_field_dict")
public class ItemFieldDictDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 领域
*/
private String field;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 专业字典表
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("major_dict")
public class MajorDictDO extends BaseModel {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 专业代码
*/
private String code;
/**
* 专业名称
*/
private String major;
/**
* 学历 1.大专 2.本科 3.硕士 4.博士
*/
private String education;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author DengMin
* @since 2024-06-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("match_college_pdf")
public class MatchCollegePdfDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private Long collegeId;
private Long matchId;
private String attachment;
private String fileName;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDateTime;
import java.util.Date;
/**
* <p>
* 赛事年份管理
* </p>
*
* @author DengMin
* @since 2021-05-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("match_dict")
public class MatchDictDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 赛事名称
*/
private String matchName;
/**
* 赛事年份
*/
private String matchDate;
/**
* 报名开始时间
*/
private Date startTime;
/**
* 报名结束时间
*/
private Date endTime;
/**
* 状态(1:启动,0:暂停)
*/
private Integer status;
/**
* 赛事类型
*/
private String matchType;
/***
* 截止时间
*/
private String deadline;
private String registrationStart;
private String registrationDeadline;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 时间安排
* </p>
*
* @author DengMin
* @since 2021-05-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("match_schedule")
public class MatchScheduleDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 赛事年份ID
*/
private Long matchId;
/**
* 时间安排
*/
private Date scheduleTime;
/**
* 说明
*/
private String explains;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* <p>
* 通知消息表
* </p>
*
* @author DengMin
* @since 2021-05-17
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("message")
public class MessageDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 发布人
*/
private String username;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 置顶
*/
private Integer top;
/**
* 发布时间
*/
private Date releaseTime;
/**
* 附件地址
*/
private String attachmentUrl;
/**
* 附件名称
*/
private String attachmentName;
/**
* 附件类型
*/
private String attachmentType;
/**
* 状态(0:停用,1:启用)
*/
private Integer status;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 权限表
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("permissions")
public class PermissionsDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 父级ID
*/
private Long parentId;
/**
* 名称
*/
private String name;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 项目奖项
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_award")
public class ProjectAwardDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 项目ID
*/
private Long projectId;
/**
* 奖项名称
*/
private String awardTitle;
/**
* 获奖项目名称
*/
private String awardProjectTitle;
/**
* 级别
*/
private String level;
/**
* 获奖人
*/
private String prizewinner;
/**
* 获奖时间
*/
private String winningTime;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 项目软件著作权
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_copyright")
public class ProjectCopyrightDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 项目ID
*/
private Long projectId;
/**
* 软件名称
*/
private String dynacomm;
/**
* 著作权人
*/
private String copyrightOwner;
/**
* 权利获取方式
*/
private String rightAcquisitionMethod;
/**
* 开发完成时间
*/
private String developmentDate;
/**
* 开发发表日期
*/
private String publishedDate;
/**
* 权利范围
*/
private String interestField;
/**
* 登记号
*/
private String registerNumber;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 项目表
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project")
public class ProjectDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 申请人ID
*/
private Long proposerId;
/**
* 所属领域
*/
private String itemField;
/**
* 项目LOGO
*/
private String logoUri;
/**
* 项目名称
*/
private String projectName;
/**
* 组别
*/
private String projectGroup;
/**
* 赛事年份
*/
private Long matchId;
/**
* 申报项目时所在院校
*/
private String college;
/**
* 类别
*/
private String classification;
/**
* 所在地址
*/
private String address;
/**
* 项目概述
*/
private String projectIntro;
/**
* 设计背景
*/
private String projectCreativity;
/**
* 科学设计
*/
private String scientificPrinciple;
/**
* 应用前景
*/
private String applicationProspect;
/**
* 路演形式
*/
private String roadShowForm;
/**
* 创意实施或实验所受条件的限制
*/
private String restriction;
/**
* 国家级重大、重点科研项目的科研成果转化项目
*/
private String projectTransform;
/**
* 学校科技成果转化
*/
private String resultTransfer;
/**
* 参赛申报人为科技成果的完成人或所有人
*/
private String competitionOwner;
/**
* 参赛申报人为科技成果的第一完成人或所有人
*/
private String competitionFirst;
/**
* 师生共创
*/
private String bothInvention;
/**
* 项目进展
*/
private String projectProgress;
/**
* 项目阶段
*/
private String projectStage;
/**
* 公司名称
*/
private String companyName;
/**
* 法人身份
*/
private String legalPersonStatus;
/**
* 法人姓名
*/
private String legalPersonName;
/**
* 职务
*/
private String position;
/**
* 注册资金
*/
private String registerFund;
/**
* 注册时间
*/
private String registerDate;
/**
* 注册省份
*/
private String registerProvince;
/**
* 注册地址
*/
private String registerAddress;
/**
* 统一社会信用代码
*/
private String unifyCode;
/**
* 财务报表
*/
private String financialStatement;
/**
* 隐私设置
*/
private String privacySetting;
/**
* 项目状态
*/
private String projectStatus;
/**
* 项目进度
*/
private String projectSchedule;
/**
* 项目类型
*/
private String projectType;
/**
* 上传加盖公章的附件
*/
private String printAttachment;
/**
* 上传加盖公章的附件类型
*/
private String printAttachmentType;
/**
* 上传加盖公章的附件名称
*/
private String printAttachmentName;
/**
* 项目是否获得投资
*/
private String investment;
/**
* 项目PPT
*/
private String projectPptUrl;
/**
* 项目PPT类型
*/
private String projectPptType;
/**
* 项目PPT名称
*/
private String projectPptName;
/**
* 评审状态
*/
private String projectReview;
/**
* 分配状态
*/
private String projectAssigned;
private Integer editStatus;
private String vodUrl;
private Integer orderNo;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 项目评审员
* </p>
*
* @author DengMin
* @since 2021-05-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_judge")
public class ProjectJudgeDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 姓名
*/
private String username;
/**
* 手机号
*/
private String telephone;
/**
* 职务
*/
private String position;
/**
* 单位
*/
private String unit;
/**
* 身份证号
*/
private String idCard;
/**
* 开户行
*/
private String bankName;
/**
* 银行卡号
*/
private String bankCard;
/**
* 状态
*/
private Integer status;
private Integer passwordFree;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 项目材料
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_materials")
public class ProjectMaterialsDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 项目ID
*/
private Long projectId;
/**
* 类型
*/
private String materialsType;
/**
* 大小
*/
private String materialsSize;
/**
* 名称
*/
private String materialsName;
/**
* 地址
*/
private String materialsUrl;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 项目团队信息表
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_member")
public class ProjectMemberDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 项目ID
*/
private Long projectId;
/**
* 姓名
*/
private String name;
/**
* 就读学校
*/
private String school;
/**
* 年级
*/
private String grade;
/**
* 身份证
*/
private String idCard;
/**
* 就读专业
*/
private String major;
/**
* 性别
*/
private String sex;
/**
* 学籍号
*/
private String studentNo;
/**
* 工作单位
*/
private String company;
/**
* 职称
*/
private String positionTitle;
/**
* 职务
*/
private String position;
/**
* 手机号
*/
private String telephone;
/**
* 邮箱
*/
private String email;
/**
* 类型(1:团队负责人,2:团队成员,3:指导老师)
*/
private String type;
private String fiveYears;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 股权结构表
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_ownership_structure")
public class ProjectOwnershipStructureDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 项目ID
*/
private Long projectId;
/**
* 股东身份
*/
private String shareholderStatus;
/**
* 股东名称
*/
private String shareholderName;
/**
* 持股比例
*/
private Double shareholdingRatio;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 项目论文
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_paper")
public class ProjectPaperDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 项目ID
*/
private Long projectId;
/**
* 论文名称
*/
private String paperTitle;
/**
* 发表期刊
*/
private String publishedJournals;
/**
* DOI号
*/
private String doi;
/**
* 是否有共同
*/
private String common;
/**
* 第一作者
*/
private String firstAuthor;
/**
* 其他作者
*/
private String otherAuthor;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 项目专利
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_patent")
public class ProjectPatentDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 项目ID
*/
private Long projectId;
/**
* 国别
*/
private String country;
/**
* 公开号
*/
private String publicationNumber;
/**
* 专利标题
*/
private String patentTitle;
/**
* 专利类型
*/
private String patentType;
/**
* 专利号
*/
private String patentNumber;
/**
* 专利申请人
*/
private String patentApplicants;
/**
* 颁发时间(获得)
*/
@TableField("Issued_time")
private String issuedTime;
/**
* 预估到期时间
*/
private String expirationTime;
/**
* 发明人
*/
private String inventor;
/**
* 其他发明人
*/
private String otherInventors;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 项目评审
* </p>
*
* @author DengMin
* @since 2021-05-18
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_review")
public class ProjectReviewDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 项目ID
*/
private Long projectId;
/**
* 评委ID
*/
private Long judgeId;
/**
* 评审分数
*/
private Double reviewScore;
/**
* 评分
*/
private Double score;
/**
* 评审意见
*/
private String reviewOpinion;
/**
* 进度
*/
private String projectSchedule;
/**
* 评审时间
*/
private Date reviewTime;
/**
* 评审状态
*/
private String reviewStatus;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.util.Date;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 评审时段
* </p>
*
* @author DengMin
* @since 2021-06-10
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_review_period")
public class ProjectReviewPeriodDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 赛事年份ID
*/
private Long matchId;
/**
* 项目组别
*/
private String projectGroup;
/**
* 项目进度
*/
private String projectSchedule;
/**
* 开始时间
*/
private Date startTime;
/**
* 结束时间
*/
private Date endTime;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 项目进度记录
* </p>
*
* @author DengMin
* @since 2021-06-02
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_schedule_record")
public class ProjectScheduleRecordDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
private Long proposerId;
private Long projectId;
private Long matchId;
private String college;
private String projectType;
private String projectSchedule;
private String projectStatus;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 项目作品
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_trademark")
public class ProjectTrademarkDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 项目ID
*/
private Long projectId;
/**
* 国际分类号
*/
private String classificationNumber;
/**
* 商标名称
*/
private String tradeName;
/**
* 注册人
*/
private String registeredPerson;
/**
* 注册日期
*/
private String registeredDate;
/**
* 有效日期
*/
private String effectiveDate;
/**
* 商标编号
*/
private String trademarkNumber;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 项目作品
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("project_works")
public class ProjectWorksDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 项目ID
*/
private Long projectId;
/**
* 作品名称
*/
private String worksName;
/**
* 作者
*/
private String author;
/**
* 创作完成日期
*/
private String completionDate;
/**
* 首次发表日期
*/
private String firstPublicationDate;
/**
* 作品类别
*/
private String worksType;
/**
* 登记号
*/
private String registerNumber;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 短信验证码
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sms_code")
public class SmsCodeDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 手机号
*/
private String telephone;
/**
* 验证码
*/
private String code;
/**
* 类型
*/
private String type;
/**
* 平台
*/
private String platform;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 短信通知记录
* </p>
*
* @author DengMin
* @since 2022-04-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sms_notice")
public class SmsNoticeDO extends BaseModel {
private static final long serialVersionUID = 1L;
private Long id;
/**
* 项目ID
*/
private Long projectId;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String telephone;
/**
* 发送内容
*/
private String content;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("student")
public class StudentDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 姓名
*/
private String name;
/**
* 头像
*/
private String avatar;
/**
* 身份证号
*/
private String idCard;
/**
* 手机号
*/
private String telephone;
/**
* 学历
*/
private String education;
/**
* 就读院校
*/
private String college;
/**
* 就读专业
*/
private String major;
/**
* 入学年份
*/
private String enrollmentDate;
/**
* 毕业年份
*/
private String graduateDate;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
*
* </p>
*
* @author DengMin
* @since 2022-11-14
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("vod_dict")
public class VodDictDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 课程id
*/
private Long courseId;
/**
* 视频名称
*/
private String vodName;
/**
* 视频地址
*/
private String vodUrl;
/**
* 视频编号
*/
private String vodCode;
/**
* 视频时长
*/
private String vodLength;
/**
* 视频大小
*/
private String vodSize;
/**
* 视频格式
*/
private String vodFormat;
/**
* 序号
*/
private Integer orderNo;
/**
* 封面
*/
private String coverPage;
/**
* 播放量
*/
private String playCount;
}
package com.zhongzhi.model;
import com.zhongzhi.model.base.BaseModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* <p>
* 年份字典表
* </p>
*
* @author DengMin
* @since 2023-04-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("year_dict")
public class YearDictDO extends BaseModel {
private static final long serialVersionUID = 1L;
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
* 年份
*/
private String year;
/**
* 状态
*/
private String status;
}
package com.zhongzhi.model.base;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class BaseModel {
/**
* 创建时间
*/
@JsonIgnore
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
/**
* 更新时间
*/
@JsonIgnore
@TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "update_time", fill = FieldFill.UPDATE)
private LocalDateTime updateTime;
/**
* 删除时间
*/
@JsonIgnore
@TableLogic
private LocalDateTime deleteTime;
}
No preview for this file type
package com.zhongzhi.service;
import com.zhongzhi.model.AdministerPermissionDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 系统用户权限表 服务类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
public interface AdministerPermissionService extends IService<AdministerPermissionDO> {
}
package com.zhongzhi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhongzhi.dto.administer.AdministerPageDTO;
import com.zhongzhi.dto.administer.LoginDTO;
import com.zhongzhi.model.AdministerDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhongzhi.vo.administer.AdministerVO;
/**
* <p>
* 中心管理账户表 服务类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
public interface AdministerService extends IService<AdministerDO> {
AdministerVO login(LoginDTO loginDTO);
IPage getAdministerPage(AdministerPageDTO administerPageDTO);
}
package com.zhongzhi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhongzhi.dto.college.*;
import com.zhongzhi.model.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhongzhi.vo.college.CollegesVO;
import com.zhongzhi.vo.college.DetailVO;
import com.zhongzhi.vo.college.RegisterMembersVO;
import com.zhongzhi.vo.college.SchoolsVO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.util.Map;
/**
* <p>
* 院校字典表 服务类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
public interface CollegesDictService extends IService<CollegesDictDO> {
CollegesVO login(LoginDTO loginDTO);
IPage getCollegesPage(CollegesPageDTO collegesPageDTO);
void createColleges(CollegesDictDO collegesDictDO);
Map<String, Object> importColleges(MultipartFile file);
void downloadErrorData(DownloadErrorDataDTO downloadErrorDataDTO);
IPage getAwardedList(AwardedListDTO awardedListDTO);
void exportAwardedList(AwardedListDTO awardedListDTO);
void exportCollege();
void updatePwd(UpdatePwdDTO updatePwdDTO);
List<ProjectDO> projects(ProjectDO projectDO);
ProjectMemberDO projectLeader(ProjectMemberDO projectMemberDO);
List<ProjectMemberDO> projectMembers(ProjectMemberDO projectMemberDO);
void addProjectMember(AddProjectMemberDTO addProjectMemberDTO)throws Exception;
void removeProject(AddProjectMemberDTO addProjectMemberDTO)throws Exception;
void addObservations(FinalMatchMemberDO finalMatchMemberDO)throws Exception;
void updateObservations(FinalMatchMemberDO finalMatchMemberDO)throws Exception;
void deleteObservations(FinalMatchMemberDO finalMatchMemberDOO)throws Exception;
List<RegisterMembersVO> registerMembers(RegisterMembersDTO registerMembersDTO);
List<RegisterMembersVO> otherMembers(RegisterMembersDTO registerMembersDTO);
List<RegisterMembersVO> cars(RegisterMembersDTO registerMembersDTO);
DetailVO detail(RegisterMembersDTO registerMembersDTO);
List<SchoolsVO> schools(RegisterMembersDTO registerMembersDTO);
void exportList(FinalMatchMemberDO finalMatchMemberDO);
void addContact(CollegesDictDO collegesDictDO);
void updateAllLoginStatus(LoginStatusDTO loginStatusDTO);
void batchUpdateLoginStatus(LoginStatusDTO loginStatusDTO);
void updateLoginStatus(LoginStatusDTO loginStatusDTO);
}
package com.zhongzhi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhongzhi.dto.course.CoursesDTO;
import com.zhongzhi.model.CourseDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhongzhi.vo.course.CourseVodsVO;
import com.zhongzhi.vo.course.CoursesVO;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author DengMin
* @since 2022-11-14
*/
public interface CourseDictService extends IService<CourseDictDO> {
void addCourse(CourseDictDO courseDictDO);
void updateCourse(CourseDictDO courseDictDO);
IPage<CoursesVO> courses(CoursesDTO coursesDTO);
void deleteCourse(CourseDictDO courseDictDO);
List<CourseVodsVO> courseVods(CourseDictDO courseDictDO);
}
package com.zhongzhi.service;
import com.zhongzhi.model.FinalMatchMemberDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author DengMin
* @since 2024-07-12
*/
public interface FinalMatchMemberService extends IService<FinalMatchMemberDO> {
}
package com.zhongzhi.service;
import com.zhongzhi.model.FundDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 届数表 服务类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
public interface FundDictService extends IService<FundDictDO> {
}
package com.zhongzhi.service;
import com.zhongzhi.model.ItemFieldDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 行业领域字典表 服务类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
public interface ItemFieldDictService extends IService<ItemFieldDictDO> {
}
package com.zhongzhi.service;
import com.zhongzhi.model.MajorDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 专业字典表 服务类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
public interface MajorDictService extends IService<MajorDictDO> {
}
package com.zhongzhi.service;
import com.zhongzhi.model.MatchCollegePdfDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhongzhi.vo.project.QueryPdfStatusVO;
/**
* <p>
* 服务类
* </p>
*
* @author DengMin
* @since 2024-06-25
*/
public interface MatchCollegePdfService extends IService<MatchCollegePdfDO> {
void uploadPdf(MatchCollegePdfDO matchCollegePdfDO);
void dropPdf(MatchCollegePdfDO matchCollegePdfDO);
MatchCollegePdfDO queryPdfStatus(MatchCollegePdfDO matchCollegePdfDO);
}
package com.zhongzhi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhongzhi.dto.match.MatchDictDTO;
import com.zhongzhi.dto.match.SelectListPageDTO;
import com.zhongzhi.model.MatchDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 赛事年份管理 服务类
* </p>
*
* @author DengMin
* @since 2021-05-17
*/
public interface MatchDictService extends IService<MatchDictDO> {
MatchDictDO getMainTrackMatch();
MatchDictDO getSeedTrackMatch();
void updateMatch(MatchDictDTO matchDictDTO);
IPage getSeedTrackMatchPage(SelectListPageDTO selectListPageDTO);
void createMatch(MatchDictDTO matchDictDTO);
List<MatchDictDO> getMatch();
List<MatchDictDO> getList(String projectType, String projectGroup);
IPage getVocationalPage(SelectListPageDTO selectListPageDTO);
MatchDictDO getVocationalMatch();
void updateMatchDate(MatchDictDO matchDictDO);
MatchDictDO getMatch(MatchDictDO matchDictDO);
}
package com.zhongzhi.service;
import com.zhongzhi.model.MatchScheduleDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 时间安排 服务类
* </p>
*
* @author DengMin
* @since 2021-05-27
*/
public interface MatchScheduleService extends IService<MatchScheduleDO> {
}
package com.zhongzhi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhongzhi.dto.message.MessagePageDTO;
import com.zhongzhi.model.MessageDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 通知消息表 服务类
* </p>
*
* @author DengMin
* @since 2021-05-17
*/
public interface MessageService extends IService<MessageDO> {
void createMessage(MessageDO messageDO);
IPage getMessagePage(MessagePageDTO messagePageDTO);
}
package com.zhongzhi.service;
import com.zhongzhi.model.PermissionsDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhongzhi.vo.permission.PermissionVO;
import java.util.List;
/**
* <p>
* 权限表 服务类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
public interface PermissionsService extends IService<PermissionsDO> {
List<PermissionVO> getPermissionById(Long id);
}
package com.zhongzhi.service;
import com.zhongzhi.model.ProjectAwardDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 项目奖项 服务类
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
public interface ProjectAwardService extends IService<ProjectAwardDO> {
}
package com.zhongzhi.service;
import com.zhongzhi.model.ProjectCopyrightDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 项目软件著作权 服务类
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
public interface ProjectCopyrightService extends IService<ProjectCopyrightDO> {
}
package com.zhongzhi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhongzhi.dto.administer.LoginDTO;
import com.zhongzhi.dto.judge.ProjectJudgePageDTO;
import com.zhongzhi.model.ProjectJudgeDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhongzhi.vo.judge.JudgeInfoVO;
import com.zhongzhi.vo.judge.ProjectJudgePageVO;
import org.springframework.web.multipart.MultipartFile;
/**
* <p>
* 项目评审员 服务类
* </p>
*
* @author DengMin
* @since 2021-05-28
*/
public interface ProjectJudgeService extends IService<ProjectJudgeDO> {
IPage<ProjectJudgePageVO> getProjectJudgePage(ProjectJudgePageDTO projectJudgePageDTO);
void createProjectJudge(ProjectJudgeDO projectJudgeDO);
void updateProjectJudge(ProjectJudgeDO projectJudgeDO);
JudgeInfoVO login(LoginDTO loginDTO);
IPage<ProjectJudgePageVO> projectJudgesAssigned(ProjectJudgePageDTO projectJudgePageDTO);
void importJudge(MultipartFile file);
void downloadTemplate();
void exportProjectJudge();
}
package com.zhongzhi.service;
import com.zhongzhi.model.ProjectMaterialsDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 项目材料 服务类
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
public interface ProjectMaterialsService extends IService<ProjectMaterialsDO> {
}
package com.zhongzhi.service;
import com.zhongzhi.model.ProjectMemberDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 项目团队信息表 服务类
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
public interface ProjectMemberService extends IService<ProjectMemberDO> {
}
package com.zhongzhi.service;
import com.zhongzhi.model.ProjectOwnershipStructureDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 股权结构表 服务类
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
public interface ProjectOwnershipStructureService extends IService<ProjectOwnershipStructureDO> {
}
package com.zhongzhi.service;
import com.zhongzhi.model.ProjectPaperDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 项目论文 服务类
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
public interface ProjectPaperService extends IService<ProjectPaperDO> {
}
package com.zhongzhi.service;
import com.zhongzhi.model.ProjectPatentDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 项目专利 服务类
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
public interface ProjectPatentService extends IService<ProjectPatentDO> {
}
package com.zhongzhi.service;
import com.zhongzhi.dto.period.ProjectReviewPeriodDTO;
import com.zhongzhi.model.ProjectReviewPeriodDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhongzhi.vo.projectReviewPeriod.ProjectReviewPeriodVO;
/**
* <p>
* 评审时段 服务类
* </p>
*
* @author DengMin
* @since 2021-06-10
*/
public interface ProjectReviewPeriodService extends IService<ProjectReviewPeriodDO> {
ProjectReviewPeriodVO getProjectReviewPeriod(ProjectReviewPeriodDTO projectReviewPeriodDTO);
void updateProjectReviewPeriod(ProjectReviewPeriodDO projectReviewPeriodDO);
}
package com.zhongzhi.service;
import com.zhongzhi.dto.review.CancelReviewDTO;
import com.zhongzhi.dto.review.ProjectReviewDTO;
import com.zhongzhi.dto.review.SetReviewDTO;
import com.zhongzhi.model.ProjectJudgeDO;
import com.zhongzhi.model.ProjectReviewDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhongzhi.vo.judge.ProjectReviewVO;
import com.zhongzhi.vo.review.SendNoticeVO;
import java.util.List;
/**
* <p>
* 项目评审 服务类
* </p>
*
* @author DengMin
* @since 2021-05-18
*/
public interface ProjectReviewService extends IService<ProjectReviewDO> {
void setReview(SetReviewDTO setReviewDTO);
List<ProjectReviewVO> getList(String projectSchedule, Long projectId);
void cancelReview(CancelReviewDTO cancelReviewVO);
List<ProjectJudgeDO> getProjectReview(ProjectReviewDTO projectReviewDTO);
void sendNotice(SendNoticeVO sendNoticeVO);
Integer selectCount(Long judgeId, Long matchId);
Integer selectNotReviewCount(Long judgeId, Long matchId);
}
package com.zhongzhi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhongzhi.dto.scheduleRecord.ProjectScheduleRecordDTO;
import com.zhongzhi.model.ProjectScheduleRecordDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhongzhi.vo.scheduleRecord.ProjectScheduleRecordVO;
import java.util.List;
/**
* <p>
* 项目进度记录 服务类
* </p>
*
* @author DengMin
* @since 2021-06-02
*/
public interface ProjectScheduleRecordService extends IService<ProjectScheduleRecordDO> {
IPage getProjectScheduleRecord(ProjectScheduleRecordDTO projectScheduleRecordDTO);
List<ProjectScheduleRecordDO> getList(Long matchId, String name, String projectGroup);
}
package com.zhongzhi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhongzhi.common.utils.ResponseData;
import com.zhongzhi.dto.member.CreateProjectMemberDTO;
import com.zhongzhi.dto.project.*;
import com.zhongzhi.dto.review.ProjectReviewPageDTO;
import com.zhongzhi.dto.review.ProjectReviewScoreDTO;
import com.zhongzhi.dto.review.SubmittedDTO;
import com.zhongzhi.model.ProjectDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhongzhi.vo.ExcelFieldVO;
import com.zhongzhi.vo.member.ProjectMemberVO;
import com.zhongzhi.vo.project.*;
import java.util.List;
/**
* <p>
* 项目表 服务类
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
public interface ProjectService extends IService<ProjectDO> {
IPage getMainTrackProject(ProjectListPageDTO projectListPageDTO);
void createMainTrackProject(CreateMainTrackProjectDTO createMainTrackProjectDTO);
void createProjectMember(CreateProjectMemberDTO createProjectMemberDTO);
void withdrawn(ProjectDO projectDO);
IPage getSeedTrackProject(ProjectListPageDTO projectListPageDTO);
void createSeedTrackProject(CreateSeedTrackProjectDTO createSeedTrackProjectDTO);
ProjectInfoVO getMainTrackProjectById();
ProjectMemberVO getProjectMemberById();
ProjectInfoVO getSeedTrackProjectById();
ProjectInfoVO getCulturalProjectById();
IPage getMainTrackProjectPage(ProjectListPageDTO projectListPageDTO);
MainTrackProjectDetailVO getMainTrackProjectDetail(Long id);
IPage getSeedTrackProjectPage(ProjectListPageDTO projectListPageDTO);
IPage getSeedTrackProjectList(ProjectListPageDTO projectListPageDTO);
void downloadPDF(String projectGroup);
SeedTrackProjectDetailVO getSeedTrackProjectDetail(Long id);
void pass(ApproveDTO approveDTO);
void batchPass(ApproveDTO approveDTO);
void weedOut(ApproveDTO approveDTO);
void batchWeedOut(ApproveDTO approveDTO);
void exportProjectList(ProjectCollegeListDTO projectCollegeListDTO);
void uploadPrintAttachment(PrintAttachmentDTO printAttachmentDTO);
IPage getReviewList(ReviewListDTO reviewListDTO);
ProjectNumVO getProjectReviewNum(ReviewListDTO reviewListDTO);
ProjectNumVO getProjectReviewAssignNum(ReviewListDTO reviewListDTO);
List<ExcelFieldVO> getExportProjectField();
List<ExcelFieldVO> getExportProjectReviewField();
IPage getProjectReviewPage(ProjectReviewPageDTO projectReviewPageDTO);
void setScore(ProjectReviewScoreDTO projectReviewScoreDTO);
void submitted(ProjectReviewScoreDTO projectReviewScoreDTO);
ProjectMemberVO getProjectMember(String projectGroup);
ProjectDataOverview getCollegeDataOverview(DataOverviewDTO dataOverviewDTO);
// ProjectDataOverview getSeedTrackDataOverview();
// ProjectDataOverview getMainTrackDataOverview();
void exportProjectReview(ReviewListDTO reviewListDTO);
void exportProjectNew(ReviewListDTO reviewListDTO);
ProjectNumVO getReviewProjectNum(ReviewListDTO reviewListDTO);
void exportCollegeProject(CollegeProjectDTO collegeProjectDTO);
void getProjectByStudentId(StudentProjectDTO studentProjectDTO);
void rollback(ProjectDO projectDO);
SeedTrackProjectNumVO getSeedTrackProjectNum(SeedTrackProjectNumDTO seedTrackProjectNumDTO);
void exportProjectCollegeList(ProjectCollegeListDTO projectCollegeListDTO);
List<ProjectDO> getList(Long matchId, String name, String projectGroup);
SeedTrackProjectDetailVO getProjectById(Long id);
void exportProjectAll(ProjectCollegeListDTO projectCollegeListDTO);
void exportProjectAllProgress(ProjectCollegeListDTO projectCollegeListDTO);
void createVocationalProject(CreateVocationalProjectDTO createVocationalProjectDTO);
void updateVocationalProject(CreateVocationalProjectDTO createVocationalProjectDTO);
VocationalProjectInfoVO getVocationalProjectById();
void createVocationalMember(CreateProjectMemberDTO createProjectMemberDTO);
void updateVocationalMember(CreateProjectMemberDTO createProjectMemberDTO);
ProjectDataOverview getVocationalDataOverview(DataOverviewDTO dataOverviewDTO);
IPage getVocationalProject(ProjectListPageDTO projectListPageDTO);
IPage getVocationalReviewList(ReviewListDTO reviewListDTO);
SeedTrackProjectDetailVO getVocationalProjectDetail(Long id);
IPage getVocationalProjectPage(ProjectListPageDTO projectListPageDTO);
IPage getVocationalProjectList(ProjectListPageDTO projectListPageDTO);
IPage getVocationalProjectReviewPage(ProjectReviewPageDTO projectReviewPageDTO);
void importVocationalProject(ImportVocationalProjectDTO importVocationalProjectDTO);
VocationalNumVO getVocationalProjectNum(SeedTrackProjectNumDTO seedTrackProjectNumDTO);
VocationalReviewNumVO getVocationalReviewNum(ReviewListDTO reviewListDTO);
void exportProjectById(ReviewListDTO reviewListDTO);
VocationalProjectNum getReviewVocationalNum(ReviewVocationalNumDTO reviewVocationalNumDTO);
void batchUpdateEditStatus(EditStatusDTO editStatusDTO);
void updateEditStatus(EditStatusDTO editStatusDTO);
void updateAllEditStatus(EditStatusDTO editStatusDTO);
ProjectAssignNumVO getVocationalAssignNum(ReviewListDTO reviewListDTO);
void importProjectByGroup(ImportVocationalProjectDTO importVocationalProjectDTO);
void exportProjectByGroup(ImportVocationalProjectDTO importVocationalProjectDTO);
// ProjectDataOverview getCollegeVocationalDataOverview();
}
package com.zhongzhi.service;
import com.zhongzhi.model.ProjectTrademarkDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 项目作品 服务类
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
public interface ProjectTrademarkService extends IService<ProjectTrademarkDO> {
}
package com.zhongzhi.service;
import com.zhongzhi.model.ProjectWorksDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 项目作品 服务类
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
public interface ProjectWorksService extends IService<ProjectWorksDO> {
}
package com.zhongzhi.service;
import com.zhongzhi.model.AdministerDO;
import com.zhongzhi.model.SmsCodeDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 短信验证码 服务类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
public interface SmsCodeService extends IService<SmsCodeDO> {
void sendRegisterCode(SmsCodeDO smsCodeDO);
void sendStudentLoginCode(SmsCodeDO smsCodeDO);
SmsCodeDO getOneByTelePhone(String telephone, String type, String platform);
void sendAdministerLoginCode(AdministerDO administerDO);
void sendJudgeLoginCode(SmsCodeDO smsCodeDO);
}
package com.zhongzhi.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zhongzhi.dto.notice.SmsNoticeDTO;
import com.zhongzhi.dto.notice.SmsNoticePageDTO;
import com.zhongzhi.model.SmsNoticeDO;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 短信通知记录 服务类
* </p>
*
* @author DengMin
* @since 2022-04-15
*/
public interface SmsNoticeService extends IService<SmsNoticeDO> {
void batchSend(SmsNoticeDTO smsNoticeDTO);
void send(SmsNoticeDTO smsNoticeDTO);
IPage getListByPage(SmsNoticePageDTO smsNoticePageDTO);
}
package com.zhongzhi.service;
import com.zhongzhi.dto.student.LoginDTO;
import com.zhongzhi.dto.student.RegisterDTO;
import com.zhongzhi.model.StudentDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhongzhi.vo.student.StudentInfoVO;
/**
* <p>
* 服务类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
public interface StudentService extends IService<StudentDO> {
StudentInfoVO register(RegisterDTO registerDTO);
StudentInfoVO login(LoginDTO loginDTO);
void updateStudentInfo(StudentDO studentDO);
}
package com.zhongzhi.service;
import com.zhongzhi.dto.course.ChangeOrdersDTO;
import com.zhongzhi.dto.course.VodsDTO;
import com.zhongzhi.model.CourseDictDO;
import com.zhongzhi.model.VodDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zhongzhi.vo.course.SignatureVO;
import com.zhongzhi.vo.course.VodsVO;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author DengMin
* @since 2022-11-14
*/
public interface VodDictService extends IService<VodDictDO> {
SignatureVO signature()throws Exception;
void deleteVod(VodDictDO vodDictDO);
void addVod(VodDictDO vodDictDO);
void updateVod(VodDictDO vodDictDO);
void changeOrders(ChangeOrdersDTO changeOrdersDTO);
List<VodsVO> vods(VodsDTO vodsDTO);
List<VodsVO> fourVods(CourseDictDO courseDictDO);
}
package com.zhongzhi.service;
import com.zhongzhi.model.YearDictDO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 年份字典表 服务类
* </p>
*
* @author DengMin
* @since 2023-04-11
*/
public interface YearDictService extends IService<YearDictDO> {
List<YearDictDO> queryYears();
void updateYear(YearDictDO yearDictDO);
void addYear(YearDictDO yearDictDO);
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.AdministerPermissionDO;
import com.zhongzhi.dao.AdministerPermissionDAO;
import com.zhongzhi.service.AdministerPermissionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 系统用户权限表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Service
public class AdministerPermissionServiceImpl extends ServiceImpl<AdministerPermissionDAO, AdministerPermissionDO> implements AdministerPermissionService {
}
package com.zhongzhi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.constant.SmsCode;
import com.zhongzhi.common.exception.HttpException;
import com.zhongzhi.common.utils.JwtUtil;
import com.zhongzhi.dto.administer.AdministerPageDTO;
import com.zhongzhi.dto.administer.LoginDTO;
import com.zhongzhi.model.AdministerDO;
import com.zhongzhi.dao.AdministerDAO;
import com.zhongzhi.model.SmsCodeDO;
import com.zhongzhi.service.AdministerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.service.PermissionsService;
import com.zhongzhi.service.SmsCodeService;
import com.zhongzhi.vo.administer.AdministerVO;
import com.zhongzhi.vo.permission.PermissionVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 中心管理账户表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Service
public class AdministerServiceImpl extends ServiceImpl<AdministerDAO, AdministerDO> implements AdministerService {
@Autowired
private SmsCodeService smsCodeService;
@Autowired
private PermissionsService permissionsService;
@Override
public AdministerVO login(LoginDTO loginDTO) {
AdministerVO administerVO = new AdministerVO();
SmsCodeDO smsCodeDO = smsCodeService.getOneByTelePhone(loginDTO.getTelephone(), SmsCode.login, SmsCode.center);
if (smsCodeDO == null) {
throw new HttpException(10025);
}
if (!smsCodeDO.getCode().equals(loginDTO.getCode())) {
throw new HttpException(10021);
}
smsCodeService.removeById(smsCodeDO.getId());
AdministerDO administerDO = this.baseMapper.selectOne(new QueryWrapper<AdministerDO>()
.lambda()
.eq(AdministerDO::getTelephone, loginDTO.getTelephone()));
if (administerDO == null) {
throw new HttpException(10060);
}
BeanUtils.copyProperties(administerDO, administerVO);
String token = JwtUtil.generateToken(administerDO.getId(), Platform.center);
administerVO.setToken(token);
List<PermissionVO> list = permissionsService.getPermissionById(administerDO.getId());
List<PermissionVO> treeList = new ArrayList();
list.forEach(permissions -> {
if (permissions.getParentId() == null) {
treeList.add(permissions);
}
list.forEach(p -> {
if (p.getParentId() != null) {
if (p.getParentId().equals(permissions.getId())) {
if (permissions.getChildNodeList() == null) {
permissions.setChildNodeList(new ArrayList<>());
}
permissions.getChildNodeList().add(p);
}
}
});
});
administerVO.setPermission(treeList);
return administerVO;
}
@Override
public IPage getAdministerPage(AdministerPageDTO administerPageDTO) {
Page page = new Page(administerPageDTO.getPageNo(), administerPageDTO.getPageSize());
return this.baseMapper.selectPage(page, new QueryWrapper<AdministerDO>()
.lambda()
.eq(AdministerDO::getRole, administerPageDTO.getListItem())
.like(AdministerDO::getUsername, administerPageDTO.getUsername()));
}
}
package com.zhongzhi.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.common.constant.Platform;
import com.zhongzhi.common.constant.ProjectSchedule;
import com.zhongzhi.common.constant.ProjectStatus;
import com.zhongzhi.common.exception.HttpException;
import com.zhongzhi.common.utils.*;
import com.zhongzhi.dao.*;
import com.zhongzhi.dto.college.*;
import com.zhongzhi.dto.projectJudge.ImportJudge;
import com.zhongzhi.model.*;
import com.zhongzhi.service.CollegesDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.service.ProjectScheduleRecordService;
import com.zhongzhi.service.ProjectService;
import com.zhongzhi.vo.ExcelFieldVO;
import com.zhongzhi.vo.college.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;
/**
* <p>
* 院校字典表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Service
public class CollegesDictServiceImpl extends ServiceImpl<CollegesDictDAO, CollegesDictDO> implements CollegesDictService {
@Autowired
private ProjectService projectService;
@Autowired
private MatchCollegePdfMapper matchCollegePdfMapper;
@Autowired
private MatchDictDAO matchDictDAO;
@Autowired
private FinalMatchMemberDAO finalMatchMemberDAO;
@Autowired
private StudentDAO studentDAO;
@Autowired
private ProjectDAO projectDAO;
@Autowired
private ProjectMemberDAO projectMemberDAO;
@Autowired
private CollegesDictDAO collegesDictDAO;
@Override
@Transactional(rollbackFor = Exception.class)
public CollegesVO login(LoginDTO loginDTO) {
CollegesVO collegesVO = new CollegesVO();
CollegesDictDO collegesDict = this.baseMapper.selectOne(new QueryWrapper<CollegesDictDO>().lambda()
.eq(CollegesDictDO::getAccount, loginDTO.getAccount()));
if (collegesDict == null) {
throw new HttpException(10060);
}
if (!collegesDict.getPassword().equals(loginDTO.getPassword())) {
throw new HttpException(10061);
}
if (collegesDict.getLoginStatus() == 0) {
throw new HttpException(10067);
}
BeanUtils.copyProperties(collegesDict, collegesVO);
if (collegesDict.getLoginTime() != null) {
collegesVO.setIsLogin(1);
} else {
collegesVO.setIsLogin(0);
}
String token = JwtUtil.generateToken(collegesDict.getId(), Platform.school);
collegesVO.setToken(token);
return collegesVO;
}
@Override
public IPage getCollegesPage(CollegesPageDTO collegesPageDTO) {
Page page = new Page(collegesPageDTO.getPageNo(), collegesPageDTO.getPageSize());
IPage<CollegePageVO> iPage = this.baseMapper.listPage(page, collegesPageDTO.getName());
return iPage;
}
@Override
public void createColleges(CollegesDictDO collegesDictDO) {
CollegesDictDO collegesDict = this.baseMapper.selectOne(new QueryWrapper<CollegesDictDO>().lambda()
.eq(CollegesDictDO::getAccount, collegesDictDO.getAccount()));
if (collegesDict != null) {
throw new HttpException(10062);
}
if (collegesDictDO.getName().equals(collegesDict.getName())) {
throw new HttpException(10063);
}
if (collegesDictDO.getCode().equals(collegesDict.getCode())) {
throw new HttpException(10064);
}
collegesDictDO.setAccount("shzc" + collegesDictDO.getCode());
collegesDictDO.setPassword(RandomUtil.randomPass(8));
this.baseMapper.insert(collegesDictDO);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Map<String, Object> importColleges(MultipartFile file) {
Map<String, Object> map = new HashMap<>();
if (file == null) {
throw new HttpException(10066);
}
List<CollegesDOT> list = ExcelUtil.readExcel(CollegesDOT.class, file);
int success = 0;
int fail = 0;
List<CollegesDOT> error = new ArrayList<>();
if (list.size() > 0) {
for (CollegesDOT collegesDOT : list) {
CollegesDictDO collegesDictDO = new CollegesDictDO();
BeanUtils.copyProperties(collegesDOT, collegesDictDO);
CollegesDictDO collegesDict = this.baseMapper.selectOne(new QueryWrapper<CollegesDictDO>()
.lambda()
.eq(CollegesDictDO::getAccount, collegesDictDO.getAccount()));
if (collegesDict != null) {
fail++;
collegesDOT.setFailReason("院校账户已存在");
continue;
}
if (collegesDictDO.getName().equals(collegesDict.getName())) {
fail++;
collegesDOT.setFailReason("院校名称重复");
continue;
}
if (collegesDictDO.getCode().equals(collegesDict.getCode())) {
fail++;
collegesDOT.setFailReason("院校代码重复");
continue;
}
if (fail > 0) {
error.add(collegesDOT);
}
collegesDictDO.setAccount("shzc" + collegesDictDO.getCode());
collegesDictDO.setPassword(RandomUtil.randomPass(8));
this.baseMapper.insert(collegesDictDO);
success++;
}
}
map.put("success", success);
map.put("fail", fail);
map.put("errorData", error);
return map;
}
@Override
public void downloadErrorData(DownloadErrorDataDTO downloadErrorDataDTO) {
List<ExcelFieldVO> list = ExcelUtil.getField(CollegesDOT.class);
List<Map> data = new ArrayList<>();
if (downloadErrorDataDTO.getErrorData().size() > 0) {
for (CollegesDOT errorDatum : downloadErrorDataDTO.getErrorData()) {
if (errorDatum != null) {
data.add(JSON.parseObject(JSON.toJSONString(errorDatum), Map.class));
}
}
}
ExcelUtil.writeExcel(list, data);
}
@Override
public IPage getAwardedList(AwardedListDTO awardedListDTO) {
IPage<AwardedListVO> iPage = this.baseMapper.getAwardedList(new Page<>(awardedListDTO.getPageNo(), awardedListDTO.getPageSize()),
awardedListDTO.getName());
for (AwardedListVO record : iPage.getRecords()) {
List<ProjectDO> list = projectService.getList(awardedListDTO.getMatchId(), record.getName(), awardedListDTO.getProjectGroup());
if (list != null && list.size() > 0) {
Integer schoolCompetitionNum = 0;
Integer rematchNum = 0;
Integer finalNum = 0;
Integer winningPrizeNum = 0;
Integer bronzeAwardNum = 0;
Integer silverAwardNum = 0;
Integer goldAwardNum = 0;
for (ProjectDO projectDO : list) {
/**
* 奖项
*/
if (projectDO.getProjectStatus().equals(ProjectStatus.REMATCH_BRONZE_AWARD)) {
bronzeAwardNum++;
} else if (projectDO.getProjectStatus().equals(ProjectStatus.REMATCH_SILVER_AWARD)) {
silverAwardNum++;
} else if (projectDO.getProjectStatus().equals(ProjectStatus.REMATCH_FINALS_GOLD_AWARD)) {
goldAwardNum++;
} else if (projectDO.getProjectStatus().equals(ProjectStatus.REMATCH_WINNING_AWARD)) {
winningPrizeNum++;
}
/**
* 项目进度
*/
if (projectDO.getProjectSchedule().equals(ProjectSchedule.SCHOOL_REVIEW)) {
schoolCompetitionNum++;
} else if (projectDO.getProjectSchedule().equals(ProjectSchedule.SEMI_FINAL_REVIEW)) {
rematchNum++;
} else if (projectDO.getProjectSchedule().equals(ProjectSchedule.FINAL_REVIEW)) {
finalNum++;
}
}
record.setSchoolCompetitionNum(schoolCompetitionNum + rematchNum + finalNum);
record.setRematchNum(rematchNum);
record.setFinalNum(finalNum);
record.setBronzeAwardNum(bronzeAwardNum);
record.setSilverAwardNum(silverAwardNum);
record.setGoldAwardNum(goldAwardNum);
record.setWinningPrizeNum(winningPrizeNum);
//盖章pdf
MatchCollegePdfDO matchCollegePdfDO = matchCollegePdfMapper.selectOne(new QueryWrapper<MatchCollegePdfDO>()
.lambda()
.eq(MatchCollegePdfDO::getMatchId, awardedListDTO.getMatchId())
.eq(MatchCollegePdfDO::getCollegeId, record.getId()));
if (null != matchCollegePdfDO) {
record.setAttachment(matchCollegePdfDO.getAttachment());
record.setFileName(matchCollegePdfDO.getFileName());
}
}
}
return iPage;
}
@Override
public void exportAwardedList(AwardedListDTO awardedListDTO) {
List<Map> data = new ArrayList<>();
List<AwardedListVO> listAll = this.baseMapper.getAwardedListAll();
for (AwardedListVO awardedListVO : listAll) {
List<ProjectDO> list = projectService.getList(awardedListDTO.getMatchId(), awardedListVO.getName(), awardedListDTO.getProjectGroup());
Integer schoolCompetitionNum = 0;
Integer rematchNum = 0;
Integer finalNum = 0;
Integer winningPrizeNum = 0;
Integer bronzeAwardNum = 0;
Integer silverAwardNum = 0;
Integer goldAwardNum = 0;
for (ProjectDO projectDO : list) {
/**
* 奖项
*/
if (projectDO.getProjectStatus().equals(ProjectStatus.REMATCH_BRONZE_AWARD)) {
bronzeAwardNum++;
} else if (projectDO.getProjectStatus().equals(ProjectStatus.REMATCH_SILVER_AWARD)) {
silverAwardNum++;
} else if (projectDO.getProjectStatus().equals(ProjectStatus.REMATCH_FINALS_GOLD_AWARD)) {
goldAwardNum++;
} else if (projectDO.getProjectStatus().equals(ProjectStatus.REMATCH_WINNING_AWARD)) {
winningPrizeNum++;
}
/**
* 项目进度
*/
if (projectDO.getProjectSchedule().equals(ProjectSchedule.SCHOOL_REVIEW)) {
schoolCompetitionNum++;
} else if (projectDO.getProjectSchedule().equals(ProjectSchedule.SEMI_FINAL_REVIEW)) {
rematchNum++;
} else if (projectDO.getProjectSchedule().equals(ProjectSchedule.FINAL_REVIEW)) {
finalNum++;
}
}
awardedListVO.setSchoolCompetitionNum(schoolCompetitionNum + rematchNum + finalNum);
awardedListVO.setRematchNum(rematchNum);
awardedListVO.setFinalNum(finalNum);
awardedListVO.setBronzeAwardNum(bronzeAwardNum);
awardedListVO.setSilverAwardNum(silverAwardNum);
awardedListVO.setGoldAwardNum(goldAwardNum);
awardedListVO.setWinningPrizeNum(winningPrizeNum);
data.add(JSON.parseObject(JSON.toJSONString(awardedListVO), Map.class));
}
ExcelUtil.writeExcel(ExcelUtil.getField(AwardedListVO.class), data);
}
@Override
public void exportCollege() {
List<ExcelFieldVO> field = ExcelUtil.getField(ExportCollegeDTO.class);
List<Map> data = new ArrayList<>();
List<CollegesDictDO> list = this.baseMapper.selectList(new QueryWrapper<>());
if (list != null && list.size() > 0) {
for (CollegesDictDO collegesDictDO : list) {
data.add(JSON.parseObject(JSON.toJSONString(collegesDictDO), Map.class));
}
}
ExcelUtil.writeExcel(field, data);
}
@Override
public void updatePwd(UpdatePwdDTO updatePwdDTO) {
CollegesDictDO collegesDict = (CollegesDictDO) Localstorage.getUser();
if (collegesDict == null) {
throw new HttpException(10060);
}
CollegesDictDO collegesDictDO = new CollegesDictDO();
collegesDictDO.setLoginTime(DateFormatUtil.dateToLocalDateTime(new Date()));
collegesDictDO.setId(collegesDict.getId());
collegesDictDO.setPassword(updatePwdDTO.getPassword());
this.baseMapper.updateById(collegesDictDO);
}
public List<ProjectDO> projects(ProjectDO projectDO) {
CollegesDictDO collegesDict = (CollegesDictDO) Localstorage.getUser();
//除去已经报名了的项目
List<ProjectDO> list = projectDAO.projects(projectDO.getMatchId(), collegesDict.getId(), collegesDict.getName());
return list;
}
public ProjectMemberDO projectLeader(ProjectMemberDO projectMemberDO) {
ProjectMemberDO projectMemberDO1 = projectMemberDAO.selectOne(new QueryWrapper<ProjectMemberDO>()
.lambda()
.eq(ProjectMemberDO::getType, "团队负责人")
.eq(ProjectMemberDO::getProjectId, projectMemberDO.getProjectId()));
ProjectDO projectDO = projectDAO.selectById(projectMemberDO.getProjectId());
StudentDO studentDO = studentDAO.selectById(projectDO.getProposerId());
projectMemberDO1.setIdCard(studentDO.getIdCard());
return projectMemberDO1;
}
public List<ProjectMemberDO> projectMembers(ProjectMemberDO projectMemberDO) {
List<ProjectMemberDO> projectMemberDOS = projectMemberDAO.projectMembers(projectMemberDO.getProjectId());
return projectMemberDOS;
}
public void addProjectMember(AddProjectMemberDTO addProjectMemberDTO) throws Exception {
CollegesDictDO collegesDict = (CollegesDictDO) Localstorage.getUser();
ProjectDO projectDO = projectDAO.selectById(addProjectMemberDTO.getProjectId());
MatchDictDO matchDictDO = matchDictDAO.selectById(addProjectMemberDTO.getMatchId());
if (StringUtils.isEmpty(matchDictDO.getRegistrationDeadline()) || StringUtils.isEmpty(matchDictDO.getRegistrationStart())){
throw new HttpException(10031);
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (new Date().before(simpleDateFormat.parse(matchDictDO.getRegistrationStart())) || new Date().after(simpleDateFormat.parse(matchDictDO.getRegistrationDeadline()))) {
throw new HttpException(10031);
}
List<Long> studentIds = addProjectMemberDTO.getStudentIds();
for (Long studentId : studentIds) {
FinalMatchMemberDO finalMatchMemberDO = new FinalMatchMemberDO();
finalMatchMemberDO.setCollegeId(collegesDict.getId());
finalMatchMemberDO.setMemberId(studentId);
finalMatchMemberDO.setProjectId(addProjectMemberDTO.getProjectId());
StudentDO studentDO = studentDAO.selectById(projectDO.getProposerId());
finalMatchMemberDO.setIdCard(studentDO.getIdCard());
ProjectMemberDO projectMemberDO = projectMemberDAO.selectById(studentId);
finalMatchMemberDO.setIdCard(projectMemberDO.getIdCard());
finalMatchMemberDO.setMatchId(addProjectMemberDTO.getMatchId());
finalMatchMemberDO.setTelephone(projectMemberDO.getTelephone());
finalMatchMemberDO.setUserName(projectMemberDO.getName());
if ("团队负责人".equals(projectMemberDO.getType())) {
finalMatchMemberDO.setMemberType("参赛人员(负责人)");
finalMatchMemberDO.setIdCard(studentDO.getIdCard());
finalMatchMemberDO.setOrderNo(0);
} else {
finalMatchMemberDO.setMemberType("参赛人员");
finalMatchMemberDO.setOrderNo(1);
}
finalMatchMemberDO.setUpdateTime(LocalDateTime.now());
finalMatchMemberDAO.insert(finalMatchMemberDO);
}
}
public void removeProject(AddProjectMemberDTO addProjectMemberDTO) throws Exception {
MatchDictDO matchDictDO = matchDictDAO.selectById(addProjectMemberDTO.getMatchId());
if (StringUtils.isEmpty(matchDictDO.getRegistrationDeadline()) || StringUtils.isEmpty(matchDictDO.getRegistrationStart())){
throw new HttpException(10031);
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (new Date().before(simpleDateFormat.parse(matchDictDO.getRegistrationStart())) || new Date().after(simpleDateFormat.parse(matchDictDO.getRegistrationDeadline()))) {
throw new HttpException(10031);
}
finalMatchMemberDAO.delete(new QueryWrapper<FinalMatchMemberDO>()
.lambda()
.eq(FinalMatchMemberDO::getProjectId, addProjectMemberDTO.getProjectId()));
}
public void addObservations(FinalMatchMemberDO finalMatchMemberDO) throws Exception {
CollegesDictDO collegesDict = (CollegesDictDO) Localstorage.getUser();
MatchDictDO matchDictDO = matchDictDAO.selectById(finalMatchMemberDO.getMatchId());
if (null == matchDictDO.getRegistrationDeadline() || null == matchDictDO.getRegistrationStart()){
throw new HttpException(10031);
}
if (null != matchDictDO.getRegistrationDeadline()) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (new Date().before(simpleDateFormat.parse(matchDictDO.getRegistrationStart())) || new Date().after(simpleDateFormat.parse(matchDictDO.getRegistrationDeadline()))) {
throw new HttpException(10031);
}
}
if ("观摩人员".equals(finalMatchMemberDO.getMemberType())) {
//当前有几个观摩人员
int count = finalMatchMemberDAO.selectCount(new QueryWrapper<FinalMatchMemberDO>()
.lambda()
.eq(FinalMatchMemberDO::getCollegeId, collegesDict.getId())
.eq(FinalMatchMemberDO::getMemberType, "观摩人员"));
if (count >=2) {
throw new HttpException(10029);
}
finalMatchMemberDO.setOrderNo(4);
finalMatchMemberDO.setCollegeId(collegesDict.getId());
finalMatchMemberDO.setUpdateTime(LocalDateTime.now());
finalMatchMemberDAO.insert(finalMatchMemberDO);
}
if ("学校领队".equals(finalMatchMemberDO.getMemberType())) {
//当前有几个学校领队
int count = finalMatchMemberDAO.selectCount(new QueryWrapper<FinalMatchMemberDO>()
.lambda()
.eq(FinalMatchMemberDO::getCollegeId, collegesDict.getId())
.eq(FinalMatchMemberDO::getMemberType, "学校领队"));
if (count > 0) {
throw new HttpException(10019);
}
finalMatchMemberDO.setCollegeId(collegesDict.getId());
finalMatchMemberDO.setOrderNo(3);
finalMatchMemberDO.setUpdateTime(LocalDateTime.now());
finalMatchMemberDAO.insert(finalMatchMemberDO);
}
if ("车".equals(finalMatchMemberDO.getMemberType())){
finalMatchMemberDO.setCollegeId(collegesDict.getId());
finalMatchMemberDO.setOrderNo(5);
finalMatchMemberDO.setUpdateTime(LocalDateTime.now());
finalMatchMemberDAO.insert(finalMatchMemberDO);
}
}
public void updateObservations(FinalMatchMemberDO finalMatchMemberDO) throws Exception {
MatchDictDO matchDictDO = matchDictDAO.selectById(finalMatchMemberDO.getMatchId());
if (StringUtils.isEmpty(matchDictDO.getRegistrationDeadline()) || StringUtils.isEmpty(matchDictDO.getRegistrationStart())){
throw new HttpException(10031);
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (new Date().before(simpleDateFormat.parse(matchDictDO.getRegistrationStart())) || new Date().after(simpleDateFormat.parse(matchDictDO.getRegistrationDeadline()))) {
throw new HttpException(10031);
}
finalMatchMemberDAO.updateById(finalMatchMemberDO);
}
public void deleteObservations(FinalMatchMemberDO finalMatchMemberDO) throws Exception {
MatchDictDO matchDictDO = matchDictDAO.selectById(finalMatchMemberDO.getMatchId());
if (StringUtils.isEmpty(matchDictDO.getRegistrationDeadline()) || StringUtils.isEmpty(matchDictDO.getRegistrationStart())){
throw new HttpException(10031);
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if (new Date().before(simpleDateFormat.parse(matchDictDO.getRegistrationStart()))||new Date().after(simpleDateFormat.parse(matchDictDO.getRegistrationDeadline()))) {
throw new HttpException(10031);
}
finalMatchMemberDAO.deleteById(finalMatchMemberDO.getId());
}
public List<RegisterMembersVO> registerMembers(RegisterMembersDTO registerMembersDTO) {
CollegesDictDO collegesDict = collegesDictDAO.selectById(registerMembersDTO.getCollegeId());
return finalMatchMemberDAO.registerMembers(collegesDict.getId(),registerMembersDTO.getMatchId());
}
public List<RegisterMembersVO> otherMembers(RegisterMembersDTO registerMembersDTO) {
CollegesDictDO collegesDict = collegesDictDAO.selectById(registerMembersDTO.getCollegeId());
return finalMatchMemberDAO.otherMembers(collegesDict.getId(),registerMembersDTO.getMatchId());
}
public List<RegisterMembersVO> cars(RegisterMembersDTO registerMembersDTO){
CollegesDictDO collegesDict = collegesDictDAO.selectById(registerMembersDTO.getCollegeId());
return finalMatchMemberDAO.cars(collegesDict.getId(),registerMembersDTO.getMatchId());
}
public DetailVO detail(RegisterMembersDTO registerMembersDTO) {
CollegesDictDO collegesDict = collegesDictDAO.selectById(registerMembersDTO.getId());
DetailVO detailVO = new DetailVO();
MatchDictDO matchDictDO = matchDictDAO.selectById(registerMembersDTO.getMatchId());
detailVO.setRegistrationDeadline(matchDictDO.getRegistrationDeadline());
//最近一次更新时间
String latestUpdateTime = finalMatchMemberDAO.latestUpdateTime(collegesDict.getId());
detailVO.setLatestUpdateTime(latestUpdateTime);
return detailVO;
}
public List<SchoolsVO> schools(RegisterMembersDTO registerMembersDTO) {
return finalMatchMemberDAO.schools(registerMembersDTO.getMatchId(), registerMembersDTO.getName());
}
public void exportList(FinalMatchMemberDO finalMatchMemberDO){
MatchDictDO matchDictDO1 = matchDictDAO.selectById(finalMatchMemberDO.getId());
//导出所有名单
List<ExportListVO> exportListVOS = finalMatchMemberDAO.exportList(matchDictDO1.getId(),finalMatchMemberDO.getCollegeId());
List<ExcelFieldVO> field = ExcelUtil.getField(ExportListVO.class);
List<Map> data = new ArrayList<>();
if (exportListVOS != null && exportListVOS.size() > 0) {
for (ExportListVO exportListVO : exportListVOS) {
data.add(JSON.parseObject(JSON.toJSONString(exportListVO), Map.class));
}
}
ExcelUtil.writeExcel(field, data);
}
@Override
public void addContact(CollegesDictDO collegesDictDO) {
CollegesDictDO collegesDict = (CollegesDictDO) Localstorage.getUser();
if (collegesDict == null) {
throw new HttpException(10060);
}
collegesDictDO.setId(collegesDict.getId());
this.baseMapper.updateById(collegesDictDO);
}
@Override
public void updateAllLoginStatus(LoginStatusDTO loginStatusDTO) {
List<CollegesDictDO> list = this.baseMapper.selectList(new QueryWrapper());
if (list != null && list.size() > 0) {
for (CollegesDictDO collegesDictDO : list) {
CollegesDictDO collegesDict = new CollegesDictDO();
collegesDict.setId(collegesDictDO.getId());
collegesDict.setLoginStatus(loginStatusDTO.getLoginStatus());
this.baseMapper.updateById(collegesDict);
}
}
}
@Override
public void batchUpdateLoginStatus(LoginStatusDTO loginStatusDTO) {
if (loginStatusDTO.getIds().length > 0) {
for (Long id : loginStatusDTO.getIds()) {
CollegesDictDO collegesDict = new CollegesDictDO();
collegesDict.setId(id);
collegesDict.setLoginStatus(loginStatusDTO.getLoginStatus());
this.baseMapper.updateById(collegesDict);
}
}
}
@Override
public void updateLoginStatus(LoginStatusDTO loginStatusDTO) {
CollegesDictDO collegesDict = new CollegesDictDO();
collegesDict.setId(loginStatusDTO.getId());
collegesDict.setLoginStatus(loginStatusDTO.getLoginStatus());
this.baseMapper.updateById(collegesDict);
}
}
package com.zhongzhi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.dao.YearDictDAO;
import com.zhongzhi.dto.course.CoursesDTO;
import com.zhongzhi.dao.VodDictDAO;
import com.zhongzhi.model.CourseDictDO;
import com.zhongzhi.dao.CourseDictDAO;
import com.zhongzhi.model.VodDictDO;
import com.zhongzhi.model.YearDictDO;
import com.zhongzhi.service.CourseDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.vo.course.CourseVodsVO;
import com.zhongzhi.vo.course.CoursesVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author DengMin
* @since 2022-11-14
*/
@Service
public class CourseDictServiceImpl extends ServiceImpl<CourseDictDAO, CourseDictDO> implements CourseDictService {
@Autowired
private VodDictDAO vodDictMapper;
@Autowired
private YearDictDAO yearDictDAO;
public void addCourse(CourseDictDO courseDictDO) {
this.baseMapper.insert(courseDictDO);
}
public void updateCourse(CourseDictDO courseDictDO) {
this.updateById(courseDictDO);
}
public IPage<CoursesVO> courses(CoursesDTO coursesDTO) {
Page page = new Page(coursesDTO.getPageNo(), coursesDTO.getPageSize());
return this.baseMapper.courses(page, coursesDTO.getCourseName(),coursesDTO.getYearId());
}
public void deleteCourse(CourseDictDO courseDictDO) {
this.baseMapper.deleteById(courseDictDO.getId());
//删除视频
vodDictMapper.delete(new QueryWrapper<VodDictDO>()
.lambda()
.eq(VodDictDO::getCourseId, courseDictDO.getId()));
}
public List<CourseVodsVO> courseVods(CourseDictDO courseDictDO) {
List<CourseVodsVO> courseVodsVOS = new ArrayList<>();
YearDictDO yearDictDO = yearDictDAO.selectById(courseDictDO.getYearId());
if ("1".equals(yearDictDO.getStatus())){
List<CourseDictDO> courseDictDOS = this.baseMapper.selectList(new QueryWrapper<CourseDictDO>()
.lambda()
.eq(CourseDictDO::getYearId,courseDictDO.getYearId()));
for (CourseDictDO cdd : courseDictDOS) {
CourseVodsVO courseVodsVO = new CourseVodsVO();
BeanUtils.copyProperties(cdd, courseVodsVO);
List<VodDictDO> vodDictDOS = vodDictMapper.selectList(new QueryWrapper<VodDictDO>()
.lambda()
.eq(VodDictDO::getCourseId,cdd.getId())
.orderByAsc(VodDictDO::getOrderNo));
courseVodsVO.setVodDictDOS(vodDictDOS);
courseVodsVOS.add(courseVodsVO);
}
}
return courseVodsVOS;
}
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.FinalMatchMemberDO;
import com.zhongzhi.dao.FinalMatchMemberDAO;
import com.zhongzhi.service.FinalMatchMemberService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author DengMin
* @since 2024-07-12
*/
@Service
public class FinalMatchMemberServiceImpl extends ServiceImpl<FinalMatchMemberDAO, FinalMatchMemberDO> implements FinalMatchMemberService {
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.FundDictDO;
import com.zhongzhi.dao.FundDictDAO;
import com.zhongzhi.service.FundDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 届数表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Service
public class FundDictServiceImpl extends ServiceImpl<FundDictDAO, FundDictDO> implements FundDictService {
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.ItemFieldDictDO;
import com.zhongzhi.dao.ItemFieldDictDAO;
import com.zhongzhi.service.ItemFieldDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 行业领域字典表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Service
public class ItemFieldDictServiceImpl extends ServiceImpl<ItemFieldDictDAO, ItemFieldDictDO> implements ItemFieldDictService {
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.MajorDictDO;
import com.zhongzhi.dao.MajorDictDAO;
import com.zhongzhi.service.MajorDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 专业字典表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Service
public class MajorDictServiceImpl extends ServiceImpl<MajorDictDAO, MajorDictDO> implements MajorDictService {
}
package com.zhongzhi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.common.exception.HttpException;
import com.zhongzhi.common.utils.Localstorage;
import com.zhongzhi.dao.MatchCollegePdfMapper;
import com.zhongzhi.dao.MatchDictDAO;
import com.zhongzhi.model.CollegesDictDO;
import com.zhongzhi.model.MatchCollegePdfDO;
import com.zhongzhi.model.MatchDictDO;
import com.zhongzhi.service.MatchCollegePdfService;
import com.zhongzhi.vo.project.QueryPdfStatusVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* <p>
* 服务实现类
* </p>
*
* @author DengMin
* @since 2024-06-25
*/
@Service
public class MatchCollegePdfServiceImpl extends ServiceImpl<MatchCollegePdfMapper, MatchCollegePdfDO> implements MatchCollegePdfService {
@Autowired
private MatchDictDAO matchDictDAO;
public void uploadPdf(MatchCollegePdfDO matchCollegePdfDO) {
MatchDictDO matchDictDO = matchDictDAO.selectById(matchCollegePdfDO.getMatchId());
//时间范围 当前时间在范围内
if (null != matchDictDO.getStartTime() && null != matchDictDO.getEndTime() && (matchDictDO.getStartTime().after(new Date()) || matchDictDO.getEndTime().before(new Date(new Date().getTime() - 24 * 60 * 60 * 1000)))) {
throw new HttpException(10018);
}
CollegesDictDO collegesDictDO = (CollegesDictDO) Localstorage.getUser();
this.baseMapper.delete(new QueryWrapper<MatchCollegePdfDO>()
.lambda()
.eq(MatchCollegePdfDO::getMatchId, matchCollegePdfDO.getMatchId())
.eq(MatchCollegePdfDO::getCollegeId, collegesDictDO.getId()));
matchCollegePdfDO.setCollegeId(collegesDictDO.getId());
this.baseMapper.insert(matchCollegePdfDO);
}
public void dropPdf(MatchCollegePdfDO matchCollegePdfDO) {
MatchDictDO matchDictDO = matchDictDAO.selectById(matchCollegePdfDO.getMatchId());
if (null != matchDictDO.getStartTime() && null != matchDictDO.getEndTime() && (matchDictDO.getStartTime().after(new Date()) || matchDictDO.getEndTime().before(new Date(new Date().getTime() - 24 * 60 * 60 * 1000)))) {
throw new HttpException(10018);
}
CollegesDictDO collegesDictDO = (CollegesDictDO) Localstorage.getUser();
this.baseMapper.delete(new QueryWrapper<MatchCollegePdfDO>()
.lambda()
.eq(MatchCollegePdfDO::getCollegeId, collegesDictDO.getId())
.eq(MatchCollegePdfDO::getMatchId, matchCollegePdfDO.getMatchId()));
}
public MatchCollegePdfDO queryPdfStatus(MatchCollegePdfDO matchCollegePdfDO) {
CollegesDictDO collegesDictDO = (CollegesDictDO) Localstorage.getUser();
matchCollegePdfDO = this.baseMapper.selectOne(new QueryWrapper<MatchCollegePdfDO>()
.lambda()
.eq(MatchCollegePdfDO::getCollegeId, collegesDictDO.getId())
.eq(MatchCollegePdfDO::getMatchId, matchCollegePdfDO.getMatchId()));
return matchCollegePdfDO;
}
}
package com.zhongzhi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.common.constant.ProjectType;
import com.zhongzhi.common.utils.DateFormatUtil;
import com.zhongzhi.dto.match.MatchDictDTO;
import com.zhongzhi.dto.match.SelectListPageDTO;
import com.zhongzhi.model.MatchDictDO;
import com.zhongzhi.dao.MatchDictDAO;
import com.zhongzhi.model.MatchScheduleDO;
import com.zhongzhi.service.MatchDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.service.MatchScheduleService;
import com.zhongzhi.vo.match.MatchDictVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
* 赛事年份管理 服务实现类
* </p>
*
* @author DengMin
* @since 2021-05-17
*/
@Service
public class MatchDictServiceImpl extends ServiceImpl<MatchDictDAO, MatchDictDO> implements MatchDictService {
@Autowired
private MatchScheduleService matchScheduleService;
@Override
public MatchDictDO getMainTrackMatch() {
return this.baseMapper.selectOne(new QueryWrapper<MatchDictDO>()
.lambda()
.eq(MatchDictDO::getMatchType, ProjectType.MAIN_TRACK)
.eq(MatchDictDO::getStatus, 1));
}
@Override
public MatchDictDO getSeedTrackMatch() {
return this.baseMapper.selectOne(new QueryWrapper<MatchDictDO>()
.lambda()
.eq(MatchDictDO::getMatchType, ProjectType.SEED_TRACK)
.eq(MatchDictDO::getStatus, 1));
}
@Override
public void updateMatch(MatchDictDTO matchDictDTO) {
MatchDictDO matchDict = this.baseMapper.selectById(matchDictDTO.getId());
MatchDictDO match = this.baseMapper.selectOne(new QueryWrapper<MatchDictDO>()
.lambda()
.eq(MatchDictDO::getMatchType, matchDict.getMatchType())
.eq(MatchDictDO::getStatus, 1));
if (matchDictDTO.getStatus() != null) {
if (match != null && !match.getId().equals(matchDictDTO.getId())) {
match.setStatus(0);
this.baseMapper.updateById(match);
}
}
MatchDictDO matchDictDO = new MatchDictDO();
BeanUtils.copyProperties(matchDictDTO, matchDictDO);
this.baseMapper.updateById(matchDictDO);
if (matchDictDTO.getSchedule() != null && matchDictDTO.getSchedule().size() > 0) {
List<MatchScheduleDO> list = matchScheduleService.list(new QueryWrapper<MatchScheduleDO>()
.lambda()
.eq(MatchScheduleDO::getMatchId, matchDictDTO.getId()));
if (list.size() > 0) {
for (MatchScheduleDO matchScheduleDO : list) {
if (matchDictDTO.getSchedule().stream().filter(ms -> ms.getScheduleTime().equals(matchScheduleDO.getScheduleTime()) &&
ms.getExplains().equals(matchScheduleDO.getExplains())).findAny().isPresent()) {
continue;
} else {
matchScheduleService.removeById(matchScheduleDO.getId());
}
}
}
for (MatchScheduleDO matchScheduleDO : matchDictDTO.getSchedule()) {
if (list.stream().filter(ms -> ms.getExplains().equals(matchScheduleDO.getExplains()) &&
DateFormatUtil.format(ms.getScheduleTime(), DateFormatUtil.FMT_sdf_yMd).equals(DateFormatUtil.format(matchScheduleDO.getScheduleTime(), DateFormatUtil.FMT_sdf_yMd))).findAny().isPresent()) {
MatchScheduleDO matchSchedule = matchScheduleService.getOne(new QueryWrapper<MatchScheduleDO>()
.lambda()
.eq(MatchScheduleDO::getMatchId, matchScheduleDO.getMatchId())
.eq(MatchScheduleDO::getExplains, matchScheduleDO.getExplains())
.eq(MatchScheduleDO::getScheduleTime, DateFormatUtil.format(matchScheduleDO.getScheduleTime(), DateFormatUtil.FMT_sdf_yMd)));
if (matchSchedule != null) {
matchScheduleDO.setId(matchSchedule.getId());
matchScheduleService.updateById(matchScheduleDO);
}
} else {
matchScheduleDO.setMatchId(matchDictDTO.getId());
matchScheduleService.save(matchScheduleDO);
}
}
}
}
@Override
public IPage<MatchDictVO> getSeedTrackMatchPage(SelectListPageDTO selectListPageDTO) {
Page page = new Page(selectListPageDTO.getPageNo(), selectListPageDTO.getPageSize());
IPage<MatchDictVO> iPage = this.baseMapper.getSeedTrackMatchPage(page, ProjectType.SEED_TRACK);
for (MatchDictVO record : iPage.getRecords()) {
List<MatchScheduleDO> list = matchScheduleService.list(new QueryWrapper<MatchScheduleDO>()
.lambda()
.eq(MatchScheduleDO::getMatchId, record.getId()));
record.setSchedule(list);
}
return iPage;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void createMatch(MatchDictDTO matchDictDTO) {
MatchDictDO matchDictDO = new MatchDictDO();
BeanUtils.copyProperties(matchDictDTO, matchDictDO);
this.baseMapper.insert(matchDictDO);
if (matchDictDTO.getSchedule().size() > 0) {
for (MatchScheduleDO matchScheduleDO : matchDictDTO.getSchedule()) {
MatchScheduleDO matchSchedule = new MatchScheduleDO();
BeanUtils.copyProperties(matchScheduleDO, matchSchedule);
matchSchedule.setMatchId(matchDictDO.getId());
matchScheduleService.save(matchSchedule);
}
}
}
@Override
public List<MatchDictDO> getMatch() {
return this.baseMapper.selectList(new QueryWrapper<MatchDictDO>()
.lambda()
.eq(MatchDictDO::getStatus, 1));
}
@Override
public MatchDictDO getVocationalMatch() {
return this.baseMapper.selectOne(new QueryWrapper<MatchDictDO>()
.lambda()
.eq(MatchDictDO::getStatus, 1)
.eq(MatchDictDO::getMatchType, ProjectType.VOCATIONAL));
}
public void updateMatchDate(MatchDictDO matchDictDO) {
this.baseMapper.updateById(matchDictDO);
}
public MatchDictDO getMatch(MatchDictDO matchDictDO) {
return this.baseMapper.selectById(matchDictDO.getId());
}
@Override
public List<MatchDictDO> getList(String projectType, String projectGroup) {
return this.baseMapper.getList(projectType, projectGroup);
}
@Override
public IPage getVocationalPage(SelectListPageDTO selectListPageDTO) {
Page page = new Page(selectListPageDTO.getPageNo(), selectListPageDTO.getPageSize());
IPage<MatchDictVO> iPage = this.baseMapper.getSeedTrackMatchPage(page, ProjectType.VOCATIONAL);
for (MatchDictVO record : iPage.getRecords()) {
List<MatchScheduleDO> list = matchScheduleService.list(new QueryWrapper<MatchScheduleDO>()
.lambda()
.eq(MatchScheduleDO::getMatchId, record.getId()));
record.setSchedule(list);
}
return iPage;
}
}
\ No newline at end of file
package com.zhongzhi.service.impl;
import com.zhongzhi.model.MatchScheduleDO;
import com.zhongzhi.dao.MatchScheduleDAO;
import com.zhongzhi.service.MatchScheduleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 时间安排 服务实现类
* </p>
*
* @author DengMin
* @since 2021-05-27
*/
@Service
public class MatchScheduleServiceImpl extends ServiceImpl<MatchScheduleDAO, MatchScheduleDO> implements MatchScheduleService {
}
package com.zhongzhi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.common.constant.Code;
import com.zhongzhi.common.exception.HttpException;
import com.zhongzhi.common.utils.Localstorage;
import com.zhongzhi.dto.message.MessagePageDTO;
import com.zhongzhi.model.AdministerDO;
import com.zhongzhi.model.MessageDO;
import com.zhongzhi.dao.MessageDAO;
import com.zhongzhi.service.AdministerService;
import com.zhongzhi.service.MessageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 通知消息表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-05-17
*/
@Service
public class MessageServiceImpl extends ServiceImpl<MessageDAO, MessageDO> implements MessageService {
@Override
public void createMessage(MessageDO messageDO) {
AdministerDO administerDO = (AdministerDO) Localstorage.getUser();
if (administerDO == null) {
throw new HttpException(Code.TOKEN_EXPIRED.getCode(), Code.TOKEN_EXPIRED.getMessage());
}
messageDO.setUsername(administerDO.getUsername());
this.baseMapper.insert(messageDO);
}
@Override
public IPage<MessageDO> getMessagePage(MessagePageDTO messagePageDTO) {
IPage<MessageDO> iPage = this.baseMapper.selectPage(new Page(messagePageDTO.getPageNo(), messagePageDTO.getPageSize()),
new QueryWrapper<MessageDO>()
.lambda()
.orderByDesc(MessageDO::getCreateTime));
return iPage;
}
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.PermissionsDO;
import com.zhongzhi.dao.PermissionsDAO;
import com.zhongzhi.service.PermissionsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.vo.permission.PermissionVO;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 权限表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Service
public class PermissionsServiceImpl extends ServiceImpl<PermissionsDAO, PermissionsDO> implements PermissionsService {
@Override
public List<PermissionVO> getPermissionById(Long id) {
return this.baseMapper.getPermissionById(id);
}
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.ProjectAwardDO;
import com.zhongzhi.dao.ProjectAwardMapper;
import com.zhongzhi.service.ProjectAwardService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 项目奖项 服务实现类
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Service
public class ProjectAwardServiceImpl extends ServiceImpl<ProjectAwardMapper, ProjectAwardDO> implements ProjectAwardService {
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.ProjectCopyrightDO;
import com.zhongzhi.dao.ProjectCopyrightMapper;
import com.zhongzhi.service.ProjectCopyrightService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 项目软件著作权 服务实现类
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Service
public class ProjectCopyrightServiceImpl extends ServiceImpl<ProjectCopyrightMapper, ProjectCopyrightDO> implements ProjectCopyrightService {
}
package com.zhongzhi.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.common.constant.SmsCode;
import com.zhongzhi.common.exception.HttpException;
import com.zhongzhi.common.utils.ExcelUtil;
import com.zhongzhi.common.utils.JwtUtil;
import com.zhongzhi.dto.administer.LoginDTO;
import com.zhongzhi.dto.judge.ProjectJudgePageDTO;
import com.zhongzhi.dto.projectJudge.ImportJudge;
import com.zhongzhi.model.ProjectJudgeDO;
import com.zhongzhi.dao.ProjectJudgeDAO;
import com.zhongzhi.model.ProjectReviewDO;
import com.zhongzhi.model.SmsCodeDO;
import com.zhongzhi.service.ProjectJudgeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.service.ProjectReviewService;
import com.zhongzhi.service.SmsCodeService;
import com.zhongzhi.vo.ExcelFieldVO;
import com.zhongzhi.vo.judge.JudgeInfoVO;
import com.zhongzhi.vo.judge.ProjectJudgePageVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* <p>
* 项目评审员 服务实现类
* </p>
*
* @author DengMin
* @since 2021-05-28
*/
@Service
public class ProjectJudgeServiceImpl extends ServiceImpl<ProjectJudgeDAO, ProjectJudgeDO> implements ProjectJudgeService {
@Autowired
private ProjectReviewService projectReviewService;
@Autowired
private SmsCodeService smsCodeService;
@Override
public IPage<ProjectJudgePageVO> getProjectJudgePage(ProjectJudgePageDTO projectJudgePageDTO) {
IPage<ProjectJudgePageVO> iPage = this.baseMapper.getProjectJudgePage(new Page(projectJudgePageDTO.getPageNo(), projectJudgePageDTO.getPageSize()), projectJudgePageDTO.getUsername(), projectJudgePageDTO.getStatus());
for (ProjectJudgePageVO record : iPage.getRecords()) {
Integer count = projectReviewService.count(new QueryWrapper<ProjectReviewDO>()
.lambda()
.eq(ProjectReviewDO::getJudgeId, record.getId()));
record.setAssignedQuantity(count);
}
return iPage;
}
@Override
public void createProjectJudge(ProjectJudgeDO projectJudgeDO) {
ProjectJudgeDO projectJudge = this.baseMapper.selectOne(new QueryWrapper<ProjectJudgeDO>()
.lambda()
.eq(ProjectJudgeDO::getTelephone, projectJudgeDO.getTelephone()));
if (projectJudge != null) {
throw new HttpException(10020);
}
this.baseMapper.insert(projectJudgeDO);
}
@Override
public void updateProjectJudge(ProjectJudgeDO projectJudgeDO) {
ProjectJudgeDO projectJudge = this.baseMapper.selectById(projectJudgeDO.getId());
if (projectJudge != null) {
if (projectJudge.getTelephone().equals(projectJudgeDO.getTelephone())) {
this.baseMapper.updateById(projectJudgeDO);
} else {
ProjectJudgeDO p = this.baseMapper.selectOne(new QueryWrapper<ProjectJudgeDO>()
.lambda()
.eq(ProjectJudgeDO::getTelephone, projectJudgeDO.getTelephone()));
if (p != null) {
throw new HttpException(10020);
} else {
this.baseMapper.updateById(projectJudgeDO);
}
}
}
}
@Override
public JudgeInfoVO login(LoginDTO loginDTO) {
JudgeInfoVO judgeInfoVO = new JudgeInfoVO();
ProjectJudgeDO projectJudgeDO = this.baseMapper.selectOne(new QueryWrapper<ProjectJudgeDO>()
.lambda()
.eq(ProjectJudgeDO::getTelephone, loginDTO.getTelephone()));
if (null != projectJudgeDO){
if (null != projectJudgeDO.getPasswordFree() && projectJudgeDO.getPasswordFree() != 1){
SmsCodeDO smsCodeDO = smsCodeService.getOneByTelePhone(loginDTO.getTelephone(), SmsCode.login, SmsCode.review);
if (smsCodeDO == null) {
throw new HttpException(10025);
}
if (!smsCodeDO.getCode().equals(loginDTO.getCode())) {
throw new HttpException(10021);
}
smsCodeService.removeById(smsCodeDO.getId());
if (projectJudgeDO == null) {
throw new HttpException(10024);
}
if (projectJudgeDO.getStatus() == 0) {
throw new HttpException(10024);
}
}
}
String token = JwtUtil.generateToken(projectJudgeDO.getId(), SmsCode.review);
judgeInfoVO.setTelephone(projectJudgeDO.getTelephone());
judgeInfoVO.setPosition(projectJudgeDO.getPosition());
judgeInfoVO.setUnit(projectJudgeDO.getUnit());
judgeInfoVO.setUsername(projectJudgeDO.getUsername());
judgeInfoVO.setToken(token);
return judgeInfoVO;
}
@Override
public IPage<ProjectJudgePageVO> projectJudgesAssigned(ProjectJudgePageDTO projectJudgePageDTO) {
IPage<ProjectJudgePageVO> iPage = this.baseMapper.projectJudgesAssigned(new Page(projectJudgePageDTO.getPageNo(), projectJudgePageDTO.getPageSize()),
projectJudgePageDTO.getMatchId(), projectJudgePageDTO.getProjectGroup(), projectJudgePageDTO.getProjectSchedule());
if (iPage.getRecords() != null && iPage.getRecords().size() > 0) {
for (ProjectJudgePageVO record : iPage.getRecords()) {
Integer count = projectReviewService.selectCount(record.getId(), projectJudgePageDTO.getMatchId());
record.setAssignedQuantity(count);
Integer notReviewNum = projectReviewService.selectNotReviewCount(record.getId(), projectJudgePageDTO.getMatchId());
record.setNotReviewedNum(notReviewNum);
}
}
return iPage;
}
@Override
public void importJudge(MultipartFile file) {
List<ImportJudge> list = ExcelUtil.readExcel(ImportJudge.class, file);
if (list != null) {
for (ImportJudge importJudge : list) {
ProjectJudgeDO projectJudgeDO = new ProjectJudgeDO();
BeanUtils.copyProperties(importJudge, projectJudgeDO);
this.baseMapper.insert(projectJudgeDO);
}
}
}
@Override
public void downloadTemplate() {
List<ExcelFieldVO> list = ExcelUtil.getField(ImportJudge.class);
ExcelUtil.writeExcel(list, new ArrayList<>());
}
@Override
public void exportProjectJudge() {
List<ExcelFieldVO> field = ExcelUtil.getField(ImportJudge.class);
List<ProjectJudgeDO> list = this.baseMapper.selectList(new QueryWrapper<>());
List<Map> data = new ArrayList<>();
if (list != null && list.size() > 0) {
for (ProjectJudgeDO projectJudgeDO : list) {
data.add(JSON.parseObject(JSON.toJSONString(projectJudgeDO), Map.class));
}
}
ExcelUtil.writeExcel(field, data);
}
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.ProjectMaterialsDO;
import com.zhongzhi.dao.ProjectMaterialsDAO;
import com.zhongzhi.service.ProjectMaterialsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 项目材料 服务实现类
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@Service
public class ProjectMaterialsServiceImpl extends ServiceImpl<ProjectMaterialsDAO, ProjectMaterialsDO> implements ProjectMaterialsService {
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.ProjectMemberDO;
import com.zhongzhi.dao.ProjectMemberDAO;
import com.zhongzhi.service.ProjectMemberService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 项目团队信息表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@Service
public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberDAO, ProjectMemberDO> implements ProjectMemberService {
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.ProjectOwnershipStructureDO;
import com.zhongzhi.dao.ProjectOwnershipStructureDAO;
import com.zhongzhi.service.ProjectOwnershipStructureService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 股权结构表 服务实现类
* </p>
*
* @author DengMin
* @since 2021-05-11
*/
@Service
public class ProjectOwnershipStructureServiceImpl extends ServiceImpl<ProjectOwnershipStructureDAO, ProjectOwnershipStructureDO> implements ProjectOwnershipStructureService {
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.ProjectPaperDO;
import com.zhongzhi.dao.ProjectPaperMapper;
import com.zhongzhi.service.ProjectPaperService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 项目论文 服务实现类
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Service
public class ProjectPaperServiceImpl extends ServiceImpl<ProjectPaperMapper, ProjectPaperDO> implements ProjectPaperService {
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.ProjectPatentDO;
import com.zhongzhi.dao.ProjectPatentMapper;
import com.zhongzhi.service.ProjectPatentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 项目专利 服务实现类
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Service
public class ProjectPatentServiceImpl extends ServiceImpl<ProjectPatentMapper, ProjectPatentDO> implements ProjectPatentService {
}
package com.zhongzhi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhongzhi.common.utils.DateFormatUtil;
import com.zhongzhi.dto.period.ProjectReviewPeriodDTO;
import com.zhongzhi.model.ProjectReviewPeriodDO;
import com.zhongzhi.dao.ProjectReviewPeriodMapper;
import com.zhongzhi.service.ProjectReviewPeriodService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.vo.projectReviewPeriod.ProjectReviewPeriodVO;
import org.springframework.stereotype.Service;
/**
* <p>
* 评审时段 服务实现类
* </p>
*
* @author DengMin
* @since 2021-06-10
*/
@Service
public class ProjectReviewPeriodServiceImpl extends ServiceImpl<ProjectReviewPeriodMapper, ProjectReviewPeriodDO> implements ProjectReviewPeriodService {
@Override
public ProjectReviewPeriodVO getProjectReviewPeriod(ProjectReviewPeriodDTO projectReviewPeriodDTO) {
ProjectReviewPeriodVO projectReviewPeriodVO = new ProjectReviewPeriodVO();
ProjectReviewPeriodDO projectReviewPeriodDO = this.baseMapper.selectOne(new QueryWrapper<ProjectReviewPeriodDO>()
.lambda()
.eq(ProjectReviewPeriodDO::getMatchId, projectReviewPeriodDTO.getMatchId())
.eq(ProjectReviewPeriodDO::getProjectGroup, projectReviewPeriodDTO.getProjectGroup())
.eq(ProjectReviewPeriodDO::getProjectSchedule, projectReviewPeriodDTO.getProjectSchedule()));
if (projectReviewPeriodDO != null) {
projectReviewPeriodVO.setId(projectReviewPeriodDO.getId());
projectReviewPeriodVO.setStartTime(DateFormatUtil.format(projectReviewPeriodDO.getStartTime(), DateFormatUtil.FMT_sdf14_L));
projectReviewPeriodVO.setEndTime(DateFormatUtil.format(projectReviewPeriodDO.getEndTime(), DateFormatUtil.FMT_sdf14_L));
}
return projectReviewPeriodVO;
}
@Override
public void updateProjectReviewPeriod(ProjectReviewPeriodDO projectReviewPeriodDO) {
ProjectReviewPeriodDO projectReviewPeriod = this.baseMapper.selectOne(new QueryWrapper<ProjectReviewPeriodDO>()
.lambda()
.eq(ProjectReviewPeriodDO::getMatchId, projectReviewPeriodDO.getMatchId())
.eq(ProjectReviewPeriodDO::getProjectSchedule, projectReviewPeriodDO.getProjectSchedule())
.eq(ProjectReviewPeriodDO::getProjectGroup, projectReviewPeriodDO.getProjectGroup()));
if (projectReviewPeriod != null) {
projectReviewPeriodDO.setId(projectReviewPeriod.getId());
this.baseMapper.updateById(projectReviewPeriodDO);
} else {
this.baseMapper.insert(projectReviewPeriodDO);
}
}
}
package com.zhongzhi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhongzhi.common.constant.ProjectReview;
import com.zhongzhi.common.constant.ProjectType;
import com.zhongzhi.common.constant.SMSTemplate;
import com.zhongzhi.common.exception.HttpException;
import com.zhongzhi.common.utils.AliyunSmsUtil;
import com.zhongzhi.common.utils.DateFormatUtil;
import com.zhongzhi.dao.ProjectDAO;
import com.zhongzhi.dto.review.CancelReviewDTO;
import com.zhongzhi.dto.review.ProjectReviewDTO;
import com.zhongzhi.dto.review.SetReviewDTO;
import com.zhongzhi.model.*;
import com.zhongzhi.dao.ProjectReviewDAO;
import com.zhongzhi.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.vo.judge.ProjectReviewVO;
import com.zhongzhi.vo.review.SendNoticeVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* <p>
* 项目评审 服务实现类
* </p>
*
* @author DengMin
* @since 2021-05-18
*/
@Service
public class ProjectReviewServiceImpl extends ServiceImpl<ProjectReviewDAO, ProjectReviewDO> implements ProjectReviewService {
@Autowired
private ProjectService projectService;
@Autowired
private ProjectJudgeService projectJudgeService;
@Autowired
private MatchDictService matchDictService;
@Autowired
private ProjectReviewPeriodService projectReviewPeriodService;
@Autowired
private AliyunSmsUtil aliyunSmsUtil;
@Override
@Transactional(rollbackFor = Exception.class)
public void setReview(SetReviewDTO setReviewDTO) {
if (setReviewDTO.getProjectId().size() == 0) {
throw new HttpException(10047);
}
if (setReviewDTO.getJudgeId().size() == 0) {
throw new HttpException(10048);
}
// Date startTime = null;
// Date endTime = null;
for (Long judgeId : setReviewDTO.getJudgeId()) {
ProjectJudgeDO projectJudgeDO = projectJudgeService.getById(judgeId);
if (projectJudgeDO != null) {
for (Long projectId : setReviewDTO.getProjectId()) {
ProjectDO projectDO = projectService.getById(projectId);
MatchDictDO matchDictDO = matchDictService.getById(projectDO.getMatchId());
if ("种子赛道".equals(matchDictDO.getMatchType())){
if (projectDO != null) {
ProjectReviewPeriodDO projectReviewPeriodDO = projectReviewPeriodService.getOne(new QueryWrapper<ProjectReviewPeriodDO>()
.lambda()
.eq(ProjectReviewPeriodDO::getMatchId, projectDO.getMatchId())
.eq(ProjectReviewPeriodDO::getProjectGroup, projectDO.getProjectProgress())
.eq(ProjectReviewPeriodDO::getProjectSchedule, projectDO.getProjectSchedule()));
// startTime = projectReviewPeriodDO.getStartTime();
// endTime = projectReviewPeriodDO.getEndTime();
if (projectReviewPeriodDO == null) {
throw new HttpException(10076);
}
if (projectDO.getProjectAssigned().equals(ProjectReview.UNASSIGNED)) {
ProjectDO project = new ProjectDO();
project.setId(projectId);
project.setProjectAssigned(ProjectReview.ASSIGNED);
if (projectDO.getProjectReview().equals(ProjectReview.SUBMITTED)) {
project.setProjectReview(ProjectReview.TO_REVIEWED);
}
projectService.updateById(project);
}
ProjectReviewDO projectReview = this.baseMapper.selectOne(new QueryWrapper<ProjectReviewDO>()
.lambda()
.eq(ProjectReviewDO::getProjectId, projectId)
.eq(ProjectReviewDO::getJudgeId, judgeId)
.eq(ProjectReviewDO::getProjectSchedule, projectDO.getProjectSchedule()));
if (projectReview != null) {
throw new HttpException(10053);
}
ProjectReviewDO projectReviewDO = new ProjectReviewDO();
projectReviewDO.setProjectId(projectId);
projectReviewDO.setJudgeId(judgeId);
projectReviewDO.setProjectSchedule(projectDO.getProjectSchedule());
projectReviewDO.setReviewStatus(ProjectReview.ASSIGNED);
this.baseMapper.insert(projectReviewDO);
}
}
else {
if (projectDO != null) {
ProjectReviewPeriodDO projectReviewPeriodDO = projectReviewPeriodService.getOne(new QueryWrapper<ProjectReviewPeriodDO>()
.lambda()
.eq(ProjectReviewPeriodDO::getMatchId, projectDO.getMatchId())
.eq(ProjectReviewPeriodDO::getProjectGroup, projectDO.getProjectGroup())
.eq(ProjectReviewPeriodDO::getProjectSchedule, projectDO.getProjectSchedule()));
// startTime = projectReviewPeriodDO.getStartTime();
// endTime = projectReviewPeriodDO.getEndTime();
if (projectReviewPeriodDO == null) {
throw new HttpException(10076);
}
if (projectDO.getProjectAssigned().equals(ProjectReview.UNASSIGNED)) {
ProjectDO project = new ProjectDO();
project.setId(projectId);
project.setProjectAssigned(ProjectReview.ASSIGNED);
if (projectDO.getProjectReview().equals(ProjectReview.SUBMITTED)) {
project.setProjectReview(ProjectReview.TO_REVIEWED);
}
projectService.updateById(project);
}
ProjectReviewDO projectReview = this.baseMapper.selectOne(new QueryWrapper<ProjectReviewDO>()
.lambda()
.eq(ProjectReviewDO::getProjectId, projectId)
.eq(ProjectReviewDO::getJudgeId, judgeId)
.eq(ProjectReviewDO::getProjectSchedule, projectDO.getProjectSchedule()));
if (projectReview != null) {
throw new HttpException(10053);
}
ProjectReviewDO projectReviewDO = new ProjectReviewDO();
projectReviewDO.setProjectId(projectId);
projectReviewDO.setJudgeId(judgeId);
projectReviewDO.setProjectSchedule(projectDO.getProjectSchedule());
projectReviewDO.setReviewStatus(ProjectReview.ASSIGNED);
this.baseMapper.insert(projectReviewDO);
}
}
}
if (setReviewDTO.getSmsMessage() == 1) {
MatchDictDO matchDictDO = matchDictService.getById(setReviewDTO.getMatchId());
int count = this.baseMapper.selectCount(new QueryWrapper<ProjectReviewDO>()
.lambda()
.eq(ProjectReviewDO::getReviewStatus, ProjectReview.ASSIGNED)
.eq(ProjectReviewDO::getJudgeId, judgeId));
String msg = "";
if (matchDictDO != null) {
// msg = matchDictDO.getMatchName() +","+count+","+ DateFormatUtil.format(startTime,DateFormatUtil.FMT_sdf14_L)+"~"+DateFormatUtil.format(endTime,DateFormatUtil.FMT_sdf14_L);
msg = matchDictDO.getMatchName() +","+count;
}
aliyunSmsUtil.sendTemplateMsg(msg, projectJudgeDO.getTelephone(), SMSTemplate.REVIEW_INVITATION_OLD);
}
}
}
}
@Override
public void sendNotice(SendNoticeVO sendNoticeVO) {
MatchDictDO matchDictDO = matchDictService.getById(sendNoticeVO.getMatchId());
if (matchDictDO != null) {
for (Long id : sendNoticeVO.getId()) {
ProjectJudgeDO projectJudgeDO = projectJudgeService.getById(id);
if (projectJudgeDO != null) {
int count = this.baseMapper.selectCount(new QueryWrapper<ProjectReviewDO>()
.lambda()
.eq(ProjectReviewDO::getReviewStatus, ProjectReview.ASSIGNED)
.eq(ProjectReviewDO::getJudgeId, id));
List<ProjectReviewPeriodDO> list = projectReviewPeriodService.list(new QueryWrapper<ProjectReviewPeriodDO>()
.lambda()
.eq(ProjectReviewPeriodDO::getMatchId, matchDictDO.getId()));
StringBuffer stringBuffer = new StringBuffer();
for (int i = 0 ; i < list.size() ; i++) {
stringBuffer.append(list.get(i).getProjectGroup()+":"+DateFormatUtil.format(list.get(i).getStartTime(),DateFormatUtil.FMT_sdf14_L)+"~"+DateFormatUtil.format(list.get(i).getEndTime(),DateFormatUtil.FMT_sdf14_L));
if (i != list.size()){
stringBuffer.append(";");
}
}
String msg = matchDictDO.getMatchName() +"," + count+","+stringBuffer.toString();
aliyunSmsUtil.sendTemplateMsgP(msg, projectJudgeDO.getTelephone(), SMSTemplate.REVIEW_INVITATION_NEW);
}
}
}
}
@Override
public Integer selectCount(Long judgeId, Long matchId) {
return this.baseMapper.selectCountByMatchId(judgeId, matchId);
}
@Override
public Integer selectNotReviewCount(Long judgeId, Long matchId) {
return this.baseMapper.selectNotReviewCount(judgeId, matchId);
}
@Override
public List<ProjectReviewVO> getList(String projectSchedule, Long projectId) {
return this.baseMapper.getList(projectSchedule, projectId);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void cancelReview(CancelReviewDTO cancelReviewDTO) {
if (cancelReviewDTO.getProjectId() == null) {
throw new HttpException(10047);
}
if (cancelReviewDTO.getJudgeId().size() == 0) {
throw new HttpException(10048);
}
for (Long judgeId : cancelReviewDTO.getJudgeId()) {
ProjectJudgeDO projectJudgeDO = projectJudgeService.getById(judgeId);
if (projectJudgeDO == null) {
throw new HttpException(10070);
}
ProjectDO projectDO = projectService.getById(cancelReviewDTO.getProjectId());
if (projectDO != null) {
ProjectReviewPeriodDO projectReviewPeriodDO = projectReviewPeriodService.getOne(new QueryWrapper<ProjectReviewPeriodDO>()
.lambda()
.eq(ProjectReviewPeriodDO::getMatchId, projectDO.getMatchId())
.eq(ProjectReviewPeriodDO::getProjectGroup, projectDO.getProjectGroup())
.eq(ProjectReviewPeriodDO::getProjectSchedule, projectDO.getProjectSchedule()));
if (projectReviewPeriodDO.getStartTime().before(new Date())) {
throw new HttpException(10075);
}
if (projectDO != null) {
Integer count = this.baseMapper.selectCount(new QueryWrapper<ProjectReviewDO>()
.lambda()
.eq(ProjectReviewDO::getProjectId, projectDO.getId())
.eq(ProjectReviewDO::getProjectSchedule, projectDO.getProjectSchedule()));
/*
只有最后一个评委是撤销修改项目分配状态
*/
if (count == 1) {
ProjectDO project = new ProjectDO();
project.setId(projectDO.getId());
project.setProjectAssigned(ProjectReview.UNASSIGNED);
projectService.updateById(project);
}
ProjectReviewDO projectReview = this.baseMapper.selectOne(new QueryWrapper<ProjectReviewDO>()
.lambda()
.eq(ProjectReviewDO::getProjectId, projectDO.getId())
.eq(ProjectReviewDO::getJudgeId, judgeId)
.eq(ProjectReviewDO::getProjectSchedule, projectDO.getProjectSchedule()));
if (projectReview == null) {
throw new HttpException(10071);
}
if (projectReview.getReviewStatus().equals(ProjectReview.SUBMITTED)) {
throw new HttpException(10059);
}
this.baseMapper.deleteById(projectReview.getId());
}
aliyunSmsUtil.sendTemplateMsg(projectDO.getProjectName(), projectJudgeDO.getTelephone(), SMSTemplate.CANCEL_REVIEW);
}
}
}
@Override
public List<ProjectJudgeDO> getProjectReview(ProjectReviewDTO projectReviewDTO) {
List<ProjectJudgeDO> data = new ArrayList<>();
ProjectDO projectDO = projectService.getById(projectReviewDTO.getProjectId());
if (projectDO != null) {
List<ProjectReviewDO> list = this.baseMapper.selectList(new QueryWrapper<ProjectReviewDO>()
.lambda()
.eq(ProjectReviewDO::getProjectSchedule, projectDO.getProjectSchedule())
.eq(ProjectReviewDO::getProjectId, projectReviewDTO.getProjectId()));
for (ProjectReviewDO projectReviewDO : list) {
ProjectJudgeDO projectJudgeDO = projectJudgeService.getById(projectReviewDO.getJudgeId());
if (projectJudgeDO != null) {
data.add(projectJudgeDO);
}
}
}
return data;
}
}
package com.zhongzhi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.common.constant.ProjectSchedule;
import com.zhongzhi.dto.scheduleRecord.ProjectScheduleRecordDTO;
import com.zhongzhi.model.MatchDictDO;
import com.zhongzhi.model.ProjectScheduleRecordDO;
import com.zhongzhi.dao.ProjectScheduleRecordDAO;
import com.zhongzhi.service.MatchDictService;
import com.zhongzhi.service.ProjectScheduleRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.vo.scheduleRecord.ProjectScheduleRecordVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 项目进度记录 服务实现类
* </p>
*
* @author DengMin
* @since 2021-06-02
*/
@Service
public class ProjectScheduleRecordServiceImpl extends ServiceImpl<ProjectScheduleRecordDAO, ProjectScheduleRecordDO> implements ProjectScheduleRecordService {
@Autowired
private MatchDictService matchDictService;
@Override
public IPage<ProjectScheduleRecordVO> getProjectScheduleRecord(ProjectScheduleRecordDTO projectScheduleRecordDTO) {
Page page = new Page(projectScheduleRecordDTO.getPageNo(), projectScheduleRecordDTO.getPageSize());
MatchDictDO matchDictDO = matchDictService.getOne(new QueryWrapper<MatchDictDO>()
.lambda()
.eq(MatchDictDO::getStatus, 1));
if (matchDictDO != null) {
IPage<ProjectScheduleRecordVO> iPage = this.baseMapper.getProjectScheduleRecord(page, matchDictDO.getId(), projectScheduleRecordDTO.getName());
for (ProjectScheduleRecordVO record : iPage.getRecords()) {
List<ProjectScheduleRecordDO> list = this.baseMapper.selectList(new QueryWrapper<ProjectScheduleRecordDO>()
.lambda()
.eq(ProjectScheduleRecordDO::getCollege, record.getCollegeName()));
Integer schoolProject = 0;
Integer rematchProject = 0;
Integer finalProject = 0;
if (list.size() > 0) {
for (ProjectScheduleRecordDO projectScheduleRecordDO : list) {
if (projectScheduleRecordDO.getProjectSchedule().equals(ProjectSchedule.SCHOOL_REVIEW)) {
schoolProject++;
} else if (projectScheduleRecordDO.getProjectSchedule().equals(ProjectSchedule.SEMI_FINAL_REVIEW)) {
rematchProject++;
} else if (projectScheduleRecordDO.getProjectSchedule().equals(ProjectSchedule.FINAL_REVIEW)) {
finalProject++;
}
}
}
record.setSchoolProject(schoolProject);
record.setRematchProject(rematchProject);
record.setFinalProject(finalProject);
}
return iPage;
}
return null;
}
@Override
public List<ProjectScheduleRecordDO> getList(Long matchId, String name, String projectGroup) {
return this.baseMapper.getList(matchId, name, projectGroup);
}
}
This diff could not be displayed because it is too large.
package com.zhongzhi.service.impl;
import com.zhongzhi.model.ProjectTrademarkDO;
import com.zhongzhi.dao.ProjectTrademarkMapper;
import com.zhongzhi.service.ProjectTrademarkService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 项目作品 服务实现类
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Service
public class ProjectTrademarkServiceImpl extends ServiceImpl<ProjectTrademarkMapper, ProjectTrademarkDO> implements ProjectTrademarkService {
}
package com.zhongzhi.service.impl;
import com.zhongzhi.model.ProjectWorksDO;
import com.zhongzhi.dao.ProjectWorksMapper;
import com.zhongzhi.service.ProjectWorksService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 项目作品 服务实现类
* </p>
*
* @author DengMin
* @since 2022-04-25
*/
@Service
public class ProjectWorksServiceImpl extends ServiceImpl<ProjectWorksMapper, ProjectWorksDO> implements ProjectWorksService {
}
package com.zhongzhi.service.impl;
import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhongzhi.common.constant.SmsCode;
import com.zhongzhi.common.exception.HttpException;
import com.zhongzhi.common.utils.AliyunSmsUtil;
import com.zhongzhi.common.utils.RandomUtil;
import com.zhongzhi.model.AdministerDO;
import com.zhongzhi.model.CollegesDictDO;
import com.zhongzhi.model.ProjectJudgeDO;
import com.zhongzhi.model.SmsCodeDO;
import com.zhongzhi.dao.SmsCodeDAO;
import com.zhongzhi.model.StudentDO;
import com.zhongzhi.service.AdministerService;
import com.zhongzhi.service.CollegesDictService;
import com.zhongzhi.service.ProjectJudgeService;
import com.zhongzhi.service.SmsCodeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 短信验证码 服务实现类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Service
public class SmsCodeServiceImpl extends ServiceImpl<SmsCodeDAO, SmsCodeDO> implements SmsCodeService {
@Autowired
private AliyunSmsUtil aliyunSmsUtil;
@Autowired
private StudentService studentService;
@Autowired
private AdministerService administerService;
@Autowired
private ProjectJudgeService projectJudgeService;
@Autowired
private CollegesDictService collegesDictService;
@Override
public void sendRegisterCode(SmsCodeDO smsCodeDO) {
StudentDO studentDO = studentService.getOne(new QueryWrapper<StudentDO>()
.lambda()
.eq(StudentDO::getTelephone, smsCodeDO.getTelephone()));
if (studentDO != null) {
throw new HttpException(10020);
}
int code = RandomUtil.getCode();
SendSmsResponse sendSmsResponse = aliyunSmsUtil.send(smsCodeDO.getTelephone(), code);
if (sendSmsResponse != null && sendSmsResponse.getCode().equals("OK")) {
SmsCodeDO smsCode = this.baseMapper.selectOne(new QueryWrapper<SmsCodeDO>()
.lambda()
.eq(SmsCodeDO::getTelephone, smsCodeDO.getTelephone()));
if (smsCode != null) {
this.baseMapper.deleteById(smsCode.getId());
}
smsCodeDO.setCode(String.valueOf(code));
smsCodeDO.setPlatform(SmsCode.student);
smsCodeDO.setType(SmsCode.register);
this.baseMapper.insert(smsCodeDO);
} else {
throw new HttpException(10011);
}
}
@Override
public void sendStudentLoginCode(SmsCodeDO smsCodeDO) {
StudentDO studentDO = studentService.getOne(new QueryWrapper<StudentDO>()
.lambda()
.eq(StudentDO::getTelephone, smsCodeDO.getTelephone()));
if (studentDO == null) {
throw new HttpException(10024);
}
CollegesDictDO collegesDictDO = collegesDictService.getOne(new QueryWrapper<CollegesDictDO>()
.lambda()
.eq(CollegesDictDO::getName, studentDO.getCollege()));
if (collegesDictDO.getLoginStatus() == 0) {
throw new HttpException(10067);
}
int code = RandomUtil.getCode();
SendSmsResponse sendSmsResponse = aliyunSmsUtil.send(smsCodeDO.getTelephone(), code);
if (sendSmsResponse != null && sendSmsResponse.getCode().equals("OK")) {
SmsCodeDO smsCode = this.baseMapper.selectOne(new QueryWrapper<SmsCodeDO>()
.lambda()
.eq(SmsCodeDO::getTelephone, smsCodeDO.getTelephone()));
if (smsCode != null) {
this.baseMapper.deleteById(smsCode.getId());
}
smsCodeDO.setCode(String.valueOf(code));
smsCodeDO.setPlatform(SmsCode.student);
smsCodeDO.setType(SmsCode.login);
this.baseMapper.insert(smsCodeDO);
} else {
throw new HttpException(10011);
}
}
@Override
public SmsCodeDO getOneByTelePhone(String telephone, String type, String platform) {
return this.baseMapper.getOneByTelePhone(telephone, type, platform);
}
@Override
public void sendAdministerLoginCode(AdministerDO administerDO) {
AdministerDO administer = administerService.getOne(new QueryWrapper<AdministerDO>()
.lambda()
.eq(AdministerDO::getTelephone, administerDO.getTelephone()));
if (administer == null) {
throw new HttpException(10060);
}
int code = RandomUtil.getCode();
SendSmsResponse sendSmsResponse = aliyunSmsUtil.send(administerDO.getTelephone(), code);
if (sendSmsResponse != null && sendSmsResponse.getCode().equals("OK")) {
SmsCodeDO smsCode = this.baseMapper.selectOne(new QueryWrapper<SmsCodeDO>()
.lambda()
.eq(SmsCodeDO::getTelephone, administerDO.getTelephone()));
if (smsCode != null) {
this.baseMapper.deleteById(smsCode.getId());
}
SmsCodeDO smsCodeDO = new SmsCodeDO();
smsCodeDO.setTelephone(administerDO.getTelephone());
smsCodeDO.setCode(String.valueOf(code));
smsCodeDO.setPlatform(SmsCode.center);
smsCodeDO.setType(SmsCode.login);
this.baseMapper.insert(smsCodeDO);
} else {
throw new HttpException(10011);
}
}
@Override
public void sendJudgeLoginCode(SmsCodeDO smsCodeDO) {
ProjectJudgeDO projectJudgeDO = projectJudgeService.getOne(new QueryWrapper<ProjectJudgeDO>()
.lambda()
.eq(ProjectJudgeDO::getTelephone, smsCodeDO.getTelephone()));
if (projectJudgeDO == null) {
throw new HttpException(10060);
}
if (projectJudgeDO.getPasswordFree() == null || projectJudgeDO.getPasswordFree() != 1) {
int code = RandomUtil.getCode();
SendSmsResponse sendSmsResponse = aliyunSmsUtil.send(smsCodeDO.getTelephone(), code);
if (sendSmsResponse != null && sendSmsResponse.getCode().equals("OK")) {
SmsCodeDO smsCode = this.baseMapper.selectOne(new QueryWrapper<SmsCodeDO>()
.lambda()
.eq(SmsCodeDO::getTelephone, smsCodeDO.getTelephone()));
if (smsCode != null) {
this.baseMapper.deleteById(smsCode.getId());
}
SmsCodeDO sc = new SmsCodeDO();
sc.setTelephone(smsCodeDO.getTelephone());
sc.setCode(String.valueOf(code));
sc.setPlatform(SmsCode.review);
sc.setType(SmsCode.login);
this.baseMapper.insert(sc);
} else {
throw new HttpException(10011);
}
}
}
}
package com.zhongzhi.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhongzhi.common.constant.SMSTemplate;
import com.zhongzhi.common.utils.AliyunSmsUtil;
import com.zhongzhi.dao.ProjectDAO;
import com.zhongzhi.dao.StudentDAO;
import com.zhongzhi.dto.notice.SmsNoticeDTO;
import com.zhongzhi.dto.notice.SmsNoticePageDTO;
import com.zhongzhi.model.ProjectDO;
import com.zhongzhi.model.SmsNoticeDO;
import com.zhongzhi.dao.SmsNoticeMapper;
import com.zhongzhi.model.StudentDO;
import com.zhongzhi.service.SmsNoticeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.vo.project.SeedTrackProjectPageVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* <p>
* 短信通知记录 服务实现类
* </p>
*
* @author DengMin
* @since 2022-04-15
*/
@Service
public class SmsNoticeServiceImpl extends ServiceImpl<SmsNoticeMapper, SmsNoticeDO> implements SmsNoticeService {
@Autowired
private AliyunSmsUtil aliyunSmsUtil;
@Autowired
private ProjectDAO projectDAO;
@Autowired
private StudentDAO studentDAO;
@Override
@Transactional(rollbackFor = Exception.class)
public void batchSend(SmsNoticeDTO smsNoticeDTO) {
List<SeedTrackProjectPageVO> list = projectDAO.getProjectList(smsNoticeDTO.getMatchId(), smsNoticeDTO.getProjectGroup(), smsNoticeDTO.getProjectSchedule(), smsNoticeDTO.getProjectStatus(), smsNoticeDTO.getName());
if (list.size() > 0) {
for (SeedTrackProjectPageVO projectDO : list) {
String msg = projectDO.getProjectSchedule() + "," + projectDO.getProjectStatus();
aliyunSmsUtil.sendTemplateMsg(msg, projectDO.getTelephone(), SMSTemplate.PROJECT_PROGRESS);
SmsNoticeDO smsNoticeDO = new SmsNoticeDO();
smsNoticeDO.setProjectId(projectDO.getId());
smsNoticeDO.setName(projectDO.getName());
smsNoticeDO.setTelephone(projectDO.getTelephone());
smsNoticeDO.setContent(msg);
this.baseMapper.insert(smsNoticeDO);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void send(SmsNoticeDTO smsNoticeDTO) {
if (smsNoticeDTO.getIds().size() > 0) {
for (Long id : smsNoticeDTO.getIds()) {
ProjectDO projectDO = projectDAO.selectById(id);
if (projectDO != null) {
StudentDO studentDO = studentDAO.selectById(projectDO.getProposerId());
String msg = projectDO.getProjectSchedule() + "," + projectDO.getProjectStatus();
aliyunSmsUtil.sendTemplateMsg(msg, studentDO.getTelephone(), SMSTemplate.PROJECT_PROGRESS);
SmsNoticeDO smsNoticeDO = new SmsNoticeDO();
smsNoticeDO.setProjectId(projectDO.getId());
smsNoticeDO.setName(studentDO.getName());
smsNoticeDO.setTelephone(studentDO.getTelephone());
smsNoticeDO.setContent(msg);
this.baseMapper.insert(smsNoticeDO);
}
}
}
}
@Override
public IPage getListByPage(SmsNoticePageDTO smsNoticePageDTO) {
Page page = new Page(smsNoticePageDTO.getPageNo(), smsNoticePageDTO.getPageSize());
return this.baseMapper.getListByPage(page, smsNoticePageDTO.getDate(), smsNoticePageDTO.getName());
}
}
package com.zhongzhi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhongzhi.common.constant.Code;
import com.zhongzhi.common.constant.SmsCode;
import com.zhongzhi.common.exception.HttpException;
import com.zhongzhi.common.utils.JwtUtil;
import com.zhongzhi.common.utils.Localstorage;
import com.zhongzhi.dto.student.LoginDTO;
import com.zhongzhi.dto.student.RegisterDTO;
import com.zhongzhi.model.CollegesDictDO;
import com.zhongzhi.model.SmsCodeDO;
import com.zhongzhi.model.StudentDO;
import com.zhongzhi.dao.StudentDAO;
import com.zhongzhi.service.CollegesDictService;
import com.zhongzhi.service.SmsCodeService;
import com.zhongzhi.service.StudentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.vo.student.StudentInfoVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author DengMin
* @since 2021-04-28
*/
@Service
public class StudentServiceImpl extends ServiceImpl<StudentDAO, StudentDO> implements StudentService {
@Autowired
private SmsCodeService smsCodeService;
@Autowired
private CollegesDictService collegesDictService;
@Override
public StudentInfoVO register(RegisterDTO registerDTO) {
StudentInfoVO studentInfoVO = new StudentInfoVO();
SmsCodeDO smsCodeDO = smsCodeService.getOneByTelePhone(registerDTO.getTelephone(), SmsCode.register, SmsCode.student);
if (smsCodeDO == null) {
throw new HttpException(10025);
}
if (!smsCodeDO.getCode().equals(registerDTO.getCode())) {
throw new HttpException(10021);
}
smsCodeService.removeById(smsCodeDO.getId());
if (!registerDTO.getTelephone().equals(smsCodeDO.getTelephone())) {
throw new HttpException(10022);
}
StudentDO telephone = this.baseMapper.selectOne(new QueryWrapper<StudentDO>()
.lambda()
.eq(StudentDO::getTelephone, registerDTO.getTelephone()));
if (telephone != null) {
throw new HttpException(10020);
}
Integer count = this.baseMapper.selectCount(new QueryWrapper<StudentDO>()
.lambda()
.eq(StudentDO::getIdCard, registerDTO.getIdCard()));
if (count > 0) {
throw new HttpException(10023);
}
StudentDO student = new StudentDO();
BeanUtils.copyProperties(registerDTO, student);
student.setCollege(registerDTO.getSchool());
this.baseMapper.insert(student);
String token = JwtUtil.generateToken(student.getId(), SmsCode.student);
BeanUtils.copyProperties(registerDTO, studentInfoVO);
studentInfoVO.setCollege(registerDTO.getSchool());
studentInfoVO.setToken(token);
return studentInfoVO;
}
@Override
public StudentInfoVO login(LoginDTO loginDTO) {
StudentInfoVO studentInfoVO = new StudentInfoVO();
SmsCodeDO smsCodeDO = smsCodeService.getOneByTelePhone(loginDTO.getTelephone(), SmsCode.login, SmsCode.student);
if (smsCodeDO == null) {
throw new HttpException(10025);
}
if (!smsCodeDO.getCode().equals(loginDTO.getCode())) {
throw new HttpException(10021);
}
smsCodeService.removeById(smsCodeDO.getId());
StudentDO studentDO = this.baseMapper.selectOne(new QueryWrapper<StudentDO>()
.lambda()
.eq(StudentDO::getTelephone, loginDTO.getTelephone()));
if (studentDO == null) {
throw new HttpException(10024);
}
CollegesDictDO collegesDictDO = collegesDictService.getOne(new QueryWrapper<CollegesDictDO>()
.lambda()
.eq(CollegesDictDO::getName, studentDO.getCollege()));
if(collegesDictDO.getLoginStatus() == 0) {
throw new HttpException(10067);
}
String token = JwtUtil.generateToken(studentDO.getId(), SmsCode.student);
BeanUtils.copyProperties(studentDO, studentInfoVO);
studentInfoVO.setToken(token);
return studentInfoVO;
}
@Override
public void updateStudentInfo(StudentDO studentDO) {
StudentDO student = (StudentDO) Localstorage.getUser();
if (studentDO == null) {
throw new HttpException(Code.TOKEN_EXPIRED.getCode(), Code.TOKEN_EXPIRED.getMessage());
}
studentDO.setId(student.getId());
this.baseMapper.updateById(studentDO);
}
}
package com.zhongzhi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhongzhi.common.configure.VODConfig;
import com.zhongzhi.common.utils.Signature;
import com.zhongzhi.common.utils.VodUtil;
import com.zhongzhi.dto.course.ChangeOrdersDTO;
import com.zhongzhi.dto.course.VodsDTO;
import com.zhongzhi.model.CourseDictDO;
import com.zhongzhi.model.VodDictDO;
import com.zhongzhi.dao.VodDictDAO;
import com.zhongzhi.service.VodDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhongzhi.vo.course.SignatureVO;
import com.zhongzhi.vo.course.VodsVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Random;
/**
* <p>
* 服务实现类
* </p>
*
* @author DengMin
* @since 2022-11-14
*/
@Service
public class VodDictServiceImpl extends ServiceImpl<VodDictDAO, VodDictDO> implements VodDictService {
@Autowired
private VODConfig vodConfig;
@Value("${spring.profiles.active}")
private String env;
public SignatureVO signature() {
//
SignatureVO signatureVO = new SignatureVO();
Signature signature = new Signature();
signature.setSecretId(vodConfig.getSecretId());
signature.setSecretKey(vodConfig.getSecretKey());
signature.setCurrentTime(System.currentTimeMillis());
signature.setRandom(new Random().nextInt(Integer.MAX_VALUE));
signature.setSignValidDuration(3600 * 24 * 2);
signature.setClassId(vodConfig.getClassId());
String sign = "";
try {
sign = signature.getUploadSignature();
signatureVO.setSign(sign);
} catch (Exception ex) {
ex.printStackTrace();
// throw new MyException(ResultEnum.UNKNOWN_ERROR);
}
return signatureVO;
}
public void deleteVod(VodDictDO vodDictDO) {
this.baseMapper.deleteById(vodDictDO.getId());
}
public void addVod(VodDictDO vodDictDO) {
//查看这个课程当前最大的no
List<VodDictDO> vodDictDOS = this.baseMapper.selectList(new QueryWrapper<VodDictDO>()
.lambda()
.eq(VodDictDO::getCourseId, vodDictDO.getCourseId())
.orderByDesc(VodDictDO::getOrderNo));
int orderNo = 1;
if (vodDictDOS.size() > 0) {
orderNo += vodDictDOS.get(0).getOrderNo();
}
vodDictDO.setOrderNo(orderNo);
this.baseMapper.insert(vodDictDO);
//测试环境就不转码了
if (env.equals("prod")){
VodUtil.processMedia(vodConfig, vodDictDO.getVodCode());
}
}
public void updateVod(VodDictDO vodDictDO) {
this.baseMapper.updateById(vodDictDO);
}
public void changeOrders(ChangeOrdersDTO changeOrdersDTO) {
List<Long> ids = changeOrdersDTO.getIds();
int i = 1;
for (Long id : ids) {
VodDictDO vodDictDO = this.baseMapper.selectById(id);
vodDictDO.setOrderNo(i);
this.baseMapper.updateById(vodDictDO);
i++;
}
}
public List<VodsVO> vods(VodsDTO vodsDTO) {
return this.baseMapper.vods(vodsDTO.getCourseId(), vodsDTO.getVodName(),vodsDTO.getYearId());
}
public List<VodsVO> fourVods(CourseDictDO courseDictDO) {
return this.baseMapper.fourVods(courseDictDO);
}
}
package com.zhongzhi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhongzhi.common.exception.HttpException;
import com.zhongzhi.model.YearDictDO;
import com.zhongzhi.dao.YearDictDAO;
import com.zhongzhi.service.YearDictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 年份字典表 服务实现类
* </p>
*
* @author DengMin
* @since 2023-04-11
*/
@Service
public class YearDictServiceImpl extends ServiceImpl<YearDictDAO, YearDictDO> implements YearDictService {
public List<YearDictDO> queryYears() {
return this.baseMapper.selectList(null);
}
public void updateYear(YearDictDO yearDictDO) {
int count = this.baseMapper.selectCount(new QueryWrapper<YearDictDO>()
.lambda()
.eq(YearDictDO::getYear,yearDictDO.getYear())
.ne(YearDictDO::getId,yearDictDO.getId()));
if (count > 0 ){
throw new HttpException(90001);
}
this.baseMapper.updateById(yearDictDO);
}
public void addYear(YearDictDO yearDictDO) {
int count = this.baseMapper.selectCount(new QueryWrapper<YearDictDO>()
.lambda()
.eq(YearDictDO::getYear,yearDictDO.getYear()));
if (count > 0 ){
throw new HttpException(90001);
}
yearDictDO.setStatus("1");
this.baseMapper.insert(yearDictDO);
}
}
package com.zhongzhi.vo;
import lombok.Data;
@Data
public class ExcelFieldVO {
private String field;
private String name;
}
package com.zhongzhi.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ResponseVO<T> {
private Integer code;
private String message;
private T data;
private String path;
}
package com.zhongzhi.vo.administer;
import com.zhongzhi.vo.permission.PermissionVO;
import lombok.Data;
import java.util.List;
@Data
public class AdministerVO {
private String token;
private String username;
private String avatar;
private String telephone;
private String role;
private List<PermissionVO> permission;
}
package com.zhongzhi.vo.college;
import com.zhongzhi.common.utils.ExcelColumn;
import lombok.Data;
@Data
public class AwardedListVO {
private Long id;
@ExcelColumn(col = 1, value = "院校")
private String name;
@ExcelColumn(col = 2, value = "校内上报项目数")
private Integer schoolCompetitionNum;
@ExcelColumn(col = 3, value = "市级复赛项目数")
private Integer rematchNum;
@ExcelColumn(col = 4, value = "市级决赛项目数")
private Integer finalNum;
@ExcelColumn(col = 5, value = "市级优胜奖")
private Integer winningPrizeNum;
@ExcelColumn(col = 6, value = "市级铜奖")
private Integer bronzeAwardNum;
@ExcelColumn(col = 7, value = "市级银奖")
private Integer silverAwardNum;
@ExcelColumn(col = 8, value = "市级金奖")
private Integer goldAwardNum;
private String attachment;
private String fileName;
}
package com.zhongzhi.vo.college;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class CollegePageVO {
private Long id;
/**
* 学校代码
*/
private String code;
/**
* 院校名称
*/
private String name;
/**
* 账户
*/
private String account;
/**
* 密码
*/
private String password;
/**
* 联系地址
*/
private String address;
/**
* 登陆时间
*/
private LocalDateTime loginTime;
private String leaderName;
private String leaderPost;
private String leaderPhone;
private String contactName;
private String contactPost;
private String contactPhone;
private Integer loginStatus;
}
package com.zhongzhi.vo.college;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class CollegesVO {
private Long id;
private String name;
private String account;
private String education;
private String address;
private LocalDateTime loginTime;
private Integer isLogin;
private String leaderName;
private String leaderPost;
private String leaderPhone;
private String contactName;
private String contactPost;
private String contactPhone;
private String token;
}
package com.zhongzhi.vo.college;
import lombok.Data;
@Data
public class DetailVO {
private String registrationDeadline;
private String latestUpdateTime;
}
package com.zhongzhi.vo.college;
import com.zhongzhi.common.utils.ExcelColumn;
import lombok.Data;
@Data
public class ExportListVO {
@ExcelColumn(col = 1, value = "学校")
private String collegeName;
@ExcelColumn(col = 2, value = "姓名")
private String userName;
@ExcelColumn(col = 3, value = "类型")
private String memberType;
@ExcelColumn(col = 4, value = "手机号")
private String telephone;
@ExcelColumn(col = 5, value = "证件号码")
private String idCard;
@ExcelColumn(col = 6, value = "项目名称")
private String projectName;
}
package com.zhongzhi.vo.college;
import lombok.Data;
@Data
public class RegisterMembersVO {
private Long id;
private Long projectId;
private String college;
private String name;
private String type;
private String telephone;
private String memberType;
private String userName;
private String idCard;
private String projectName;
}
package com.zhongzhi.vo.college;
import lombok.Data;
@Data
public class SchoolsVO {
private Long collegeId;
private String name;
private Integer cnt;
}
package com.zhongzhi.vo.course;
import com.zhongzhi.model.CourseDictDO;
import com.zhongzhi.model.VodDictDO;
import lombok.Data;
import java.util.List;
@Data
public class CourseVodsVO extends CourseDictDO {
private List<VodDictDO> vodDictDOS;
}
package com.zhongzhi.vo.course;
import lombok.Data;
@Data
public class CoursesVO {
private Long id;
private String courseName;
private Integer vodCnt;
}
package com.zhongzhi.vo.course;
import lombok.Data;
@Data
public class SignatureVO {
private String sign;
}
package com.zhongzhi.vo.course;
import com.zhongzhi.model.VodDictDO;
import lombok.Data;
@Data
public class VodsVO extends VodDictDO {
private String courseName;
}
package com.zhongzhi.vo.judge;
import lombok.Data;
@Data
public class JudgeInfoVO {
private String username;
private String telephone;
private String position;
private String unit;
private String token;
}
package com.zhongzhi.vo.judge;
import lombok.Data;
@Data
public class ProjectJudgePageVO {
private Long id;
/**
* 姓名
*/
private String username;
/**
* 手机号
*/
private String telephone;
/**
* 职务
*/
private String position;
/**
* 单位
*/
private String unit;
/**
* 身份证号
*/
private String idCard;
/**
* 开户行
*/
private String bankName;
/**
* 银行卡号
*/
private String bankCard;
/**
* 状态
*/
private Integer status;
/**
* 分配数量
*/
private Integer assignedQuantity;
/**
* 待评审数量
*/
private Integer notReviewedNum;
}
package com.zhongzhi.vo.judge;
import lombok.Data;
@Data
public class ProjectReviewVO {
private String judgesName;
private Double score;
}
package com.zhongzhi.vo.match;
import com.zhongzhi.model.MatchScheduleDO;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class MatchDictVO {
private Long id;
private String matchName;
private String matchDate;
private Date startTime;
private Date endTime;
private Integer status;
private String matchType;
private List<MatchScheduleDO> schedule;
}
package com.zhongzhi.vo.member;
import com.zhongzhi.dto.member.MentorDTO;
import com.zhongzhi.dto.member.TeamMemberDTO;
import lombok.Data;
import java.util.List;
@Data
public class ProjectMemberVO {
private Long id;
/**
* 姓名
*/
private String name;
/**
* 就读学校
*/
private String school;
/**
* 年级
*/
private String grade;
/**
* 就读专业
*/
private String major;
private String idCard;
/**
* 性别
*/
private String sex;
/**
* 学籍号
*/
private String studentNo;
private String telephone;
private String email;
/**
* 团队成员
*/
private List<TeamMemberDTO> teamMember;
/**
* 指导老师
*/
private List<MentorDTO> mentor;
private Integer editStatus;
private String fiveYears;
}
package com.zhongzhi.vo.message;
import lombok.Data;
@Data
public class MessageVO {
private Long id;
/**
* 标题
*/
private String title;
/**
* 内容
*/
private String content;
/**
* 创建时间
*/
private String releaseTime;
private String attachmentUrl;
}
package com.zhongzhi.vo.notice;
import lombok.Data;
import java.time.LocalDateTime;
@Data
public class SmsNoticeVO {
private Long id;
private String projectName;
private String name;
private String telephone;
private String createTime;
}
package com.zhongzhi.vo.oss;
import lombok.Data;
@Data
public class GetSecretVO {
private String key;
private String secret;
}
package com.zhongzhi.vo.oss;
import lombok.Data;
@Data
public class UploadFileVO {
private String url;
}
package com.zhongzhi.vo.permission;
import lombok.Data;
import java.util.List;
@Data
public class PermissionVO {
private Long id;
private Long parentId;
private String name;
private List<PermissionVO> childNodeList;
}
package com.zhongzhi.vo.project;
import com.zhongzhi.common.utils.ExcelColumn;
import lombok.Data;
@Data
public class CollegeProjectVO {
@ExcelColumn(col = 1, value = "项目名称")
private String projectName;
@ExcelColumn(col = 2, value = "项目组别")
private String projectGroup;
@ExcelColumn(col = 3, value = "负责人")
private String name;
@ExcelColumn(col = 4, value = "院校")
private String college;
@ExcelColumn(col = 5, value = "专业")
private String major;
@ExcelColumn(col = 6, value = "手机号")
private String telephone;
@ExcelColumn(col = 7, value = "申请时间")
private String applicationTime;
}
package com.zhongzhi.vo.project;
import com.zhongzhi.model.ProjectOwnershipStructureDO;
import com.zhongzhi.vo.member.ProjectMemberVO;
import lombok.Data;
import java.util.List;
@Data
public class MainTrackProjectDetailVO extends ProjectMemberVO {
private Long id;
/**
* 所属领域
*/
private String itemField;
/**
* 项目LOGO
*/
private String logoUri;
/**
* 项目名称
*/
private String projectName;
/**
* 组别
*/
private String projectGroup;
/**
* 类别
*/
private String classification;
/**
* 所在地址
*/
private String address;
/**
* 项目概述
*/
private String projectIntro;
/**
* 设计背景
*/
private String projectCreativity;
/**
* 科学设计
*/
private String scientificPrinciple;
/**
* 应用前景
*/
private String applicationProspect;
/**
* 路演形式
*/
private String roadShowForm;
/**
* 创意实施或实验所受条件的限制
*/
private String restriction;
/**
* 国家级重大、重点科研项目的科研成果转化项目
*/
private String projectTransform;
/**
* 学校科技成果转化
*/
private String resultTransfer;
/**
* 参赛申报人为科技成果的完成人或所有人
*/
private String competitionOwner;
/**
* 参赛申报人为科技成果的第一完成人或所有人
*/
private String competitionFirst;
/**
* 师生共创
*/
private String bothInvention;
/**
* 项目进展
*/
private String projectProgress;
/**
* 公司名称
*/
private String companyName;
/**
* 法人身份
*/
private String legalPersonStatus;
/**
* 法人姓名
*/
private String legalPersonName;
/**
* 职务
*/
private String position;
/**
* 注册资金
*/
private String registerFund;
/**
* 注册时间
*/
private String registerDate;
/**
* 注册省份
*/
private String registerProvince;
/**
* 注册地址
*/
private String registerAddress;
/**
* 统一社会信用代码
*/
private String unifyCode;
/**
* 财务报表
*/
private String financialStatement;
/**
* 隐私设置
*/
private String privacySetting;
/**
* 类型
*/
private String materialsType;
/**
* 大小
*/
private String materialsSize;
/**
* 名称
*/
private String materialsName;
/**
* 地址
*/
private String materialsUrl;
/**
* 股权结构
*/
private List<ProjectOwnershipStructureDO> po;
}
package com.zhongzhi.vo.project;
import lombok.Data;
@Data
public class MainTrackProjectPageVO {
private Long id;
private String projectName;
private String itemField;
private String name;
private String major;
private String telephone;
private String projectStatus;
private String applicationTime;
private String materialsType;
private String materialsSize;
private String materialsName;
private String materialsUrl;
}
package com.zhongzhi.vo.project;
import lombok.Data;
@Data
public class ProjectAssignNumVO {
/**
* 中职复赛项目数量
*/
private Long vocRematchNum;
/**
* 中职决赛项目数量
*/
private Long vocFinalNum;
/**
* 高职复赛项目数量
*/
private Long secRematchNum;
/**
* 高职决赛项目数量
*/
private Long secFinalNum;
/**
* 高职初赛项目数量
*/
// private Long secPreliminaryNUm;
/**
* 已分配
*/
private Long assignNum;
/**
* 未分配
*/
private Long unassignedNum;
}
package com.zhongzhi.vo.project;
import lombok.Data;
@Data
public class ProjectDataOverview {
/*
注册人数
*/
private Integer registeredNum;
/*
已提交项目的院校数量
*/
private Integer matchNum;
/*
全部项目数量
*/
private Integer projectNum;
/*
校级项目申请数量
*/
private Integer schoolProjectNum;
/*
初赛项目数量
*/
private Integer preliminaryProjectNum;
/*
复赛项目数量
*/
private Integer rematchProjectNum;
/*
复赛项目比例
*/
private Double rematchProportion;
/*
决赛项目数量
*/
private Integer finalProjectNum;
/*
决赛项目比例
*/
private Double finalProportion;
/*
市级复赛铜奖
*/
private Integer rematchBronzeAwardNum;
/*
市级复赛银奖
*/
private Integer rematchSilverAwardNum;
/*
市级复赛金奖
*/
private Integer rematchWinningAwardNum;
/*
市级决赛银奖
*/
private Integer finalsSilverAwardNum;
/*
市级决赛金奖
*/
private Integer finalsGoldAwardNum;
}
package com.zhongzhi.vo.project;
import com.zhongzhi.model.ProjectMaterialsDO;
import com.zhongzhi.model.ProjectOwnershipStructureDO;
import lombok.Data;
import java.util.List;
@Data
public class ProjectInfoVO {
private Long id;
/**
* 所属领域
*/
private String itemField;
/**
* 项目LOGO
*/
private String logoUri;
/**
* 项目名称
*/
private String projectName;
/**
* 组别
*/
private String projectGroup;
/**
* 赛事年份
*/
private String matchId;
/**
* 红色文创组类别
*/
private String culClassification;
/**
* 类别
*/
private List<String> classification;
/**
* 所在地址
*/
private String address;
/**
* 项目概述
*/
private String projectIntro;
/**
* 设计背景
*/
private String projectCreativity;
/**
* 科学设计
*/
private String scientificPrinciple;
/**
* 应用前景
*/
private String applicationProspect;
/**
* 路演形式
*/
private List<String> roadShowForm;
/**
* 创意实施或实验所受条件的限制
*/
private List<String> restriction;
/**
* 国家级重大、重点科研项目的科研成果转化项目
*/
private String projectTransform;
/**
* 学校科技成果转化
*/
private String resultTransfer;
/**
* 参赛申报人为科技成果的完成人或所有人
*/
private String competitionOwner;
/**
* 参赛申报人为科技成果的第一完成人或所有人
*/
private String competitionFirst;
/**
* 师生共创
*/
private String bothInvention;
/**
* 项目进展
*/
private String projectProgress;
/**
* 公司名称
*/
private String companyName;
/**
* 法人身份
*/
private String legalPersonStatus;
/**
* 法人姓名
*/
private String legalPersonName;
/**
* 职务
*/
private String position;
/**
* 注册资金
*/
private String registerFund;
/**
* 注册时间
*/
private String registerDate;
/**
* 注册省份
*/
private String registerProvince;
/**
* 注册地址
*/
private String registerAddress;
/**
* 统一社会信用代码
*/
private String unifyCode;
/**
* 财务报表
*/
private String financialStatement;
/**
* 隐私设置
*/
private String privacySetting;
/**
* 类型
*/
private String materialsType;
/**
* 大小
*/
private String materialsSize;
/**
* 名称
*/
private String materialsName;
/**
* 地址
*/
private String materialsUrl;
/**
* 股权结构
*/
private List<ProjectOwnershipStructureDO> po;
/**
* 项目材料
*/
private List<ProjectMaterialsDO> materials;
/**
* 填写进度
*/
private Integer fillInProgress;
}
package com.zhongzhi.vo.project;
import com.zhongzhi.common.utils.ExcelColumn;
import lombok.Data;
@Data
public class ProjectJudgeVO {
@ExcelColumn(col = 1, value = "届数")
private String matchName;
@ExcelColumn(col = 2, value = "项目名称")
private String projectName;
@ExcelColumn(col = 3, value = "负责人")
private String leader;
@ExcelColumn(col = 4, value = "组别")
private String projectProgress;
@ExcelColumn(col = 5, value = "院校")
private String college;
@ExcelColumn(col = 6, value = "阶段")
private String projectSchedule;
}
package com.zhongzhi.vo.project;
import lombok.Data;
@Data
public class ProjectNumVO {
/*
科技创新组复赛项目数量
*/
private Integer technologyRematchNum;
/*
科技创新组决赛项目数量
*/
private Integer technologyFinalNum;
/*
红色文创组复赛项目数量
*/
private Integer culturalRematchNum;
/*
红色文创组决赛项目数量
*/
private Integer culturalFinalNum;
/*
已评审数量
*/
private Integer reviewedNum;
/*
未评审数量
*/
private Integer notReviewedNum;
private String projectGroup;
}
package com.zhongzhi.vo.project;
import com.zhongzhi.model.ProjectMaterialsDO;
import lombok.Data;
import java.util.List;
@Data
public class ProjectPageVO {
private Long id;
private Long proposerId;
private Long matchId;
private String matchName;
private String projectName;
private String itemField;
private String projectGroup;
private String college;
private String name;
private Double score;
private String reviewOpinion;
private Double reviewScore;
private String projectProgress;
private String projectSchedule;
private String projectStatus;
private Integer status;
private Integer editStatus;
private String reviewStatus;
private String reviewResult;
private List<ProjectMaterialsDO> materials;
}
package com.zhongzhi.vo.project;
import lombok.Data;
@Data
public class QueryPdfStatusVO {
private Boolean uploadStatus;
}
package com.zhongzhi.vo.project;
import lombok.Data;
@Data
public class ReviewListVO {
private Long id;
private Long proposerId;
private String name;
private String projectName;
private String projectGroup;
private String school;
private String projectSchedule;
private String reviewResult;
private String projectAssigned;
private String projectProgress;
}
package com.zhongzhi.vo.project;
import com.zhongzhi.model.ProjectAwardDO;
import com.zhongzhi.model.ProjectCopyrightDO;
import com.zhongzhi.model.ProjectMaterialsDO;
import com.zhongzhi.model.ProjectOwnershipStructureDO;
import com.zhongzhi.model.ProjectPaperDO;
import com.zhongzhi.model.ProjectPatentDO;
import com.zhongzhi.model.ProjectTrademarkDO;
import com.zhongzhi.model.ProjectWorksDO;
import com.zhongzhi.vo.member.ProjectMemberVO;
import com.zhongzhi.vo.review.FinalsReviewVO;
import com.zhongzhi.vo.review.ReMatchReviewVO;
import lombok.Data;
import java.util.List;
@Data
public class SeedTrackProjectDetailVO extends ProjectMemberVO {
private Long id;
/**
* 申请人ID
*/
private Long proposerId;
/**
* 所属领域
*/
private String itemField;
/**
* 项目LOGO
*/
private String logoUri;
/**
* 项目名称
*/
private String projectName;
/**
* 组别
*/
private String projectGroup;
/**
* 赛事年份
*/
private Long matchId;
/**
* 申报项目时所在院校
*/
private String college;
/**
* 类别
*/
private String classification;
/**
* 所在地址
*/
private String address;
/**
* 项目概述
*/
private String projectIntro;
/**
* 设计背景
*/
private String projectCreativity;
/**
* 科学设计
*/
private String scientificPrinciple;
/**
* 应用前景
*/
private String applicationProspect;
/**
* 路演形式
*/
private String roadShowForm;
/**
* 创意实施或实验所受条件的限制
*/
private String restriction;
/**
* 国家级重大、重点科研项目的科研成果转化项目
*/
private String projectTransform;
/**
* 学校科技成果转化
*/
private String resultTransfer;
/**
* 参赛申报人为科技成果的完成人或所有人
*/
private String competitionOwner;
/**
* 参赛申报人为科技成果的第一完成人或所有人
*/
private String competitionFirst;
/**
* 师生共创
*/
private String bothInvention;
/**
* 项目进展
*/
private String projectProgress;
/**
* 项目阶段
*/
private String projectStage;
/**
* 公司名称
*/
private String companyName;
/**
* 法人身份
*/
private String legalPersonStatus;
/**
* 法人姓名
*/
private String legalPersonName;
/**
* 职务
*/
private String position;
/**
* 注册资金
*/
private String registerFund;
/**
* 注册时间
*/
private String registerDate;
/**
* 注册省份
*/
private String registerProvince;
/**
* 注册地址
*/
private String registerAddress;
/**
* 统一社会信用代码
*/
private String unifyCode;
/**
* 财务报表
*/
private String financialStatement;
/**
* 隐私设置
*/
private String privacySetting;
/**
* 项目状态
*/
private String projectStatus;
/**
* 项目进度
*/
private String projectSchedule;
/**
* 项目类型
*/
private String projectType;
/**
* 上传加盖公章的附件
*/
private String printAttachment;
/**
* 上传加盖公章的附件类型
*/
private String printAttachmentType;
/**
* 上传加盖公章的附件名称
*/
private String printAttachmentName;
/**
* 项目是否获得投资
*/
private String investment;
/**
* 项目PPT
*/
private String projectPptUrl;
/**
* 项目PPT类型
*/
private String projectPptType;
/**
* 项目PPT名称
*/
private String projectPptName;
private String email;
private String reviewStatus;
private Double reviewScore;
private String reviewOpinion;
/**
* 项目材料
*/
private List<ProjectMaterialsDO> materials;
/**
* 复赛评分
*/
private List<ReMatchReviewVO> rematch;
/**
* 决赛评分
*/
private List<FinalsReviewVO> finals;
/**
* 股权结构
*/
private List<ProjectOwnershipStructureDO> ownership;
/**
* 专利
*/
private List<ProjectPatentDO> patent;
/**
* 论文
*/
private List<ProjectPaperDO> paper;
/**
* 奖项
*/
private List<ProjectAwardDO> award;
/**
* 软件著作权
*/
private List<ProjectCopyrightDO> copyright;
/**
* 作品著作
*/
private List<ProjectWorksDO> works;
/**
* 商标
*/
private List<ProjectTrademarkDO> trademark;
private Integer editStatus;
private String vodUrl;
}
package com.zhongzhi.vo.project;
import lombok.Data;
@Data
public class SeedTrackProjectNumVO {
private Integer schoolProjectNum;
private Integer rematchProjectNum;
private Integer finalProjectNum;
}
package com.zhongzhi.vo.project;
import com.zhongzhi.model.ProjectMaterialsDO;
import lombok.Data;
import java.util.List;
@Data
public class SeedTrackProjectPageVO {
private Long id;
private String projectName;
private String projectGroup;
private String college;
private String name;
private String major;
private String telephone;
private String projectStatus;
private String applicationTime;
private String projectSchedule;
private String projectProgress;
/**
* 上传加盖公章的附件
*/
private String printAttachment;
private String printAttachmentType;
private String printAttachmentName;
/**
* 项目材料
*/
private List<ProjectMaterialsDO> materials;
/**
* 项目是否获得投资
*/
private String investment;
/**
* 项目PPT
*/
private String projectPptUrl;
/**
* 项目PPT类型
*/
private String projectPptType;
/**
* 项目PPT名称
*/
private String projectPptName;
private Integer editStatus;
}
package com.zhongzhi.vo.project;
import com.zhongzhi.vo.member.ProjectMemberVO;
import lombok.Data;
@Data
public class SeedTrackProjectVO extends ProjectMemberVO {
private Long id;
private String projectName;
private String classification;
/**
* 设计背景、思路
*/
private String projectCreativity;
/**
* 科学设计
*/
private String scientificPrinciple;
/**
* 应用前景
*/
private String applicationProspect;
/**
* 路演形式
*/
private String roadShowForm;
/**
* 创意实施或实验所受条件的限制
*/
private String restriction;
// 红色文创
/**
*
*/
private String projectIntro;
}
package com.zhongzhi.vo.project;
import lombok.Data;
@Data
public class VocationalNumVO {
/**
* 校内赛
*/
private Integer schoolProjectNum;
/**
* 复赛
*/
private Integer rematchNum;
/**
* 报名阶段
*/
private Integer registerNum;
/**
* 决赛
*/
private Integer finalNum;
}
package com.zhongzhi.vo.project;
import com.zhongzhi.model.ProjectAwardDO;
import com.zhongzhi.model.ProjectCopyrightDO;
import com.zhongzhi.model.ProjectOwnershipStructureDO;
import com.zhongzhi.model.ProjectPaperDO;
import com.zhongzhi.model.ProjectPatentDO;
import com.zhongzhi.model.ProjectTrademarkDO;
import com.zhongzhi.model.ProjectWorksDO;
import lombok.Data;
import java.util.List;
@Data
public class VocationalProjectInfoVO {
private Long id;
/**
* 所属领域
*/
private String itemField;
/**
* 项目LOGO
*/
private String logoUri;
/**
* 项目名称
*/
private String projectName;
/**
* 组别
*/
private String projectGroup;
/**
* 赛事年份
*/
private Long matchId;
/**
* 类别
*/
private String classification;
/**
* 所在地址
*/
private String address;
/**
* 项目概述
*/
private String projectIntro;
/**
* 设计背景
*/
private String projectCreativity;
/**
* 科学设计
*/
private String scientificPrinciple;
/**
* 应用前景
*/
private String applicationProspect;
/**
* 路演形式
*/
private String roadShowForm;
/**
* 创意实施或实验所受条件的限制
*/
private String restriction;
/**
* 国家级重大、重点科研项目的科研成果转化项目
*/
private String projectTransform;
/**
* 学校科技成果转化
*/
private String resultTransfer;
/**
* 参赛申报人为科技成果的完成人或所有人
*/
private String competitionOwner;
/**
* 参赛申报人为科技成果的第一完成人或所有人
*/
private String competitionFirst;
/**
* 师生共创
*/
private String bothInvention;
/**
* 项目进展
*/
private String projectProgress;
/**
* 项目阶段
*/
private String projectStage;
/**
* 公司名称
*/
private String companyName;
/**
* 法人身份
*/
private String legalPersonStatus;
/**
* 法人姓名
*/
private String legalPersonName;
/**
* 职务
*/
private String position;
/**
* 注册资金
*/
private String registerFund;
/**
* 注册时间
*/
private String registerDate;
/**
* 注册省份
*/
private String registerProvince;
/**
* 注册地址
*/
private String registerAddress;
/**
* 统一社会信用代码
*/
private String unifyCode;
/**
* 财务报表
*/
private String financialStatement;
/**
* 隐私设置
*/
private String privacySetting;
/**
* 项目状态
*/
private String projectStatus;
/**
* 项目进度
*/
private String projectSchedule;
/**
* 项目类型
*/
private String projectType;
/**
* 上传加盖公章的附件
*/
private String printAttachment;
/**
* 上传加盖公章的附件类型
*/
private String printAttachmentType;
/**
* 上传加盖公章的附件名称
*/
private String printAttachmentName;
/**
* 项目是否获得投资
*/
private String investment;
/**
* 项目PPT
*/
private String projectPptUrl;
/**
* 项目PPT类型
*/
private String projectPptType;
/**
* 项目PPT名称
*/
private String projectPptName;
/**
* 项目材料名称
*/
private String materialsName;
/**
* 项目材料大小
*/
private String materialsSize;
/**
* 项目材料类型
*/
private String materialsType;
/**
* 视频地址
*/
private String vodUrl;
/**
* 项目材料地址
*/
private String materialsUrl;
private List<ProjectOwnershipStructureDO> Ownership;
private List<ProjectPatentDO> Patent;
private List<ProjectPaperDO> Paper;
private List<ProjectAwardDO> Award;
private List<ProjectCopyrightDO> Copyright;
private List<ProjectWorksDO> Works;
private List<ProjectTrademarkDO> Trademark;
private Integer editStatus;
}
package com.zhongzhi.vo.project;
import lombok.Data;
@Data
public class VocationalProjectNum {
/**
* 中职复赛项目数量
*/
private Long vocRematchNum;
/**
* 中职决赛项目数量
*/
private Long vocFinalNum;
/**
* 高职复赛项目数量
*/
private Long secRematchNum;
/**
* 高职决赛项目数量
*/
private Long secFinalNum;
/**
* 高职初赛项目数量
*/
// private Long secPreliminaryNUm;
/**
* 已评审项目数量
*/
private Long reviewedNum;
/**
* 待评审项目数量
*/
private Long notReviewedNum;
}
package com.zhongzhi.vo.project;
import com.zhongzhi.common.utils.ExcelColumn;
import lombok.Data;
@Data
public class VocationalProjectVO {
@ExcelColumn(col = 1, value = "序号")
private Long id;
@ExcelColumn(col = 2, value = "项目名称")
private String projectName;
@ExcelColumn(col = 3, value = "赛道组别")
private String projectProgress;
@ExcelColumn(col = 4, value = "负责人姓名")
private String name;
@ExcelColumn(col = 5, value = "负责人手机号")
private String telephone;
@ExcelColumn(col = 6, value = "成员姓名")
private String teamMember;
@ExcelColumn(col = 7, value = "指导老师")
private String mentor;
}
package com.zhongzhi.vo.project;
import lombok.Data;
@Data
public class VocationalReviewNumVO {
/**
* 中职复赛项目数量
*/
private Long vocRematchNum;
/**
* 中职决赛项目数量
*/
private Long vocFinalNum;
/**
* 高职复赛项目数量
*/
private Long secRematchNum;
/**
* 高职决赛项目数量
*/
private Long secFinalNum;
/**
* 高职初赛项目数量
*/
private Long secPreliminaryNUm;
private Long review;
private Long notReview;
}
package com.zhongzhi.vo.projectReviewPeriod;
import lombok.Data;
@Data
public class ProjectReviewPeriodVO {
private Long id;
private String startTime;
private String endTime;
}
package com.zhongzhi.vo.review;
import lombok.Data;
@Data
public class FinalsReviewVO {
private Long id;
/**
* 评审分数
*/
private Double finalsScore;
/**
* 评委名字
*/
private String finalsJudgeName;
/**
* 评审时间
*/
private String finalsTime;
}
package com.zhongzhi.vo.review;
import lombok.Data;
@Data
public class ReMatchReviewVO {
private Long id;
/**
* 评审分数
*/
private Double rematchScore;
/**
* 评委名字
*/
private String rematchJudgeName;
/**
* 评审时间
*/
private String rematchTime;
}
package com.zhongzhi.vo.review;
import lombok.Data;
@Data
public class SchoolReviewVO {
private Long id;
/**
* 评审分数
*/
private Double schoolScore;
/**
* 评审意见
*/
private String schoolOpinion;
/**
* 评审结果
*/
private String schoolResult;
/**
* 评审时间
*/
private String schoolTime;
}
package com.zhongzhi.vo.review;
import lombok.Data;
import java.util.List;
@Data
public class SendNoticeVO {
private List<Long> id;
private Long matchId;
}
package com.zhongzhi.vo.scheduleRecord;
import lombok.Data;
@Data
public class ProjectScheduleRecordVO {
private Long id;
private String collegeName;
private Integer schoolProject;
private Integer rematchProject;
private Integer finalProject;
}
package com.zhongzhi.vo.student;
import lombok.Data;
@Data
public class StudentInfoVO {
private String token;
private String name;
private String avatar;
private String telephone;
private String education;
/**
* 就读院校
*/
private String college;
/**
* 就读专业
*/
private String major;
/**
* 入学年份
*/
private String enrollmentDate;
/**
* 毕业年份
*/
private String graduateDate;
}
# 本地环境配置
# 端口号
server.port=11210
# 数据源配置
spring.datasource.url=jdbc:mysql://116.62.57.92:3306/zhongzhi?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=devloper
spring.datasource.password=dev@1553$
spring.datasource.druid.initialSize=5
spring.datasource.druid.minIdle=5
spring.datasource.druid.maxActive=20
spring.datasource.druid.maxWait=60000
spring.datasource.druid.timeBetweenEvictionRunsMillis=60000
spring.datasource.druid.minEvictableIdleTimeMillis=300000
spring.datasource.druid.validationQuery=SELECT 1 FROM DUAL
spring.datasource.druid.testWhileIdle=true
spring.datasource.druid.testOnBorrow=false
spring.datasource.druid.testOnReturn=false
spring.datasource.druid.poolPreparedStatements=true
spring.datasource.druid.maxPoolPreparedStatementPerConnectionSize=20
spring.datasource.druid.useGlobalDataSourceStat=true
# 控制台日志打印
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
\ No newline at end of file
# 预生产环境配置
# 端口号
server.port=11210
# 数据源配置
spring.datasource.url=jdbc:mysql://116.62.57.92:3306/zhongzhi?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=devloper
spring.datasource.password=dev@1553$
spring.datasource.druid.initialSize=5
spring.datasource.druid.minIdle=5
spring.datasource.druid.maxActive=20
spring.datasource.druid.maxWait=60000
spring.datasource.druid.timeBetweenEvictionRunsMillis=60000
spring.datasource.druid.minEvictableIdleTimeMillis=300000
spring.datasource.druid.validationQuery=SELECT 1 FROM DUAL
spring.datasource.druid.testWhileIdle=true
spring.datasource.druid.testOnBorrow=false
spring.datasource.druid.testOnReturn=false
spring.datasource.druid.poolPreparedStatements=true
spring.datasource.druid.maxPoolPreparedStatementPerConnectionSize=20
spring.datasource.druid.useGlobalDataSourceStat=true
# 控制台日志打印
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
\ No newline at end of file
# 生产环境配置
# 端口号
server.port=11210
# 数据源配置
spring.datasource.url=jdbc:mysql://rm-uf69w46mo6agw0ahao.mysql.rds.aliyuncs.com:3306/zhongzhi?characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.username=ykadmin
spring.datasource.password=youkedb608@good
spring.datasource.druid.initialSize=5
spring.datasource.druid.minIdle=5
spring.datasource.druid.maxActive=20
spring.datasource.druid.maxWait=60000
spring.datasource.druid.timeBetweenEvictionRunsMillis=60000
spring.datasource.druid.minEvictableIdleTimeMillis=300000
spring.datasource.druid.validationQuery=SELECT 1 FROM DUAL
spring.datasource.druid.testWhileIdle=true
spring.datasource.druid.testOnBorrow=false
spring.datasource.druid.testOnReturn=false
spring.datasource.druid.poolPreparedStatements=true
spring.datasource.druid.maxPoolPreparedStatementPerConnectionSize=20
spring.datasource.druid.useGlobalDataSourceStat=true
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
\ No newline at end of file
# 环境配置
spring.profiles.active=prod
# 文件编码 UTF8
spring.mandatory-file-encoding=UTF-8
spring.jackson.time-zone=GMT+8
spring.servlet.multipart.max-file-size=100MB
spring.servlet.multipart.max-request-size=50MB
# 404 交给异常处理器处理
spring.mvc.throw-exception-if-no-handler-found=true
# 关闭静态资源的映射
spring.resources.add-mappings=false
# 关闭banner打印
mybatis-plus.global-config.banner=false
# mybatis-plus相关配置
mybatis-plus.mapper-locations=classpath:mapper/*.xml
# 是否开启自动驼峰命名规则映射
mybatis-plus.configuration.map-underscore-to-camel-case=true
# 如果查询结果中包含空值的列,则 MyBatis 在映射的时候,不会映射这个字段
mybatis-plus.configuration.call-setters-on-nulls=true
# 逻辑删除
mybatis-plus.global-config.db-config.logic-delete-value=NOW()
mybatis-plus.global-config.db-config.logic-not-delete-value=NULL
#日志配置
logging.config=classpath:logback-spring.xml
# 阿里云短信
sms.product=Dysmsapi
sms.domain=dysmsapi.aliyuncs.com
sms.accessKeyId=LTAI5tPAH7P7WQVeowo517BE
sms.accessKeySecret=0ueqhIfdAZyw5lWlBVSLpAxTtx37RY
sms.rcsapi=http://rcsapi.wo.cn:8000/umcinterface/sendtempletmsg
sms.cpcode=AABNUV
sms.excode=210120
sms.key=49197e89c95c9c6be46a1b420ff0d84d
vod.appId=1302252447
vod.secretId=AKIDOcePHvZ2C5VeYHQGSO5aqtlNxJQLqfz2
vod.secretKey=vjHYRmrfDbw0rWxA7oFcj7F8lDPKCm8E
vod.api=vod.tencentcloudapi.com
vod.region=ap-shanghai
vod.classId=848920
___ ___ __ ___ __ __ ___
|" \/" ||/"| / ")/" | | "\ |" |
\ \ / (: |/ /(: (__) :)|| |
\\ \/ | __/ \/ \/ |: |
/ / (// _ \ // __ \\ \ |___
/ / |: | \ \(: ( ) :)( \_|: \
|___/ (__| \__)\__| |__/ \_______)
c.code-message[0]=成功
c.code-message[10010]=PDF下载失败
c.code-message[10011]=发送失败,获取验证码频繁
# 学生
c.code-message[10020]=手机号已注册
c.code-message[10025]=验证码已过期
c.code-message[10021]=验证码不正确
c.code-message[10022]=输入的手机号和接收验证码手机号不一致
c.code-message[10023]=该身份证号已注册
c.code-message[10024]=手机号未注册
# 项目
c.code-message[10040]=项目已申请
c.code-message[10041]=项目负责人已存在
c.code-message[10042]=提交失败,您填写的项目信息不完整
c.code-message[10043]=项目已提交,请等待项目审核
c.code-message[10044]=撤回失败,您未申请项目
c.code-message[10045]=撤回失败,您的项目已进入审批状态
c.code-message[10046]=项目不存在
c.code-message[10047]=请选择要分配的项目
c.code-message[10048]=请选择要分配的评委
c.code-message[10049]=项目信息不完整
c.code-message[10050]=您不是该项目的评委
c.code-message[10051]=项目评分已提交
c.code-message[10052]=请先进行预评分
c.code-message[10053]=评委已分配了该项目
c.code-message[10054]=未指定赛事年份
c.code-message[10055]=创建失败,尚未处于大赛规定的报名时间
c.code-message[10056]=项目赛事已结束报名
c.code-message[10057]=赛事暂未开放
c.code-message[10058]=您已超过规定的项目上报数量
c.code-message[10059]=撤回失败,评委已进行了项目评分
c.code-message[10070]=撤回失败,评委不存在
c.code-message[10071]=撤回失败,项目未分配该评委
c.code-message[10072]=您已创建了类型的项目
c.code-message[10073]=撤回失败,项目已评审
c.code-message[10074]=不在评审时间内
c.code-message[10075]=评审已开始,不能撤回评委
c.code-message[10076]=请先设置评审起始时间
c.code-message[10077]=提交失败,有信息尚未填写
c.code-message[10078]=撤回失败,当前时间不在大赛时间段内
c.code-message[10079]=指导老师手机号不能重复
# 院校
c.code-message[10060]=账户不存在
c.code-message[10061]=密码错误
c.code-message[10062]=账户已存在
c.code-message[10063]=院校名称已存在
c.code-message[10064]=学校代码已存在
c.code-message[10065]=项目未分配评审
c.code-message[10066]=上传文件为空
c.code-message[10067]=系统已暂停登录功能
c.code-message[10068]=成员不能是负责人
c.code-message[10018]=不在大赛时间范围内
c.code-message[10019]=最多只能添加1位学校领队
c.code-message[10029]=最多只能添加9位观摩人员
c.code-message[10030]=车牌号已存在
c.code-message[10031]=不在申报时间范围内
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
<property name="LOG_PATH" value="logs/"/>
<property name="APP_NAME" value="springboot-logback"/>
<contextName>${APP_NAME}</contextName>
<jmxConfigurator/>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder>
<pattern>%d [%t] %5p %c:%L - %m%n</pattern>
<charset>UTF-8</charset>
</encoder>
</appender>
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${LOG_PATH}${APP_NAME}-info.log</File>
<encoder>
<pattern>%d [%t] %5p %c:%L - %m%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<FileNamePattern>${LOG_PATH}${APP_NAME}/info/%d{yyyy-MM-dd}-%i.log.gz
</FileNamePattern>
<MaxHistory>30</MaxHistory>
</rollingPolicy>
</appender>
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>${LOG_PATH}${APP_NAME}-error.log</File>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>error</level>
</filter>
<encoder>
<pattern>%d [%t] %5p %c:%L - %m%n</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>256MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<FileNamePattern>${LOG_PATH}${APP_NAME}/error/%d{yyyy-MM-dd}-%i.log.gz
</FileNamePattern>
<MaxHistory>30</MaxHistory>
</rollingPolicy>
</appender>
<springProfile name="dev">
<logger name="com.zhongzhi" level="error"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
<springProfile name="pre">
<logger name="com.zhongzhi" level="error"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
<springProfile name="prod">
<logger name="com.zhongzhi" level="error"/>
<root level="INFO">
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
</configuration>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.AdministerDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.AdministerDO">
<id column="id" property="id"/>
<result column="telephone" property="telephone"/>
<result column="username" property="username"/>
<result column="avatar" property="avatar"/>
<result column="role" property="role"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, telephone, username, avatar, role, create_time, update_time, delete_time
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.AdministerPermissionDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.AdministerPermissionDO">
<id column="id" property="id"/>
<result column="administer_id" property="administerId"/>
<result column="permission_id" property="permissionId"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, administer_id, permission_id, create_time, update_time, delete_time
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.CollegesDictDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.CollegesDictDO">
<id column="id" property="id"/>
<result column="code" property="code"/>
<result column="education" property="education"/>
<result column="name" property="name"/>
<result column="account" property="account"/>
<result column="password" property="password"/>
<result column="address" property="address"/>
<result column="leader_name" property="leaderName"/>
<result column="leader_post" property="leaderPost"/>
<result column="leader_phone" property="leaderPhone"/>
<result column="contact_name" property="contactName"/>
<result column="contact_post" property="contactPost"/>
<result column="contact_phone" property="contactPhone"/>
<result column="login_time" property="loginTime"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="login_status" property="loginStatus"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, code, name, education, account, password, address, login_time, create_time, update_time, delete_time,loginStatus
</sql>
<select id="listPage" resultType="com.zhongzhi.vo.college.CollegePageVO">
select
*
from colleges_dict
<where>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
and delete_time is null
</where>
</select>
<select id="getAwardedList" resultType="com.zhongzhi.vo.college.AwardedListVO">
select
*
from colleges_dict
<where>
<if test="name != null and name != ''">
and name like concat('%', #{name} ,'%')
</if>
and delete_time is null
</where>
</select>
<select id="getAwardedListAll" resultType="com.zhongzhi.vo.college.AwardedListVO">
select
*
from colleges_dict
where delete_time is null
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.CourseDictDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.CourseDictDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="course_name" property="courseName"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
delete_time,
id, course_name, vod_cnt
</sql>
<select id="courses" parameterType="string" resultType="com.zhongzhi.vo.course.CoursesVO">
SELECT
t.id,
t.course_name,
t3.cnt as vodCnt
FROM
course_dict t
LEFT JOIN ( SELECT t2.course_id, count( 1 ) AS cnt FROM vod_dict t2 WHERE t2.delete_time IS NULL GROUP BY t2.course_id ) t3 ON t.id = t3.course_id
WHERE
t.delete_time IS NULL
<if test="courseName != null and courseName != ''">
and t.course_name like concat('%', #{courseName}, '%')
</if>
and t.year_id =#{yearId}
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.FinalMatchMemberDAO">
<select id="registerMembers" parameterType="long" resultType="com.zhongzhi.vo.college.RegisterMembersVO">
SELECT
t.id,
t.project_id,
t3.college,
t2.`name` as userName,
t2.type,
t2.telephone,
t.id_card,
t3.project_name,
t.member_type
FROM
final_match_member t
LEFT JOIN project_member t2 ON t.member_id = t2.id
LEFT JOIN project t3 ON t.project_id = t3.id
WHERE
t.delete_time IS NULL
AND t2.delete_time IS NULL
AND t3.delete_time IS NULL
and t.project_id is not null
AND t.college_id =#{collegeId}
and t3.match_id = #{matchId}
</select>
<select id="otherMembers" resultType="com.zhongzhi.vo.college.RegisterMembersVO">
SELECT
t.id,
t4.`name` as college,
t.user_name,
t.member_type,
t.telephone,
t.id_card,
t3.project_name
FROM
final_match_member t
LEFT JOIN project t3 ON t.project_id = t3.id
left join colleges_dict t4 on t.college_id = t4.id
WHERE
t.delete_time IS NULL
AND t3.delete_time IS NULL
and t.project_id is null
AND t.college_id =#{collegeId}
and t.match_id = #{matchId}
and t.member_type != '车'
</select>
<select id="cars" resultType="com.zhongzhi.vo.college.RegisterMembersVO">
SELECT
t.id,
t4.`name` as college,
t.user_name,
t.member_type,
t.telephone,
t.id_card,
t3.project_name
FROM
final_match_member t
LEFT JOIN project t3 ON t.project_id = t3.id
left join colleges_dict t4 on t.college_id = t4.id
WHERE
t.delete_time IS NULL
AND t3.delete_time IS NULL
and t.project_id is null
AND t.college_id =#{collegeId}
and t.match_id = #{matchId}
and t.member_type = '车'
</select>
<select id="latestUpdateTime" parameterType="long" resultType="string">
SELECT
max( ddd )
FROM
(
SELECT
max( t.update_time ) ddd
FROM
final_match_member t
WHERE
t.college_id = #{collegeId} UNION
SELECT
max( t1.create_time ) ddd
FROM
final_match_member t1
WHERE
t1.college_id = #{collegeId} UNION
SELECT
max( t2.delete_time ) ddd
FROM
final_match_member t2
WHERE
t2.college_id = #{collegeId}
) t4
</select>
<select id="schools" resultType="com.zhongzhi.vo.college.SchoolsVO">
SELECT
t.college_id,
t3.NAME,
count( 1 ) AS cnt
FROM
final_match_member t
LEFT JOIN colleges_dict t3 ON t.college_id = t3.id
WHERE
t.delete_time IS NULL
AND t.match_id = #{matchId}
<if test="name != null and name != ''">
and t3.`name` like concat('%', #{name}, '%')
</if>
and t.member_type != '车'
GROUP BY
t.college_id
</select>
<select id="exportList" resultType="com.zhongzhi.vo.college.ExportListVO">
SELECT
t2.`name` collegeName,
t.user_name,
t.member_type,
t.telephone,
t.id_card,
t4.project_name
FROM
final_match_member t
LEFT JOIN colleges_dict t2 ON t.college_id = t2.id
LEFT JOIN project t4 ON t.project_id = t4.id
WHERE
t.delete_time IS NULL
AND t2.delete_time IS NULL
AND t4.delete_time IS NULL
AND t.match_id =#{matchId}
<if test="collegeId != null and collegeId != ''">
and t.college_id = #{collegeId}
</if>
ORDER BY
t2.`name`,
t4.project_name DESC,
t.order_no
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.FundDictDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.FundDictDO">
<id column="id" property="id"/>
<result column="fund_name" property="fundName"/>
<result column="year" property="year"/>
<result column="status" property="status"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, fund_name, year, status, create_time, update_time, delete_time
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ItemFieldDictDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ItemFieldDictDO">
<id column="id" property="id"/>
<result column="field" property="field"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, field, create_time, update_time, delete_time
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.MajorDictDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.MajorDictDO">
<id column="id" property="id"/>
<result column="code" property="code"/>
<result column="major" property="major"/>
<result column="education" property="education"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, code, major, education, create_time, update_time, delete_time
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.MatchCollegePdfMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.MatchDictDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.MatchDictDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="match_name" property="matchName"/>
<result column="match_date" property="matchDate"/>
<result column="status" property="status"/>
<result column="match_type" property="matchType"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
delete_time,
id, match_name, match_date, status, match_type
</sql>
<select id="getSeedTrackMatchPage" resultType="com.zhongzhi.vo.match.MatchDictVO">
select
*
from match_dict
where match_type = #{matchType}
and delete_time is null
</select>
<select id="getList" resultType="com.zhongzhi.model.MatchDictDO">
SELECT
p.*
FROM project p
LEFT JOIN student s ON s.id = p.proposer_id
LEFT JOIN colleges_dict c ON c.`name` = s.college
<where>
AND p.project_status != '填写中'
<if test="projectType != null and projectType != ''">
AND p.project_type = #{projectType}
</if>
<if test="projectGroup != null and projectGroup != ''">
AND p.project_group = #{projectGroup}
</if>
AND p.delete_time IS NULL
AND s.delete_time IS NULL
AND c.delete_time IS NULL
</where>
GROUP BY
c.id
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.MatchScheduleDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.MatchScheduleDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="match_id" property="matchId"/>
<result column="schedule_time" property="scheduleTime"/>
<result column="explains" property="explains"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
delete_time,
id, match_id, schedule_time, explains
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.MessageDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.MessageDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="title" property="title"/>
<result column="username" property="username"/>
<result column="content" property="content"/>
<result column="top" property="top"/>
<result column="release_time" property="releaseTime"/>
<result column="status" property="status"/>
<result column="attachment_url" property="attachmentUrl"/>
<result column="attachment_name" property="attachmentName"/>
<result column="attachment_type" property="attachmentType"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
delete_time,
id, title, username, content, top, release_time, status, attachment_url, attachment_name, attachment_type
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.PermissionsDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.PermissionsDO">
<id column="id" property="id"/>
<result column="parent_id" property="parentId"/>
<result column="name" property="name"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, parent_id, name, create_time, update_time, delete_time
</sql>
<select id="getPermissionById" resultType="com.zhongzhi.vo.permission.PermissionVO">
select
p.*
from permissions p
left join administer_permission ap on ap.permission_id = p.id
where ap.administer_id = #{id}
and p.delete_time is null
and p.delete_time is null
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectAwardMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectAwardDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="project_id" property="projectId"/>
<result column="award_title" property="awardTitle"/>
<result column="award_project_title" property="awardProjectTitle"/>
<result column="level" property="level"/>
<result column="prizewinner" property="prizewinner"/>
<result column="winning_time" property="winningTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
delete_time,
id, project_id, award_title, award_project_title, level, prizewinner, winning_time
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectCopyrightMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectCopyrightDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="project_id" property="projectId"/>
<result column="dynacomm" property="dynacomm"/>
<result column="copyright_owner" property="copyrightOwner"/>
<result column="right_acquisition_method" property="rightAcquisitionMethod"/>
<result column="development_date" property="developmentDate"/>
<result column="published_date" property="publishedDate"/>
<result column="interest_field" property="interestField"/>
<result column="register_number" property="registerNumber"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time
,
update_time,
delete_time,
id, project_id, dynacomm, copyright_owner, right_acquisition_method, development_date, published_date, interest_field, register_number
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="proposer_id" property="proposerId"/>
<result column="item_field" property="itemField"/>
<result column="logo_uri" property="logoUri"/>
<result column="project_name" property="projectName"/>
<result column="project_group" property="projectGroup"/>
<result column="match_id" property="matchId"/>
<result column="college" property="college" />
<result column="classification" property="classification"/>
<result column="address" property="address"/>
<result column="project_intro" property="projectIntro"/>
<result column="project_creativity" property="projectCreativity"/>
<result column="scientific_principle" property="scientificPrinciple"/>
<result column="application_prospect" property="applicationProspect"/>
<result column="road_show_form" property="roadShowForm"/>
<result column="restriction" property="restriction"/>
<result column="project_transform" property="projectTransform"/>
<result column="result_transfer" property="resultTransfer"/>
<result column="competition_owner" property="competitionOwner"/>
<result column="competition_first" property="competitionFirst"/>
<result column="both_invention" property="bothInvention"/>
<result column="project_progress" property="projectProgress"/>
<result column="project_stage" property="projectStage"/>
<result column="company_name" property="companyName"/>
<result column="legal_person_status" property="legalPersonStatus"/>
<result column="legal_person_name" property="legalPersonName"/>
<result column="position" property="position"/>
<result column="register_fund" property="registerFund"/>
<result column="register_date" property="registerDate"/>
<result column="register_province" property="registerProvince"/>
<result column="register_address" property="registerAddress"/>
<result column="unify_code" property="unifyCode"/>
<result column="print_attachment" property="printAttachment"/>
<result column="print_attachment_type" property="printAttachmentType"/>
<result column="print_attachment_name" property="printAttachmentName"/>
<result column="privacy_setting" property="privacySetting"/>
<result column="project_status" property="projectStatus"/>
<result column="project_schedule" property="projectSchedule"/>
<result column="project_type" property="projectType"/>
<result column="project_review" property="projectReview"/>
<result column="project_assigned" property="projectAssigned"/>
<result column="financial_statement" property="financialStatement"/>
<result column="edit_status" property="editStatus"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
id, proposer_id, item_field, logo_uri, project_name, project_group, match_id,college ,classification, address,
project_intro, project_creativity, scientific_principle, application_prospect, road_show_form, restriction,
project_transform, result_transfer, competition_owner, competition_first, both_invention, project_progress,
company_name, legal_person_status, legal_person_name, position, register_fund, register_date, register_province,
register_address, unify_code, privacy_setting, project_status, project_schedule, project_type, delelte_time
,print_attachment, print_attachment_type, print_attachment_name, project_review, project_assigned,edit_status
</sql>
<select id="getListPage" resultType="com.zhongzhi.vo.project.ProjectPageVO">
select
p.id,
p.match_id,
p.project_name,
p.project_group,
p.project_schedule,
p.project_status,
p.project_progress,
p.college,
p.edit_status,
s.name
from project p
left join student s on s.id = p.proposer_id
<where>
<if test="matchId != null and matchId != ''">
and match_id = #{matchId}
</if>
and p.project_type = #{projectType}
and proposer_id = #{proposerId}
and s.delete_time is null
and p.delete_time is null
</where>
</select>
<select id="getMainTrackProjectPage" resultType="com.zhongzhi.vo.project.MainTrackProjectPageVO">
select
p.*,
DATE_FORMAT(p.create_time, '%Y-%m-%d') as applicationTime
from project p
left join project_member pm on pm.project_id = p.id
<where>
and p.match_id = #{matchId}
and pm.type = #{type}
and p.project_type = #{projectType}
<if test="projectSchedule != null and projectSchedule != ''">
and p.project_schedule = #{projectSchedule}
</if>
<if test="projectStatus != null and projectStatus != ''">
and p.project_status = #{projectStatus}
</if>
<if test="itemField != null and itemField != ''">
and p.item_field = #{itemField}
</if>
<if test="name != null and name != ''">
and (p.project_name = #{name} or pm.school = #{name})
</if>
and (p.project_status != '填写中' and p.project_status != '已撤回')
and p.delete_time is null
and pm.delete_time is null
</where>
</select>
<select id="getSeedTrackProjectPage" resultType="com.zhongzhi.vo.project.SeedTrackProjectPageVO">
select
p.*,
p.college,
s.name,
s.major,
s.telephone,
DATE_FORMAT(p.create_time, '%Y-%m-%d') as applicationTime
from project p
left join student s ON s.id = p.proposer_id
<where>
and p.match_id = #{matchId}
and p.project_type = #{projectType}
and p.project_status != '填写中'
<if test="school != null and school != ''">
and p.college = #{school}
</if>
<if test="projectGroup != null and projectGroup != '' and projectGroup !='中职/高职'">
and p.project_group = #{projectGroup}
</if>
<if test="projectSchedule != null and projectSchedule != ''">
and p.project_schedule = #{projectSchedule}
</if>
<if test="projectStatus != null and projectStatus != ''">
<if test="projectStatus == '已评审'">
and p.project_status != '待评审'
</if>
<if test="projectStatus != '已评审'">
and p.project_status = #{projectStatus}
</if>
</if>
<if test="itemField != null and itemField != ''">
and p.item_field = #{itemField}
</if>
<if test="projectProgress != null and projectProgress != ''">
and p.project_progress = #{projectProgress}
</if>
<if test="name != null and name != ''">
and (p.project_name like concat('%',#{name},'%') or p.college like concat('%',#{name},'%'))
</if>
and p.delete_time is null
and s.delete_time is null
</where>
</select>
<select id="getReviewList" resultType="com.zhongzhi.vo.project.ReviewListVO">
select
*
from project
<where>
<if test="matchId != null and matchId != ''">
and match_id = #{matchId}
</if>
<if test="projectStatus != null and projectStatus != ''">
and project_schedule = #{projectStatus}
</if>
<if test="projectReview != null and projectReview != ''">
and project_review = #{projectReview}
</if>
<if test="projectName != null and projectName != ''">
and (project_name like concat('%', #{projectName}, '%') or college like concat('%', #{projectName}, '%'))
</if>
<if test="projectGroup != null and projectGroup != ''">
and project_group = #{projectGroup}
</if>
<if test="projectAssigned != null and projectAssigned != ''">
and project_assigned = #{projectAssigned}
</if>
<if test="projectProgress != null and projectProgress != ''">
and project_progress = #{projectProgress}
</if>
and project_schedule != '校级申请项目'
and delete_time is null
</where>
</select>
<select id="getProjectReviewPage" resultType="com.zhongzhi.vo.project.ProjectPageVO">
select
p.*,
pr.review_status as reviewStatus,
pr.review_score as reviewScore,
pr.score as score,
pr.review_opinion
from project p
left join project_review pr on pr.project_id = p.id
<where>
<if test="judgeId != null and judgeId != ''">
and pr.judge_id = #{judgeId}
</if>
<if test="matchId != null and matchId != ''">
and p.match_id = #{matchId}
</if>
<if test="projectSchedule != null and projectSchedule != ''">
and pr.project_schedule = #{projectSchedule}
</if>
<if test="projectReview != null and projectReview != ''">
and pr.review_status = #{projectReview}
</if>
<if test="projectName != null and projectName != ''">
and p.project_name like concat('%', #{projectName}, '%')
</if>
<if test="projectGroup != null and projectGroup != ''">
and p.project_group = #{projectGroup}
</if>
<if test="projectProgress != null and projectProgress != ''">
and p.project_progress = #{projectProgress}
</if>
and p.delete_time is null
and pr.delete_time is null
</where>
order by p.order_no
</select>
<select id="getProjectReviewList" resultType="com.zhongzhi.model.ProjectDO">
select
p.*,
pr.project_schedule as projectSchedule,
pr.review_status as projectReview
from project p
left join project_review pr on p.id = pr.project_id
where
p.match_id = #{matchId}
and pr.judge_id = #{id}
and p.delete_time is null
and pr.delete_time is null
<if test="projectProgress != null and projectProgress != '' ">
and p.project_progress = #{projectProgress}
</if>
</select>
<select id="getProjectByCollege" resultType="com.zhongzhi.model.ProjectDO">
select
p.*
from project p
left join student s on s.id = p.proposer_id
<where>
and p.match_id = #{matchId}
and s.college = #{name}
<if test="projectProgress != null and projectProgress != ''">
and p.project_progress = #{projectProgress}
</if>
and (p.project_status != '填写中' or p.project_status != '不予提交市级复赛')
and p.delete_time is null
and s.delete_time is null
</where>
</select>
<select id="getSeedTrackProjectList" resultType="com.zhongzhi.model.ProjectDO">
select
p.*
from project p
left join student s on s.id = p.proposer_id
<where>
<if test="matchId != null and matchId !=''">
and p.match_id = #{matchId}
</if>
<if test="projectGroup != null and projectGroup != ''">
and p.project_group = #{projectGroup}
</if>
<if test="name != null and name != ''">
and p.college = #{name}
</if>
<if test="projectProgress!= null and projectProgress != ''">
and p.project_progress = #{projectProgress}
</if>
and p.project_status != '填写中'
and p.delete_time is null
and s.delete_time is null
</where>
</select>
<select id="selectListByCollege" resultType="com.zhongzhi.model.ProjectDO">
select
p.*
from project p
left join student s on s.id = p.proposer_id
<where>
<if test="name != null and name != ''">
and s.college = #{name}
</if>
<if test="projectType != null and projectType != ''">
and p.project_type = #{projectType}
</if>
<if test="projectGroup != null and projectGroup != ''">
and p.project_group = #{projectGroup}
</if>
and p.project_status != '填写中'
and s.delete_time is null
and p.delete_time is null
</where>
</select>
<select id="getList" resultType="com.zhongzhi.model.ProjectDO">
select
p.*
from project p
left join student s on s.id = p.proposer_id
<where>
and p.match_id = #{matchId}
and s.college = #{name}
<if test="projectGroup != null and projectGroup != ''">
and p.project_group like concat('%', #{projectGroup}, '%')
</if>
and p.project_status != '填写中'
and p.delete_time is null
and s.delete_time is null
</where>
</select>
<select id="getProjectList" resultType="com.zhongzhi.vo.project.SeedTrackProjectPageVO">
select
p.*,
s.college,
s.name,
s.major,
s.telephone,
DATE_FORMAT(p.create_time, '%Y-%m-%d') as applicationTime
from project p
left join student s ON s.id = p.proposer_id
<where>
and p.match_id = #{matchId}
and p.project_group = #{projectGroup}
and p.project_status != '填写中'
<if test="projectSchedule != null and projectSchedule != ''">
and p.project_schedule = #{projectSchedule}
</if>
<if test="projectStatus != null and projectStatus != ''">
<if test="projectStatus == '已评审'">
and p.project_status != '待评审'
</if>
<if test="projectStatus != '已评审'">
and p.project_status = #{projectStatus}
</if>
</if>
<if test="name != null and name != ''">
and (p.project_name like concat('%',#{name},'%') or s.college like concat('%',#{name},'%'))
</if>
and p.delete_time is null
and s.delete_time is null
</where>
</select>
<select id="getListByJudgeId" resultType="com.zhongzhi.model.ProjectDO">
select
p.*
from project p
left join project_review pr on pr.project_id = p.id
<where>
<if test="matchId != null and matchId !=''">
and p.match_id = #{matchId}
</if>
<if test="projectGroup != null and projectGroup != ''">
and p.project_group = #{projectGroup}
</if>
<if test="judgeId != null and judgeId != ''">
and pr.judge_id = #{judgeId}
</if>
and p.project_status != '填写中'
and p.delete_time is null
and pr.delete_time is null
</where>
</select>
<select id="getProjectById" resultType="com.zhongzhi.model.ProjectDO">
select
*
from project
<where>
<choose>
<when test="ids.length != 0">
AND ( id in
<foreach collection="ids" open="(" separator="," close=")" item="item">
#{item}
</foreach>
)
</when>
</choose>
AND delete_time is null
</where>
</select>
<select id="projects" resultType="com.zhongzhi.model.ProjectDO">
SELECT
*
FROM
project t
WHERE
t.delete_time IS NULL
AND t.match_id = #{matchId}
AND t.college = #{college}
and t.project_schedule='市级决赛项目'
AND t.id NOT IN (
SELECT
t2.project_id
FROM
final_match_member t2
WHERE
t2.delete_time IS NULL
AND t2.college_id = #{collegeId}
AND t2.match_id = #{matchId}
and t2.project_id is not null
)
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectJudgeDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectJudgeDO">
<id column="id" property="id"/>
<result column="username" property="username"/>
<result column="telephone" property="telephone"/>
<result column="position" property="position"/>
<result column="unit" property="unit"/>
<result column="id_card" property="idCard"/>
<result column="bank_name" property="bankName"/>
<result column="bank_card" property="bankCard"/>
<result column="status" property="status"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, username, telephone, position, unit, status, create_time, update_time, delete_time
</sql>
<select id="getProjectJudgePage" resultType="com.zhongzhi.vo.judge.ProjectJudgePageVO">
select
*
from project_judge
<where>
<if test="username != null and username != ''">
and username like concat('%', #{username}, '%')
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
and delete_time is null
</where>
</select>
<select id="projectJudgesAssigned" resultType="com.zhongzhi.vo.judge.ProjectJudgePageVO">
select
pj.*
from project_judge pj
left join project_review pr on pr.judge_id = pj.id
left join project p on p.id = pr.project_id
<where>
<if test="projectGroup != null and projectGroup != ''">
and p.project_group = #{projectGroup}
</if>
<if test="projectSchedule != null and projectSchedule != ''">
and p.project_schedule = #{projectSchedule}
</if>
and p.match_id = #{matchId}
and pj.status = 1
and p.delete_time is null
and pj.delete_time is null
and pr.delete_time is null
</where>
group by pj.id
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectMaterialsDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectMaterialsDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="project_id" property="projectId"/>
<result column="materials_type" property="materialsType"/>
<result column="materials_size" property="materialsSize"/>
<result column="materials_name" property="materialsName"/>
<result column="materials_url" property="materialsUrl"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
delete_time,
id, project_id, materials_type, materials_size, materials_name, materials_url
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectMemberDAO">
<select id="projectMembers" resultType="com.zhongzhi.model.ProjectMemberDO">
SELECT
t.id,
t.school,
t.`name`,
t.type,
t.telephone,
t2.project_name,
IFNULL( t.id_card, t3.id_card ) idCard
FROM
project_member t
LEFT JOIN project t2 ON t.project_id = t2.id
LEFT JOIN student t3 ON t2.proposer_id = t3.id
WHERE
t.delete_time IS NULL
AND t.project_id = #{projectId}
AND t.type != '指导教师'
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectOwnershipStructureDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectOwnershipStructureDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="project_id" property="projectId"/>
<result column="shareholder_status" property="shareholderStatus"/>
<result column="shareholder_name" property="shareholderName"/>
<result column="shareholding_ratio" property="shareholdingRatio"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
delete_time,
id, project_id, shareholder_status, shareholder_name, shareholding_ratio
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectPaperMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectPaperDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="project_id" property="projectId"/>
<result column="paper_title" property="paperTitle"/>
<result column="published_journals" property="publishedJournals"/>
<result column="doi" property="doi"/>
<result column="common" property="common"/>
<result column="first_author" property="firstAuthor"/>
<result column="other_author" property="otherAuthor"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
delete_time,
id, project_id, paper_title, published_journals, doi, common, first_author, other_author
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectPatentMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectPatentDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="project_id" property="projectId"/>
<result column="country" property="country"/>
<result column="publication_number" property="publicationNumber"/>
<result column="patent_title" property="patentTitle"/>
<result column="patent_type" property="patentType"/>
<result column="patent_number" property="patentNumber"/>
<result column="patent_applicants" property="patentApplicants"/>
<result column="Issued_time" property="issuedTime"/>
<result column="expiration_time" property="expirationTime"/>
<result column="inventor" property="inventor"/>
<result column="other_inventors" property="otherInventors"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time
,
update_time,
delete_time,
id, project_id, country, publication_number, patent_title, patent_type, patent_number, patent_applicants, Issued_time, expiration_time, inventor, other_inventors
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectReviewDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectReviewDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="project_id" property="projectId"/>
<result column="judge_id" property="judgeId"/>
<result column="review_score" property="reviewScore"/>
<result column="score" property="score"/>
<result column="review_opinion" property="reviewOpinion"/>
<result column="project_schedule" property="projectSchedule"/>
<result column="review_time" property="reviewTime"/>
<result column="review_status" property="reviewStatus"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
delete_time,
id, project_id, judge_id, review_score, score, review_opinion, project_schedule, review_time, review_status
</sql>
<select id="getList" resultType="com.zhongzhi.vo.judge.ProjectReviewVO">
select
pj.username as judgesName,
pr.score as score
from project_review pr
left join project_judge pj on pj.id = pr.judge_id
where pr.project_id = #{projectId}
and pr.project_schedule = #{projectSchedule}
and pr.delete_time is null
and pj.delete_time is null
</select>
<select id="selectCountByMatchId" resultType="java.lang.Integer">
select
count(*)
from project_review pr
left join project p on pr.project_id = p.id
where p.match_id = #{matchId}
and pr.judge_id = #{judgeId}
and pr.delete_time is null
and p.delete_time is null
</select>
<select id="selectNotReviewCount" resultType="java.lang.Integer">
select
count(*)
from project_review pr
left join project p on pr.project_id = p.id
where p.match_id = #{matchId}
and pr.judge_id = #{judgeId}
and pr.review_status = '已分配'
and pr.delete_time is null
and p.delete_time is null
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectReviewPeriodMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectReviewPeriodDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="match_id" property="matchId"/>
<result column="project_group" property="projectGroup"/>
<result column="project_schedule" property="projectSchedule"/>
<result column="start_time" property="startTime"/>
<result column="end_time" property="endTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
delete_time,
id, match_id, project_group, project_schedule, start_time, end_time
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectScheduleRecordDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectScheduleRecordDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="proposer_id" property="proposerId"/>
<result column="project_id" property="projectId"/>
<result column="match_id" property="matchId"/>
<result column="college" property="college"/>
<result column="project_type" property="projectType"/>
<result column="project_schedule" property="projectSchedule"/>
<result column="project_status" property="projectStatus"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
delete_time,
id, proposer_id, project_id, match_id, project_type, project_schedule, college, project_status
</sql>
<select id="getProjectScheduleRecord" resultType="com.zhongzhi.vo.scheduleRecord.ProjectScheduleRecordVO">
select
p.id,
s.college as collegeName
from project p
left join student s on s.id = p.proposer_id
<where>
<if test="name != null and name != ''">
and p.project_name like concat('%', #{name}, '%')
</if>
and p.match_id = #{matchId}
and p.delete_time is null
and s.delete_time is null
</where>
group by s.college
</select>
<select id="getList" resultType="com.zhongzhi.model.ProjectScheduleRecordDO">
select
ps.*
from project_schedule_record ps
left join project p on p.id = ps.project_id
<where>
<if test="matchId != null and matchId != ''">
and ps.match_id = #{matchId}
</if>
<if test="college != null and college != ''">
and ps.college = #{college}
</if>
<if test="projectGroup != null and projectGroup != ''">
and p.project_group = #{projectGroup}
</if>
and ps.delete_time is null
and p.delete_time is null
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectTrademarkMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectTrademarkDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="project_id" property="projectId"/>
<result column="classification_number" property="classificationNumber"/>
<result column="trade_name" property="tradeName"/>
<result column="registered_person" property="registeredPerson"/>
<result column="registered_date" property="registeredDate"/>
<result column="effective_date" property="effectiveDate"/>
<result column="trademark_numbe" property="trademarkNumber"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time
,
update_time,
delete_time,
id, project_id, classification_number, trade_name, registered_person, registered_date, effective_date, trademark_number
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.ProjectWorksMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.ProjectWorksDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="project_id" property="projectId"/>
<result column="works_name" property="worksName"/>
<result column="author" property="author"/>
<result column="completion_date" property="completionDate"/>
<result column="first_publication_date" property="firstPublicationDate"/>
<result column="works_type" property="worksType"/>
<result column="register_number" property="registerNumber"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time
,
update_time,
delete_time,
id, project_id, works_name, author, completion_date, first_publication_date, works_type, register_number
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.SmsCodeDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.SmsCodeDO">
<id column="id" property="id"/>
<result column="telephone" property="telephone"/>
<result column="code" property="code"/>
<result column="type" property="type"/>
<result column="platform" property="platform"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, telephone, code, type, platform, create_time, update_time, delete_time
</sql>
<select id="getOneByTelePhone" resultType="com.zhongzhi.model.SmsCodeDO">
select
*
from
sms_code
where
create_time > DATE_ADD(
NOW(),
INTERVAL - 300 MINUTE)
and telephone = #{telephone}
and type = #{type}
and platform = #{platform}
and delete_time is null
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.SmsNoticeMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.SmsNoticeDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="project_id" property="projectId"/>
<result column="name" property="name"/>
<result column="telephone" property="telephone"/>
<result column="content" property="content"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time
,
update_time,
delete_time,
id, project_id, name, telephone, content
</sql>
<select id="getListByPage" resultType="com.zhongzhi.vo.notice.SmsNoticeVO">
SELECT
p.project_name,
sn.`name`,
sn.telephone,
DATE_FORMAT(sn.create_time, '%Y-%m-%d')
FROM
sms_notice sn
LEFT JOIN project p ON p.id = sn.project_id
<where>
<if test="">
AND sn.create_time like concat('%',#{date},'%')
</if>
<if test="">
AND (p.project_name like concat('%',#{name},'%') or sn.name like concat('%',#{name},'%'))
</if>
AND sn.delete_time is null
AND p.delete_time os null
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.StudentDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.StudentDO">
<id column="id" property="id"/>
<result column="name" property="name"/>
<result column="avatar" property="avatar"/>
<result column="id_card" property="idCard"/>
<result column="telephone" property="telephone"/>
<result column="education" property="education"/>
<result column="college_id" property="college"/>
<result column="major_id" property="major"/>
<result column="enrollment_date" property="enrollmentDate"/>
<result column="graduate_date" property="graduateDate"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, avatar, id_card, telephone, education, college, major, enrollment_date, graduate_date, create_time,
update_time, delete_time
</sql>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.VodDictDAO">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.zhongzhi.model.VodDictDO">
<id column="id" property="id"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
<result column="delete_time" property="deleteTime"/>
<result column="course_id" property="courseId"/>
<result column="vod_name" property="vodName"/>
<result column="vod_url" property="vodUrl"/>
<result column="vod_code" property="vodCode"/>
<result column="vod_length" property="vodLength"/>
<result column="vod_size" property="vodSize"/>
<result column="vod_format" property="vodFormat"/>
<result column="order_no" property="orderNo"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
create_time,
update_time,
delete_time,
id, course_id, vod_name, vod_url, vod_code, vod_length, vod_size, vod_format, order_no
</sql>
<select id="vods" parameterType="long" resultType="com.zhongzhi.vo.course.VodsVO">
SELECT
t.*,
t2.course_name
FROM
vod_dict t
LEFT JOIN course_dict t2 ON t.course_id = t2.id
WHERE
t.delete_time IS NULL
AND t2.delete_time IS NULL
AND t.course_id = #{courseId}
<if test="vodName != null and vodName != ''">
and t.vod_name like concat('%', #{vodName}, '%')
</if>
</select>
<select id="fourVods" resultType="com.zhongzhi.vo.course.VodsVO">
SELECT
t.*,
t2.course_name
FROM
vod_dict t
LEFT JOIN course_dict t2 ON t.course_id = t2.id
WHERE
t.delete_time IS NULL
AND t2.delete_time IS NULL
and t2.year_id = #{yearId}
order by t.create_time desc
limit 4
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhongzhi.dao.YearDictDAO">
</mapper>
# 此处为本项目src所在路径(代码生成器输出路径)
outputDir=/src/main/java/
author=DengMin
# 父的包名
setParent=com.zhongzhi
# mapper.xml文件生成路径
mapperPath=/src/main/resources/mapper/
# 数据库地址
url=jdbc:mysql://116.62.57.92:3306/zhongzhi
driverName=com.mysql.cj.jdbc.Driver
userName=devloper
password=dev@1553$
\ No newline at end of file
package ${package.Controller};
import org.springframework.web.bind.annotation.RequestMapping;
<#if restControllerStyle>
import org.springframework.web.bind.annotation.RestController;
<#else>
import org.springframework.stereotype.Controller;
</#if>
<#if superControllerClassPackage??>
import ${superControllerClassPackage};
</#if>
/**
* <p>
* ${table.comment!} 前端控制器
* </p>
*
* @author ${author}
* @since ${date}
*/
<#if restControllerStyle>
@RestController
<#else>
@Controller
</#if>
@RequestMapping("<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
<#if kotlin>
class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
<#else>
<#if superControllerClass??>
public class ${table.controllerName} extends ${superControllerClass} {
<#else>
public class ${table.controllerName} {
</#if>
}
</#if>
package ${package.Entity};
<#list table.importPackages as pkg>
import ${pkg};
</#list>
<#if swagger2>
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
</#if>
<#if entityLombokModel>
import lombok.Data;
import lombok.EqualsAndHashCode;
<#if chainModel>
import lombok.experimental.Accessors;
</#if>
</#if>
/**
* <p>
* ${table.comment!}
* </p>
*
* @author ${author}
* @since ${date}
*/
<#if entityLombokModel>
@Data
<#if superEntityClass??>
@EqualsAndHashCode(callSuper = true)
<#else>
@EqualsAndHashCode(callSuper = false)
</#if>
<#if chainModel>
@Accessors(chain = true)
</#if>
</#if>
<#if table.convert>
@TableName("${table.name}")
</#if>
<#if swagger2>
@ApiModel(value="${entity}对象", description="${table.comment!}")
</#if>
<#if superEntityClass??>
public class ${entity} extends ${superEntityClass}<#if activeRecord><${entity}></#if> {
<#elseif activeRecord>
public class ${entity} extends Model<${entity}> {
<#else>
public class ${entity} implements Serializable {
</#if>
<#if entitySerialVersionUID>
private static final long serialVersionUID = 1L;
</#if>
<#-- ---------- BEGIN 字段循环遍历 ---------->
<#list table.fields as field>
<#if field.keyFlag>
<#assign keyPropertyName="${field.propertyName}"/>
</#if>
<#if field.comment!?length gt 0>
<#if swagger2>
@ApiModelProperty(value = "${field.comment}")
<#else>
/**
* ${field.comment}
*/
</#if>
</#if>
<#if field.keyFlag>
<#-- 主键 -->
<#if field.keyIdentityFlag>
@TableId(value = "${field.annotationColumnName}", type = IdType.AUTO)
<#elseif idType??>
@TableId(value = "${field.annotationColumnName}", type = IdType.${idType})
<#elseif field.convert>
@TableId("${field.annotationColumnName}")
</#if>
<#-- 普通字段 -->
<#elseif field.fill??>
<#-- ----- 存在字段填充设置 ----->
<#if field.convert>
@TableField(value = "${field.annotationColumnName}", fill = FieldFill.${field.fill})
<#else>
@TableField(fill = FieldFill.${field.fill})
</#if>
<#elseif field.convert>
@TableField("${field.annotationColumnName}")
</#if>
<#-- 乐观锁注解 -->
<#if (versionFieldName!"") == field.name>
@Version
</#if>
<#-- 逻辑删除注解 -->
<#if (logicDeleteFieldName!"") == field.name>
@TableLogic
</#if>
private ${field.propertyType} ${field.propertyName};
</#list>
<#------------ END 字段循环遍历 ---------->
<#if !entityLombokModel>
<#list table.fields as field>
<#if field.propertyType == "boolean">
<#assign getprefix="is"/>
<#else>
<#assign getprefix="get"/>
</#if>
public ${field.propertyType} ${getprefix}${field.capitalName}() {
return ${field.propertyName};
}
<#if chainModel>
public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
<#else>
public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
</#if>
this.${field.propertyName} = ${field.propertyName};
<#if chainModel>
return this;
</#if>
}
</#list>
</#if>
<#if entityColumnConstant>
<#list table.fields as field>
public static final String ${field.name?upper_case} = "${field.name}";
</#list>
</#if>
<#if activeRecord>
@Override
protected Serializable pkVal() {
<#if keyPropertyName??>
return this.${keyPropertyName};
<#else>
return null;
</#if>
}
</#if>
<#if !entityLombokModel>
@Override
public String toString() {
return "${entity}{" +
<#list table.fields as field>
<#if field_index==0>
"${field.propertyName}=" + ${field.propertyName} +
<#else>
", ${field.propertyName}=" + ${field.propertyName} +
</#if>
</#list>
"}";
}
</#if>
}
package ${package.Mapper};
import ${package.Entity}.${entity};
import ${superMapperClassPackage};
/**
* <p>
* ${table.comment!} Mapper 接口
* </p>
*
* @author ${author}
* @since ${date}
*/
<#if kotlin>
interface ${table.mapperName} : ${superMapperClass}<${entity}>
<#else>
public interface ${table.mapperName} extends ${superMapperClass}<${entity}> {
}
</#if>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${package.Mapper}.${table.mapperName}">
<#if enableCache>
<!-- 开启二级缓存 -->
<cache type="org.mybatis.caches.ehcache.LoggingEhcache"/>
</#if>
<#if baseResultMap>
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="${package.Entity}.${entity}">
<#list table.fields as field>
<#if field.keyFlag><#--生成主键排在第一位-->
<id column="${field.name}" property="${field.propertyName}"/>
</#if>
</#list>
<#list table.commonFields as field><#--生成公共字段 -->
<result column="${field.name}" property="${field.propertyName}"/>
</#list>
<#list table.fields as field>
<#if !field.keyFlag><#--生成普通字段 -->
<result column="${field.name}" property="${field.propertyName}"/>
</#if>
</#list>
</resultMap>
</#if>
<#if baseColumnList>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
<#list table.commonFields as field>
${field.columnName},
</#list>
${table.fieldNames}
</sql>
</#if>
</mapper>
package ${package.Service};
import ${package.Entity}.${entity};
import ${superServiceClassPackage};
/**
* <p>
* ${table.comment!} 服务类
* </p>
*
* @author ${author}
* @since ${date}
*/
<#if kotlin>
interface ${table.serviceName} : ${superServiceClass}<${entity}>
<#else>
public interface ${table.serviceName} extends ${superServiceClass}<${entity}> {
}
</#if>
package ${package.ServiceImpl};
import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import ${superServiceImplClassPackage};
import org.springframework.stereotype.Service;
/**
* <p>
* ${table.comment!} 服务实现类
* </p>
*
* @author ${author}
* @since ${date}
*/
@Service
<#if kotlin>
open class ${table.serviceImplName} : ${superServiceImplClass}<${table.mapperName}, ${entity}>(), ${table.serviceName} {
}
<#else>
public class ${table.serviceImplName} extends ${superServiceImplClass}<${table.mapperName}, ${entity}> implements ${table.serviceName} {
}
</#if>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!