diff --git b/.gitignore a/.gitignore new file mode 100644 index 0000000..7763800 --- /dev/null +++ a/.gitignore @@ -0,0 +1,34 @@ +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 diff --git b/mvnw a/mvnw new file mode 100644 index 0000000..a16b543 --- /dev/null +++ a/mvnw @@ -0,0 +1,310 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`which java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git b/mvnw.cmd a/mvnw.cmd new file mode 100644 index 0000000..c8d4337 --- /dev/null +++ a/mvnw.cmd @@ -0,0 +1,182 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" +if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + +FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" +if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%" == "on" pause + +if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% + +exit /B %ERROR_CODE% diff --git b/pom.xml a/pom.xml new file mode 100644 index 0000000..6e083c4 --- /dev/null +++ a/pom.xml @@ -0,0 +1,206 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.1.7.RELEASE + + + com.subsidy + subsidy + 0.0.1 + subsidy + Demo project for Spring Boot + + + UTF-8 + UTF-8 + 1.8 + 3.3.0 + 3.3.2 + 2.9.2 + 1.2.58 + 2.0.0 + 3.13 + 1.1.0 + 4.4.6 + 3.9 + 1.1.22 + 5.2.0 + 5.4.1 + 3.10.3 + + + + + org.springframework.boot + spring-boot-starter + + + + org.freemarker + freemarker + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-aop + + + + com.tencentcloudapi + tencentcloud-sdk-java + 3.1.64 + + + + com.qcloud + vod_api + 2.1.2 + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + + mysql + mysql-connector-java + runtime + + + + com.alibaba + druid-spring-boot-starter + ${druid.version} + + + + org.springframework.boot + spring-boot-starter-jdbc + + + + org.projectlombok + lombok + + + + + com.baomidou + mybatis-plus-boot-starter + ${mybatis-plus.version} + + + + com.baomidou + mybatis-plus-generator + ${generator.version} + + + + com.alibaba + fastjson + ${fastjson.version} + + + + io.springfox + springfox-swagger2 + ${swagger2.version} + + + + io.springfox + springfox-swagger-ui + ${swagger2.version} + + + + com.amdelamar + jhash + ${jhash.version} + + + + org.apache.poi + poi-ooxml + ${poi-ooxml.version} + + + + com.aliyun + aliyun-java-sdk-dysmsapi + ${dysmsapi.version} + + + com.aliyun + aliyun-java-sdk-core + ${sdk-core.version} + + + org.apache.commons + commons-lang3 + ${lang3.version} + + + + com.itextpdf + itext-asian + ${itext-asian.version} + + + + com.itextpdf + itextpdf + ${itextpdf.version} + + + + com.auth0 + java-jwt + ${java-jwt.version} + + + + net.sf.json-lib + json-lib + 2.4 + jdk15 + + + + org.scilab.forge + jlatexmath + 1.0.7 + + + + + subsidy + + + org.springframework.boot + spring-boot-maven-plugin + + + + org.projectlombok + lombok + + + + + + + + diff --git b/src/main/java/com/meishu/MeishuApplication.java a/src/main/java/com/meishu/MeishuApplication.java new file mode 100644 index 0000000..986f2e8 --- /dev/null +++ a/src/main/java/com/meishu/MeishuApplication.java @@ -0,0 +1,39 @@ +package com.meishu; + +import com.alibaba.druid.support.http.StatViewServlet; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SpringBootApplication +@MapperScan(basePackages = {"com.meishu.mapper"}) +@EnableScheduling +@EnableAsync +public class MeishuApplication { + + public static void main(String[] args) { + SpringApplication.run(MeishuApplication.class, args); + } + + @Bean + public ServletRegistrationBean druidStatViewServlet() { + //先配置管理后台的servLet,访问的入口为/druid/ + ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean( + new StatViewServlet(), "/druid/*"); + // IP白名单 (没有配置或者为空,则允许所有访问) + servletRegistrationBean.addInitParameter("allow", "127.0.0.1"); + // IP黑名单 (存在共同时,deny优先于allow) + servletRegistrationBean.addInitParameter("deny", ""); + servletRegistrationBean.addInitParameter("loginUsername", "admin"); + servletRegistrationBean.addInitParameter("loginPassword", "yhkl1234"); + servletRegistrationBean.addInitParameter("resetEnable", "false"); + return servletRegistrationBean; + } + +} diff --git b/src/main/java/com/meishu/common/Code.java a/src/main/java/com/meishu/common/Code.java new file mode 100644 index 0000000..8aa1868 --- /dev/null +++ a/src/main/java/com/meishu/common/Code.java @@ -0,0 +1,45 @@ +package com.meishu.common; + +public enum Code { + + USERNAMENOTFOUND(10001, "用户不存在"), + BADCREDENTIALS(10002,"账户或者密码错误"), + ACCOUNTEXPIRED(10003,"账户过期"), + LOCKEDEXCEPTION(10004, "账户已锁定"), + DISABLEDEXCEPTION(10005,"账户已禁用"), + ACCESSDENIED(10006,"无权限访问"), + AUTHENTICATION(10007,"身份验证异常"), + NOHANDLERFOUND(10008,"找不到相应的视图处理器"), + PARAM_INVALID(10009, "参数不合法"), + TOKEN_EXCEPTION(10010, "Token不合法"), + TOKEN_EXPIRED(10011, "Token已过期"), + OSS_ERROR(10012, "OSS文件上传异常"), + Network_ERROR(90000, "网络请求失败"), + SERVER_INTERNAL_ERROR(99999, "服务器内部错误"), + ; + + private Integer code; + + private String message; + + Code(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git b/src/main/java/com/meishu/common/ResponseData.java a/src/main/java/com/meishu/common/ResponseData.java new file mode 100644 index 0000000..c80c3a8 --- /dev/null +++ a/src/main/java/com/meishu/common/ResponseData.java @@ -0,0 +1,54 @@ +package com.meishu.common; + +import com.meishu.common.configure.RemoteProperties; +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 ResponseVO generateCreatedResponse(int code) { + return (ResponseVO) ResponseVO.builder() + .code(code) + .message(RemoteProperties.getMessage(code)) + .build(); + } + + public static ResponseVO generateCreatedResponse(int code, String message) { + return (ResponseVO) ResponseVO.builder() + .code(code) + .message(message) + .build(); + } + + public static ResponseVO generateCreatedResponse(int code, T data) { + return (ResponseVO) ResponseVO.builder() + .code(code) + .message(RemoteProperties.getMessage(code)) + .data(data) + .build(); + } + + public static ResponseVO generateCreatedResponse(int code, String message, T data) { + return (ResponseVO) ResponseVO.builder() + .code(code) + .message(message) + .data(data) + .build(); + } + + public static ResponseVO generateCreatedResponse(int code, String message, String path) { + return (ResponseVO) ResponseVO.builder() + .code(code) + .message(message) + .path(path) + .build(); + } +} \ No newline at end of file diff --git b/src/main/java/com/meishu/common/ResponseVO.java a/src/main/java/com/meishu/common/ResponseVO.java new file mode 100644 index 0000000..7cc4173 --- /dev/null +++ a/src/main/java/com/meishu/common/ResponseVO.java @@ -0,0 +1,21 @@ +package com.meishu.common; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ResponseVO { + + private Integer code; + + private String message; + + private T data; + + private String path; +} \ No newline at end of file diff --git b/src/main/java/com/meishu/common/configure/AliyunSmsProperties.java a/src/main/java/com/meishu/common/configure/AliyunSmsProperties.java new file mode 100644 index 0000000..d47f388 --- /dev/null +++ a/src/main/java/com/meishu/common/configure/AliyunSmsProperties.java @@ -0,0 +1,19 @@ +package com.meishu.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; +} diff --git b/src/main/java/com/meishu/common/configure/MybatisPlusConfig.java a/src/main/java/com/meishu/common/configure/MybatisPlusConfig.java new file mode 100644 index 0000000..a95a738 --- /dev/null +++ a/src/main/java/com/meishu/common/configure/MybatisPlusConfig.java @@ -0,0 +1,54 @@ +package com.meishu.common.configure; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.core.config.GlobalConfig; +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import com.meishu.common.handler.MetaHandler; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author: tuyp + * @create: 2020-08-12 12:01 + */ +@Configuration +@ConditionalOnClass(value = {PaginationInterceptor.class}) +public class MybatisPlusConfig { + + /** + * 分页 + * @return + */ + @Bean + public PaginationInterceptor paginationInterceptor(){ + PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); + paginationInterceptor.setDialectType(DbType.MYSQL.getDb()); + return paginationInterceptor; + } +// +// /** +// * 打印 sql +// */ +// @Bean +// public PerformanceInterceptor performanceInterceptor() { +// PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor(); +// //格式化sql语句 +// Properties properties = new Properties(); +// properties.setProperty("format", "false"); +// performanceInterceptor.setProperties(properties); +// return performanceInterceptor; +// } + + /** + * 自动填充功能 + * @return + */ + @Bean + public GlobalConfig globalConfig() { + GlobalConfig globalConfig = new GlobalConfig(); + globalConfig.setMetaObjectHandler(new MetaHandler()); + return globalConfig; + } + +} diff --git b/src/main/java/com/meishu/common/configure/RemoteProperties.java a/src/main/java/com/meishu/common/configure/RemoteProperties.java new file mode 100644 index 0000000..043c5e9 --- /dev/null +++ a/src/main/java/com/meishu/common/configure/RemoteProperties.java @@ -0,0 +1,36 @@ +package com.meishu.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; + +/** + *

+ * 读取状态码 + *

+ * + * @author DengMin + * @date Created in 2020/08/24 + */ +@Component +@ConfigurationProperties(prefix = "meishu") +@PropertySource(value = "classpath:code.properties", encoding = "UTF-8") +public class RemoteProperties { + + private static Map codeMessage = new HashMap<>(); + + public static String getMessage(Integer code) { + return codeMessage.get(code); + } + + public Map getCodeMessage() { + return codeMessage; + } + + public void setCodeMessage(Map codeMessage) { + RemoteProperties.codeMessage = codeMessage; + } +} \ No newline at end of file diff --git b/src/main/java/com/meishu/common/configure/RestTemplateConfig.java a/src/main/java/com/meishu/common/configure/RestTemplateConfig.java new file mode 100644 index 0000000..5f9887c --- /dev/null +++ a/src/main/java/com/meishu/common/configure/RestTemplateConfig.java @@ -0,0 +1,31 @@ +package com.meishu.common.configure; + +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; + +import java.util.ArrayList; +import java.util.List; + +@Component +public class RestTemplateConfig { + + @Bean + public RestTemplate restTemplate() { + RestTemplate restTemplate = new RestTemplate(); + restTemplate.getMessageConverters().add(new WxMappingJackson2HttpMessageConverter()); + return restTemplate; + } + + public class WxMappingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter { + public WxMappingJackson2HttpMessageConverter(){ + List mediaTypes = new ArrayList<>(); + mediaTypes.add(MediaType.TEXT_PLAIN); + mediaTypes.add(MediaType.TEXT_HTML); + setSupportedMediaTypes(mediaTypes); + } + } + +} diff --git b/src/main/java/com/meishu/common/configure/SwaggerConfig.java a/src/main/java/com/meishu/common/configure/SwaggerConfig.java new file mode 100644 index 0000000..ae3f471 --- /dev/null +++ a/src/main/java/com/meishu/common/configure/SwaggerConfig.java @@ -0,0 +1,31 @@ +package com.meishu.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; + +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .pathMapping("/") + .select() + .apis(RequestHandlerSelectors.basePackage("com.meishu")) + .paths(PathSelectors.any()) + .build().apiInfo(new ApiInfoBuilder() + .title("市西cms") + .description("接口文档规范") + .version("1.0") +// .contact(new Contact("啊啊啊啊","www.youkehulian.com","tcp@meishu.com")) +// .license("The Apache License") +// .licenseUrl("http://www.baidu.com") + .build()); + } +} diff --git b/src/main/java/com/meishu/common/configure/VODConfig.java a/src/main/java/com/meishu/common/configure/VODConfig.java new file mode 100644 index 0000000..0b42810 --- /dev/null +++ a/src/main/java/com/meishu/common/configure/VODConfig.java @@ -0,0 +1,25 @@ +package com.meishu.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; +} diff --git b/src/main/java/com/meishu/common/configure/WebConfig.java a/src/main/java/com/meishu/common/configure/WebConfig.java new file mode 100644 index 0000000..a8b746a --- /dev/null +++ a/src/main/java/com/meishu/common/configure/WebConfig.java @@ -0,0 +1,61 @@ +package com.meishu.common.configure; + +import com.meishu.common.interceptor.AuthenticationInterceptor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * @author DengMin + * @date 2020/07/06 + **/ +@Configuration +public class WebConfig implements WebMvcConfigurer { + + @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); + } + + /** + * 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/"); + } + + /** + * 鉴权 + * @param registry + */ + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(authenticationInterceptor) + .excludePathPatterns("/static/*") + .addPathPatterns("/**"); + } + + + +} \ No newline at end of file diff --git b/src/main/java/com/meishu/common/configure/WebLogAspect.java a/src/main/java/com/meishu/common/configure/WebLogAspect.java new file mode 100644 index 0000000..c4deaf1 --- /dev/null +++ a/src/main/java/com/meishu/common/configure/WebLogAspect.java @@ -0,0 +1,56 @@ +package com.meishu.common.configure; + +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; + +@Aspect +@Component +public class WebLogAspect { + + private final Logger logger = LoggerFactory.getLogger(WebLogAspect.class); + + @Pointcut("execution(public * com.meishu.controller.*.*(..))")//切入点描述 这个是controller包的切入点 + public void controllerLog(){}//签名,可以理解成这个切入点的一个名称 + + @Pointcut("execution(public * com.meishu.controller.*.*(..))") + public void serviceImplLog(){} + + @Before("controllerLog()") //在切入点的方法run之前要干的 + public void logBeforeController(JoinPoint joinPoint) { + + + RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); + //这个RequestContextHolder是Springmvc提供来获得请求的东西 + HttpServletRequest request = ((ServletRequestAttributes)requestAttributes).getRequest(); + + // 记录下请求内容 + logger.info("####requestUrl : " + request.getRequestURL().toString()); + logger.info("####requestParam : " + Arrays.toString(joinPoint.getArgs())); + + } + +// @Around("serviceImplLog()") +// public Object afterController(ProceedingJoinPoint proceedingJoinPoint) { +// +// Object result = null; +// +// try{ +// result = proceedingJoinPoint.proceed(); +// logger.info("====reulst"+result); +// }catch (Throwable e){ +// MyException myException =(MyException)e; +// throw myException; +// } +// return result; +// } + +} \ No newline at end of file diff --git b/src/main/java/com/meishu/common/configure/WechatConfig.java a/src/main/java/com/meishu/common/configure/WechatConfig.java new file mode 100644 index 0000000..042038f --- /dev/null +++ a/src/main/java/com/meishu/common/configure/WechatConfig.java @@ -0,0 +1,24 @@ +package com.meishu.common.configure; + + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Data +@Configuration +@ConfigurationProperties(prefix = "wechat") +public class WechatConfig { + + private String appId; + + private String appSecret; + + private String msgUrl; + + private String templateId; + + private String agentId; + + +} diff --git b/src/main/java/com/meishu/common/constant/AttendanceConstant.java a/src/main/java/com/meishu/common/constant/AttendanceConstant.java new file mode 100644 index 0000000..33b119d --- /dev/null +++ a/src/main/java/com/meishu/common/constant/AttendanceConstant.java @@ -0,0 +1,29 @@ +package com.meishu.common.constant; + +public class AttendanceConstant { + + /** + * 创建预约api + */ + public static final String CREATE_TOPIC_URL = "https://open.api.roomis.com.cn/api/my/booking/spaces/{spaceId}/events"; + + /** + * 考勤api + */ + public static final String GET_ATTENDANCE_URL = "https://open.api.roomis.com.cn/api/attendance/{id}"; + + /** + * 创建人ID + */ + public static Long organizerId = 200000222L; + + /** + * 开始时间 + */ + public static String startTime = "07:00:00"; + + /** + * 结束时间 + */ + public static String endTime = "21:00:00"; +} diff --git b/src/main/java/com/meishu/common/constant/Code.java a/src/main/java/com/meishu/common/constant/Code.java new file mode 100644 index 0000000..58388c5 --- /dev/null +++ a/src/main/java/com/meishu/common/constant/Code.java @@ -0,0 +1,33 @@ +package com.meishu.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(1013, "令牌验证失败"), + OSS_ERROR(1012, "OSS文件上传异常"), + Network_ERROR(9000, "网络请求失败"), + SERVER_INTERNAL_ERROR(99999, "服务器内部错误"), + ; + + private Integer code; + + private String message; + + Code(Integer code, String message) { + this.code = code; + this.message = message; + } +} diff --git b/src/main/java/com/meishu/common/constant/WxConstant.java a/src/main/java/com/meishu/common/constant/WxConstant.java new file mode 100644 index 0000000..b9ad76d --- /dev/null +++ a/src/main/java/com/meishu/common/constant/WxConstant.java @@ -0,0 +1,35 @@ +package com.meishu.common.constant; + +public class WxConstant { + + /** + * app id + */ + public static final String APPID = "wx75ec06e9ce50ef73"; + + /** + * 秘钥 + */ + public static final String SECRENT = "c039d32804278503474dfcf7cb3944b9"; + + /** + * 获取访问用户身份 + */ + public static final String GETUSERINFO = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token={access_token}&code={code}"; + + /** + * 读取成员 + */ + public static final String GET = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token={access_token}&userid={userid}"; + + /** + * 获取access_token + */ + public static final String GET_SUITE_TOKEN = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={appid}&secret={secret}"; + + + /** + * 扫码登陆回调地址 + */ + public static final String QR_REDIRECT_URL = "http://massadmin.youkehulian.com"; +} diff --git b/src/main/java/com/meishu/common/exception/GlobalExceptionHandler.java a/src/main/java/com/meishu/common/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..f20187c --- /dev/null +++ a/src/main/java/com/meishu/common/exception/GlobalExceptionHandler.java @@ -0,0 +1,118 @@ +package com.meishu.common.exception; + +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.configure.RemoteProperties; +import com.meishu.common.constant.Code; +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; + +/** + * 异常处理 + * @author DengMin + * @date 2020/07/14 + **/ +@Slf4j +@RestControllerAdvice +public class GlobalExceptionHandler { + + /** + * 自定义异常 + * @param e + * @return + */ + @ExceptionHandler(value = HttpException.class) + public ResponseVO 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 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 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 validateException(MethodArgumentNotValidException e){ + final List 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 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 BindException(BindException e){ + final List 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 serverInternalError(Exception e, HttpServletRequest request) { + String url = request.getRequestURI(); + log.error("path:"+url); + log.error("---- error message: ---"+e.toString()); + return ResponseData.generateCreatedResponse(Code.SERVER_INTERNAL_ERROR.getCode(), Code.SERVER_INTERNAL_ERROR.getMessage(), url); + } +} \ No newline at end of file diff --git b/src/main/java/com/meishu/common/exception/HttpException.java a/src/main/java/com/meishu/common/exception/HttpException.java new file mode 100644 index 0000000..d38b63a --- /dev/null +++ a/src/main/java/com/meishu/common/exception/HttpException.java @@ -0,0 +1,45 @@ +package com.meishu.common.exception; + + +import com.meishu.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; + } +} diff --git b/src/main/java/com/meishu/common/handler/MetaHandler.java a/src/main/java/com/meishu/common/handler/MetaHandler.java new file mode 100644 index 0000000..3d42a8f --- /dev/null +++ a/src/main/java/com/meishu/common/handler/MetaHandler.java @@ -0,0 +1,26 @@ +package com.meishu.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("createDate", LocalDateTime.now(), metaObject); + } + + @Override + public void updateFill(MetaObject metaObject) { + this.setFieldValByName("updateDate", LocalDateTime.now(), metaObject); + } +} diff --git b/src/main/java/com/meishu/common/interceptor/AuthenticationInterceptor.java a/src/main/java/com/meishu/common/interceptor/AuthenticationInterceptor.java new file mode 100644 index 0000000..a3dc6e7 --- /dev/null +++ a/src/main/java/com/meishu/common/interceptor/AuthenticationInterceptor.java @@ -0,0 +1,85 @@ +package com.meishu.common.interceptor; + +import com.auth0.jwt.interfaces.Claim; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.meishu.common.exception.HttpException; +import com.meishu.mapper.AdministerMapper; +import com.meishu.model.AdministerDO; +import com.meishu.util.JwtUtil; +import com.meishu.util.Localstorage; +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.Map; + +/** + *

+ * 鉴权拦截器 + *

+ * + * @author DengMin + * @since 2021/4/14 + */ +@Component +public class AuthenticationInterceptor implements HandlerInterceptor { + + + @Autowired + private AdministerMapper administerMapper; + + @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)) { + String token = authorization; + if (authorization.startsWith("Bearer")) { + token = authorization.replace("Bearer ", ""); + } + /*Token不存在*/ + if (token == null || JwtUtil.isExpired(token) || !JwtUtil.verifyToken(token)) { + throw new HttpException(1010); + } + + Map claimMap = JwtUtil.getClaims(token); + if (claimMap != null) { + String[] role = methodAnnotation.value(); + String type = claimMap.get("type").asString(); + if (role.length > 0) { + if ("administer".equals(type)) { + AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong()); + if (administerDO != null) { + Localstorage.setUser(administerDO); + return true; + } + } else { + throw new HttpException(1010); + } + } else { + AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong()); + if (administerDO != null) { + Localstorage.setUser(administerDO); + return true; + } + } + } +// return true; + } + throw new HttpException(1010); + } + return true; + } +} diff --git b/src/main/java/com/meishu/common/interceptor/LoginRequired.java a/src/main/java/com/meishu/common/interceptor/LoginRequired.java new file mode 100644 index 0000000..0dab707 --- /dev/null +++ a/src/main/java/com/meishu/common/interceptor/LoginRequired.java @@ -0,0 +1,20 @@ +package com.meishu.common.interceptor; + +import java.lang.annotation.*; + +/** + *

+ * 自定义验证登陆注解 + *

+ * + * @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 diff --git b/src/main/java/com/meishu/common/schedule/ChangeStudentStatus.java a/src/main/java/com/meishu/common/schedule/ChangeStudentStatus.java new file mode 100644 index 0000000..5b16f0a --- /dev/null +++ a/src/main/java/com/meishu/common/schedule/ChangeStudentStatus.java @@ -0,0 +1,20 @@ +package com.meishu.common.schedule; + +import com.meishu.mapper.StudentMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +@Component +public class ChangeStudentStatus { + + @Autowired + private StudentMapper studentMapper; + + @Scheduled(cron = "0 30 20 * * ?") + public void changeStudentStatus(){ + System.out.println("========="); + studentMapper.changeStudentStatus(); + } + +} diff --git b/src/main/java/com/meishu/controller/AccessTokenController.java a/src/main/java/com/meishu/controller/AccessTokenController.java new file mode 100644 index 0000000..186f3a7 --- /dev/null +++ a/src/main/java/com/meishu/controller/AccessTokenController.java @@ -0,0 +1,45 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.token.GetAllStudentsDTO; +import com.meishu.dto.token.GetAllTeachersDTO; +import com.meishu.model.AdministerDO; +import com.meishu.model.UserRoleDO; +import com.meishu.service.AccessTokenService; +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 io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-10 + */ +@RestController +@Api(tags = "公共接口") +@RequestMapping("/public") +public class AccessTokenController { + + @Autowired + private AccessTokenService accessTokenService; + + @PostMapping("getAllTeachers") + public ResponseVO getAllTeachers(@RequestBody GetAllTeachersDTO getAllTeachersDTO){ + return ResponseData.generateCreatedResponse(0,accessTokenService.getAllTeachers(getAllTeachersDTO)); + } + + @PostMapping("getAllStudents") + public ResponseVO getAllStudents(@RequestBody GetAllStudentsDTO getAllStudentsDTO){ + return ResponseData.generateCreatedResponse(0,accessTokenService.getAllStudents(getAllStudentsDTO)); + } + +} diff --git b/src/main/java/com/meishu/controller/AdministerController.java a/src/main/java/com/meishu/controller/AdministerController.java new file mode 100644 index 0000000..2845495 --- /dev/null +++ a/src/main/java/com/meishu/controller/AdministerController.java @@ -0,0 +1,109 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.administer.AddAdministerDTO; +import com.meishu.dto.administer.ChangeStatusDTO; +import com.meishu.dto.administer.PublishTasksDTO; +import com.meishu.dto.administer.UpdateAdministerDTO; +import com.meishu.dto.exercise.UpdateStatusDTO; +import com.meishu.dto.test.PublishTestDTO; +import com.meishu.model.AdministerDO; +import com.meishu.model.SmsCodeDO; +import com.meishu.service.AdministerService; +import com.meishu.util.ConstantUtils; +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; + +/** + *

+ * 中心管理账户表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@RestController +@Api(tags= "管理平台用户") +@RequestMapping("/administer") +public class AdministerController { + + @Autowired + private AdministerService administerService; + + @PostMapping("sendMsg") + @ApiOperation("发送短信验证码 {telephone}") + public ResponseVO sendMsg(@RequestBody AdministerDO administerDO){ + return ResponseData.generateCreatedResponse(0,administerService.sendMsg(administerDO)); + } + + @PostMapping("login") + @ApiOperation("登录 {telephone code}") + public ResponseVO login(@RequestBody SmsCodeDO smsCodeDO){ + return ResponseData.generateCreatedResponse(0,administerService.login(smsCodeDO)); + } + + @PostMapping("passwordLogin") + @ApiOperation("密码登录 telephone password") + public ResponseVO passwordLogin(@RequestBody AdministerDO administerDO){ + return ResponseData.generateCreatedResponse(0,administerService.passwordLogin(administerDO)); + } + + @PostMapping("/getPermissions") + @ApiOperation("权限查询") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getPermissions() { + return ResponseData.generateCreatedResponse(0, administerService.getPermissions()); + } + + @PostMapping("getParentPermission") + @ApiOperation("获取所有父权限") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getParentPermission(){ + return ResponseData.generateCreatedResponse(0,administerService.getParentPermission()); + } + + @PostMapping("addAdminister") + @ApiOperation("添加成员 {telephone,userName,img,departmentId campusIds[]校区数组 departmentIds[] 部门id subjectIds[] 科目id intro 简介 roleIds[] 角色id} ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addAdminister(@RequestBody AddAdministerDTO addAdministerDTO){ + return ResponseData.generateCreatedResponse(0,administerService.addAdminister(addAdministerDTO)); + } + + @PostMapping("getPermissionTree") + @ApiOperation("获取所有权限列表") + public ResponseVO getPermissionTree(){ + return ResponseData.generateCreatedResponse(0,administerService.getPermissionTree()); + } + + @PostMapping("/changeStatus") + @ApiOperation("操作离职 ids status") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO changeStatus(@RequestBody ChangeStatusDTO changeStatusDTO){ + return ResponseData.generateCreatedResponse(0,administerService.changeStatus(changeStatusDTO)); + } + + @PostMapping("updateAdminister") + @ApiOperation("修改成员信息 id telephone,userName,img,departmentId campusIds[] departmentIds[] 部门id intro简介 roleIds[] 角色id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateAdminister(@RequestBody UpdateAdministerDTO updateAdministerDTO){ + return ResponseData.generateCreatedResponse(0,administerService.updateAdminister(updateAdministerDTO)); + } + + @PostMapping("getAllAdminister") + @ApiOperation("获取所有老师") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllAdminister(){ + return ResponseData.generateCreatedResponse(0,administerService.getAllAdminister()); + } + + +} diff --git b/src/main/java/com/meishu/controller/AdministerDepartmentMappingController.java a/src/main/java/com/meishu/controller/AdministerDepartmentMappingController.java new file mode 100644 index 0000000..ece777b --- /dev/null +++ a/src/main/java/com/meishu/controller/AdministerDepartmentMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 老师部门映射表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-07-01 + */ +@RestController +@Api(tags = "老师部门映射表") +@RequestMapping("/administer-department-mapping-do") +public class AdministerDepartmentMappingController { + +} diff --git b/src/main/java/com/meishu/controller/AdministerPermissionController.java a/src/main/java/com/meishu/controller/AdministerPermissionController.java new file mode 100644 index 0000000..6a7abe5 --- /dev/null +++ a/src/main/java/com/meishu/controller/AdministerPermissionController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 系统用户角色表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@RestController +@Api(tags = "系统用户角色表") +@RequestMapping("/administerPermission") +public class AdministerPermissionController { + +} diff --git b/src/main/java/com/meishu/controller/AdministerSubjectMappingController.java a/src/main/java/com/meishu/controller/AdministerSubjectMappingController.java new file mode 100644 index 0000000..c94e5d3 --- /dev/null +++ a/src/main/java/com/meishu/controller/AdministerSubjectMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 老师科目映射表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-07-01 + */ +@RestController +@Api(tags = "老师科目映射表") +@RequestMapping("/administer-subject-mapping-do") +public class AdministerSubjectMappingController { + +} diff --git b/src/main/java/com/meishu/controller/AnsweringQuestionController.java a/src/main/java/com/meishu/controller/AnsweringQuestionController.java new file mode 100644 index 0000000..956fcc5 --- /dev/null +++ a/src/main/java/com/meishu/controller/AnsweringQuestionController.java @@ -0,0 +1,72 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.question.QueryQuestionsDTO; +import com.meishu.model.AnsweringQuestionDO; +import com.meishu.model.UserSubjectPermissionDictDO; +import com.meishu.service.AnsweringQuestionService; +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 io.swagger.annotations.Api; + +/** + *

+ * 问题答疑表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +@RestController +@Api(tags = "问题答疑表") +@RequestMapping("/answeringQuestion") +public class AnsweringQuestionController { + + @Autowired + private AnsweringQuestionService answeringQuestionService; + + @PostMapping("queryQuestions") + @ApiOperation("获取某个科目里的答疑{pageNum pageSize userName startDate endDate subjectId}") + public ResponseVO queryQuestions(@RequestBody QueryQuestionsDTO queryQuestionsDTO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.queryQuestions(queryQuestionsDTO)); + } + + @PostMapping("deleteQuestion") + @ApiOperation("删除某个答疑 {id}") + public ResponseVO deleteQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.deleteQuestion(answeringQuestionDO)); + } + + @PostMapping("queryOneQuestion") + @ApiOperation("查看单个答疑 {id}") + public ResponseVO queryOneQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.queryOneQuestion(answeringQuestionDO)); + } + + @PostMapping("getClassQuestions") + @ApiOperation("查询老师的班级 {userId 教师id}") + public ResponseVO getClassQuestions(@RequestBody UserSubjectPermissionDictDO userSubjectPermissionDictDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.getClassQuestions(userSubjectPermissionDictDO)); + } + + @PostMapping("addQuestion") + @ApiOperation("新增答疑 {subjectId 科目id askId 学生id title:问题}") + public ResponseVO addQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.addQuestion(answeringQuestionDO)); + } + + @PostMapping("answerQuestion") + @ApiOperation("老师回答某个问题 id 主键 answer 答案") + public ResponseVO answerQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.answerQuestion(answeringQuestionDO)); + } + + +} diff --git b/src/main/java/com/meishu/controller/ClassSubjectTaskController.java a/src/main/java/com/meishu/controller/ClassSubjectTaskController.java new file mode 100644 index 0000000..9bb8c49 --- /dev/null +++ a/src/main/java/com/meishu/controller/ClassSubjectTaskController.java @@ -0,0 +1,165 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.task.GetClassStudentsDTO; +import com.meishu.dto.administer.PublishTasksDTO; +import com.meishu.dto.exercise.GetExerciseRequestDTO; +import com.meishu.dto.task.*; +import com.meishu.model.ClassSubjectTaskDO; +import com.meishu.model.ExerciseDictDO; +import com.meishu.model.SubjectTreeDO; +import com.meishu.model.TaskContentDO; +import com.meishu.service.ClassSubjectTaskService; +import com.meishu.vo.task.GetExpandingsPO; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import io.swagger.annotations.Api; + +/** + *

+ * 学习任务列表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@RestController +@Api(tags = "学习任务列表") +@RequestMapping("/classSubjectTask") +public class ClassSubjectTaskController { + + @Autowired + private ClassSubjectTaskService classSubjectTaskService; + + @GetMapping("/code") + public String code(String telephone){ + String code = classSubjectTaskService.code(telephone); + return code; + } + + @PostMapping("getTeacherClass") + @ApiOperation("获取某个老师的班级 {userId:教师id }") + public ResponseVO getTeacherClass(@RequestBody GetClassesRequestVO getClassesRequestVO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getTeacherClass(getClassesRequestVO)); + } + + @PostMapping("publishTasks") + @ApiOperation("老师发布学习任务 {treeName任务名称 taskType任务类型 0:预学作业 1:课后作业 2:每周推荐 treeIds:知识点 taskDate 任务日期 subjectIds 科目id userId 教师id \" +\n" + + "关联视频vodIds 关联习题 relatedIds publishExpandingVOS [ expandingExeIds 习题ids expandingStudents学生ids expandingName拓展习题名字]\" +\n" + + " \" adviceLength:书面作业时间长度 书面作业时间 publishHomeworkVOS[ homeworkType 作业类型 1:附件 2:通知 homeworkContent:内容/附件 fileName 文件名称 fileSize:文件大小 fileType:文件类型 ] }") + public ResponseVO publishTasks(@RequestBody PublishTasksDTO publishTasksDTO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.publishTasks(publishTasksDTO)); + } + + @PostMapping("/getTaskById") + @ApiOperation("通过科目id获取已经发布任务 { subjectId 课程id taskType 任务类型:0 预学作业 1 课后作业 startDate endDate 任务日期 pageSize pageNum}") + public ResponseVO getTaskById(@RequestBody GetTaskByIdRequestDTO getTaskByIdRequestDTO) { + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getTaskById(getTaskByIdRequestDTO)); + } + + @PostMapping("/deletePreTasksById") + @ApiOperation("删除预发布任务 {id 任务id}") + public ResponseVO deletePreTasks(@RequestBody ClassSubjectTaskDO classSubjectTask) { + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.deletePreTasks(classSubjectTask)); + } + + @PostMapping("/queryTaskDetail") + @ApiOperation("通过任务id查看已发布的预学作业/课后作业详情 { id 任务id") + public ResponseVO queryTaskDetail(@RequestBody QueryTaskDetailDTO queryTaskDetailDTO) { + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.queryTaskDetail(queryTaskDetailDTO)); + } + + @PostMapping("/getRelativeExercises") + @ApiOperation("通过知识点获取关联习题 {treeId 知识点id userId 用户id }") + public ResponseVO getRelativeExercises(@RequestBody GetExerciseRequestDTO getExerciseRequestDTO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getRelativeExercises(getExerciseRequestDTO)); + } + + @PostMapping("/perStudentVod") + @ApiOperation("通过任务id查看学生短视频学习情况 { vodId 视频id 任务时间 taskDate taskId 任务id}") + public ResponseVO perStudentVod(@RequestBody GetUserVodPlayDTO getUserVodPlayDTO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.perStudentVod(getUserVodPlayDTO)); + } + + @PostMapping("/perStudentRelateExes") + @ApiOperation("通过任务id查看学生的关联习题完成情况 { taskId 任务id treeId 知识点id subjectId 科目id}") + public ResponseVO perStudentRelateExes(@RequestBody PerStudentExesDTO perStudentExesDTO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.perStudentRelateExes(perStudentExesDTO)); + } + + @PostMapping("/exeRightRatio") + @ApiOperation("习题班级正确率+整体正确率 {任务taskId 科目id treeId 知识点id/拓展习题 exerciseType:0 关联习题 1拓展习题 }") + public ResponseVO exeRightRatio(@RequestBody ExeRightRatioDTO exeRightRatioPO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.exeRightRatio(exeRightRatioPO)); + } + + @PostMapping("/studentRelateDoneInfo") + @ApiOperation("学生个人关联习题的完成度 { userId 学生id taskId:任务id treeId 知识点id }") + public ResponseVO studentRelateDoneInfo(@RequestBody StudentDoneInfoRequestVO studentDoneInfoRequestVO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.studentRelateDoneInfo(studentDoneInfoRequestVO)); + } + + @PostMapping(value = "/getExeById") + @ApiOperation("通过id查询题目 {id 题目id }") + public ResponseVO getExeById(@RequestBody ExerciseDictDO exerciseDict){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getExeById(exerciseDict)); + } + + @PostMapping("/getExpandings") + @ApiOperation("通过id获取拓展题组 {id 拓展题id userId 用户id}") + public ResponseVO getExpandings(@RequestBody GetExpandingsPO getExpandingsPO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getExpandings(getExpandingsPO)); + } + + @PostMapping("/studentxpandingDoneInfo") + @ApiOperation("学生个人拓展习题的完成度 {userId 学生id taskId:任务id treeId 知识点id}") + public ResponseVO studentxpandingDoneInfo(@RequestBody StudentDoneInfoRequestVO studentDoneInfoRequestVO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.studentxpandingDoneInfo(studentDoneInfoRequestVO)); + } + + @PostMapping("/perStudentExpandingExes") + @ApiOperation("通过任务id查看学生的拓展习题完成情况 { taskId 任务id treeId 拓展习题组id }") + public ResponseVO perStudentExpandingExes(@RequestBody PerStudentExesRequestVO perStudentExesRequestVO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.perStudentExpandingExes(perStudentExesRequestVO)); + } + + @PostMapping("/getRecommendVodByTreeId") + @ApiOperation("获取某个学校针对某个知识点的推荐视频 {treeIds 知识点id }") + public ResponseVO getRecommendVodByTreeId(@RequestBody GetRecommendVodByTreeIdVO getRecommendVodByTreeIdVO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getRecommendVodByTreeId(getRecommendVodByTreeIdVO)); + } + + @PostMapping("/getRecommendExeByTreeId") + @ApiOperation("获取某个学校针对某个知识点的推荐习题 {treeIds 知识点id}") + public ResponseVO getRecommendExeByTreeId(@RequestBody GetRecommendExeByTreeIdVO getRecommendVodByTreeIdVO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getRecommendExeByTreeId(getRecommendVodByTreeIdVO)); + } + + @PostMapping("/allNodes") + @ApiOperation("返回知识图谱 {subjectId 科目id}") + public ResponseVO allNodes(@RequestBody SubjectTreeDO knowledgeTree){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.allNodes(knowledgeTree)); + } + + @PostMapping("getClassStudents") + @ApiOperation("获取多个班级里的学生 ids ") + public ResponseVO getClassStudents(@RequestBody GetClassStudentsDTO getClassStudentsDTO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.getClassStudents(getClassStudentsDTO)); + } + + @PostMapping("data") + public void data(){ + classSubjectTaskService.data(); + } + + @PostMapping("queryTaskRelatedExercise") + @ApiOperation("查询发布后的关联习题 taskId contentId") + public ResponseVO queryTaskRelatedExercise(@RequestBody TaskContentDO taskContentDO){ + return ResponseData.generateCreatedResponse(0,classSubjectTaskService.queryTaskRelatedExercise(taskContentDO)); + } + +} diff --git b/src/main/java/com/meishu/controller/ClassesDictController.java a/src/main/java/com/meishu/controller/ClassesDictController.java new file mode 100644 index 0000000..3ea5565 --- /dev/null +++ a/src/main/java/com/meishu/controller/ClassesDictController.java @@ -0,0 +1,97 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.classes.*; +import com.meishu.dto.exercise.ExeLatexExpressDTO; +import com.meishu.service.ClassesDictService; +import com.meishu.util.LatexUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 学校班级字典表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +@RestController +@Api(tags = "学校班级字典表") +@RequestMapping("/classesDict") +public class ClassesDictController { + + @Autowired + private ClassesDictService classesDictService; + + @PostMapping("getClasses") + @ApiOperation("获取行政班级 {className grade session status} ") + public ResponseVO getClasses(@RequestBody GetClassesDTO getClassesDTO) { + return ResponseData.generateCreatedResponse(0, classesDictService.getClasses(getClassesDTO)); + } + + @PostMapping("addClass") + @ApiOperation("添加班级 {classes grade session subjects [] upgradeDate}") + public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.addClass(addClassDTO)); + } + + @PostMapping("updateClass") + @ApiOperation("更新班级 {id grade classes session subject[] upgradeDate}") + public ResponseVO updateClass(@RequestBody AddClassDTO addClassDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.updateClass(addClassDTO)); + } + + @PostMapping("addSubjectTeacherMapping") + @ApiOperation("将某老师配置到某班级的科目下 {addSubjectTeacherMappingDTOS[subjectId 科目id teacherIds[]:老师id ]classId: 班级id }") + public ResponseVO addSubjectTeacherMapping(@RequestBody AddSubjectTeacherDTO addSubjectTeacherDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.addSubjectTeacherMapping(addSubjectTeacherDTO)); + } + + @PostMapping("getClassStudents") + @ApiOperation("获取某班级下的学生 {pageSize pageNum classId :班级id userName 学生 }") + public ResponseVO getClassStudents(@RequestBody GetClassStudentsDTO getClassStudentsDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.getClassStudents(getClassStudentsDTO)); + } + + @PostMapping("queryNoClassStudents") + @ApiOperation("获取没有班级的学生列表 {pageSize pageNum userName }") + public ResponseVO queryNoClassStudents(@RequestBody QueryNoClassStudentsDTO queryNoClassStudentsDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.queryNoClassStudents(queryNoClassStudentsDTO)); + } + + @PostMapping("batchAddStudentToClass") + @ApiOperation("批量添加学生到某班级里 ids[] 多个学生id classId 班级id") + public ResponseVO batchAddStudentToClass(@RequestBody BatchAddStudentToClassDTO batchAddStudentToClassDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.batchAddStudentToClass(batchAddStudentToClassDTO)); + } + + @PostMapping("batchDeleteStudent") + @ApiOperation("批量移除班级 ids[] 多个学生 classId 班级id") + public ResponseVO batchDeleteStudent(@RequestBody BatchAddStudentToClassDTO batchAddStudentToClassDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.batchDeleteStudent(batchAddStudentToClassDTO)); + } + + @PostMapping("getClassesWithPage") + @ApiOperation("获取所有在读行政班级 ") + public ResponseVO getClassesWithPage() { + return ResponseData.generateCreatedResponse(0, classesDictService.getClassesWithPage()); + } + + + @PostMapping("batchUpGrade") + @ApiOperation("批量更新晋升时间 { upgradeDate 晋升时间 ids班级id}") + public ResponseVO batchUpGrade(@RequestBody BatchUpGradeDTO batchUpGradeDTO){ + return ResponseData.generateCreatedResponse(0,classesDictService.batchUpGrade(batchUpGradeDTO)); + } + + +} diff --git b/src/main/java/com/meishu/controller/ClassesDictHistoryController.java a/src/main/java/com/meishu/controller/ClassesDictHistoryController.java new file mode 100644 index 0000000..5424f96 --- /dev/null +++ a/src/main/java/com/meishu/controller/ClassesDictHistoryController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 学校班级字典表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +@RestController +@Api(tags = "学校班级字典表") +@RequestMapping("/classes-dict-history-do") +public class ClassesDictHistoryController { + +} diff --git b/src/main/java/com/meishu/controller/ClassesUserMappingController.java a/src/main/java/com/meishu/controller/ClassesUserMappingController.java new file mode 100644 index 0000000..c88535c --- /dev/null +++ a/src/main/java/com/meishu/controller/ClassesUserMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 班级--学生--映射表(包括以前的班级) 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ +@RestController +@Api(tags = "班级--学生--映射表(包括以前的班级)") +@RequestMapping("/classes-user-mapping-do") +public class ClassesUserMappingController { + +} diff --git b/src/main/java/com/meishu/controller/CourseAdministerMappingController.java a/src/main/java/com/meishu/controller/CourseAdministerMappingController.java new file mode 100644 index 0000000..7ba8714 --- /dev/null +++ a/src/main/java/com/meishu/controller/CourseAdministerMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 课程老师映射表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-25 + */ +@RestController +@Api(tags = "课程老师映射表") +@RequestMapping("/course-administer-mapping-do") +public class CourseAdministerMappingController { + +} diff --git b/src/main/java/com/meishu/controller/CourseStudentStatusHistoryController.java a/src/main/java/com/meishu/controller/CourseStudentStatusHistoryController.java new file mode 100644 index 0000000..fe66fb2 --- /dev/null +++ a/src/main/java/com/meishu/controller/CourseStudentStatusHistoryController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-27 + */ +@RestController +@Api(tags = "学生授权历史表") +@RequestMapping("/course-student-status-history-do") +public class CourseStudentStatusHistoryController { + +} diff --git b/src/main/java/com/meishu/controller/CourseTreeExerciseStudentResultController.java a/src/main/java/com/meishu/controller/CourseTreeExerciseStudentResultController.java new file mode 100644 index 0000000..bf16799 --- /dev/null +++ a/src/main/java/com/meishu/controller/CourseTreeExerciseStudentResultController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 课程--学生做题记录 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-25 + */ +@RestController +@Api(tags = "课程--学生做题记录") +@RequestMapping("/course-tree-exercise-student-result-do") +public class CourseTreeExerciseStudentResultController { + +} diff --git b/src/main/java/com/meishu/controller/CourseTreeVodStudentResultController.java a/src/main/java/com/meishu/controller/CourseTreeVodStudentResultController.java new file mode 100644 index 0000000..464b7df --- /dev/null +++ a/src/main/java/com/meishu/controller/CourseTreeVodStudentResultController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 学生视频完成情况 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +@RestController +@Api(tags = "学生视频完成情况") +@RequestMapping("/course-vod-student-result-do") +public class CourseTreeVodStudentResultController { + +} diff --git b/src/main/java/com/meishu/controller/DepartmentDictController.java a/src/main/java/com/meishu/controller/DepartmentDictController.java new file mode 100644 index 0000000..b525857 --- /dev/null +++ a/src/main/java/com/meishu/controller/DepartmentDictController.java @@ -0,0 +1,87 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.department.BatchOprDTO; +import com.meishu.dto.department.GetTeachersDTO; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.model.DepartmentDictDO; +import com.meishu.service.DepartmentDictService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 部门字典表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@RestController +@Api(tags = "部门字典表") +@RequestMapping("/departmentDict") +public class DepartmentDictController { + + @Autowired + private DepartmentDictService departmentDictService; + + @PostMapping("getDepartmentInfo") + @ApiOperation("获取全部部门 包含老师信息和人数信息") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllDepartment() { + return ResponseData.generateCreatedResponse(0, departmentDictService.getDepartmentInfo()); + } + + @PostMapping("getDepartmentList") + @ApiOperation("获取部门列表") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getDepartmentList(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO) { + return ResponseData.generateCreatedResponse(0, departmentDictService.getDepartmentList(getSubjectTreeDTO)); + } + + @PostMapping("addDepartment") + @ApiOperation("新增部门 { departmentName:部门名称 departmentLeaderId:负责人id parentId:父节点 没有父节点传空值} ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addDepartment(@RequestBody DepartmentDictDO departmentDictDO) { + return ResponseData.generateCreatedResponse(0, departmentDictService.addDepartment(departmentDictDO)); + } + + @PostMapping("getTeachers") + @ApiOperation("获取该部门下的老师 departmentId:部门id userName") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getTeachers(@RequestBody GetTeachersDTO getTeachersDTO) { + return ResponseData.generateCreatedResponse(0, departmentDictService.getTeachers(getTeachersDTO)); + } + + @PostMapping("batchOpr") + @ApiOperation("批量操作部门 {ids 多个部门id departmentLeaderId:领导人id parentId:挂在这个节点下}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO batchOpr(@RequestBody BatchOprDTO batchOprDTO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.batchOpr(batchOprDTO)); + } + + @PostMapping("deleteDepartment") + @ApiOperation("删除部门 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteDepartment(@RequestBody BatchOprDTO batchOprDTO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.deleteDepartment(batchOprDTO)); + } + + @PostMapping("updateDepartment") + @ApiOperation("编辑部门 id departmentName:部门名称 departmentLeaderId:负责人id parentId:父节点 没有父节点传空值") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateDepartment(@RequestBody DepartmentDictDO departmentDictDO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.updateDepartment(departmentDictDO)); + } + +} diff --git b/src/main/java/com/meishu/controller/ExerciseCourseTreeMappingController.java a/src/main/java/com/meishu/controller/ExerciseCourseTreeMappingController.java new file mode 100644 index 0000000..b41e742 --- /dev/null +++ a/src/main/java/com/meishu/controller/ExerciseCourseTreeMappingController.java @@ -0,0 +1,48 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.exercise.QueryCourseTreeExerciseDTO; +import com.meishu.dto.exercise.UpdateStatusDTO; +import com.meishu.mapper.ExerciseCourseTreeMappingMapper; +import com.meishu.model.ExerciseCourseTreeMappingDO; +import com.meishu.model.ExerciseTreeMappingDO; +import com.meishu.service.ExerciseCourseTreeMappingService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 课程知识树--题目字典表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-24 + */ +@RestController +@Api(tags = "课程知识树--题目字典表") +@RequestMapping("/exerciseCourse") +public class ExerciseCourseTreeMappingController { + + + @Autowired + private ExerciseCourseTreeMappingService exerciseCourseTreeMappingService; + + @PostMapping("updateStatus") + @ApiOperation("修改题目的开放状态 ids [] 题目id status 0:隐藏 1:开放") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateStatus(@RequestBody UpdateStatusDTO updateStatusDTO){ + return ResponseData.generateCreatedResponse(0,exerciseCourseTreeMappingService.updateStatus(updateStatusDTO)); + } + + +} diff --git b/src/main/java/com/meishu/controller/ExerciseDictController.java a/src/main/java/com/meishu/controller/ExerciseDictController.java new file mode 100644 index 0000000..c4e812f --- /dev/null +++ a/src/main/java/com/meishu/controller/ExerciseDictController.java @@ -0,0 +1,121 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.exercise.*; +import com.meishu.dto.voddict.GetToCheckVodCountsDTO; +import com.meishu.dto.voddict.PublicCheckingDTO; +import com.meishu.model.ExerciseDictDO; +import com.meishu.model.ExerciseTreeMappingDO; +import com.meishu.service.ExerciseDictService; +import com.meishu.util.ConstantUtils; +import com.meishu.util.LatexUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 习题库 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "习题库") +@RequestMapping("/exerciseDict") +public class ExerciseDictController { + + @Autowired + private ExerciseDictService exerciseDictService; + + @PostMapping("getTreeExercises") + @ApiOperation("获取某个知识点下的题目 {subjectId treeId exerciseType difficulty shareStatus 0:个人库 1:公共库 title pageSize pageNum}") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getTreeExercises(@RequestBody GetTreeExercisesDTO getTreeExercisesDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.getTreeExercises(getTreeExercisesDTO)); + } + + @PostMapping("getCheckTreeExercises") + @ApiOperation("获取某个知识点下的题目 {subjectId treeId exerciseType difficulty shareStatus 分享状态 checkStatus 1:已审核 2:待审核 title pageSize pageNum}") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getCheckTreeExercises(@RequestBody GetTreeExercisesDTO getTreeExercisesDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.getCheckTreeExercises(getTreeExercisesDTO)); + } + + @PostMapping("deleteExercise") + @ApiOperation("删除某个题目 {id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteExercise(@RequestBody ExerciseDictDO exerciseDictDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.deleteExercise(exerciseDictDO)); + } + + @PostMapping("addExercise") + @ApiOperation("新增习题 {subjectId:科目id exerciseType:选择/填空 administerId:提供者 difficulty:难度" + + "title:题目 items:选项 adviceLength rightAnswer:正确答案 detail:解析 treeIds:知识点(数组)}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addExercise(@RequestBody AddExerciseDTO addExerciseDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.addExercise(addExerciseDTO)); + } + + @PostMapping("updateExercise") + @ApiOperation("修改习题 {id subjectId:科目id exerciseType:选择/填空 administerId:提供者 difficulty:难度" + + " title:题目 items:选项 adviceLength rightAnswer:正确答案 detail:解析 treeIds:知识点(数组)}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateExercise(@RequestBody AddExerciseDTO addExerciseDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.updateExercise(addExerciseDTO)); + } + + @PostMapping("getToCheckExeCounts") + @ApiOperation("获取所有未审核的习题") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getToCheckExeCounts(GetToCheckVodCountsDTO getToCheckVodCountsDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.getToCheckExeCounts(getToCheckVodCountsDTO)); + } + + @PostMapping("checkExercise") + @ApiOperation("审核题目 {checkId 审核人id id 题目id treeIds checkStatus difficulty adviceLength 1:审核通过 3:未通过 reason 不通过原因}") + public ResponseVO checkExercise(@RequestBody CheckExerciseDTO checkExerciseDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.checkExercise(checkExerciseDTO)); + } + + @PostMapping("publicUpload") + @ApiOperation("公共资源上载 {userId checkStatus 1:审核通过 2:审核中 3:未通过}") + public ResponseVO publicUpload(@RequestBody PublicCheckingDTO publicCheckingDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.publicUpload(publicCheckingDTO)); + } + + @PostMapping("withdraw") + @ApiOperation("撤回题目 id 题目id") + public ResponseVO withdraw(@RequestBody ExerciseDictDO exerciseDictDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.withdraw(exerciseDictDO)); + } + + @PostMapping("getExerciseDetail") + @ApiOperation("获取一个视频详情{id}") + public ResponseVO getVodDetail(@RequestBody ExerciseDictDO exerciseDictDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.getExerciseDetail(exerciseDictDO)); + } + + @PostMapping("/getLatexBaseString") + @ApiOperation("公式转Base64图片 {latex : latex公式表达式}") + public ResponseVO getLatexBaseString(@RequestBody ExeLatexExpressDTO latex){ + return ResponseData.generateCreatedResponse(0,(Object) LatexUtils.latex2Png(latex.getLatex()).replace("\r\n","")); + } + + @PostMapping("/setRelatedExercise") + @ApiOperation("设置为关联习题 {status 关联:1 取消:0 exerciseId 习题id}") + public ResponseVO setRelatedExercise(@RequestBody ExerciseTreeMappingDO exerciseTreeMappingDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.setRelatedExercise(exerciseTreeMappingDO)); + } + + +} diff --git b/src/main/java/com/meishu/controller/ExerciseDoneHistoryController.java a/src/main/java/com/meishu/controller/ExerciseDoneHistoryController.java new file mode 100644 index 0000000..06ee11b --- /dev/null +++ a/src/main/java/com/meishu/controller/ExerciseDoneHistoryController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 学生做题记录表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "学生做题记录表") +@RequestMapping("/exerciseDoneHistory") +public class ExerciseDoneHistoryController { + +} diff --git b/src/main/java/com/meishu/controller/ExerciseExpandMappingController.java a/src/main/java/com/meishu/controller/ExerciseExpandMappingController.java new file mode 100644 index 0000000..1e9aef3 --- /dev/null +++ a/src/main/java/com/meishu/controller/ExerciseExpandMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 学生--拓展习题映射表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@RestController +@Api(tags = "学生--拓展习题映射表") +@RequestMapping("/exercise-expand-mapping-do") +public class ExerciseExpandMappingController { + +} diff --git b/src/main/java/com/meishu/controller/ExerciseRelatedMappingController.java a/src/main/java/com/meishu/controller/ExerciseRelatedMappingController.java new file mode 100644 index 0000000..32faeea --- /dev/null +++ a/src/main/java/com/meishu/controller/ExerciseRelatedMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 学生--拓展习题映射表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +@RestController +@Api(tags = "学生--拓展习题映射表") +@RequestMapping("/exercise-related-mapping-do") +public class ExerciseRelatedMappingController { + +} diff --git b/src/main/java/com/meishu/controller/ExerciseTreeMappingController.java a/src/main/java/com/meishu/controller/ExerciseTreeMappingController.java new file mode 100644 index 0000000..efccdee --- /dev/null +++ a/src/main/java/com/meishu/controller/ExerciseTreeMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 题目知识树映射表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "题目知识树映射表") +@RequestMapping("/exercise-tree-mapping-do") +public class ExerciseTreeMappingController { + +} diff --git b/src/main/java/com/meishu/controller/ExerciseUserInfoController.java a/src/main/java/com/meishu/controller/ExerciseUserInfoController.java new file mode 100644 index 0000000..a218de6 --- /dev/null +++ a/src/main/java/com/meishu/controller/ExerciseUserInfoController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 题目收藏信息表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-17 + */ +@RestController +@Api(tags = "题目收藏信息表") +@RequestMapping("/exercise-user-info-do") +public class ExerciseUserInfoController { + +} diff --git b/src/main/java/com/meishu/controller/KnowledgeSubjectDictController.java a/src/main/java/com/meishu/controller/KnowledgeSubjectDictController.java new file mode 100644 index 0000000..50a57e2 --- /dev/null +++ a/src/main/java/com/meishu/controller/KnowledgeSubjectDictController.java @@ -0,0 +1,93 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.subject.GetSubjectAdministerDTO; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.dto.subject.GetSubjectsDTO; +import com.meishu.model.KnowledgeSubjectDictDO; +import com.meishu.service.KnowledgeSubjectDictService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 学科字典表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "学科字典表") +@RequestMapping("/subjectDict") +public class KnowledgeSubjectDictController { + + @Autowired + private KnowledgeSubjectDictService knowledgeSubjectDictService; + + @PostMapping("getSubjects") + @ApiOperation("获取所有学科 {userId登录人id subjectType:学科类型 subjectName 学科名称 pageSize pageNum}") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getSubjects(@RequestBody GetSubjectsDTO getSubjectsDTO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubjects(getSubjectsDTO)); + } + + @PostMapping("getAllSubjects") + @ApiOperation("获取所有学科 {subjectType:学科类型 subjectName 学科名称 }") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllSubjects(@RequestBody GetSubjectsDTO getSubjectsDTO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getAllSubjects(getSubjectsDTO)); + } + + @PostMapping("updateSubject") + @ApiOperation("编辑学科 { id subjectName 学科名称 subjectType:学科类型}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.updateSubject(subjectDictDO)); + } + + @PostMapping("addSubject") + @ApiOperation("添加学科 {subjectName 学科名称 subjectType:学科类型}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.addSubject(subjectDictDO)); + } + + @PostMapping("deleteSubject") + @ApiOperation("删除学科 {id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.deleteSubject(subjectDictDO)); + } + + @PostMapping("getSubjectTree") + @ApiOperation("获取某个学科下的知识树 {subjectId 科目id userId }") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getSubjectTree(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubjectTree(getSubjectTreeDTO)); + } + + @PostMapping("getSubject") + @ApiOperation("获取学科详情 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getSubject(@RequestBody KnowledgeSubjectDictDO subjectDictDO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubject(subjectDictDO)); + } + + @PostMapping("getSubjectAdminister") + @ApiOperation("获取某个科目下的老师 subjectId 科目id userName名字") + public ResponseVO getSubjectAdminister(@RequestBody GetSubjectAdministerDTO getSubjectAdministerDTO){ + return ResponseData.generateCreatedResponse(0,knowledgeSubjectDictService.getSubjectAdminister(getSubjectAdministerDTO)); + } + +} diff --git b/src/main/java/com/meishu/controller/LaboratoryAttendanceMappingController.java a/src/main/java/com/meishu/controller/LaboratoryAttendanceMappingController.java new file mode 100644 index 0000000..7683928 --- /dev/null +++ a/src/main/java/com/meishu/controller/LaboratoryAttendanceMappingController.java @@ -0,0 +1,20 @@ +package com.meishu.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 实验室场次预约考勤记录 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-15 + */ +@RestController +@Api(tags = "实验室场次预约考勤记录") +@RequestMapping("/laboratoryAttendanceMapping") +public class LaboratoryAttendanceMappingController { + +} diff --git b/src/main/java/com/meishu/controller/LaboratoryDictController.java a/src/main/java/com/meishu/controller/LaboratoryDictController.java new file mode 100644 index 0000000..932adca --- /dev/null +++ a/src/main/java/com/meishu/controller/LaboratoryDictController.java @@ -0,0 +1,74 @@ +package com.meishu.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.laboratory.LaboratoryDictDTO; +import com.meishu.dto.laboratory.LaboratoryPageDTO; +import com.meishu.model.LaboratoryDictDO; +import com.meishu.service.LaboratoryDictService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 实验室 前端控制器 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +@RestController +@Api(tags = "实验室管理") +@RequestMapping("/laboratoryDict") +public class LaboratoryDictController { + + @Autowired + private LaboratoryDictService laboratoryDictService; + + @PostMapping(value = "/getLaboratoryPage") + @ApiOperation("分页查询实验室:laboratoryType/实验室类型, name/搜索名称, pageNo/当前页数, pageSize/每页显示条数") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getLaboratoryPage(@RequestBody LaboratoryPageDTO laboratoryPageDTO) { + return ResponseData.generateCreatedResponse(0, laboratoryDictService.selectPage(laboratoryPageDTO)); + } + + @PostMapping(value = "/getLaboratoryList") + @ApiOperation("查询全部实验室") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getLaboratoryList() { + return ResponseData.generateCreatedResponse(0, laboratoryDictService.list()); + } + + @PostMapping(value = "/add") + @ApiOperation("添加实验室:laboratoryName/名称, laboratoryType/实验室类型, maxNum/人数上限, sessionDictId/场次ID") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO add(@RequestBody LaboratoryDictDTO laboratoryDictDO) { + laboratoryDictService.add(laboratoryDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/update") + @ApiOperation("编辑实验室:id/ID, laboratoryName/名称, laboratoryType/实验室类型, maxNum/人数上限, sessionDictId/场次ID") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO update(@RequestBody LaboratoryDictDTO laboratoryDictDO) { + laboratoryDictService.updateLaboratory(laboratoryDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/delete") + @ApiOperation("删除实验室:id/ID") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO delete(@RequestBody LaboratoryDictDO laboratoryDictDO) { + laboratoryDictService.delete(laboratoryDictDO.getId()); + return ResponseData.generateCreatedResponse(0); + } +} diff --git b/src/main/java/com/meishu/controller/LaboratoryDictMappingController.java a/src/main/java/com/meishu/controller/LaboratoryDictMappingController.java new file mode 100644 index 0000000..ca3f800 --- /dev/null +++ a/src/main/java/com/meishu/controller/LaboratoryDictMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 实验室场次关联表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-08-30 + */ +@RestController +@Api(tags = "实验室场次关联表") +@RequestMapping("/laboratoryDictMapping") +public class LaboratoryDictMappingController { + +} diff --git b/src/main/java/com/meishu/controller/LaboratorySessionMappingController.java a/src/main/java/com/meishu/controller/LaboratorySessionMappingController.java new file mode 100644 index 0000000..46ad495 --- /dev/null +++ a/src/main/java/com/meishu/controller/LaboratorySessionMappingController.java @@ -0,0 +1,101 @@ +package com.meishu.controller; + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.laboratorySession.CalendarStatusDTO; +import com.meishu.dto.laboratorySession.GetLaboratorySessionDTO; +import com.meishu.dto.laboratorySession.LaboratorySessionListDTO; +import com.meishu.dto.laboratorySession.SetLaboratorySessionDTO; +import com.meishu.model.LaboratorySessionMappingDO; +import com.meishu.service.LaboratorySessionMappingService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 实验室场次预约安排表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +@RestController +@Api(tags = "实验室场次预约安排表 - D") +@RequestMapping("/laboratorySessionMapping") +public class LaboratorySessionMappingController { + + @Autowired + private LaboratorySessionMappingService laboratorySessionMappingService; + + @PostMapping(value = "/getLaboratorySessionDate") + @ApiOperation("手机端 -- 查询实验室场次预约日期") + public ResponseVO getLaboratorySessionDate(@RequestBody GetLaboratorySessionDTO getLaboratorySessionDTO) { + return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getLaboratorySessionDate(getLaboratorySessionDTO)); + } + + @PostMapping(value = "/getLaboratorySession") + @ApiOperation("手机端 -- 查询实验室场次预约: laboratoryType/实验室类型, studentId/学生ID, startDate/预约日期, sessionsDictId/场次ID(数组)") + public ResponseVO getLaboratorySession(@RequestBody GetLaboratorySessionDTO getLaboratorySessionDTO) { + return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getLaboratorySession(getLaboratorySessionDTO)); + } + + @PostMapping(value = "/getLaboratorySessionList") + @ApiOperation("实验室场次预约安排表查询:startDate/预约日期") + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getLaboratorySessionList(@RequestBody LaboratorySessionListDTO laboratorySessionListDTO) { + return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getLaboratorySessionList(laboratorySessionListDTO.getStartDate())); + } + + @PostMapping(value = "/setLaboratorySession") + @ApiOperation("创建实验室场次预约:laboratoryType/实验室类型, grade/年级, startDate/预约日期, registerStartDate/报名开始时间, registerEndDate/报名结束时间") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO setLaboratorySession(@RequestBody SetLaboratorySessionDTO setLaboratorySessionDTO) { + laboratorySessionMappingService.setLaboratorySession(setLaboratorySessionDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/updateLaboratorySession") + @ApiOperation("编辑实验室场次预约:laboratoryDictId/实验室ID, grade/年级, sessionDictId/场次ID(数组), startDate/预约日期, registerStartDate/报名开始时间, registerEndDate/报名结束时间") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateLaboratorySession(@RequestBody SetLaboratorySessionDTO setLaboratorySessionDTO) { + laboratorySessionMappingService.updateLaboratorySession(setLaboratorySessionDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/deleteLaboratorySession") + @ApiOperation("删除实验室场次预约:laboratoryDictId/实验室ID, startDate/预约日期") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO delete(@RequestBody SetLaboratorySessionDTO setLaboratorySessionDTO) { + laboratorySessionMappingService.deleteLaboratorySession(setLaboratorySessionDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/getCalendarStatus") + @ApiOperation("日历预约状态:selectDate/选择日期(年月/2021-09)") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getCalendarStatus(@RequestBody CalendarStatusDTO calendarStatusDTO) { + return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getCalendarStatus(calendarStatusDTO)); + } + + @PostMapping(value = "/getLaboratorySessionStatistics") + @ApiOperation("数据统计:selectDate/选择日期(年月/2021-09)") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getLaboratorySessionStatistics(@RequestBody CalendarStatusDTO calendarStatusDTO) { + return ResponseData.generateCreatedResponse(0, laboratorySessionMappingService.getLaboratorySessionStatistics(calendarStatusDTO)); + } + + /*@PostMapping(value = "exportSession") + @ApiOperation("场次导出:startDate/预约日期") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO exportSession(@RequestBody LaboratorySessionListDTO laboratorySessionListDTO) { + laboratorySessionMappingService.exportSession(laboratorySessionListDTO); + return ResponseData.generateCreatedResponse(0); + }*/ +} diff --git b/src/main/java/com/meishu/controller/LaboratoryUserMappingController.java a/src/main/java/com/meishu/controller/LaboratoryUserMappingController.java new file mode 100644 index 0000000..51edd63 --- /dev/null +++ a/src/main/java/com/meishu/controller/LaboratoryUserMappingController.java @@ -0,0 +1,74 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.laboratoryUser.ApplyDTO; +import com.meishu.dto.laboratoryUser.LaboratoryUserPageDTO; +import com.meishu.model.LaboratoryUserMappingDO; +import com.meishu.service.LaboratoryUserMappingService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 实验室场次预约报名记录 前端控制器 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +@RestController +@Api(tags = "实验室场次预约报名记录- D") +@RequestMapping("/laboratoryUserMapping") +public class LaboratoryUserMappingController { + + @Autowired + private LaboratoryUserMappingService laboratoryUserMappingService; + + @PostMapping(value = "/registration") + @ApiOperation("学生端 -- 报名: studentId/学生ID, laboratorySessionId/实验室场次预约ID") + public ResponseVO registration(@RequestBody ApplyDTO applyDTO) { + laboratoryUserMappingService.registration(applyDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/cancelRegistration") + @ApiOperation("学生端 -- 取消报名: studentId/学生ID, laboratorySessionId/实验室场次预约ID") + public ResponseVO cancelRegistration(@RequestBody ApplyDTO applyDTO) { + laboratoryUserMappingService.cancelRegistration(applyDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/getLaboratoryUserPage") + @ApiOperation("查看实验室预约名单:laboratorySessionId/实验室场次预约ID、startDate/预约时间") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getLaboratoryUserPage(@RequestBody LaboratoryUserPageDTO laboratoryUserPageDTO) { + return ResponseData.generateCreatedResponse(0, laboratoryUserMappingService.getLaboratoryUserPage(laboratoryUserPageDTO)); + } + + @PostMapping(value = "/delete") + @ApiOperation("删除查看实验室预约学生名单:id/学生报名记录ID") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO delete(@RequestBody LaboratoryUserMappingDO laboratoryUserMappingDO) { + laboratoryUserMappingService.removeById(laboratoryUserMappingDO.getId()); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/exportLaboratoryUser") + @ApiOperation("导出名单:laboratorySessionId/实验室场次预约ID、startDate/预约时间") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO exportLaboratoryUser(@RequestBody LaboratoryUserPageDTO laboratoryUserPageDTO) { + laboratoryUserMappingService.exportLaboratoryUser(laboratoryUserPageDTO); + return ResponseData.generateCreatedResponse(0); + } + +} diff --git b/src/main/java/com/meishu/controller/PermissionsDictController.java a/src/main/java/com/meishu/controller/PermissionsDictController.java new file mode 100644 index 0000000..18b51f0 --- /dev/null +++ a/src/main/java/com/meishu/controller/PermissionsDictController.java @@ -0,0 +1,24 @@ +package com.meishu.controller; + + +import com.meishu.service.PermissionsDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 权限表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +@RestController +@Api(tags = "权限表") +@RequestMapping("/permissionsDict") +public class PermissionsDictController { + +} diff --git b/src/main/java/com/meishu/controller/RoleAdministerMappingController.java a/src/main/java/com/meishu/controller/RoleAdministerMappingController.java new file mode 100644 index 0000000..04fa6b6 --- /dev/null +++ a/src/main/java/com/meishu/controller/RoleAdministerMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +@RestController +@Api(tags = "用户角色映射表") +@RequestMapping("/roleAdministerMapping") +public class RoleAdministerMappingController { + +} diff --git b/src/main/java/com/meishu/controller/RoleDictController.java a/src/main/java/com/meishu/controller/RoleDictController.java new file mode 100644 index 0000000..73d4d9d --- /dev/null +++ a/src/main/java/com/meishu/controller/RoleDictController.java @@ -0,0 +1,83 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.role.AddPermissionDTO; +import com.meishu.dto.role.DeletePermissionDTO; +import com.meishu.dto.role.GetRoleTeachersDTO; +import com.meishu.dto.role.RoleTeacherDTO; +import com.meishu.mapper.RoleAdministerMappingMapper; +import com.meishu.model.RoleAdministerMappingDO; +import com.meishu.service.RoleDictService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 角色表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +@RestController +@Api(tags = "角色字典表") +@RequestMapping("/roleDict") +public class RoleDictController { + + @Autowired + private RoleDictService roleDictService; + + @PostMapping("getAllRoles") + @ApiOperation("获取所有的角色") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllRoles(){ + return ResponseData.generateCreatedResponse(0,roleDictService.getAllRoles()); + } + + @PostMapping("getRoleTeachers") + @ApiOperation("获取某一角色下的所有老师 {roleId :角色id userName:老师名字 pageSize pageNum}") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getRoleTeachers(@RequestBody GetRoleTeachersDTO getRoleTeachersDTO){ + return ResponseData.generateCreatedResponse(0,roleDictService.getRoleTeachers(getRoleTeachersDTO)); + } + + @PostMapping("removeTeacher") + @ApiOperation("移除某一角色下的老师 ids {映射id} roleId :角色id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO removeTeacher(@RequestBody RoleTeacherDTO roleTeacherDTO){ + return ResponseData.generateCreatedResponse(0,roleDictService.removeTeacher(roleTeacherDTO)); + } + + @PostMapping("roleTeacher") + @ApiOperation("添加老师的角色 ids:老师id[] roleId :角色id ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO roleTeacher(@RequestBody RoleTeacherDTO roleTeacherDTO){ + return ResponseData.generateCreatedResponse(0,roleDictService.roleTeacher(roleTeacherDTO)); + } + + @PostMapping("addPermission") + @ApiOperation("给角色添加权限 {roleId 角色id permissionIds 多个权限}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addPermission(@RequestBody AddPermissionDTO addPermissionDTO){ + return ResponseData.generateCreatedResponse(0,roleDictService.addPermission(addPermissionDTO)); + } + + @PostMapping("deletePermission") + @ApiOperation("给角色删除权限 {roleId 角色id permissionIds 多个权限ids}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deletePermission(@RequestBody DeletePermissionDTO deletePermissionDTO){ + return ResponseData.generateCreatedResponse(0,roleDictService.deletePermission(deletePermissionDTO)); + } + + +} diff --git b/src/main/java/com/meishu/controller/RolePermissionMappingController.java a/src/main/java/com/meishu/controller/RolePermissionMappingController.java new file mode 100644 index 0000000..fb30161 --- /dev/null +++ a/src/main/java/com/meishu/controller/RolePermissionMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 系统用户角色表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +@RestController +@Api(tags = "角色权限表") +@RequestMapping("/rolePermissionMapping") +public class RolePermissionMappingController { + +} diff --git b/src/main/java/com/meishu/controller/SessionsDictController.java a/src/main/java/com/meishu/controller/SessionsDictController.java new file mode 100644 index 0000000..c77a968 --- /dev/null +++ a/src/main/java/com/meishu/controller/SessionsDictController.java @@ -0,0 +1,79 @@ +package com.meishu.controller; + +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.sessions.SessionsDictPageDTO; +import com.meishu.model.LaboratorySessionMappingDO; +import com.meishu.model.SessionsDictDO; +import com.meishu.service.SessionsDictService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 场次字典表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +@RestController +@Api(tags = "场次字典表 - D") +@RequestMapping("/sessionsDict") +public class SessionsDictController { + + @Autowired + private SessionsDictService sessionsDictService; + + @PostMapping(value = "/getListAll") + @ApiOperation("手机端 -- 查询全部场次") + public ResponseVO getListAll() { + return ResponseData.generateCreatedResponse(0, sessionsDictService.list()); + } + + @PostMapping(value = "/getListById") + @ApiOperation("根据实验室ID查询场次: laboratoryDictId/实验室ID") + public ResponseVO getListById(@RequestBody LaboratorySessionMappingDO laboratorySessionMappingDO) { + return ResponseData.generateCreatedResponse(0, sessionsDictService.getListById(laboratorySessionMappingDO.getLaboratoryDictId())); + } + + @PostMapping(value = "/getSessionsDictPage") + @ApiOperation("分页查询场次:pageNo/当前页数, pageSize/每页显示条数") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getSessionsDictPage(@RequestBody SessionsDictPageDTO sessionsDictPageDTO) { + return ResponseData.generateCreatedResponse(0, sessionsDictService.page(new Page(sessionsDictPageDTO.getPageNo(), sessionsDictPageDTO.getPageSize()))); + } + + @PostMapping(value = "/add") + @ApiOperation("添加场次:timeSlot/时间段(字符串:08:20 - 08:4)") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO add(@RequestBody SessionsDictDO sessionsDictDO) { + sessionsDictService.save(sessionsDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/update") + @ApiOperation("编辑场次:id/ID, timeSlot/时间段(字符串:08:20 - 08:04)") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO update(@RequestBody SessionsDictDO sessionsDictDO) { + sessionsDictService.updateById(sessionsDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "/delete") + @ApiOperation("删除场次:id/ID") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO delete(@RequestBody SessionsDictDO sessionsDictDO) { + sessionsDictService.removeById(sessionsDictDO.getId()); + return ResponseData.generateCreatedResponse(0); + } + +} diff --git b/src/main/java/com/meishu/controller/SignInRecordController.java a/src/main/java/com/meishu/controller/SignInRecordController.java new file mode 100644 index 0000000..5d0657e --- /dev/null +++ a/src/main/java/com/meishu/controller/SignInRecordController.java @@ -0,0 +1,42 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.sign.ClassSignInDTO; +import com.meishu.service.SignInRecordService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import io.swagger.annotations.Api; + +/** + *

+ * 学生签到表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +@RestController +@Api(tags = "学生签到表") +@RequestMapping("/signInRecord") +public class SignInRecordController { + + @Autowired + private SignInRecordService signInRecordService; + + + @PostMapping("classSignIn") + @ApiOperation("获取某个班级的打卡记录 pageSize pageNum ") + public ResponseVO classSignIn(@RequestBody ClassSignInDTO classSignInDTO){ + return ResponseData.generateCreatedResponse(0,signInRecordService.classSignIn(classSignInDTO)); + } + + + + + + +} diff --git b/src/main/java/com/meishu/controller/SmsCodeController.java a/src/main/java/com/meishu/controller/SmsCodeController.java new file mode 100644 index 0000000..93ceb5f --- /dev/null +++ a/src/main/java/com/meishu/controller/SmsCodeController.java @@ -0,0 +1,36 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.sms.SendVerifyCodeDTO; +import com.meishu.service.SmsCodeService; +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; + +/** + *

+ * 短信验证码 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@RestController +@RequestMapping("/sms") +public class SmsCodeController { + + @Autowired + private SmsCodeService smsCodeService; + + @PostMapping(value = "/send") + @ApiOperation("发送短信验证码") + public ResponseVO sendVerifyCode(@RequestBody SendVerifyCodeDTO sendVerifyCodeDTO ) { + smsCodeService.sendVerifyCode(sendVerifyCodeDTO); + return ResponseData.generateCreatedResponse(0); + } +} diff --git b/src/main/java/com/meishu/controller/StudentController.java a/src/main/java/com/meishu/controller/StudentController.java new file mode 100644 index 0000000..347c639 --- /dev/null +++ a/src/main/java/com/meishu/controller/StudentController.java @@ -0,0 +1,88 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.campus.BatchUpdateStatusDTO; +import com.meishu.dto.student.*; +import com.meishu.dto.subject.BatchStatusOprDTO; +import com.meishu.model.*; +import com.meishu.service.StudentService; +import com.meishu.util.ConstantUtils; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.java.Log; +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; + +/** + *

+ * 白名单 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@RestController +@RequestMapping("/student") +@Api(tags = "学生端") +public class StudentController { + + + @Autowired + private StudentService studentService; + + @PostMapping("sendMsg") + @ApiOperation("小程序---发送短信验证码 {telephone}") + public ResponseVO sendMsg(@RequestBody StudentDO studentDO){ + return ResponseData.generateCreatedResponse(0,studentService.sendMsg(studentDO)); + } + + @PostMapping("login") + @ApiOperation("小程序---验证短信验证码 {telephone code}") + public ResponseVO login(@RequestBody SmsCodeDO smsCodeDO){ + return ResponseData.generateCreatedResponse(0,studentService.login(smsCodeDO)); + } + + @PostMapping("addStudent") + @ApiOperation("添加学生 {telephone,username,parentTelephone,campusId}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addStudent(@RequestBody StudentDO studentDO){ + return ResponseData.generateCreatedResponse(0,studentService.addStudent(studentDO)); + } + + @PostMapping("updateStudent" ) + @ApiOperation("修改学生 id,username,parentTelephone,campusId,status 0:禁用 1:启用") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateStudent(@RequestBody StudentDO studentDO){ + return ResponseData.generateCreatedResponse(0,studentService.updateStudent(studentDO)); + } + + @PostMapping("batchUpdateStudent") + @ApiOperation("批量修改学生状态 ids[] status") + public ResponseVO batchUpdateStudent(@RequestBody BatchStatusOprDTO batchStatusOprDTO){ + return ResponseData.generateCreatedResponse(0,studentService.batchUpdateStudent(batchStatusOprDTO)); + } + + @PostMapping("deleteStudent") + @ApiOperation("删除学生 {ids[]}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteStudent(@RequestBody DeleteStudentDTO deleteStudentDTO){ + return ResponseData.generateCreatedResponse(0,studentService.deleteStudent(deleteStudentDTO)); + } + + @PostMapping("queryStudent") + @ApiOperation("查询单个学生 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO queryStudent(@RequestBody StudentDO studentDO){ + return ResponseData.generateCreatedResponse(0,studentService.queryStudent(studentDO)); + } + + + +} diff --git b/src/main/java/com/meishu/controller/StuentCourseMappingController.java a/src/main/java/com/meishu/controller/StuentCourseMappingController.java new file mode 100644 index 0000000..5e6406f --- /dev/null +++ a/src/main/java/com/meishu/controller/StuentCourseMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-17 + */ +@RestController +@Api(tags = "") +@RequestMapping("/stuent-course-mapping-do") +public class StuentCourseMappingController { + +} diff --git b/src/main/java/com/meishu/controller/SubjectDictController.java a/src/main/java/com/meishu/controller/SubjectDictController.java new file mode 100644 index 0000000..d87ac75 --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectDictController.java @@ -0,0 +1,31 @@ +package com.meishu.controller; + + +import com.meishu.service.SubjectDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 学校科目字典表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ +@RestController +@Api(tags = "学校科目字典表") +@RequestMapping("/subject") +public class SubjectDictController { + + @Autowired + private SubjectDictService subjectDictService; + + + + + +} diff --git b/src/main/java/com/meishu/controller/SubjectDimensionDictController.java a/src/main/java/com/meishu/controller/SubjectDimensionDictController.java new file mode 100644 index 0000000..21ff10a --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectDimensionDictController.java @@ -0,0 +1,69 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.model.SubjectDimensionDictDO; +import com.meishu.model.SubjectTestPublishGradeDO; +import com.meishu.service.SubjectDimensionDictService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 测评表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +@RestController +@Api(tags = "测评表") +@RequestMapping("/subjectDimensionDict") +public class SubjectDimensionDictController { + + @Autowired + private SubjectDimensionDictService subjectDimensionDictService; + + @PostMapping("getAllDimensions") + @ApiOperation("获取所有的维度 {ruleId 规则id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllDimensions(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.getAllDimensions(subjectDimensionDictDO)); + } + + @PostMapping("deleteDimensionById") + @ApiOperation("删除某个维度 {id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteDimensionById(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.deleteDimensionById(subjectDimensionDictDO)); + } + + @PostMapping("updateDimension") + @ApiOperation("编辑维度 {id dimension:维度名称 }") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateDimension(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.updateDimension(subjectDimensionDictDO)); + } + + @PostMapping("addDimension") + @ApiOperation("新增维度 {id ruleId: }") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addDimension(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.addDimension(subjectDimensionDictDO)); + } + + @PostMapping("getAllDimensionStar") + @ApiOperation("获取某个【规则】下的全部权限星级 publishId 规则id") + public ResponseVO getAllDimensionStar(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.getAllDimensionStar(subjectTestPublishGradeDO)); + } +} diff --git b/src/main/java/com/meishu/controller/SubjectDimensionStarDictController.java a/src/main/java/com/meishu/controller/SubjectDimensionStarDictController.java new file mode 100644 index 0000000..d81dc71 --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectDimensionStarDictController.java @@ -0,0 +1,65 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.dimension.AddStarDTO; +import com.meishu.dto.dimension.DeleteStarByIdDTO; +import com.meishu.model.SubjectDimensionStarDictDO; +import com.meishu.service.SubjectDimensionStarDictService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 维度星级字典表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +@RestController +@Api(tags = "维度星级字典表") +@RequestMapping("/subjectDimensionStartDict") +public class SubjectDimensionStarDictController { + + @Autowired + private SubjectDimensionStarDictService subjectDimensionStartDictService; + + @PostMapping("getAllDimensionStars") + @ApiOperation("获取某个维度下所有的星级 {dimensionId:维度id star星级 }") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllDimensionStars(@RequestBody SubjectDimensionStarDictDO subjectDimensionStartDictDO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.getAllDimensionStars(subjectDimensionStartDictDO)); + } + + @PostMapping("deleteStarById") + @ApiOperation("删除某个星级 ids:id数组") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteStarById(@RequestBody DeleteStarByIdDTO deleteDimensionByIdDTO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.deleteStarById(deleteDimensionByIdDTO)); + } + + @PostMapping("addStar") + @ApiOperation("新建星级 treeIds:多个知识点的数组 dimensionId:维度i1111d star:星级 description:评析") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addStar(@RequestBody AddStarDTO addStarDTO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.addStar(addStarDTO)); + } + + @PostMapping("updateStar") + @ApiOperation("修改星级 id treeIds:多个知识点的数组 dimensionId:维度id star:星级 description:评析") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateStar(@RequestBody AddStarDTO addStarDTO){ + return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.updateStar(addStarDTO)); + } + +} diff --git b/src/main/java/com/meishu/controller/SubjectRuleController.java a/src/main/java/com/meishu/controller/SubjectRuleController.java new file mode 100644 index 0000000..edc8ecb --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectRuleController.java @@ -0,0 +1,72 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.rule.GetAllRulesDTO; +import com.meishu.dto.rule.GetRuleReportDTO; +import com.meishu.model.SubjectRuleDO; +import com.meishu.service.SubjectRuleService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 规则字典表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-08 + */ +@RestController +@Api(tags = "规则字典表") +@RequestMapping("/subjectRule") +public class SubjectRuleController { + + @Autowired + private SubjectRuleService subjectRuleService; + + @PostMapping("getAllRules") + @ApiOperation("获取所有规则 ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllRules(@RequestBody GetAllRulesDTO getAllRulesDTO){ + return ResponseData.generateCreatedResponse(0,subjectRuleService.getAllRules(getAllRulesDTO)); + } + + @PostMapping("getRules") + @ApiOperation("获取所有规则 ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getRules(){ + return ResponseData.generateCreatedResponse(0,subjectRuleService.getRules()); + } + + @PostMapping("addRule") + @ApiOperation("新建规则 {subjectId:科目id ruleName规则名称}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addRule(@RequestBody SubjectRuleDO subjectRuleDO){ + return ResponseData.generateCreatedResponse(0,subjectRuleService.addRule(subjectRuleDO)); + } + + @PostMapping("updateRule") + @ApiOperation("更新规则 {id subjectId:科目id ruleName规则名称 status }") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateRule(@RequestBody SubjectRuleDO subjectRuleDO){ + return ResponseData.generateCreatedResponse(0,subjectRuleService.updateRule(subjectRuleDO)); + } + + @PostMapping("deleteRule") + @ApiOperation("删除规则 {id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteRule(@RequestBody SubjectRuleDO subjectRuleDO){ + return ResponseData.generateCreatedResponse(0,subjectRuleService.deleteRule(subjectRuleDO)); + } + +} diff --git b/src/main/java/com/meishu/controller/SubjectSemesterController.java a/src/main/java/com/meishu/controller/SubjectSemesterController.java new file mode 100644 index 0000000..24d2012 --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectSemesterController.java @@ -0,0 +1,79 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.semester.GetSemesterScoreDTO; +import com.meishu.dto.semester.GetStudentDetailDTO; +import com.meishu.dto.semester.GetStudentRecordDTO; +import com.meishu.service.SubjectSemesterService; +import com.meishu.util.excel.ExcelUtil; +import com.meishu.vo.semester.GetSemesterScoreVO; +import com.meishu.vo.semester.GetStudentRecordVO; +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 io.swagger.annotations.Api; + +import java.util.List; + +/** + *

+ * 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +@RestController +@Api(tags = "学期表") +@RequestMapping("/semester") +public class SubjectSemesterController { + + @Autowired + private SubjectSemesterService subjectSemesterService; + + @PostMapping("getAllStudyingSemester") + @ApiOperation("获取所有在读班级") + public ResponseVO getAllStudyingSemester(){ + return ResponseData.generateCreatedResponse(0,subjectSemesterService.getAllStudyingSemester()); + } + + @PostMapping("getAllPastSemester") + @ApiOperation("获取所有归档班级") + public ResponseVO getAllPastSemester(){ + return ResponseData.generateCreatedResponse(0,subjectSemesterService.getAllPastSemester()); + } + + + @PostMapping("getSemesterScore") + @ApiOperation("查看某个学期下的成绩 {pageSize pageNum grade classes session userName semester 上/下 subject 语文/数学....") + public ResponseVO getSemesterScore(@RequestBody GetSemesterScoreDTO getSemesterScoreDTO){ + return ResponseData.generateCreatedResponse(0,subjectSemesterService.getSemesterScore(getSemesterScoreDTO)); + } + + @PostMapping("exportScore") + @ApiOperation("导出筛选后的数据 { grade classes session userName semester 上/下 subject 语文/数学....}") + public void exportScore(@RequestBody GetSemesterScoreDTO getSemesterScoreDTO){ + List getSemesterScoreVOS = subjectSemesterService.exportScore(getSemesterScoreDTO); + ExcelUtil.writeExcel(getSemesterScoreVOS,GetSemesterScoreVO.class); + } + + @PostMapping("getStudentDetail") + @ApiOperation("获取学生分数详情 {pageSize pageNum id 学科+学期id userId 学生id}") + public ResponseVO getStudentDetail(@RequestBody GetStudentDetailDTO getStudentDetailDTO){ + return ResponseData.generateCreatedResponse(0,subjectSemesterService.getStudentDetail(getStudentDetailDTO)); + } + + @PostMapping("getStudentRecord") + @ApiOperation("获取学生扣分记录 {startDate endDate}") + public void getStudentRecord(@RequestBody GetStudentRecordDTO getStudentRecordDTO){ + List getStudentRecordVOS = subjectSemesterService.getStudentRecord(getStudentRecordDTO); + ExcelUtil.writeExcel(getStudentRecordVOS,GetStudentRecordVO.class); + } + +} diff --git b/src/main/java/com/meishu/controller/SubjectStarTreeMappingController.java a/src/main/java/com/meishu/controller/SubjectStarTreeMappingController.java new file mode 100644 index 0000000..f3a78e8 --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectStarTreeMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 测评-知识点关联表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +@RestController +@Api(tags = "测评-知识点关联表") +@RequestMapping("/subject-star-tree-mapping-do") +public class SubjectStarTreeMappingController { + +} diff --git b/src/main/java/com/meishu/controller/SubjectStudentAnswerStarController.java a/src/main/java/com/meishu/controller/SubjectStudentAnswerStarController.java new file mode 100644 index 0000000..76e21c7 --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectStudentAnswerStarController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 学生答卷星级表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +@RestController +@Api(tags = "学生答卷星级表") +@RequestMapping("/subject-student-answer-star-do") +public class SubjectStudentAnswerStarController { + +} diff --git b/src/main/java/com/meishu/controller/SubjectTestDictController.java a/src/main/java/com/meishu/controller/SubjectTestDictController.java new file mode 100644 index 0000000..4bae51c --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectTestDictController.java @@ -0,0 +1,74 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.test.GetAllTestDTO; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.service.SubjectTestDictService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 测评表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-20 + */ +@RestController +@Api(tags = "测评字典表") +@RequestMapping("/subjectTest") +public class SubjectTestDictController { + + @Autowired + private SubjectTestDictService subjectTestService; + + @PostMapping("getAllTest") + @ApiOperation("获取全部测评字典数据 分页 {ruleId testName pageSize pageNum}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllTest(@RequestBody GetAllTestDTO getAllTestDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestService.getAllTest(getAllTestDTO)); + } + + @PostMapping("getTest") + @ApiOperation("获取全不对测评 不分页 {ruleId testName}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getTest(@RequestBody GetAllTestDTO getAllTestDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestService.getTest(getAllTestDTO)); + } + + + @PostMapping("insertTest") + @ApiOperation("新增一个测评 {ruleId 规则id testName:测评名称 examination:卷面}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO insertTest(@RequestBody SubjectTestDictDO subjectTestDictDO){ + return ResponseData.generateCreatedResponse(0,subjectTestService.insertTest(subjectTestDictDO)); + } + + @PostMapping("updateTest") + @ApiOperation("修改一个测评 {id ruleId 规则id testName:测评名称 examination:卷面} ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateTest(@RequestBody SubjectTestDictDO subjectTestDictDO){ + return ResponseData.generateCreatedResponse(0,subjectTestService.updateTest(subjectTestDictDO)); + } + + @PostMapping("deleteByTestId") + @ApiOperation("删除一个测评 {id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteByTestId(@RequestBody SubjectTestDictDO subjectTestDictDO){ + return ResponseData.generateCreatedResponse(0,subjectTestService.deleteByTestId(subjectTestDictDO)); + } + + + +} diff --git b/src/main/java/com/meishu/controller/SubjectTestGradeExampleMappingController.java a/src/main/java/com/meishu/controller/SubjectTestGradeExampleMappingController.java new file mode 100644 index 0000000..f93b650 --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectTestGradeExampleMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 样卷映射表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +@RestController +@Api(tags = "样卷映射表") +@RequestMapping("/subject-test-grede-example-mapping-do") +public class SubjectTestGradeExampleMappingController { + +} diff --git b/src/main/java/com/meishu/controller/SubjectTestGradeStarMappingController.java a/src/main/java/com/meishu/controller/SubjectTestGradeStarMappingController.java new file mode 100644 index 0000000..031b520 --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectTestGradeStarMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 档次星级映射表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +@RestController +@Api(tags = "档次星级映射表") +@RequestMapping("/subject-test-grede-star-mapping-do") +public class SubjectTestGradeStarMappingController { + +} diff --git b/src/main/java/com/meishu/controller/SubjectTestPublishGradeController.java a/src/main/java/com/meishu/controller/SubjectTestPublishGradeController.java new file mode 100644 index 0000000..fb622a1 --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectTestPublishGradeController.java @@ -0,0 +1,78 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.grade.AddGradeDTO; +import com.meishu.model.SubjectTestPublishGradeDO; +import com.meishu.service.SubjectTestPublishGradeService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 档次表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +@RestController +@Api(tags = "档次表") +@RequestMapping("/subjectGrade") +public class SubjectTestPublishGradeController { + + @Autowired + private SubjectTestPublishGradeService subjectTestPublishGradeService; + + @PostMapping("addGrade") + @ApiOperation("添加一个档次 gradeName档次名称 publishId 发布id content 综合评价 subjectTestGradeExampleMappingDOS [exampleView 样卷地址] subjectTestGradeStarMappingDOS [starId 星级id]") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addGrade(@RequestBody AddGradeDTO addGradeDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.addGrade(addGradeDTO)); + } + + @PostMapping("deleteGrade") + @ApiOperation("删除一个档次 id 档次id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteGrade(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.deleteGrade(subjectTestPublishGradeDO)); + } + + @PostMapping("queryGrade") + @ApiOperation("查询档次全部档次") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO queryGrade(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.queryGrade(subjectTestPublishGradeDO)); + } + + @PostMapping("queryOneGrade") + @ApiOperation("查询单个档次 id") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO queryOneGrade(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.queryOneGrade(subjectTestPublishGradeDO)); + } + + @PostMapping("updateGrade") + @ApiOperation("编辑某个档次 id gradeName档次名称 publishId 发布id subjectTestGradeExampleMappingDOS [exampleView 样卷地址] subjectTestGradeStarMappingDOS [starId 星级id] ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateGrade(@RequestBody AddGradeDTO addGradeDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.updateGrade(addGradeDTO)); + } + + @PostMapping("getRuleIdByPublishId") + @ApiOperation("通过publishId查询ruleId {publishId 发布id}") + public ResponseVO getRuleIdByPublishId(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishGradeService.getRuleIdByPublishId(subjectTestPublishGradeDO)); + } + + +} diff --git b/src/main/java/com/meishu/controller/SubjectTestPublishHistoryController.java a/src/main/java/com/meishu/controller/SubjectTestPublishHistoryController.java new file mode 100644 index 0000000..b78b54a --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectTestPublishHistoryController.java @@ -0,0 +1,90 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.test.*; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.model.SubjectTestPublishHistoryDO; +import com.meishu.service.SubjectTestPublishHistoryService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 测评发布记录表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-08 + */ +@RestController +@Api(tags = "测评发布记录表") +@RequestMapping("/subjectTestPublishHistory") +public class SubjectTestPublishHistoryController { + + @Autowired + private SubjectTestPublishHistoryService subjectTestPublishHistoryService; + + + @PostMapping("publishTest") + @ApiOperation("发布一条测评 {testId 测评id outline studentIds coverPage 多个学生id testTime 测评时间}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO publishTest(@RequestBody PublishTestDTO publishTestDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.publishTest(publishTestDTO)); + } + + + @PostMapping("updatePublish") + @ApiOperation("修改一个测评 {publishId 发布id testId 测评id outline studentIds 多个学生id testTime 测评时间}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updatePublish(@RequestBody PublishTestDTO publishTestDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.updatePublish(publishTestDTO)); + } + + + @PostMapping("getPublishHistory") + @ApiOperation("获取所有的测评发布历史 {ruleId 规则id publishName测评名称 pageSize pageNum}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getPublishHistory(@RequestBody GetPublishHistoryDTO getPublishHistoryDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.getPublishHistory(getPublishHistoryDTO)); + } + + @PostMapping("getTestReport") + @ApiOperation("测评报告 {ruleId 规则id publishName测评名称 pageSize pageNum}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getTestReport(@RequestBody GetTestReportDTO getTestReportDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.getTestReport(getTestReportDTO)); + } + + @PostMapping("getOnePublish") + @ApiOperation("查看某个测评的报告 {id 发布的id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getOnePublish(@RequestBody GetOnePublishDTO getOnePublishDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.getOnePublish(getOnePublishDTO)); + } + + @PostMapping("comment") + @ApiOperation("评析卷子 {studentId 学生id publishId 发布id dimensionId 维度id starId 星级id administerId:评卷人id}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO comment(@RequestBody CommentDTO commentDTO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.comment(commentDTO)); + } + + @PostMapping("deletePublish") + @ApiOperation("删除一条发布测评 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deletePublish(@RequestBody SubjectTestPublishHistoryDO subjectTestPublishHistoryDO){ + return ResponseData.generateCreatedResponse(0,subjectTestPublishHistoryService.deletePublish(subjectTestPublishHistoryDO)); + } + + +} diff --git b/src/main/java/com/meishu/controller/SubjectTestStudentAnswerController.java a/src/main/java/com/meishu/controller/SubjectTestStudentAnswerController.java new file mode 100644 index 0000000..32445a9 --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectTestStudentAnswerController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 学生月考答卷 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +@RestController +@Api(tags = "学生月考答卷") +@RequestMapping("/subject-test-student-answer-do") +public class SubjectTestStudentAnswerController { + +} diff --git b/src/main/java/com/meishu/controller/SubjectTreeController.java a/src/main/java/com/meishu/controller/SubjectTreeController.java new file mode 100644 index 0000000..951e4e1 --- /dev/null +++ a/src/main/java/com/meishu/controller/SubjectTreeController.java @@ -0,0 +1,78 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.dto.subject.UpdateTreeOrderDTO; +import com.meishu.model.SubjectTreeDO; +import com.meishu.service.SubjectTreeService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "知识树") +@RequestMapping("/subjectTree") +public class SubjectTreeController { + + @Autowired + private SubjectTreeService subjectTreeService; + + @PostMapping("updateSubjectTree") + @ApiOperation("更新知识树子节点 id treeName:知识点名称 parentId父节点id treeNode 编号") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateSubjectTree(@RequestBody SubjectTreeDO subjectTreeDO){ + return ResponseData.generateCreatedResponse(0,subjectTreeService.updateSubjectTree(subjectTreeDO)); + } + + @PostMapping("addSubjectTree") + @ApiOperation("添加知识树节点 subjectId 科目id parentId:父节点 treeName:知识点名称 " + + "treeNode 编号 ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addSubjectTree(@RequestBody SubjectTreeDO subjectTreeDO){ + return ResponseData.generateCreatedResponse(0,subjectTreeService.addSubjectTree(subjectTreeDO)); + } + + @PostMapping("deleteSubjectTree") + @ApiOperation("删除子节点(递归删除) {id}") + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteSubjectTree(@RequestBody SubjectTreeDO subjectTreeDO){ + return ResponseData.generateCreatedResponse(0,subjectTreeService.deleteSubjectTree(subjectTreeDO)); + } + + @PostMapping("updateTreeOrder") + @ApiOperation("知识点排序 {ids[]知识树id parentId }") + public ResponseVO updateTreeOrder(@RequestBody UpdateTreeOrderDTO updateTreeOrderDTO){ + return ResponseData.generateCreatedResponse(0,subjectTreeService.updateTreeOrder(updateTreeOrderDTO)); + } + + @PostMapping("getTreesCnt") + @ApiOperation("获取知识树+ 题目视频数 subjectId userId") + public ResponseVO getTreesCnt(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO){ + return ResponseData.generateCreatedResponse(0,subjectTreeService.getTreesCnt(getSubjectTreeDTO)); + } + + @PostMapping("getTreesCheckCnt") + @ApiOperation("获取知识树+ 视频题目审核数 subjectId userId shareStatus 2:待审核 1已审核") + public ResponseVO getTreesCheckCnt(@RequestBody GetSubjectTreeDTO getSubjectTreeDTO){ + return ResponseData.generateCreatedResponse(0,subjectTreeService.getTreesCheckCnt(getSubjectTreeDTO)); + } + + +} diff --git b/src/main/java/com/meishu/controller/TaskCompletionStatusController.java a/src/main/java/com/meishu/controller/TaskCompletionStatusController.java new file mode 100644 index 0000000..7a5175b --- /dev/null +++ a/src/main/java/com/meishu/controller/TaskCompletionStatusController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 作业任务完成状态 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@RestController +@Api(tags = "作业任务完成状态") +@RequestMapping("/task-completion-status-do") +public class TaskCompletionStatusController { + +} diff --git b/src/main/java/com/meishu/controller/TaskContentController.java a/src/main/java/com/meishu/controller/TaskContentController.java new file mode 100644 index 0000000..8ab4d30 --- /dev/null +++ a/src/main/java/com/meishu/controller/TaskContentController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 作业内容表(取题目,视频,书面作业) 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@RestController +@Api(tags = "作业内容表(取题目,视频,书面作业)") +@RequestMapping("/task-content-do") +public class TaskContentController { + +} diff --git b/src/main/java/com/meishu/controller/TaskContentDoneInfoController.java a/src/main/java/com/meishu/controller/TaskContentDoneInfoController.java new file mode 100644 index 0000000..cc4813f --- /dev/null +++ a/src/main/java/com/meishu/controller/TaskContentDoneInfoController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-30 + */ +@RestController +@Api(tags = "") +@RequestMapping("/task-content-done-info-do") +public class TaskContentDoneInfoController { + +} diff --git b/src/main/java/com/meishu/controller/TaskDoneHistoryController.java a/src/main/java/com/meishu/controller/TaskDoneHistoryController.java new file mode 100644 index 0000000..4f0945a --- /dev/null +++ a/src/main/java/com/meishu/controller/TaskDoneHistoryController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@RestController +@Api(tags = "") +@RequestMapping("/task-done-history-do") +public class TaskDoneHistoryController { + +} diff --git b/src/main/java/com/meishu/controller/UserRoleController.java a/src/main/java/com/meishu/controller/UserRoleController.java new file mode 100644 index 0000000..ec535bb --- /dev/null +++ a/src/main/java/com/meishu/controller/UserRoleController.java @@ -0,0 +1,91 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.dto.sms.VerifyCodeDTO; +import com.meishu.dto.userrole.AccountLoginDTO; +import com.meishu.dto.userrole.AddStudentsDTO; +import com.meishu.dto.userrole.QueryStudentsDTO; +import com.meishu.model.UserRoleDO; +import com.meishu.service.UserRoleService; +import com.meishu.util.excel.ExcelUtil; +import com.meishu.vo.semester.GetSemesterScoreVO; +import com.meishu.vo.student.QueryStudentVO; +import com.meishu.vo.userrole.QueryStudentsVO; +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 io.swagger.annotations.Api; + +import java.util.List; + +/** + *

+ * 学生表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-08-16 + */ +@RestController +@Api(tags = "学生表") +@RequestMapping("/userRole") +public class UserRoleController { + + @Autowired + private UserRoleService userRoleService; + + @PostMapping(value = "/login") + @ApiOperation("手机端:实验室预约登录:phone/手机号, verifyCode/验证码") + public ResponseVO login(@RequestBody VerifyCodeDTO verifyCodeDTO) { + return ResponseData.generateCreatedResponse(0, userRoleService.login(verifyCodeDTO)); + } + + @PostMapping(value = "/accountLogin") + @ApiOperation("手机端:实验室预约账户登录:idCard/身份证, password/密码") + public ResponseVO accountLogin(@RequestBody AccountLoginDTO accountLoginDTO) { + return ResponseData.generateCreatedResponse(0, userRoleService.accountLogin(accountLoginDTO)); + } + + @PostMapping(value = "/userInfo") + @ApiOperation("获取用户信息:id/学生ID") + public ResponseVO userInfo(@RequestBody UserRoleDO userRoleDO) { + return ResponseData.generateCreatedResponse(0, userRoleService.userInfo(userRoleDO.getUserId())); + } + + @PostMapping("queryStudents") + @ApiOperation("学生管理--查询所有学生 {pageSize pageNum userName 学生名称 grade 年级 session 入读时间 userStatus 状态 }") + public ResponseVO queryStudents(@RequestBody QueryStudentsDTO queryStudentsDTO){ + return ResponseData.generateCreatedResponse(0,userRoleService.queryStudents(queryStudentsDTO)); + } + + @PostMapping("addStudents") + @ApiOperation("学生管理--添加学生 {userName:学生姓名 studyCode:学籍号 phone:手机号 idCard:身份证号 session:入学年份 gender:性别 email:邮箱 }") + public ResponseVO addStudents(@RequestBody UserRoleDO userRoleDO){ + return ResponseData.generateCreatedResponse(0,userRoleService.addStudents(userRoleDO)); + } + + @PostMapping("updateStudent") + @ApiOperation("学生管理--编辑学生 {id userName:学生姓名 studyCode:学籍号 phone:手机号 idCard:身份证号 session:入学年份 gender:性别 email:邮箱}") + public ResponseVO updateStudent(@RequestBody UserRoleDO userRoleDO){ + return ResponseData.generateCreatedResponse(0,userRoleService.updateStudent(userRoleDO)); + } + + @PostMapping("exportStudents") + @ApiOperation("学生管理--导出 { userName 学生名称 grade 年级 session 入读时间 userStatus 状态 0:归档 1:在读 2:休学}") + public void exportStudents(@RequestBody QueryStudentsDTO queryStudentsDTO){ + List queryStudentsVOS = userRoleService.exportStudents(queryStudentsDTO); + ExcelUtil.writeExcel(queryStudentsVOS, QueryStudentsVO.class); + } + + @PostMapping("studycode") + public void studycode(){ + userRoleService.studycode(); + } + +} diff --git b/src/main/java/com/meishu/controller/UserSubjectMappingController.java a/src/main/java/com/meishu/controller/UserSubjectMappingController.java new file mode 100644 index 0000000..b5a1507 --- /dev/null +++ a/src/main/java/com/meishu/controller/UserSubjectMappingController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 老师-科目映射表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ +@RestController +@Api(tags = "老师-科目映射表") +@RequestMapping("/user-subject-mapping-do") +public class UserSubjectMappingController { + +} diff --git b/src/main/java/com/meishu/controller/UserSubjectPermissionDictController.java a/src/main/java/com/meishu/controller/UserSubjectPermissionDictController.java new file mode 100644 index 0000000..c4572b0 --- /dev/null +++ a/src/main/java/com/meishu/controller/UserSubjectPermissionDictController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 平时成绩---老师班级权限 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-08-18 + */ +@RestController +@Api(tags = "平时成绩---老师班级权限") +@RequestMapping("/user-subject-permission-dict-do") +public class UserSubjectPermissionDictController { + +} diff --git b/src/main/java/com/meishu/controller/UuidHistoryController.java a/src/main/java/com/meishu/controller/UuidHistoryController.java new file mode 100644 index 0000000..9a02c83 --- /dev/null +++ a/src/main/java/com/meishu/controller/UuidHistoryController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-29 + */ +@RestController +@Api(tags = "") +@RequestMapping("/uuid-history-do") +public class UuidHistoryController { + +} diff --git b/src/main/java/com/meishu/controller/VodDictController.java a/src/main/java/com/meishu/controller/VodDictController.java new file mode 100644 index 0000000..5e14208 --- /dev/null +++ a/src/main/java/com/meishu/controller/VodDictController.java @@ -0,0 +1,147 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.voddict.*; +import com.meishu.model.VodDictDO; +import com.meishu.model.VodPlayHistoryDO; +import com.meishu.model.VodSubjectTreeMappingDO; +import com.meishu.service.VodDictService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 视频字典表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "视频字典表") +@RequestMapping("/vodDict") +public class VodDictController { + + @Autowired + private VodDictService vodDictService; + + @PostMapping("/signature") + @ApiOperation("获取签名") + public ResponseVO signature()throws Exception{ + return ResponseData.generateCreatedResponse(0,vodDictService.signature()); + } + + @PostMapping("getTreeVods") + @ApiOperation("(个人库/公共库)获取某个知识树下的视频 subjectId 科目id vodType:课型 vodName:视频名称 shareStatus 0:个人库 1:公共库 treeId:知识树id userId 用户id pageSize pageNum") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getTreeVods (@RequestBody GetTreeVodsDTO getTreeVodsDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.getTreeVods(getTreeVodsDTO)); + } + + @PostMapping("getCheckTreeVods") + @ApiOperation("(审核)获取某个知识树下的视频 subjectId 科目id vodType:课型 vodName:视频名称 checkStatus 1:已审核 2:待审核 treeId:知识树id userId 用户id pageSize pageNum") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getCheckTreeVods (@RequestBody GetTreeVodsDTO getTreeVodsDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.getCheckTreeVods(getTreeVodsDTO)); + } + + @PostMapping("deleteVod") + @ApiOperation("删除某个视频(从腾讯云中也删除) id ") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.deleteVod(vodDictDO)); + } + + @PostMapping("uploadVods") + @ApiOperation("上传某个视频 {subjectId 科目id vodName视频名称 vodUrl 视频地址 vodType课型" + + "vodIntro 视频介绍 vodLength视频长度 vodCode:腾讯云上视频code administerId 视频提供者" + + "treeIds 多个知识点(数组)}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO uploadVods(@RequestBody UploadVodsDTO uploadVodsDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.uploadVods(uploadVodsDTO)); + } + + @PostMapping("updateVod") + @ApiOperation("修改某个视频 {id 视频名称 subjectId 科目id vodName视频名称 vodUrl 视频地址 vodType课型" + + " vodIntro 视频介绍 vodLength视频长度 vodCode:腾讯云上视频code administerId 视频提供者" + + "treeIds 多个知识点(数组)}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateVod(@RequestBody UploadVodsDTO uploadVodsDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.updateVod(uploadVodsDTO)); + } + + @PostMapping("getVodInfo") + @ApiOperation("小程序---获取视频详情 id:视频id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getVodInfo(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.getVodInfo(vodDictDO)); + } + + @PostMapping("insertPlayHistory") + @ApiOperation("小程序--记录播放记录 {vodId 视频id treeId知识点 studentId 学生id playLength 观看时长 playRecord 播放位点}") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO insertPlayHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.insertPlayHistory(vodPlayHistoryDO)); + } + + @PostMapping("getToCheckVodCounts") + @ApiOperation("获取所有未审核/已审核的视频个数 {subjectId 科目 checkStatus 审核状态 1:已审核 2:待审核}") +// @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getToCheckVodCounts(@RequestBody GetToCheckVodCountsDTO getToCheckVodCountsDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.getToCheckVodCounts(getToCheckVodCountsDTO)); + } + + @PostMapping("compressVodByCode") + @ApiOperation("通过code压缩视频并删除原视频 {id 视频id }") + public ResponseVO compressVodByCode(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.compressVodByCode(vodDictDO)); + } + + @PostMapping("deleteOriginVod") + @ApiOperation("删除原视频") + public ResponseVO deleteOriginVod(@RequestBody DeleteOriginVodDTO deleteOriginVodDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.deleteOriginVod(deleteOriginVodDTO)); + } + + @PostMapping("checkVod") + @ApiOperation("审核视频 {checkId 审核人id id 视频id vodType:课型 vodName:视频名称 treeIds:多个知识点id checkStatus 1:审核通过 3:未通过 reason:原因}") + public ResponseVO checkVod(@RequestBody CheckVodDTO checkVodDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.checkVod(checkVodDTO)); + } + + @PostMapping("publicUpload") + @ApiOperation("公共资源上载 {userId checkStatus 1:审核通过 2:审核中 3:未通过}") + public ResponseVO publicUpload(@RequestBody PublicCheckingDTO publicCheckingDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.publicUpload(publicCheckingDTO)); + } + + @PostMapping("withdraw") + @ApiOperation("撤回视频 id 视频id") + public ResponseVO withdraw(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.withdraw(vodDictDO)); + } + + @PostMapping("getVodDetail") + @ApiOperation("获取一个视频详情{id}") + public ResponseVO getVodDetail(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.getVodDetail(vodDictDO)); + } + + @PostMapping("setRelatedVod") + @ApiOperation("设置关联题目 {vodId 视频id status 1:关联 0:取消关联}") + public ResponseVO setRelatedVod(@RequestBody VodSubjectTreeMappingDO vodSubjectTreeMappingDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.setRelatedVod(vodSubjectTreeMappingDO)); + } + + +} diff --git b/src/main/java/com/meishu/controller/VodPlayHistoryController.java a/src/main/java/com/meishu/controller/VodPlayHistoryController.java new file mode 100644 index 0000000..ce74c11 --- /dev/null +++ a/src/main/java/com/meishu/controller/VodPlayHistoryController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 视频播放历史记录表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "视频播放历史记录表") +@RequestMapping("/vod-play-history-do") +public class VodPlayHistoryController { + +} diff --git b/src/main/java/com/meishu/controller/VodSubjectTreeMappingController.java a/src/main/java/com/meishu/controller/VodSubjectTreeMappingController.java new file mode 100644 index 0000000..60f3926 --- /dev/null +++ a/src/main/java/com/meishu/controller/VodSubjectTreeMappingController.java @@ -0,0 +1,52 @@ +package com.meishu.controller; + + +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.interceptor.LoginRequired; +import com.meishu.dto.subject.BatchStatusOprDTO; +import com.meishu.dto.subject.GetAllVodsStatusDTO; +import com.meishu.service.VodSubjectTreeMappingService; +import com.meishu.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 视频知识点映射表 前端控制器 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@RestController +@Api(tags = "视频知识点映射表") +@RequestMapping("/vodTreeMapping") +public class VodSubjectTreeMappingController { + + + @Autowired + private VodSubjectTreeMappingService vodSubjectTreeMappingService; + + @PostMapping("getAllVodsStatus") + @ApiOperation("获取所有未授权的视频 subjectId status 0:未授权 1:已授权") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllVodsStatus(@RequestBody GetAllVodsStatusDTO getAllNoAuthenVodsDTO){ + return ResponseData.generateCreatedResponse(0,vodSubjectTreeMappingService.getAllNoAuthenVods(getAllNoAuthenVodsDTO)); + } + + @PostMapping("batchStatusOpr") + @ApiOperation("批量操作视频审核状态 {ids 多个视频id[] status 1:通过 0:驳回}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO batchStatusOpr(@RequestBody BatchStatusOprDTO batchStatusOprDTO){ + return ResponseData.generateCreatedResponse(0,vodSubjectTreeMappingService.batchStatusOpr(batchStatusOprDTO)); + } + + +} diff --git b/src/main/java/com/meishu/controller/WechatController.java a/src/main/java/com/meishu/controller/WechatController.java new file mode 100644 index 0000000..9778e37 --- /dev/null +++ a/src/main/java/com/meishu/controller/WechatController.java @@ -0,0 +1,138 @@ +package com.meishu.controller; + + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.common.ResponseData; +import com.meishu.common.ResponseVO; +import com.meishu.common.configure.RestTemplateConfig; +import com.meishu.common.configure.WechatConfig; +import com.meishu.dto.wechat.AuthenRequestDTO; +import com.meishu.dto.wechat.JsSdkDTO; +import com.meishu.dto.wechat.SignDTO; +import com.meishu.mapper.AccessTokenMapper; +import com.meishu.mapper.StudentMapper; +import com.meishu.model.AccessTokenDO; +import com.meishu.model.StudentDO; +import com.meishu.util.SecretUtils; +import com.meishu.util.WechatUtil; +import com.meishu.vo.wechat.AuthenTokenVO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +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.time.LocalDateTime; +import java.util.List; + +@RestController +@RequestMapping("/wechat") +@Api(tags = "微信授权") +public class WechatController { + + @Autowired + private RestTemplateConfig restTemplateConfig; + + @Autowired + private WechatConfig wechatConfig; + + @Autowired + private AccessTokenMapper accessTokenMapper; + + @Autowired + private StudentMapper studentMapper; + + @PostMapping(value = "/getJsapiTicket") + @ApiOperation("通过token请求获得jsapi_ticket {url}") + public ResponseVO getJsapiTicket(@RequestBody SignDTO signVO) { + + List accessTokens = accessTokenMapper.selectList(null); + + String accessToken = ""; + if (accessTokens.size() == 0) { + accessToken = WechatUtil.getAccessToken().getAccess_token(); + AccessTokenDO accessToken1 = new AccessTokenDO(); + accessToken1.setAccessToken(accessToken); + accessToken1.setUpdateDate(LocalDateTime.now()); + accessTokenMapper.insert(accessToken1); + } else { + AccessTokenDO accessToken1 = accessTokens.get(0); + int diff = LocalDateTime.now().getNano() - accessToken1.getUpdateDate().getNano(); + if (diff >= 2 * 60 * 60*1000000000 - 5*1000000000) { + accessToken = WechatUtil.getAccessToken().getAccess_token(); + accessToken1.setAccessToken(accessToken); + accessToken1.setUpdateDate(LocalDateTime.now()); + accessTokenMapper.updateById(accessToken1); + } else { + accessToken = accessToken1.getAccessToken(); + } + } + signVO.setAccess_token(accessToken); + String url1 = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + accessToken + "&type=jsapi"; + ResponseEntity response1 = restTemplateConfig.restTemplate() + .exchange(url1, HttpMethod.GET, null, JsSdkDTO.class); + + String ticket = response1.getBody().getTicket(); + signVO.setJsapi_ticket(ticket); + signVO.setNoncestr("Wm3WZYTPz0wzccnW"); + signVO.setTimestamp(String.valueOf(System.currentTimeMillis())); + String signStr = "jsapi_ticket=" + signVO.getJsapi_ticket() + "&noncestr=" + signVO.getNoncestr() + "×tamp=" + signVO.getTimestamp() + + "&url=" + signVO.getUrl(); + + signVO.setSign(SecretUtils.getSHAString(signStr)); + signVO.setAppId(wechatConfig.getAppId()); + signVO.setAgentId(wechatConfig.getAgentId()); + return ResponseData.generateCreatedResponse(0, signVO); + } + + + @PostMapping("/webAuthen") + @ApiOperation("网页授权 通过code换取身份信息 {code phone 手机号}") + public ResponseVO webAuthen(@RequestBody AuthenRequestDTO authenRequestDTO) { + + String url = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=" + wechatConfig.getAppId() + "&secret=" + + wechatConfig.getAppSecret() + "&code=" + authenRequestDTO.getCode() + "&grant_type=authorization_code"; + ResponseEntity response = restTemplateConfig.restTemplate() + .exchange(url, HttpMethod.GET, null, AuthenTokenVO.class); + AuthenTokenVO authenTokenVO = response.getBody(); + + + //通过openId从库里查询 + StudentDO user = studentMapper.selectOne(new QueryWrapper() + .lambda() + .eq(StudentDO::getOpenid,authenTokenVO.getOpenid())); + + if (null==user){ + String url1 = "https://api.weixin.qq.com/sns/userinfo?access_token=" + authenTokenVO.getAccess_token() + "&openid=" + authenTokenVO.getOpenid() + "&lang=zh_CN"; + + ResponseEntity response1 = restTemplateConfig.restTemplate() + .exchange(url1, HttpMethod.GET, null, AuthenTokenVO.class); + return ResponseData.generateCreatedResponse(0,response1.getBody()); + }else { +// //该openId已存在,查出该用户的角色信息 +// +// List userInfoVOS = new ArrayList<>(); +// QueryWrapper queryWrapper = new QueryWrapper(); +// queryWrapper.eq("user_id",user.getId()); +// queryWrapper.eq("role_type","学生"); +// List userRoles = userRoleMapper.selectList(queryWrapper); +// for (UserRole userRole : userRoles){ +// UserInfoVO userInfoVO = new UserInfoVO(); +// BeanUtils.copyProperties(userRole,userInfoVO); +// ClassesDict classesDict = classesDictMapper.selectById(userRole.getClassesId()); +// userInfoVO.setSchool(classesDict.getSchool()); +// userInfoVO.setGrade(classesDict.getGrade()); +// userInfoVO.setClasses(classesDict.getClasses()); +// userInfoVO.setSession(classesDict.getSession()); +// userInfoVO.setSubjectType(classesDict.getSubjectType()); +// userInfoVOS.add(userInfoVO); +// } + return null; + } + } + +} diff --git b/src/main/java/com/meishu/controller/WrittenHomeworkController.java a/src/main/java/com/meishu/controller/WrittenHomeworkController.java new file mode 100644 index 0000000..3e3955c --- /dev/null +++ a/src/main/java/com/meishu/controller/WrittenHomeworkController.java @@ -0,0 +1,22 @@ +package com.meishu.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 通知/附件作业表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@RestController +@Api(tags = "通知/附件作业表") +@RequestMapping("/written-homework-do") +public class WrittenHomeworkController { + +} diff --git b/src/main/java/com/meishu/dto/administer/AddAdministerDTO.java a/src/main/java/com/meishu/dto/administer/AddAdministerDTO.java new file mode 100644 index 0000000..5bbab30 --- /dev/null +++ a/src/main/java/com/meishu/dto/administer/AddAdministerDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.administer; + +import com.meishu.model.AdministerDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddAdministerDTO extends AdministerDO { + + private List campusIds; + + private List departmentIds; + + private List subjectIds; + + private List roleIds; +} diff --git b/src/main/java/com/meishu/dto/administer/ChangeStatusDTO.java a/src/main/java/com/meishu/dto/administer/ChangeStatusDTO.java new file mode 100644 index 0000000..915d7bb --- /dev/null +++ a/src/main/java/com/meishu/dto/administer/ChangeStatusDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.administer; + +import lombok.Data; + +import java.util.List; + +@Data +public class ChangeStatusDTO { + + private List ids; + + private String status; + +} diff --git b/src/main/java/com/meishu/dto/administer/GetClassesRequestVO.java a/src/main/java/com/meishu/dto/administer/GetClassesRequestVO.java new file mode 100644 index 0000000..f19585f --- /dev/null +++ a/src/main/java/com/meishu/dto/administer/GetClassesRequestVO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.administer; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-06-22 18:18 + */ +@Data +public class GetClassesRequestVO { + + private Integer userId; + + private String status; + + private String subject; + + private String subjectType; + +} diff --git b/src/main/java/com/meishu/dto/administer/PublishExpandingVO.java a/src/main/java/com/meishu/dto/administer/PublishExpandingVO.java new file mode 100644 index 0000000..ce9b14e --- /dev/null +++ a/src/main/java/com/meishu/dto/administer/PublishExpandingVO.java @@ -0,0 +1,19 @@ +package com.meishu.dto.administer; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-21 14:48 + */ +@Data +public class PublishExpandingVO { + + private String expandingExeIds; + + private String expandingStudents; + + private String expandingName; + + +} diff --git b/src/main/java/com/meishu/dto/administer/PublishHomeworkVO.java a/src/main/java/com/meishu/dto/administer/PublishHomeworkVO.java new file mode 100644 index 0000000..6eaf4c7 --- /dev/null +++ a/src/main/java/com/meishu/dto/administer/PublishHomeworkVO.java @@ -0,0 +1,25 @@ +package com.meishu.dto.administer; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-21 14:52 + */ +@Data +public class PublishHomeworkVO { + + private Integer homeworkType; + + private String homeworkContent; + + private Integer adviceLength; + + private String fileSize; + + private String fileType; + + private String fileName; + + +} diff --git b/src/main/java/com/meishu/dto/administer/PublishTasksDTO.java a/src/main/java/com/meishu/dto/administer/PublishTasksDTO.java new file mode 100644 index 0000000..a00033c --- /dev/null +++ a/src/main/java/com/meishu/dto/administer/PublishTasksDTO.java @@ -0,0 +1,38 @@ +package com.meishu.dto.administer; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +public class PublishTasksDTO { + + + private Integer id; + + private String treeName; + + private Integer taskType; + + private String treeIds; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private Date taskDate; + + private List subjectIds; + + private Integer userId; + + private String vodIds; + + private String relatedIds; + + private Integer adviceLength; + + private List publishExpandingVOS; + + private List publishHomeworkVOS; + +} diff --git b/src/main/java/com/meishu/dto/administer/PushMsgPO.java a/src/main/java/com/meishu/dto/administer/PushMsgPO.java new file mode 100644 index 0000000..c3b6972 --- /dev/null +++ a/src/main/java/com/meishu/dto/administer/PushMsgPO.java @@ -0,0 +1,24 @@ +package com.meishu.dto.administer; + +import lombok.Data; + +@Data +public class PushMsgPO { + + + private String title; + + private String school; + + private String teacherName; + + private String taskName; + + private String DateTime; + + private String remark; + + private String openId; + + +} diff --git b/src/main/java/com/meishu/dto/administer/UpdateAdministerDTO.java a/src/main/java/com/meishu/dto/administer/UpdateAdministerDTO.java new file mode 100644 index 0000000..f238456 --- /dev/null +++ a/src/main/java/com/meishu/dto/administer/UpdateAdministerDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.administer; + +import com.meishu.model.AdministerDO; +import lombok.Data; + +import java.util.List; + +@Data +public class UpdateAdministerDTO extends AdministerDO { + + private List campusIds; + + private List departmentIds; + + private List subjectIds; + + private List roleIds; +} diff --git b/src/main/java/com/meishu/dto/campus/BatchUpdateStatusDTO.java a/src/main/java/com/meishu/dto/campus/BatchUpdateStatusDTO.java new file mode 100644 index 0000000..7b92d79 --- /dev/null +++ a/src/main/java/com/meishu/dto/campus/BatchUpdateStatusDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.campus; + +import lombok.Data; + +import java.util.List; + +@Data +public class BatchUpdateStatusDTO { + + private List id; + + private String status; + +} diff --git b/src/main/java/com/meishu/dto/campus/CampusStudentDTO.java a/src/main/java/com/meishu/dto/campus/CampusStudentDTO.java new file mode 100644 index 0000000..b2868b9 --- /dev/null +++ a/src/main/java/com/meishu/dto/campus/CampusStudentDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.campus; + +import lombok.Data; + +@Data +public class CampusStudentDTO { + + private Long campusId; + + private String username; + + private Integer pageSize; + + private Integer pageNum; + +} diff --git b/src/main/java/com/meishu/dto/chapter/AddTreeToChapterDTO.java a/src/main/java/com/meishu/dto/chapter/AddTreeToChapterDTO.java new file mode 100644 index 0000000..7418f04 --- /dev/null +++ a/src/main/java/com/meishu/dto/chapter/AddTreeToChapterDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.chapter; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddTreeToChapterDTO { + + private List ids; + + private Long chapterId; + +} diff --git b/src/main/java/com/meishu/dto/chapter/ChapterExerciseVO.java a/src/main/java/com/meishu/dto/chapter/ChapterExerciseVO.java new file mode 100644 index 0000000..e3c31eb --- /dev/null +++ a/src/main/java/com/meishu/dto/chapter/ChapterExerciseVO.java @@ -0,0 +1,21 @@ +package com.meishu.dto.chapter; + +import com.meishu.model.CourseTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class ChapterExerciseVO { + + private String createTime; + + private Integer rightCounts; + + private Integer totalCounts; + + private String chapter; + + private List courseTreeDOS; + +} diff --git b/src/main/java/com/meishu/dto/chapter/ChapterVodsVO.java a/src/main/java/com/meishu/dto/chapter/ChapterVodsVO.java new file mode 100644 index 0000000..d99b4ae --- /dev/null +++ a/src/main/java/com/meishu/dto/chapter/ChapterVodsVO.java @@ -0,0 +1,25 @@ +package com.meishu.dto.chapter; + +import lombok.Data; + +@Data +public class ChapterVodsVO { + + private Long vodId; + + private String vodName; + + private String treeName; + + private Integer vodLength; + + private Integer playRecord; + + private String lengthPercent; + + private String createTime; + + private Integer playCounts; + + private Long id; +} diff --git b/src/main/java/com/meishu/dto/chapter/GetChapterCourseDetailVO.java a/src/main/java/com/meishu/dto/chapter/GetChapterCourseDetailVO.java new file mode 100644 index 0000000..5f06535 --- /dev/null +++ a/src/main/java/com/meishu/dto/chapter/GetChapterCourseDetailVO.java @@ -0,0 +1,27 @@ +package com.meishu.dto.chapter; + +import com.meishu.vo.course.GetExerciseDetailVO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetChapterCourseDetailVO { + + private String chapter; + + private String createTime; + + private Integer rightCounts; + + private Integer totalCounts; + + private String avgRightPercent; + + private Integer useLength; + + private Integer avgLength; + + private List getExerciseDetailVOS; + +} diff --git b/src/main/java/com/meishu/dto/chapter/StudentChapterDTO.java a/src/main/java/com/meishu/dto/chapter/StudentChapterDTO.java new file mode 100644 index 0000000..8934eae --- /dev/null +++ a/src/main/java/com/meishu/dto/chapter/StudentChapterDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.chapter; + +import lombok.Data; + +@Data +public class StudentChapterDTO { + + private Long studentId; + + private Long chapterId; + + private Long courseId; + +} diff --git b/src/main/java/com/meishu/dto/chapter/UpdateChapterOrderDTO.java a/src/main/java/com/meishu/dto/chapter/UpdateChapterOrderDTO.java new file mode 100644 index 0000000..351e705 --- /dev/null +++ a/src/main/java/com/meishu/dto/chapter/UpdateChapterOrderDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.chapter; + +import lombok.Data; + +import java.util.List; + +@Data +public class UpdateChapterOrderDTO { + + private List ids; + +} diff --git b/src/main/java/com/meishu/dto/classes/AddClassDTO.java a/src/main/java/com/meishu/dto/classes/AddClassDTO.java new file mode 100644 index 0000000..e66e509 --- /dev/null +++ a/src/main/java/com/meishu/dto/classes/AddClassDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.classes; + +import com.meishu.model.ClassesDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddClassDTO extends ClassesDictDO { + + List subjects; + +} diff --git b/src/main/java/com/meishu/dto/classes/AddSubjectTeacherDTO.java a/src/main/java/com/meishu/dto/classes/AddSubjectTeacherDTO.java new file mode 100644 index 0000000..390debb --- /dev/null +++ a/src/main/java/com/meishu/dto/classes/AddSubjectTeacherDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddSubjectTeacherDTO { + + private List addSubjectTeacherMappingDTOS; + + private Integer classId; + +} diff --git b/src/main/java/com/meishu/dto/classes/AddSubjectTeacherMappingDTO.java a/src/main/java/com/meishu/dto/classes/AddSubjectTeacherMappingDTO.java new file mode 100644 index 0000000..f563e18 --- /dev/null +++ a/src/main/java/com/meishu/dto/classes/AddSubjectTeacherMappingDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddSubjectTeacherMappingDTO { + + private String subjectId; + + private List teacherIds; + + +} diff --git b/src/main/java/com/meishu/dto/classes/BatchAddStudentToClassDTO.java a/src/main/java/com/meishu/dto/classes/BatchAddStudentToClassDTO.java new file mode 100644 index 0000000..f8b3ba1 --- /dev/null +++ a/src/main/java/com/meishu/dto/classes/BatchAddStudentToClassDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +import java.util.List; + +@Data +public class BatchAddStudentToClassDTO { + + private List ids; + + private Integer classId; + +} diff --git b/src/main/java/com/meishu/dto/classes/BatchUpGradeDTO.java a/src/main/java/com/meishu/dto/classes/BatchUpGradeDTO.java new file mode 100644 index 0000000..253ee6e --- /dev/null +++ a/src/main/java/com/meishu/dto/classes/BatchUpGradeDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +import java.util.Date; +import java.util.List; + +@Data +public class BatchUpGradeDTO { + + private List ids; + + private Date upgradeDate; + +} diff --git b/src/main/java/com/meishu/dto/classes/GetClassStudentsDTO.java a/src/main/java/com/meishu/dto/classes/GetClassStudentsDTO.java new file mode 100644 index 0000000..9a9ee98 --- /dev/null +++ a/src/main/java/com/meishu/dto/classes/GetClassStudentsDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +@Data +public class GetClassStudentsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Integer classId; + + private String userName; + +} diff --git b/src/main/java/com/meishu/dto/classes/GetClassesDTO.java a/src/main/java/com/meishu/dto/classes/GetClassesDTO.java new file mode 100644 index 0000000..d6d11e8 --- /dev/null +++ a/src/main/java/com/meishu/dto/classes/GetClassesDTO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +@Data +public class GetClassesDTO { + + private Integer pageNum; + + private Integer pageSize; + + private String className; + + private String grade; + + private String session; + + private String status; + +} diff --git b/src/main/java/com/meishu/dto/classes/QueryNoClassStudentsDTO.java a/src/main/java/com/meishu/dto/classes/QueryNoClassStudentsDTO.java new file mode 100644 index 0000000..7c7cf5b --- /dev/null +++ a/src/main/java/com/meishu/dto/classes/QueryNoClassStudentsDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.classes; + +import lombok.Data; + +@Data +public class QueryNoClassStudentsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String userName; + +} diff --git b/src/main/java/com/meishu/dto/course/AddCourseDTO.java a/src/main/java/com/meishu/dto/course/AddCourseDTO.java new file mode 100644 index 0000000..5ed8383 --- /dev/null +++ a/src/main/java/com/meishu/dto/course/AddCourseDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.course; + +import com.meishu.model.CourseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddCourseDTO extends CourseDictDO { + + private List administerIds; + +} diff --git b/src/main/java/com/meishu/dto/course/AddCourseTreeNodeDTO.java a/src/main/java/com/meishu/dto/course/AddCourseTreeNodeDTO.java new file mode 100644 index 0000000..362925b --- /dev/null +++ a/src/main/java/com/meishu/dto/course/AddCourseTreeNodeDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.course; + + +import com.meishu.model.CourseTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddCourseTreeNodeDTO { + + private Long courseId; + + private List courseTreeDOS; + +} diff --git b/src/main/java/com/meishu/dto/course/AddStudentAuthenDTO.java a/src/main/java/com/meishu/dto/course/AddStudentAuthenDTO.java new file mode 100644 index 0000000..2caf633 --- /dev/null +++ a/src/main/java/com/meishu/dto/course/AddStudentAuthenDTO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.course; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddStudentAuthenDTO { + + private List ids; + + private String startDate; + + private String endDate; + + private Long courseId; + + private Long administerId; + +} diff --git b/src/main/java/com/meishu/dto/course/BatchVodOprDTO.java a/src/main/java/com/meishu/dto/course/BatchVodOprDTO.java new file mode 100644 index 0000000..d7b2953 --- /dev/null +++ a/src/main/java/com/meishu/dto/course/BatchVodOprDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.course; + +import lombok.Data; + +import java.util.List; + +@Data +public class BatchVodOprDTO { + + private List ids; + + private String status; + +} diff --git b/src/main/java/com/meishu/dto/course/CourseProgressDTO.java a/src/main/java/com/meishu/dto/course/CourseProgressDTO.java new file mode 100644 index 0000000..a390de4 --- /dev/null +++ a/src/main/java/com/meishu/dto/course/CourseProgressDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.course; + +import lombok.Data; + +@Data +public class CourseProgressDTO { + + private Long courseId; + + private Integer pageSize; + + private Integer pageNum; + + private Long campusId; + + private String username; + +} diff --git b/src/main/java/com/meishu/dto/course/CourseVodDTO.java a/src/main/java/com/meishu/dto/course/CourseVodDTO.java new file mode 100644 index 0000000..d32825d --- /dev/null +++ a/src/main/java/com/meishu/dto/course/CourseVodDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.course; + +import lombok.Data; + +@Data +public class CourseVodDTO { + + private Long courseTreeId; + + private Long vodId; + +} diff --git b/src/main/java/com/meishu/dto/course/GetAllUnAuthenStudentsDTO.java a/src/main/java/com/meishu/dto/course/GetAllUnAuthenStudentsDTO.java new file mode 100644 index 0000000..ffca948 --- /dev/null +++ a/src/main/java/com/meishu/dto/course/GetAllUnAuthenStudentsDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.course; + +import lombok.Data; + +@Data +public class GetAllUnAuthenStudentsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long courseId; + + private String username; + + private String campus; + +} diff --git b/src/main/java/com/meishu/dto/course/GetCourseStudentsDTO.java a/src/main/java/com/meishu/dto/course/GetCourseStudentsDTO.java new file mode 100644 index 0000000..539d600 --- /dev/null +++ a/src/main/java/com/meishu/dto/course/GetCourseStudentsDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.course; + +import lombok.Data; + +@Data +public class GetCourseStudentsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long courseId; + + private String username; + +} diff --git b/src/main/java/com/meishu/dto/course/GetExercisesByTreeDTO.java a/src/main/java/com/meishu/dto/course/GetExercisesByTreeDTO.java new file mode 100644 index 0000000..d8507ce --- /dev/null +++ a/src/main/java/com/meishu/dto/course/GetExercisesByTreeDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.course; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetExercisesByTreeDTO { + + private Long treeId; + + private List exerciseIds; + +} diff --git b/src/main/java/com/meishu/dto/department/BatchOprDTO.java a/src/main/java/com/meishu/dto/department/BatchOprDTO.java new file mode 100644 index 0000000..1eba2b0 --- /dev/null +++ a/src/main/java/com/meishu/dto/department/BatchOprDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.department; + +import lombok.Data; + +import java.util.List; + +@Data +public class BatchOprDTO { + + private List ids; + + private Long parentId; + + private Long departmentLeaderId; + +} diff --git b/src/main/java/com/meishu/dto/department/GetAllDepartmentVO.java a/src/main/java/com/meishu/dto/department/GetAllDepartmentVO.java new file mode 100644 index 0000000..93e39d5 --- /dev/null +++ a/src/main/java/com/meishu/dto/department/GetAllDepartmentVO.java @@ -0,0 +1,38 @@ +package com.meishu.dto.department; + +import com.meishu.model.AdministerDO; +import com.meishu.model.AdministerDepartmentMappingDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllDepartmentVO { + + private Long id; + + private String departmentName; + + private Long departmentLeaderId; + + private Long parentId; + + private String parentDepartmentName; + + private Long administerId; + + private String userName; + + private String img; + + private Integer count; + +// private Long administerDepartmentId; + + private List administerDOS; + + private List administerDepartmentMappingDOS; + + private List children; + +} diff --git b/src/main/java/com/meishu/dto/department/GetTeachersDTO.java a/src/main/java/com/meishu/dto/department/GetTeachersDTO.java new file mode 100644 index 0000000..755e67b --- /dev/null +++ a/src/main/java/com/meishu/dto/department/GetTeachersDTO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.department; + +import lombok.Data; + +@Data +public class GetTeachersDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long departmentId; + + private String userName; + + private Long campusId; + + private Long userId; + +} diff --git b/src/main/java/com/meishu/dto/dimension/AddStarDTO.java a/src/main/java/com/meishu/dto/dimension/AddStarDTO.java new file mode 100644 index 0000000..f6bdda5 --- /dev/null +++ a/src/main/java/com/meishu/dto/dimension/AddStarDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.dimension; + +import com.meishu.model.SubjectDimensionStarDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddStarDTO extends SubjectDimensionStarDictDO { + + private List treeIds; + +} diff --git b/src/main/java/com/meishu/dto/dimension/DeleteStarByIdDTO.java a/src/main/java/com/meishu/dto/dimension/DeleteStarByIdDTO.java new file mode 100644 index 0000000..b51f994 --- /dev/null +++ a/src/main/java/com/meishu/dto/dimension/DeleteStarByIdDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.dimension; + +import lombok.Data; + +import java.util.List; + +@Data +public class DeleteStarByIdDTO { + + private List ids; + +} diff --git b/src/main/java/com/meishu/dto/exercise/AddExerciseDTO.java a/src/main/java/com/meishu/dto/exercise/AddExerciseDTO.java new file mode 100644 index 0000000..f2dd668 --- /dev/null +++ a/src/main/java/com/meishu/dto/exercise/AddExerciseDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.exercise; + +import com.meishu.model.ExerciseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddExerciseDTO extends ExerciseDictDO { + + private List treeIds; + +} diff --git b/src/main/java/com/meishu/dto/exercise/CheckExerciseDTO.java a/src/main/java/com/meishu/dto/exercise/CheckExerciseDTO.java new file mode 100644 index 0000000..1efb139 --- /dev/null +++ a/src/main/java/com/meishu/dto/exercise/CheckExerciseDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.exercise; + +import com.meishu.model.ExerciseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class CheckExerciseDTO extends ExerciseDictDO { + + private List treeIds; + +} diff --git b/src/main/java/com/meishu/dto/exercise/ExeLatexExpressDTO.java a/src/main/java/com/meishu/dto/exercise/ExeLatexExpressDTO.java new file mode 100644 index 0000000..f877753 --- /dev/null +++ a/src/main/java/com/meishu/dto/exercise/ExeLatexExpressDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.exercise; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-08-08 23:20 + */ +@Data +public class ExeLatexExpressDTO { + + private String latex; + +} diff --git b/src/main/java/com/meishu/dto/exercise/GetExerciseRequestDTO.java a/src/main/java/com/meishu/dto/exercise/GetExerciseRequestDTO.java new file mode 100644 index 0000000..5e903dc --- /dev/null +++ a/src/main/java/com/meishu/dto/exercise/GetExerciseRequestDTO.java @@ -0,0 +1,21 @@ +package com.meishu.dto.exercise; + +import com.meishu.model.ExerciseDictDO; +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-19 17:07 + */ +@Data +public class GetExerciseRequestDTO extends ExerciseDictDO { + + private Integer collectionStatus; + + private String school; + + private Integer userId; + + private Integer treeId; + +} diff --git b/src/main/java/com/meishu/dto/exercise/GetStatusVodsDTO.java a/src/main/java/com/meishu/dto/exercise/GetStatusVodsDTO.java new file mode 100644 index 0000000..dba1d2b --- /dev/null +++ a/src/main/java/com/meishu/dto/exercise/GetStatusVodsDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.exercise; + +import lombok.Data; + +@Data +public class GetStatusVodsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String status; + + private Long treeId; + +} diff --git b/src/main/java/com/meishu/dto/exercise/GetTreeExercisesDTO.java a/src/main/java/com/meishu/dto/exercise/GetTreeExercisesDTO.java new file mode 100644 index 0000000..f1d0012 --- /dev/null +++ a/src/main/java/com/meishu/dto/exercise/GetTreeExercisesDTO.java @@ -0,0 +1,31 @@ +package com.meishu.dto.exercise; + +import lombok.Data; + +@Data +public class GetTreeExercisesDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long treeId; + + private String exerciseType; + + private Integer difficulty; + + private String title; + + private Long subjectId; + + private String status; + + private String shareStatus; + + private String checkStatus; + + private Long userId; + + +} diff --git b/src/main/java/com/meishu/dto/exercise/QueryCourseTreeExerciseDTO.java a/src/main/java/com/meishu/dto/exercise/QueryCourseTreeExerciseDTO.java new file mode 100644 index 0000000..451c629 --- /dev/null +++ a/src/main/java/com/meishu/dto/exercise/QueryCourseTreeExerciseDTO.java @@ -0,0 +1,22 @@ +package com.meishu.dto.exercise; + +import lombok.Data; + +@Data +public class QueryCourseTreeExerciseDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String title; + + private Integer difficulty; + + private String exerciseType; + + private Long courseId; + + private Long courseTreeId; + +} diff --git b/src/main/java/com/meishu/dto/exercise/UpdateStatusDTO.java a/src/main/java/com/meishu/dto/exercise/UpdateStatusDTO.java new file mode 100644 index 0000000..0242cbd --- /dev/null +++ a/src/main/java/com/meishu/dto/exercise/UpdateStatusDTO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.exercise; + +import lombok.Data; + +import java.util.List; + +@Data +public class UpdateStatusDTO { + + private List ids; + + private String status; + + private String startDate; + + private String endDate; + + private Long administerId; + +} diff --git b/src/main/java/com/meishu/dto/grade/AddGradeDTO.java a/src/main/java/com/meishu/dto/grade/AddGradeDTO.java new file mode 100644 index 0000000..0b63cca --- /dev/null +++ a/src/main/java/com/meishu/dto/grade/AddGradeDTO.java @@ -0,0 +1,24 @@ +package com.meishu.dto.grade; + +import com.meishu.model.SubjectTestGradeExampleMappingDO; +import com.meishu.model.SubjectTestGradeStarMappingDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddGradeDTO { + + private Long id; + + private String gradeName; + + private Long publishId; + + private String content; + + private List subjectTestGradeExampleMappingDOS; + + private List subjectTestGradeStarMappingDOS; + +} diff --git b/src/main/java/com/meishu/dto/laboratory/LaboratoryDictDTO.java a/src/main/java/com/meishu/dto/laboratory/LaboratoryDictDTO.java new file mode 100644 index 0000000..dbb0070 --- /dev/null +++ a/src/main/java/com/meishu/dto/laboratory/LaboratoryDictDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.laboratory; + +import lombok.Data; +import java.util.List; + +@Data +public class LaboratoryDictDTO { + + private Long id; + + private String laboratoryName; + + private String laboratoryType; + + private Integer maxNum; + + private List sessionDictId; +} diff --git b/src/main/java/com/meishu/dto/laboratory/LaboratoryPageDTO.java a/src/main/java/com/meishu/dto/laboratory/LaboratoryPageDTO.java new file mode 100644 index 0000000..11c9de9 --- /dev/null +++ a/src/main/java/com/meishu/dto/laboratory/LaboratoryPageDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.laboratory; + +import lombok.Data; + +@Data +public class LaboratoryPageDTO { + + private String name; + + private String laboratoryType; + + private Integer pageNo; + + private Integer pageSize; +} diff --git b/src/main/java/com/meishu/dto/laboratorySession/CalendarStatusDTO.java a/src/main/java/com/meishu/dto/laboratorySession/CalendarStatusDTO.java new file mode 100644 index 0000000..d8d8e24 --- /dev/null +++ a/src/main/java/com/meishu/dto/laboratorySession/CalendarStatusDTO.java @@ -0,0 +1,9 @@ +package com.meishu.dto.laboratorySession; + +import lombok.Data; + +@Data +public class CalendarStatusDTO { + + private String selectDate; +} diff --git b/src/main/java/com/meishu/dto/laboratorySession/GetLaboratorySessionDTO.java a/src/main/java/com/meishu/dto/laboratorySession/GetLaboratorySessionDTO.java new file mode 100644 index 0000000..09b879b --- /dev/null +++ a/src/main/java/com/meishu/dto/laboratorySession/GetLaboratorySessionDTO.java @@ -0,0 +1,17 @@ +package com.meishu.dto.laboratorySession; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetLaboratorySessionDTO { + + private Long studentId; + + private String startDate; + + private String laboratoryType; + + private List sessionsDictId; +} diff --git b/src/main/java/com/meishu/dto/laboratorySession/LaboratorySessionListDTO.java a/src/main/java/com/meishu/dto/laboratorySession/LaboratorySessionListDTO.java new file mode 100644 index 0000000..0021402 --- /dev/null +++ a/src/main/java/com/meishu/dto/laboratorySession/LaboratorySessionListDTO.java @@ -0,0 +1,9 @@ +package com.meishu.dto.laboratorySession; + +import lombok.Data; + +@Data +public class LaboratorySessionListDTO { + + private String startDate; +} \ No newline at end of file diff --git b/src/main/java/com/meishu/dto/laboratorySession/SetLaboratorySessionDTO.java a/src/main/java/com/meishu/dto/laboratorySession/SetLaboratorySessionDTO.java new file mode 100644 index 0000000..ed3ca68 --- /dev/null +++ a/src/main/java/com/meishu/dto/laboratorySession/SetLaboratorySessionDTO.java @@ -0,0 +1,23 @@ +package com.meishu.dto.laboratorySession; + +import lombok.Data; + +import java.util.List; + +@Data +public class SetLaboratorySessionDTO { + + private Long laboratoryDictId; + + private String laboratoryType; + + private String grade; + + private String startDate; + + private String registerStartDate; + + private String registerEndDate; + + private List sessionDictId; +} diff --git b/src/main/java/com/meishu/dto/laboratoryUser/ApplyDTO.java a/src/main/java/com/meishu/dto/laboratoryUser/ApplyDTO.java new file mode 100644 index 0000000..ef6b98a --- /dev/null +++ a/src/main/java/com/meishu/dto/laboratoryUser/ApplyDTO.java @@ -0,0 +1,11 @@ +package com.meishu.dto.laboratoryUser; + +import lombok.Data; + +@Data +public class ApplyDTO { + + private Long studentId; + + private Long laboratorySessionId; +} diff --git b/src/main/java/com/meishu/dto/laboratoryUser/LaboratoryUserPageDTO.java a/src/main/java/com/meishu/dto/laboratoryUser/LaboratoryUserPageDTO.java new file mode 100644 index 0000000..8459516 --- /dev/null +++ a/src/main/java/com/meishu/dto/laboratoryUser/LaboratoryUserPageDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.laboratoryUser; + +import lombok.Data; + +@Data +public class LaboratoryUserPageDTO { + + private Long laboratorySessionId; + + private String startDate; + + private Integer pageNo; + + private Integer pageSize; +} diff --git b/src/main/java/com/meishu/dto/question/QueryQuestionsDTO.java a/src/main/java/com/meishu/dto/question/QueryQuestionsDTO.java new file mode 100644 index 0000000..0192166 --- /dev/null +++ a/src/main/java/com/meishu/dto/question/QueryQuestionsDTO.java @@ -0,0 +1,26 @@ +package com.meishu.dto.question; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +@Data +public class QueryQuestionsDTO { + + private Integer pageSize; + + private Integer pageNum; + + + private String userName; + + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date startDate; + + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date endDate; + + private Integer subjectId; + +} diff --git b/src/main/java/com/meishu/dto/role/AddPermissionDTO.java a/src/main/java/com/meishu/dto/role/AddPermissionDTO.java new file mode 100644 index 0000000..334b699 --- /dev/null +++ a/src/main/java/com/meishu/dto/role/AddPermissionDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.role; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddPermissionDTO { + + private Long roleId; + + private List permissionIds; + +} diff --git b/src/main/java/com/meishu/dto/role/DeletePermissionDTO.java a/src/main/java/com/meishu/dto/role/DeletePermissionDTO.java new file mode 100644 index 0000000..e3abffc --- /dev/null +++ a/src/main/java/com/meishu/dto/role/DeletePermissionDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.role; + + +import lombok.Data; + +import java.util.List; + +@Data +public class DeletePermissionDTO { + + private List roleIds; + + private Long permissionId; + +} diff --git b/src/main/java/com/meishu/dto/role/GetRoleTeachersDTO.java a/src/main/java/com/meishu/dto/role/GetRoleTeachersDTO.java new file mode 100644 index 0000000..89b869a --- /dev/null +++ a/src/main/java/com/meishu/dto/role/GetRoleTeachersDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.role; + +import lombok.Data; + +@Data +public class GetRoleTeachersDTO { + + private String userName; + + private Long roleId; + + private Integer pageSize; + + private Integer pageNum; + +} diff --git b/src/main/java/com/meishu/dto/role/RoleTeacherDTO.java a/src/main/java/com/meishu/dto/role/RoleTeacherDTO.java new file mode 100644 index 0000000..5c0239f --- /dev/null +++ a/src/main/java/com/meishu/dto/role/RoleTeacherDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.role; + +import lombok.Data; + +import java.util.List; + +@Data +public class RoleTeacherDTO { + + private List ids; + + private Long roleId; + +} diff --git b/src/main/java/com/meishu/dto/rule/GetAllRulesDTO.java a/src/main/java/com/meishu/dto/rule/GetAllRulesDTO.java new file mode 100644 index 0000000..21ca3ca --- /dev/null +++ a/src/main/java/com/meishu/dto/rule/GetAllRulesDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.rule; + +import lombok.Data; + +@Data +public class GetAllRulesDTO { + + private Integer pageSize; + + private Integer pageNum; + +} diff --git b/src/main/java/com/meishu/dto/rule/GetRuleReportDTO.java a/src/main/java/com/meishu/dto/rule/GetRuleReportDTO.java new file mode 100644 index 0000000..c29ae0f --- /dev/null +++ a/src/main/java/com/meishu/dto/rule/GetRuleReportDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.rule; + +import lombok.Data; + +@Data +public class GetRuleReportDTO { + + private Long ruleId; + + private Long campusId; + + private String ruleName; + +} diff --git b/src/main/java/com/meishu/dto/semester/GetSemesterScoreDTO.java a/src/main/java/com/meishu/dto/semester/GetSemesterScoreDTO.java new file mode 100644 index 0000000..7459c06 --- /dev/null +++ a/src/main/java/com/meishu/dto/semester/GetSemesterScoreDTO.java @@ -0,0 +1,24 @@ +package com.meishu.dto.semester; + +import lombok.Data; + +@Data +public class GetSemesterScoreDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String userName; + + private String semester; + + private String subject; + + private String grade; + + private String classes; + + private String session; + +} diff --git b/src/main/java/com/meishu/dto/semester/GetStudentDetailDTO.java a/src/main/java/com/meishu/dto/semester/GetStudentDetailDTO.java new file mode 100644 index 0000000..74e1a4a --- /dev/null +++ a/src/main/java/com/meishu/dto/semester/GetStudentDetailDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.semester; + +import lombok.Data; + +@Data +public class GetStudentDetailDTO { + + private Integer pageNum; + + private Integer pageSize; + + private Integer id; + + private Integer userId; + +} diff --git b/src/main/java/com/meishu/dto/semester/GetStudentRecordDTO.java a/src/main/java/com/meishu/dto/semester/GetStudentRecordDTO.java new file mode 100644 index 0000000..3f6c0ee --- /dev/null +++ a/src/main/java/com/meishu/dto/semester/GetStudentRecordDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.semester; + +import lombok.Data; + +@Data +public class GetStudentRecordDTO { + + private String startDate; + + private String endDate; + +} diff --git b/src/main/java/com/meishu/dto/sessions/SessionsDictPageDTO.java a/src/main/java/com/meishu/dto/sessions/SessionsDictPageDTO.java new file mode 100644 index 0000000..e74af48 --- /dev/null +++ a/src/main/java/com/meishu/dto/sessions/SessionsDictPageDTO.java @@ -0,0 +1,11 @@ +package com.meishu.dto.sessions; + +import lombok.Data; + +@Data +public class SessionsDictPageDTO { + + private Integer pageNo; + + private Integer pageSize; +} diff --git b/src/main/java/com/meishu/dto/sign/ClassSignInDTO.java a/src/main/java/com/meishu/dto/sign/ClassSignInDTO.java new file mode 100644 index 0000000..5760c01 --- /dev/null +++ a/src/main/java/com/meishu/dto/sign/ClassSignInDTO.java @@ -0,0 +1,22 @@ +package com.meishu.dto.sign; + +import lombok.Data; + +import java.util.Date; + +@Data +public class ClassSignInDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Integer classId; + + private String userName; + + private Date startDate; + + private Date endDate; + +} diff --git b/src/main/java/com/meishu/dto/sms/SendVerifyCodeDTO.java a/src/main/java/com/meishu/dto/sms/SendVerifyCodeDTO.java new file mode 100644 index 0000000..47f80d0 --- /dev/null +++ a/src/main/java/com/meishu/dto/sms/SendVerifyCodeDTO.java @@ -0,0 +1,9 @@ +package com.meishu.dto.sms; + +import lombok.Data; + +@Data +public class SendVerifyCodeDTO { + + private String phone; +} diff --git b/src/main/java/com/meishu/dto/sms/VerifyCodeDTO.java a/src/main/java/com/meishu/dto/sms/VerifyCodeDTO.java new file mode 100644 index 0000000..d65a2e5 --- /dev/null +++ a/src/main/java/com/meishu/dto/sms/VerifyCodeDTO.java @@ -0,0 +1,11 @@ +package com.meishu.dto.sms; + +import lombok.Data; + +@Data +public class VerifyCodeDTO { + + private String phone; + + private String verifyCode; +} diff --git b/src/main/java/com/meishu/dto/student/DeleteStudentDTO.java a/src/main/java/com/meishu/dto/student/DeleteStudentDTO.java new file mode 100644 index 0000000..4fce943 --- /dev/null +++ a/src/main/java/com/meishu/dto/student/DeleteStudentDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.student; + + +import lombok.Data; + +import java.util.List; + +@Data +public class DeleteStudentDTO { + + private List ids; + +} diff --git b/src/main/java/com/meishu/dto/student/GetChildTreesDTO.java a/src/main/java/com/meishu/dto/student/GetChildTreesDTO.java new file mode 100644 index 0000000..0e2e9e3 --- /dev/null +++ a/src/main/java/com/meishu/dto/student/GetChildTreesDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.student; + +import lombok.Data; + +@Data +public class GetChildTreesDTO { + + private Long studentId; + + private Long courseTreeId; + +} diff --git b/src/main/java/com/meishu/dto/student/GetStudentRulesDTO.java a/src/main/java/com/meishu/dto/student/GetStudentRulesDTO.java new file mode 100644 index 0000000..ffd48f2 --- /dev/null +++ a/src/main/java/com/meishu/dto/student/GetStudentRulesDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.student; + +import lombok.Data; + +@Data +public class GetStudentRulesDTO { + + private Long id; + + private Long subjectId; + +} diff --git b/src/main/java/com/meishu/dto/student/GetStudyProgressDTO.java a/src/main/java/com/meishu/dto/student/GetStudyProgressDTO.java new file mode 100644 index 0000000..051a189 --- /dev/null +++ a/src/main/java/com/meishu/dto/student/GetStudyProgressDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.student; + +import lombok.Data; + +@Data +public class GetStudyProgressDTO { + + private Long studentId; + + private Long chapterId; + +} diff --git b/src/main/java/com/meishu/dto/student/GetVodIndexDTO.java a/src/main/java/com/meishu/dto/student/GetVodIndexDTO.java new file mode 100644 index 0000000..e72eac0 --- /dev/null +++ a/src/main/java/com/meishu/dto/student/GetVodIndexDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.student; + +import lombok.Data; + +@Data +public class GetVodIndexDTO { + + private Long studentId; + + private Long treeId; + + private Long chapterId; + +} diff --git b/src/main/java/com/meishu/dto/student/SearchVodsDTO.java a/src/main/java/com/meishu/dto/student/SearchVodsDTO.java new file mode 100644 index 0000000..2245124 --- /dev/null +++ a/src/main/java/com/meishu/dto/student/SearchVodsDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.student; + +import lombok.Data; + +@Data +public class SearchVodsDTO { + + private String treeName; + + private Long courseId; + + private Long studentId; +} diff --git b/src/main/java/com/meishu/dto/student/SubmitTestDTO.java a/src/main/java/com/meishu/dto/student/SubmitTestDTO.java new file mode 100644 index 0000000..d5db469 --- /dev/null +++ a/src/main/java/com/meishu/dto/student/SubmitTestDTO.java @@ -0,0 +1,17 @@ +package com.meishu.dto.student; + +import com.meishu.model.CourseTreeExerciseStudentResultDO; +import lombok.Data; + +import java.util.List; + +@Data +public class SubmitTestDTO { + + private Long studentId; + + private Long chapterId; + + private List courseTreeExerciseStudentResultDOS; + +} diff --git b/src/main/java/com/meishu/dto/subject/BatchStatusOprDTO.java a/src/main/java/com/meishu/dto/subject/BatchStatusOprDTO.java new file mode 100644 index 0000000..138729e --- /dev/null +++ a/src/main/java/com/meishu/dto/subject/BatchStatusOprDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.subject; + +import lombok.Data; + +import java.util.List; + +@Data +public class BatchStatusOprDTO { + + private List ids; + + private String status; + + private String isShow; + +} diff --git b/src/main/java/com/meishu/dto/subject/GetAllVodsStatusDTO.java a/src/main/java/com/meishu/dto/subject/GetAllVodsStatusDTO.java new file mode 100644 index 0000000..970abd7 --- /dev/null +++ a/src/main/java/com/meishu/dto/subject/GetAllVodsStatusDTO.java @@ -0,0 +1,19 @@ +package com.meishu.dto.subject; + +import lombok.Data; + +@Data +public class GetAllVodsStatusDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String vodType; + + private Long treeId; + + private String status; + + +} diff --git b/src/main/java/com/meishu/dto/subject/GetSubjectAdministerDTO.java a/src/main/java/com/meishu/dto/subject/GetSubjectAdministerDTO.java new file mode 100644 index 0000000..53adae5 --- /dev/null +++ a/src/main/java/com/meishu/dto/subject/GetSubjectAdministerDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.subject; + +import lombok.Data; + +@Data +public class GetSubjectAdministerDTO { + + private Long subjectId; + + private String userName; + +} diff --git b/src/main/java/com/meishu/dto/subject/GetSubjectTreeDTO.java a/src/main/java/com/meishu/dto/subject/GetSubjectTreeDTO.java new file mode 100644 index 0000000..9c5186c --- /dev/null +++ a/src/main/java/com/meishu/dto/subject/GetSubjectTreeDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.subject; + +import lombok.Data; + +@Data +public class GetSubjectTreeDTO { + + private Long userId; + + private Long subjectId; + + private String shareStatus; + +} diff --git b/src/main/java/com/meishu/dto/subject/GetSubjectsDTO.java a/src/main/java/com/meishu/dto/subject/GetSubjectsDTO.java new file mode 100644 index 0000000..036cb97 --- /dev/null +++ a/src/main/java/com/meishu/dto/subject/GetSubjectsDTO.java @@ -0,0 +1,17 @@ +package com.meishu.dto.subject; + +import lombok.Data; + +@Data +public class GetSubjectsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String subjectName; + + private String subjectType; + + private Long userId; +} diff --git b/src/main/java/com/meishu/dto/subject/UpdateTreeOrderDTO.java a/src/main/java/com/meishu/dto/subject/UpdateTreeOrderDTO.java new file mode 100644 index 0000000..0da8c10 --- /dev/null +++ a/src/main/java/com/meishu/dto/subject/UpdateTreeOrderDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.subject; + +import lombok.Data; + +import java.util.List; + +@Data +public class UpdateTreeOrderDTO { + + private List ids; + + private Long parentId; + + private String treeName; + +} diff --git b/src/main/java/com/meishu/dto/task/ClassDoneInfoDTO.java a/src/main/java/com/meishu/dto/task/ClassDoneInfoDTO.java new file mode 100644 index 0000000..ea321d1 --- /dev/null +++ a/src/main/java/com/meishu/dto/task/ClassDoneInfoDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.task; + +import lombok.Data; + +@Data +public class ClassDoneInfoDTO { + + private Integer taskId; + + private Integer treeId; + + private String subject; + + private Integer exerciseType; + +} diff --git b/src/main/java/com/meishu/dto/task/ExeRightRatioDTO.java a/src/main/java/com/meishu/dto/task/ExeRightRatioDTO.java new file mode 100644 index 0000000..fbd7ceb --- /dev/null +++ a/src/main/java/com/meishu/dto/task/ExeRightRatioDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.task; + +import lombok.Data; + +@Data +public class ExeRightRatioDTO { + + //private Integer subjectId; + + private Integer taskId; + + private Integer treeId; + + private Integer userId; + + private Integer exerciseType; + +} diff --git b/src/main/java/com/meishu/dto/task/ExesDoneInfoPO.java a/src/main/java/com/meishu/dto/task/ExesDoneInfoPO.java new file mode 100644 index 0000000..fe940f6 --- /dev/null +++ a/src/main/java/com/meishu/dto/task/ExesDoneInfoPO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.task; + +import lombok.Data; + +import java.util.List; + +@Data +public class ExesDoneInfoPO { + + private List exeIds; + + private String subject; + +} diff --git b/src/main/java/com/meishu/dto/task/GetClassStudentsDTO.java a/src/main/java/com/meishu/dto/task/GetClassStudentsDTO.java new file mode 100644 index 0000000..e4d6747 --- /dev/null +++ a/src/main/java/com/meishu/dto/task/GetClassStudentsDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.task; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetClassStudentsDTO { + + private List ids; + +} diff --git b/src/main/java/com/meishu/dto/task/GetClassesRequestVO.java a/src/main/java/com/meishu/dto/task/GetClassesRequestVO.java new file mode 100644 index 0000000..a5a7cfe --- /dev/null +++ a/src/main/java/com/meishu/dto/task/GetClassesRequestVO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-06-22 18:18 + */ +@Data +public class GetClassesRequestVO { + + private Integer userId; + + private String status; + + private String subject; + + private String subjectType; + +} diff --git b/src/main/java/com/meishu/dto/task/GetRecommendExeByTreeIdVO.java a/src/main/java/com/meishu/dto/task/GetRecommendExeByTreeIdVO.java new file mode 100644 index 0000000..886d0b2 --- /dev/null +++ a/src/main/java/com/meishu/dto/task/GetRecommendExeByTreeIdVO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-23 17:50 + */ +@Data +public class GetRecommendExeByTreeIdVO { + + private String treeIds; + + private String school; + +} diff --git b/src/main/java/com/meishu/dto/task/GetRecommendVodByTreeIdVO.java a/src/main/java/com/meishu/dto/task/GetRecommendVodByTreeIdVO.java new file mode 100644 index 0000000..ac0bfe0 --- /dev/null +++ a/src/main/java/com/meishu/dto/task/GetRecommendVodByTreeIdVO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.task; + +import lombok.Data; + +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-23 14:13 + */ +@Data +public class GetRecommendVodByTreeIdVO { + + private String treeIds; + + private String school; + + private List treeIdInteger; + +} diff --git b/src/main/java/com/meishu/dto/task/GetTaskByIdRequestDTO.java a/src/main/java/com/meishu/dto/task/GetTaskByIdRequestDTO.java new file mode 100644 index 0000000..d281d31 --- /dev/null +++ a/src/main/java/com/meishu/dto/task/GetTaskByIdRequestDTO.java @@ -0,0 +1,39 @@ +package com.meishu.dto.task; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author: tuyp + * @create: 2020-07-21 11:45 + */ +@Data +public class GetTaskByIdRequestDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Integer subjectId; + + private Integer classId; + + private String treeId; + + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date startDate; + + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date endDate; + + private Integer teacherId; + + private Integer taskType; + + private Date currentDate; + + private String subjectEn; + +} diff --git b/src/main/java/com/meishu/dto/task/GetUserVodPlayDTO.java a/src/main/java/com/meishu/dto/task/GetUserVodPlayDTO.java new file mode 100644 index 0000000..6f040f8 --- /dev/null +++ a/src/main/java/com/meishu/dto/task/GetUserVodPlayDTO.java @@ -0,0 +1,28 @@ +package com.meishu.dto.task; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author: tuyp + * @create: 2020-07-23 11:50 + */ +@Data +public class GetUserVodPlayDTO { + + private Integer treeId; + + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private Date taskDate; + + private Integer classesId; + + private String subject; + + private Integer vodId; + + private Integer taskId; + +} diff --git b/src/main/java/com/meishu/dto/task/PerStudentExesDTO.java a/src/main/java/com/meishu/dto/task/PerStudentExesDTO.java new file mode 100644 index 0000000..8c312a4 --- /dev/null +++ a/src/main/java/com/meishu/dto/task/PerStudentExesDTO.java @@ -0,0 +1,26 @@ +package com.meishu.dto.task; + +import lombok.Data; + +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-23 15:41 + */ +@Data +public class PerStudentExesDTO { + + private Integer taskId; + + private Integer treeId; + + private Integer subjectId; + + private List userIds; + + private Integer classesId; + + private String subject; + +} diff --git b/src/main/java/com/meishu/dto/task/PerStudentExesRequestVO.java a/src/main/java/com/meishu/dto/task/PerStudentExesRequestVO.java new file mode 100644 index 0000000..ed727d3 --- /dev/null +++ a/src/main/java/com/meishu/dto/task/PerStudentExesRequestVO.java @@ -0,0 +1,26 @@ +package com.meishu.dto.task; + +import lombok.Data; + +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-23 15:41 + */ +@Data +public class PerStudentExesRequestVO { + + private Integer taskId; + + private Integer treeId; + + private Integer subjectId; + + private List userIds; + + private Integer classesId; + + private String subject; + +} diff --git b/src/main/java/com/meishu/dto/task/QueryTaskDetailDTO.java a/src/main/java/com/meishu/dto/task/QueryTaskDetailDTO.java new file mode 100644 index 0000000..b81f30b --- /dev/null +++ a/src/main/java/com/meishu/dto/task/QueryTaskDetailDTO.java @@ -0,0 +1,17 @@ +package com.meishu.dto.task; + +import lombok.Data; + + +/** + * @author: tuyp + * @create: 2020-06-28 10:53 + */ +@Data +public class QueryTaskDetailDTO { + + private Integer id; + + private String subject; + +} diff --git b/src/main/java/com/meishu/dto/task/StudentDoneInfoRequestVO.java a/src/main/java/com/meishu/dto/task/StudentDoneInfoRequestVO.java new file mode 100644 index 0000000..cfdb23d --- /dev/null +++ a/src/main/java/com/meishu/dto/task/StudentDoneInfoRequestVO.java @@ -0,0 +1,22 @@ +package com.meishu.dto.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-23 18:37 + */ +@Data +public class StudentDoneInfoRequestVO { + + private Integer userId; + + private Integer taskId; + + private String treeId; + + //private Integer subjectId; + + //private String subject; + +} diff --git b/src/main/java/com/meishu/dto/test/CommentDTO.java a/src/main/java/com/meishu/dto/test/CommentDTO.java new file mode 100644 index 0000000..9b42292 --- /dev/null +++ a/src/main/java/com/meishu/dto/test/CommentDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.test; + +import com.meishu.model.SubjectStudentAnswerStarDO; +import lombok.Data; + +import java.util.List; + +@Data +public class CommentDTO { + + List subjectStudentAnswerStarDOS; + +} diff --git b/src/main/java/com/meishu/dto/test/GetAllTestDTO.java a/src/main/java/com/meishu/dto/test/GetAllTestDTO.java new file mode 100644 index 0000000..9f34d03 --- /dev/null +++ a/src/main/java/com/meishu/dto/test/GetAllTestDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.test; + +import lombok.Data; + +@Data +public class GetAllTestDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long ruleId; + + private Long campusId; + + private String testName; + +} diff --git b/src/main/java/com/meishu/dto/test/GetOnePublishDTO.java a/src/main/java/com/meishu/dto/test/GetOnePublishDTO.java new file mode 100644 index 0000000..087fc6c --- /dev/null +++ a/src/main/java/com/meishu/dto/test/GetOnePublishDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.test; + +import lombok.Data; + +@Data +public class GetOnePublishDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String commentStatus; + + private String userName; + + private Long id; + +} diff --git b/src/main/java/com/meishu/dto/test/GetPublishHistoryDTO.java a/src/main/java/com/meishu/dto/test/GetPublishHistoryDTO.java new file mode 100644 index 0000000..6ff7009 --- /dev/null +++ a/src/main/java/com/meishu/dto/test/GetPublishHistoryDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.test; + +import lombok.Data; + +@Data +public class GetPublishHistoryDTO { + + private Long ruleId; + + private Long campusId; + + private String publishName; + + private Integer pageSize; + + private Integer pageNum; + +} diff --git b/src/main/java/com/meishu/dto/test/GetTestReportDTO.java a/src/main/java/com/meishu/dto/test/GetTestReportDTO.java new file mode 100644 index 0000000..bf5bb29 --- /dev/null +++ a/src/main/java/com/meishu/dto/test/GetTestReportDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.test; + +import lombok.Data; + +@Data +public class GetTestReportDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String publishName; + + private Long ruleId; + +} diff --git b/src/main/java/com/meishu/dto/test/PublishTestDTO.java a/src/main/java/com/meishu/dto/test/PublishTestDTO.java new file mode 100644 index 0000000..3786a7f --- /dev/null +++ a/src/main/java/com/meishu/dto/test/PublishTestDTO.java @@ -0,0 +1,26 @@ +package com.meishu.dto.test; + +import lombok.Data; + +import java.util.List; + +@Data +public class PublishTestDTO { + + private Long publishId; + + private Long testId; + + private String testTime; + + private String publishName; + + private String outline; + + private String coverPage; + + private List studentIds; + + + +} diff --git b/src/main/java/com/meishu/dto/token/GetAllStudentsDTO.java a/src/main/java/com/meishu/dto/token/GetAllStudentsDTO.java new file mode 100644 index 0000000..ca099bf --- /dev/null +++ a/src/main/java/com/meishu/dto/token/GetAllStudentsDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.token; + +import com.meishu.model.UserRoleDO; +import lombok.Data; + +@Data +public class GetAllStudentsDTO extends UserRoleDO { + + private String uuid; + + private String uuidSecret; + +} diff --git b/src/main/java/com/meishu/dto/token/GetAllTeachersDTO.java a/src/main/java/com/meishu/dto/token/GetAllTeachersDTO.java new file mode 100644 index 0000000..29614e6 --- /dev/null +++ a/src/main/java/com/meishu/dto/token/GetAllTeachersDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.token; + +import com.meishu.model.AdministerDO; +import com.meishu.model.UserRoleDO; +import lombok.Data; + +@Data +public class GetAllTeachersDTO extends AdministerDO { + + private String uuid; + + private String uuidSecret; + + +} diff --git b/src/main/java/com/meishu/dto/userrole/AccountLoginDTO.java a/src/main/java/com/meishu/dto/userrole/AccountLoginDTO.java new file mode 100644 index 0000000..1327125 --- /dev/null +++ a/src/main/java/com/meishu/dto/userrole/AccountLoginDTO.java @@ -0,0 +1,11 @@ +package com.meishu.dto.userrole; + +import lombok.Data; + +@Data +public class AccountLoginDTO { + + private String idCard; + + private String password; +} diff --git b/src/main/java/com/meishu/dto/userrole/AddStudentsDTO.java a/src/main/java/com/meishu/dto/userrole/AddStudentsDTO.java new file mode 100644 index 0000000..b5b0ecd --- /dev/null +++ a/src/main/java/com/meishu/dto/userrole/AddStudentsDTO.java @@ -0,0 +1,22 @@ +package com.meishu.dto.userrole; + +import lombok.Data; + +@Data +public class AddStudentsDTO { + + private String userName; + + private String studyCode; + + private String phone; + + private String idCard; + + private String session; + + private String gender; + + private String email; + +} diff --git b/src/main/java/com/meishu/dto/userrole/QueryStudentsDTO.java a/src/main/java/com/meishu/dto/userrole/QueryStudentsDTO.java new file mode 100644 index 0000000..909b6fc --- /dev/null +++ a/src/main/java/com/meishu/dto/userrole/QueryStudentsDTO.java @@ -0,0 +1,20 @@ +package com.meishu.dto.userrole; + +import lombok.Data; + +@Data +public class QueryStudentsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String userName; + + private String session; + + private String grade; + + private String userStatus; + +} diff --git b/src/main/java/com/meishu/dto/voddict/CheckVodDTO.java a/src/main/java/com/meishu/dto/voddict/CheckVodDTO.java new file mode 100644 index 0000000..646cddf --- /dev/null +++ a/src/main/java/com/meishu/dto/voddict/CheckVodDTO.java @@ -0,0 +1,13 @@ +package com.meishu.dto.voddict; + +import com.meishu.model.VodDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class CheckVodDTO extends VodDictDO { + + private List treeIds; + +} diff --git b/src/main/java/com/meishu/dto/voddict/DeleteOriginVodDTO.java a/src/main/java/com/meishu/dto/voddict/DeleteOriginVodDTO.java new file mode 100644 index 0000000..f77c5e1 --- /dev/null +++ a/src/main/java/com/meishu/dto/voddict/DeleteOriginVodDTO.java @@ -0,0 +1,17 @@ +package com.meishu.dto.voddict; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.util.List; + +@Data +public class DeleteOriginVodDTO { + + @JsonProperty + private String EventType; + + @JsonProperty + private ProcedureStateChangeEvent ProcedureStateChangeEvent; + +} diff --git b/src/main/java/com/meishu/dto/voddict/GetToCheckVodCountsDTO.java a/src/main/java/com/meishu/dto/voddict/GetToCheckVodCountsDTO.java new file mode 100644 index 0000000..709e64d --- /dev/null +++ a/src/main/java/com/meishu/dto/voddict/GetToCheckVodCountsDTO.java @@ -0,0 +1,12 @@ +package com.meishu.dto.voddict; + +import lombok.Data; + +@Data +public class GetToCheckVodCountsDTO { + + private Long subjectId; + +// private String checkStatus; + +} diff --git b/src/main/java/com/meishu/dto/voddict/GetTreeVodsDTO.java a/src/main/java/com/meishu/dto/voddict/GetTreeVodsDTO.java new file mode 100644 index 0000000..6b6263c --- /dev/null +++ a/src/main/java/com/meishu/dto/voddict/GetTreeVodsDTO.java @@ -0,0 +1,28 @@ +package com.meishu.dto.voddict; + +import lombok.Data; + +@Data +public class GetTreeVodsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String vodType; + + private String vodName; + + private Long treeId; + + private Long subjectId; + + private String status; + + private String shareStatus; + + private Long userId; + + private String checkStatus; + +} diff --git b/src/main/java/com/meishu/dto/voddict/MediaProcessResultSet.java a/src/main/java/com/meishu/dto/voddict/MediaProcessResultSet.java new file mode 100644 index 0000000..fb0ec06 --- /dev/null +++ a/src/main/java/com/meishu/dto/voddict/MediaProcessResultSet.java @@ -0,0 +1,12 @@ +package com.meishu.dto.voddict; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +@Data +public class MediaProcessResultSet { + + @JsonProperty + private TranscodeTask TranscodeTask; + +} diff --git b/src/main/java/com/meishu/dto/voddict/Output.java a/src/main/java/com/meishu/dto/voddict/Output.java new file mode 100644 index 0000000..6100af7 --- /dev/null +++ a/src/main/java/com/meishu/dto/voddict/Output.java @@ -0,0 +1,12 @@ +package com.meishu.dto.voddict; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +@Data +public class Output { + + @JsonProperty + private String Url; + +} diff --git b/src/main/java/com/meishu/dto/voddict/ProcedureStateChangeEvent.java a/src/main/java/com/meishu/dto/voddict/ProcedureStateChangeEvent.java new file mode 100644 index 0000000..06112e1 --- /dev/null +++ a/src/main/java/com/meishu/dto/voddict/ProcedureStateChangeEvent.java @@ -0,0 +1,16 @@ +package com.meishu.dto.voddict; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.util.List; + +@Data +public class ProcedureStateChangeEvent { + + @JsonProperty + private String FileId; + + @JsonProperty + private List MediaProcessResultSet; +} diff --git b/src/main/java/com/meishu/dto/voddict/PublicCheckingDTO.java a/src/main/java/com/meishu/dto/voddict/PublicCheckingDTO.java new file mode 100644 index 0000000..f9f72b7 --- /dev/null +++ a/src/main/java/com/meishu/dto/voddict/PublicCheckingDTO.java @@ -0,0 +1,18 @@ +package com.meishu.dto.voddict; + +import lombok.Data; + +@Data +public class PublicCheckingDTO { + + private Long userId; + + private String shareStatus; + + private Integer pageSize; + + private Integer pageNum; + + private Integer checkStatus; + +} diff --git b/src/main/java/com/meishu/dto/voddict/TranscodeTask.java a/src/main/java/com/meishu/dto/voddict/TranscodeTask.java new file mode 100644 index 0000000..46ff3ed --- /dev/null +++ a/src/main/java/com/meishu/dto/voddict/TranscodeTask.java @@ -0,0 +1,12 @@ +package com.meishu.dto.voddict; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +@Data +public class TranscodeTask { + + @JsonProperty + private Output Output; + +} diff --git b/src/main/java/com/meishu/dto/voddict/UploadVodsDTO.java a/src/main/java/com/meishu/dto/voddict/UploadVodsDTO.java new file mode 100644 index 0000000..1b9c21e --- /dev/null +++ a/src/main/java/com/meishu/dto/voddict/UploadVodsDTO.java @@ -0,0 +1,14 @@ +package com.meishu.dto.voddict; + +import com.meishu.model.VodDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class UploadVodsDTO extends VodDictDO { + + private List treeIds; + + +} diff --git b/src/main/java/com/meishu/dto/wechat/AuthenRequestDTO.java a/src/main/java/com/meishu/dto/wechat/AuthenRequestDTO.java new file mode 100644 index 0000000..3ac523e --- /dev/null +++ a/src/main/java/com/meishu/dto/wechat/AuthenRequestDTO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.wechat; + +import lombok.Data; + +@Data +public class AuthenRequestDTO { + + private String code; + + private String phone; + + private String openId; + + +} diff --git b/src/main/java/com/meishu/dto/wechat/InviteDTO.java a/src/main/java/com/meishu/dto/wechat/InviteDTO.java new file mode 100644 index 0000000..02fafda --- /dev/null +++ a/src/main/java/com/meishu/dto/wechat/InviteDTO.java @@ -0,0 +1,10 @@ +package com.meishu.dto.wechat; + +import lombok.Data; + +@Data +public class InviteDTO { + + private String userId; + +} diff --git b/src/main/java/com/meishu/dto/wechat/JsSdkDTO.java a/src/main/java/com/meishu/dto/wechat/JsSdkDTO.java new file mode 100644 index 0000000..5312889 --- /dev/null +++ a/src/main/java/com/meishu/dto/wechat/JsSdkDTO.java @@ -0,0 +1,17 @@ +package com.meishu.dto.wechat; + +import lombok.Data; + +@Data +public class JsSdkDTO { + + private String errcode; + + private String errmsg; + + private String ticket; + + private String expires_in; + + +} diff --git b/src/main/java/com/meishu/dto/wechat/PushMsgVO.java a/src/main/java/com/meishu/dto/wechat/PushMsgVO.java new file mode 100644 index 0000000..eb0732c --- /dev/null +++ a/src/main/java/com/meishu/dto/wechat/PushMsgVO.java @@ -0,0 +1,15 @@ +package com.meishu.dto.wechat; + +import lombok.Data; + +@Data +public class PushMsgVO { + + private Integer errcode; + + private String errmsg; + + private Integer msgId; + + +} diff --git b/src/main/java/com/meishu/dto/wechat/SignDTO.java a/src/main/java/com/meishu/dto/wechat/SignDTO.java new file mode 100644 index 0000000..400c785 --- /dev/null +++ a/src/main/java/com/meishu/dto/wechat/SignDTO.java @@ -0,0 +1,26 @@ +package com.meishu.dto.wechat; + + +import lombok.Data; + +@Data +public class SignDTO { + + private String access_token; + + private String noncestr; + + private String jsapi_ticket; + + private String timestamp; + + private String url; + + private String sign; + + private String code; + + private String appId; + + private String agentId; +} diff --git b/src/main/java/com/meishu/dto/wechat/WechatInviteDTO.java a/src/main/java/com/meishu/dto/wechat/WechatInviteDTO.java new file mode 100644 index 0000000..c89a483 --- /dev/null +++ a/src/main/java/com/meishu/dto/wechat/WechatInviteDTO.java @@ -0,0 +1,16 @@ +package com.meishu.dto.wechat; + +import lombok.Data; + +import java.util.List; + +@Data +public class WechatInviteDTO { + + private List user; + + private List party; + + private List tag; + +} diff --git b/src/main/java/com/meishu/job/UpgradeClassJob.java a/src/main/java/com/meishu/job/UpgradeClassJob.java new file mode 100644 index 0000000..9613934 --- /dev/null +++ a/src/main/java/com/meishu/job/UpgradeClassJob.java @@ -0,0 +1,117 @@ +package com.meishu.job; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.mapper.ClassesDictHistoryMapper; +import com.meishu.mapper.ClassesDictMapper; +import com.meishu.model.ClassesDictDO; +import com.meishu.model.ClassesDictHistoryDO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +/** + * 定时任务 每天凌晨查看班级里是否有需要晋升的 + */ + +@Component +public class UpgradeClassJob { + + @Autowired + private ClassesDictMapper classesDictMapper; + + @Autowired + private ClassesDictHistoryMapper classesDictHistoryMapper; + + @Scheduled(cron = "0 10 0 * * ?") + public void updateGrade(){ + + List classesDictDOS = classesDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassesDictDO::getStatus,"在读")); + + for (ClassesDictDO classesDictDO : classesDictDOS){ + + //获取班级的晋升时间 + Date date = classesDictDO.getUpgradeDate(); + Date current = new Date(); + + if (null!=date && date.getYear() == current.getYear() && date.getMonth() == current.getMonth() && date.getDate() == current.getDate()){ + + //将history表里该班级的记录置为归档 + ClassesDictHistoryDO classesDictHistoryDO = classesDictHistoryMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ClassesDictHistoryDO::getStatus,"在读") + .eq(ClassesDictHistoryDO::getClassDictId,classesDictDO.getId())); + + if (null != classesDictHistoryDO){ + classesDictHistoryDO.setStatus("归档"); + classesDictHistoryMapper.updateById(classesDictHistoryDO); + } + + //将classdict表里的grade修改为新的年级 + if ("高三".equals(classesDictDO.getGrade())){ + classesDictDO.setStatus("归档"); + classesDictMapper.updateById(classesDictDO); + }else { + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + int month = cal.get(Calendar.MONTH)+1;//获取月份 + + if (month>=7){ + date.setYear(year-1899); + date.setMonth(7); + date.setDate(1); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + }else { + date.setYear(year-1900); + date.setMonth(7); + date.setDate(1); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + } + classesDictDO.setUpgradeDate(date); + classesDictDO.setGrade(changeGrade(classesDictDO.getGrade())); + classesDictDO.setClassName(changeClassName(classesDictDO.getClassName())); + classesDictMapper.updateById(classesDictDO); + + //在history中插入新的记录 + ClassesDictHistoryDO classesDictHistoryDO1 = new ClassesDictHistoryDO(); + BeanUtils.copyProperties(classesDictDO,classesDictHistoryDO1); + classesDictHistoryDO1.setClassDictId(classesDictDO.getId()); + classesDictHistoryMapper.insert(classesDictHistoryDO1); + } + } + } + } + + + public String changeGrade(String grade){ + + if("高一".equals(grade)){ + return "高二"; + }else { + return "高三"; + } + } + + public String changeClassName(String className){ + + String newName = ""; + if (className.contains("高一")){ + newName = className.replace("高一","高二"); + }else { + newName = className.replace("高二","高三"); + } + return newName; + } + + +} diff --git b/src/main/java/com/meishu/mapper/AccessTokenMapper.java a/src/main/java/com/meishu/mapper/AccessTokenMapper.java new file mode 100644 index 0000000..f6e7219 --- /dev/null +++ a/src/main/java/com/meishu/mapper/AccessTokenMapper.java @@ -0,0 +1,30 @@ +package com.meishu.mapper; + +import com.meishu.dto.token.GetAllStudentsDTO; +import com.meishu.dto.token.GetAllTeachersDTO; +import com.meishu.model.AccessTokenDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.AdministerDO; +import com.meishu.model.UserRoleDO; +import com.meishu.vo.accesstoken.GetAllStudentsVO; +import com.meishu.vo.accesstoken.GetAllTeachersVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-10 + */ +@Repository +public interface AccessTokenMapper extends BaseMapper { + + List getAllTeachers(GetAllTeachersDTO getAllTeachersDTO); + + List getAllStudents(GetAllStudentsDTO getAllStudentsDTO); + +} diff --git b/src/main/java/com/meishu/mapper/AdministerDepartmentMappingMapper.java a/src/main/java/com/meishu/mapper/AdministerDepartmentMappingMapper.java new file mode 100644 index 0000000..14ae9a1 --- /dev/null +++ a/src/main/java/com/meishu/mapper/AdministerDepartmentMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.AdministerDepartmentMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 老师部门映射表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-07-01 + */ + @Repository +public interface AdministerDepartmentMappingMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/AdministerMapper.java a/src/main/java/com/meishu/mapper/AdministerMapper.java new file mode 100644 index 0000000..ad9efd5 --- /dev/null +++ a/src/main/java/com/meishu/mapper/AdministerMapper.java @@ -0,0 +1,74 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.task.GetClassesRequestVO; +import com.meishu.model.*; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.administer.GetClassesDetailResponseVO; +import com.meishu.vo.administer.GetTeacherSubjectVO; +import com.meishu.vo.administer.GetTeachersVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 中心管理账户表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@Repository +public interface AdministerMapper extends BaseMapper { + + + /** + * 获取某部门成员 + */ + IPage getDepartmentTeachers(IPage iPage, Long departmentId, Long campusId, String teacherName,List userIds); + + /** + * 查看某个老师在几个校区 + */ + List getTeacherCampus(Long id); + + /** + * 通过部门id获取部门人员 + */ + + List getAdministerByDepartmentId(Long departmentId); + + /** + * 通过成员id获取其所在的部门 + */ + List getDepartmentByAdministerId(Long administerId); + + /** + * 通过成员id获取其所有学科 + */ + List getTeacherSubjects(Long administerId); + + /** + * 通过成员id返回角色信息 + */ + List getTeacherRoles(Long administerId); + + /** + * 通过成员id返回其所有班级 + */ + List getTeacherClasses(Long administerId); + + /** + * 查看老师下的班级+科目 + * @param getClassesRequestVO + * @return + */ + List getClasses(GetClassesRequestVO getClassesRequestVO); + + + /** + * 查看老师具体的班级+科目 + */ + List getTeacherSubject(Integer userId); +} diff --git b/src/main/java/com/meishu/mapper/AdministerPermissionMapper.java a/src/main/java/com/meishu/mapper/AdministerPermissionMapper.java new file mode 100644 index 0000000..1fb31e3 --- /dev/null +++ a/src/main/java/com/meishu/mapper/AdministerPermissionMapper.java @@ -0,0 +1,24 @@ +package com.meishu.mapper; + +import com.meishu.model.AdministerPermissionDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.administer.PermissionsVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 系统用户角色表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ + @Repository +public interface AdministerPermissionMapper extends BaseMapper { + + List getPermissions(Long id); + + +} diff --git b/src/main/java/com/meishu/mapper/AdministerSubjectMappingMapper.java a/src/main/java/com/meishu/mapper/AdministerSubjectMappingMapper.java new file mode 100644 index 0000000..b13d159 --- /dev/null +++ a/src/main/java/com/meishu/mapper/AdministerSubjectMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.AdministerSubjectMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 老师科目映射表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-07-01 + */ + @Repository +public interface AdministerSubjectMappingMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/AnsweringQuestionMapper.java a/src/main/java/com/meishu/mapper/AnsweringQuestionMapper.java new file mode 100644 index 0000000..d85970a --- /dev/null +++ a/src/main/java/com/meishu/mapper/AnsweringQuestionMapper.java @@ -0,0 +1,25 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.question.QueryQuestionsDTO; +import com.meishu.model.AnsweringQuestionDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.question.QueryQuestionsVO; +import org.springframework.stereotype.Repository; + +import java.util.Date; + +/** + *

+ * 问题答疑表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +@Repository +public interface AnsweringQuestionMapper extends BaseMapper { + + IPage queryQuestions(IPage page, Integer subjectId, Date startDate,Date endDate,String userName); + +} diff --git b/src/main/java/com/meishu/mapper/ClassSubjectTaskMapper.java a/src/main/java/com/meishu/mapper/ClassSubjectTaskMapper.java new file mode 100644 index 0000000..81d465c --- /dev/null +++ a/src/main/java/com/meishu/mapper/ClassSubjectTaskMapper.java @@ -0,0 +1,31 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.task.GetClassStudentsDTO; +import com.meishu.dto.task.GetTaskByIdRequestDTO; +import com.meishu.model.ClassSubjectTaskDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.UserRoleDO; +import com.meishu.vo.task.GetTaskByIdVO; +import org.springframework.stereotype.Repository; + +import java.util.Date; +import java.util.List; + +/** + *

+ * 学习任务列表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@Repository +public interface ClassSubjectTaskMapper extends BaseMapper { + + + IPage queryAlreadyTasks(IPage iPage, Integer classId, Integer subjectId, Date startDate, Date endDate, Integer taskType); + + List getClassStudents(GetClassStudentsDTO getClassStudentsDTO); + +} diff --git b/src/main/java/com/meishu/mapper/ClassesDictHistoryMapper.java a/src/main/java/com/meishu/mapper/ClassesDictHistoryMapper.java new file mode 100644 index 0000000..678b9c0 --- /dev/null +++ a/src/main/java/com/meishu/mapper/ClassesDictHistoryMapper.java @@ -0,0 +1,22 @@ +package com.meishu.mapper; + +import com.meishu.model.ClassesDictHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 学校班级字典表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +@Repository +public interface ClassesDictHistoryMapper extends BaseMapper { + + List getAllPastSemester(String grade); + +} diff --git b/src/main/java/com/meishu/mapper/ClassesDictMapper.java a/src/main/java/com/meishu/mapper/ClassesDictMapper.java new file mode 100644 index 0000000..9f7e582 --- /dev/null +++ a/src/main/java/com/meishu/mapper/ClassesDictMapper.java @@ -0,0 +1,35 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.model.ClassesDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.UserRoleDO; +import com.meishu.vo.classes.GetClassStudentsVO; +import com.meishu.vo.classes.GetClassesVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 学校班级字典表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +@Repository +public interface ClassesDictMapper extends BaseMapper { + + IPage getClasses(IPage page, String className, String grade, String session, String status); + + List getClassStudents(Integer classId,String userName); + + IPage queryNoClassStudents(IPage iPage,String userName); + + ClassesDictDO getClassesById(@Param("studentId") Long studentId); + + List getGradeClasses(String grade); + +} diff --git b/src/main/java/com/meishu/mapper/ClassesUserMappingMapper.java a/src/main/java/com/meishu/mapper/ClassesUserMappingMapper.java new file mode 100644 index 0000000..6f6e81b --- /dev/null +++ a/src/main/java/com/meishu/mapper/ClassesUserMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.ClassesUserMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 班级--学生--映射表(包括以前的班级) Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ + @Repository +public interface ClassesUserMappingMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/CourseAdministerMappingMapper.java a/src/main/java/com/meishu/mapper/CourseAdministerMappingMapper.java new file mode 100644 index 0000000..7b7e439 --- /dev/null +++ a/src/main/java/com/meishu/mapper/CourseAdministerMappingMapper.java @@ -0,0 +1,28 @@ +package com.meishu.mapper; + +import com.meishu.model.AdministerDO; +import com.meishu.model.CourseAdministerMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 课程老师映射表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-25 + */ + @Repository +public interface CourseAdministerMappingMapper extends BaseMapper { + + + /** + * 通过课程id查询老师 + */ + + List getAdminister(Long courseId); + +} diff --git b/src/main/java/com/meishu/mapper/CourseStudentStatusHistoryMapper.java a/src/main/java/com/meishu/mapper/CourseStudentStatusHistoryMapper.java new file mode 100644 index 0000000..6e8f201 --- /dev/null +++ a/src/main/java/com/meishu/mapper/CourseStudentStatusHistoryMapper.java @@ -0,0 +1,28 @@ +package com.meishu.mapper; + +import com.meishu.model.CourseStudentStatusHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.course.GetStudentHistoryVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-27 + */ +@Repository +public interface CourseStudentStatusHistoryMapper extends BaseMapper { + + /** + * 获取某个课程某个学生的授权记录 + */ + List getStudentHistory(CourseStudentStatusHistoryDO courseStudentStatusHistoryDO); + + + +} diff --git b/src/main/java/com/meishu/mapper/CourseTreeExerciseStudentResultMapper.java a/src/main/java/com/meishu/mapper/CourseTreeExerciseStudentResultMapper.java new file mode 100644 index 0000000..12d99b7 --- /dev/null +++ a/src/main/java/com/meishu/mapper/CourseTreeExerciseStudentResultMapper.java @@ -0,0 +1,40 @@ +package com.meishu.mapper; + +import com.meishu.model.CourseTreeDO; +import com.meishu.model.CourseTreeExerciseStudentResultDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.SubjectTreeDO; +import com.meishu.vo.course.GetExerciseDetailVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 课程--学生做题记录 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-25 + */ +@Repository +public interface CourseTreeExerciseStudentResultMapper extends BaseMapper { + + + /** + * 查看某个学生某个章节的做题记录 + */ + List studentExercise(Long studentId, Long chapterId); + + /** + * 根据多个题目id查询这些题目关联的知识点 + */ + List getTreesByExerciseIds(@Param("longs") List longs); + + /** + * 查询吗,每个题目的做题详情 正确率用时 + */ + List getExerciseDetail(Long studentId, Long chapterId); + +} diff --git b/src/main/java/com/meishu/mapper/CourseTreeVodStudentResultMapper.java a/src/main/java/com/meishu/mapper/CourseTreeVodStudentResultMapper.java new file mode 100644 index 0000000..fbeda54 --- /dev/null +++ a/src/main/java/com/meishu/mapper/CourseTreeVodStudentResultMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.CourseTreeVodStudentResultDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 学生视频完成情况 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-20 + */ + @Repository +public interface CourseTreeVodStudentResultMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/CourseVodTressStudentResultMapper.java a/src/main/java/com/meishu/mapper/CourseVodTressStudentResultMapper.java new file mode 100644 index 0000000..8a1645f --- /dev/null +++ a/src/main/java/com/meishu/mapper/CourseVodTressStudentResultMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.CourseTreeVodStudentResultDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 学生视频完成情况 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ + @Repository +public interface CourseVodTressStudentResultMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/DepartmentDictMapper.java a/src/main/java/com/meishu/mapper/DepartmentDictMapper.java new file mode 100644 index 0000000..b1e249a --- /dev/null +++ a/src/main/java/com/meishu/mapper/DepartmentDictMapper.java @@ -0,0 +1,21 @@ +package com.meishu.mapper; + +import com.meishu.model.AdministerDO; +import com.meishu.model.DepartmentDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 部门字典表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ + @Repository +public interface DepartmentDictMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/ExerciseCourseTreeMappingMapper.java a/src/main/java/com/meishu/mapper/ExerciseCourseTreeMappingMapper.java new file mode 100644 index 0000000..e4c9eed --- /dev/null +++ a/src/main/java/com/meishu/mapper/ExerciseCourseTreeMappingMapper.java @@ -0,0 +1,46 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.course.GetExercisesByTreeDTO; +import com.meishu.dto.exercise.QueryCourseTreeExerciseDTO; +import com.meishu.dto.student.GetStudyProgressDTO; +import com.meishu.model.CourseTreeDO; +import com.meishu.model.ExerciseCourseTreeMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.ExerciseDictDO; +import com.meishu.service.ExerciseCourseTreeMappingService; +import com.meishu.vo.exercise.QueryCourseTreeExerciseVO; +import com.meishu.vo.student.QueryChapterTestVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 课程知识树--题目字典表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-24 + */ + @Repository +public interface ExerciseCourseTreeMappingMapper extends BaseMapper { + + IPage queryCourseTreeExercise(IPage iPage,Long courseId,Long courseTreeId,String title,Integer difficulty,String exerciseType); + + /** + * 根据映射id去课程知识树id + */ + CourseTreeDO getParentTreeId(Long id); + + /** + * 通过知识点查询该课程下的所有题目 + */ + List getExercisesByTree(GetExercisesByTreeDTO getExercisesByTreeDTO); + + /** + * 查看某个同学 某个章节的做题记录 + */ + List queryChapterTest(Long studentId,Long chapterId); +} diff --git b/src/main/java/com/meishu/mapper/ExerciseDictMapper.java a/src/main/java/com/meishu/mapper/ExerciseDictMapper.java new file mode 100644 index 0000000..42c2ffa --- /dev/null +++ a/src/main/java/com/meishu/mapper/ExerciseDictMapper.java @@ -0,0 +1,35 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.exercise.GetExerciseRequestDTO; +import com.meishu.model.ExerciseDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.SubjectTreeDO; +import com.meishu.vo.exercise.GetExerciseDetailResponseVO; +import com.meishu.vo.exercise.GetTreeExercisesVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 习题库 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Repository +public interface ExerciseDictMapper extends BaseMapper { + + IPage getTreeExercises(IPage iPage,Long userId,String subjectEn, Long treeId, String exerciseType, Integer difficulty, String title,String shareStatus,String checkStatus,List strings); + + List getTrees(Long id); + + /** + * 通过知识点和学校查看关联习题+用户收藏状态 + * @param getExerciseRequestVO + * @return + */ + List getRelativeExercises(GetExerciseRequestDTO getExerciseRequestVO); +} diff --git b/src/main/java/com/meishu/mapper/ExerciseDoneHistoryMapper.java a/src/main/java/com/meishu/mapper/ExerciseDoneHistoryMapper.java new file mode 100644 index 0000000..5a5dbe1 --- /dev/null +++ a/src/main/java/com/meishu/mapper/ExerciseDoneHistoryMapper.java @@ -0,0 +1,61 @@ +package com.meishu.mapper; + +import com.meishu.dto.task.ClassDoneInfoDTO; +import com.meishu.dto.task.ExesDoneInfoPO; +import com.meishu.dto.task.PerStudentExesDTO; +import com.meishu.dto.task.PerStudentExesRequestVO; +import com.meishu.model.ExerciseDoneHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.task.ClassDoneInfoVO; +import com.meishu.vo.task.GetClassExeDoneInfoRequestVO; +import com.meishu.vo.task.GetClassExeDoneInfoResponseVO; +import com.meishu.vo.task.PerStuExeDoneResponseVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 学生做题记录表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ + @Repository +public interface ExerciseDoneHistoryMapper extends BaseMapper { + + /** + * 获取班级某个关联习题做题情况 + * @return + */ + List perStudentRelateExes(PerStudentExesDTO perStudentExesRequestVO); + + /** + * 获取关联/拓展题组做题情况 + */ + List classDoneInfo(ClassDoneInfoDTO classDoneInfoPO); + + /** + * 获取某题目组做题情况 + */ + List exesDoneInfo(ExesDoneInfoPO exesDoneInfoPO); + + /** + * 个人关联习题完成度明细 + * @param getClassExeDoneInfoVO + * @return + */ + List getRelateExeDoneInfo(GetClassExeDoneInfoRequestVO getClassExeDoneInfoVO); + + /** + * 个人拓展习题完成度明细 + */ + List getExpandingExeDoneInfo(GetClassExeDoneInfoRequestVO getClassExeDoneInfoRequestVO); + + + /** + * 获取班级某个拓展习题组做题情况 + */ + List perStudentExpandingExes(PerStudentExesRequestVO perStudentExesRequestVO); +} diff --git b/src/main/java/com/meishu/mapper/ExerciseExpandMappingMapper.java a/src/main/java/com/meishu/mapper/ExerciseExpandMappingMapper.java new file mode 100644 index 0000000..0638cd6 --- /dev/null +++ a/src/main/java/com/meishu/mapper/ExerciseExpandMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.ExerciseExpandMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 学生--拓展习题映射表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ + @Repository +public interface ExerciseExpandMappingMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/ExerciseRelatedMappingMapper.java a/src/main/java/com/meishu/mapper/ExerciseRelatedMappingMapper.java new file mode 100644 index 0000000..9713ce0 --- /dev/null +++ a/src/main/java/com/meishu/mapper/ExerciseRelatedMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.ExerciseRelatedMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 学生--拓展习题映射表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ + @Repository +public interface ExerciseRelatedMappingMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/ExerciseTreeMappingMapper.java a/src/main/java/com/meishu/mapper/ExerciseTreeMappingMapper.java new file mode 100644 index 0000000..7e24470 --- /dev/null +++ a/src/main/java/com/meishu/mapper/ExerciseTreeMappingMapper.java @@ -0,0 +1,33 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.meishu.model.ExerciseDictDO; +import com.meishu.model.ExerciseTreeMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 题目知识树映射表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Repository +public interface ExerciseTreeMappingMapper extends BaseMapper { + + /** + * 查看挂在知识点上的视频数 + */ + Integer getTreeExerciseCount(Long userId, Long treeId, String shareStatus, String subject,String checkStatus); + + + /** + * 获取某学校某知识点的关联习题 + * @return 审核通过的视频 + */ + List getRelatedExercise(Integer treeId); +} diff --git b/src/main/java/com/meishu/mapper/ExerciseUserInfoMapper.java a/src/main/java/com/meishu/mapper/ExerciseUserInfoMapper.java new file mode 100644 index 0000000..235ab2c --- /dev/null +++ a/src/main/java/com/meishu/mapper/ExerciseUserInfoMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.ExerciseUserInfoDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 题目收藏信息表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-17 + */ + @Repository +public interface ExerciseUserInfoMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/KnowledgeSubjectDictMapper.java a/src/main/java/com/meishu/mapper/KnowledgeSubjectDictMapper.java new file mode 100644 index 0000000..b51dbfc --- /dev/null +++ a/src/main/java/com/meishu/mapper/KnowledgeSubjectDictMapper.java @@ -0,0 +1,33 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.model.AdministerDO; +import com.meishu.model.KnowledgeSubjectDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 学科字典表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Repository +public interface KnowledgeSubjectDictMapper extends BaseMapper { + + + /** + * 查看某个科目下的老师 + */ + List getSubjectAdminister(Long subjectId,String userName); + + /** + * 查看某个老师下的所有科目 分页 模糊搜索 subjectType subjectName + */ + IPage getAdministerSubjects(IPage page, Long userId, String subjectType, String subjectName); + +} diff --git b/src/main/java/com/meishu/mapper/LaboratoryAttendanceMappingMapper.java a/src/main/java/com/meishu/mapper/LaboratoryAttendanceMappingMapper.java new file mode 100644 index 0000000..142f3bb --- /dev/null +++ a/src/main/java/com/meishu/mapper/LaboratoryAttendanceMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.LaboratoryAttendanceMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 实验室场次预约考勤记录 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-15 + */ + @Repository +public interface LaboratoryAttendanceMappingMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/LaboratoryDictMapper.java a/src/main/java/com/meishu/mapper/LaboratoryDictMapper.java new file mode 100644 index 0000000..5eb791b --- /dev/null +++ a/src/main/java/com/meishu/mapper/LaboratoryDictMapper.java @@ -0,0 +1,25 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.model.LaboratoryDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.laboratorySession.LaboratoryDictPageVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +/** + *

+ * 实验室 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ + @Repository +public interface LaboratoryDictMapper extends BaseMapper { + + IPage getLaboratoryPage(Page page, String laboratoryName, String laboratoryType); + + LaboratoryDictDO getLaboratoryDicOne(String laboratoryType, @Param("startDate") String startDate); +} diff --git b/src/main/java/com/meishu/mapper/LaboratoryDictMappingMapper.java a/src/main/java/com/meishu/mapper/LaboratoryDictMappingMapper.java new file mode 100644 index 0000000..5ea4961 --- /dev/null +++ a/src/main/java/com/meishu/mapper/LaboratoryDictMappingMapper.java @@ -0,0 +1,21 @@ +package com.meishu.mapper; + +import com.meishu.model.LaboratoryDictMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 实验室场次关联表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-08-30 + */ + @Repository +public interface LaboratoryDictMappingMapper extends BaseMapper { + + List getList(Long laboratoryDictId); +} diff --git b/src/main/java/com/meishu/mapper/LaboratorySessionMappingMapper.java a/src/main/java/com/meishu/mapper/LaboratorySessionMappingMapper.java new file mode 100644 index 0000000..b0d2ed4 --- /dev/null +++ a/src/main/java/com/meishu/mapper/LaboratorySessionMappingMapper.java @@ -0,0 +1,29 @@ +package com.meishu.mapper; + +import com.meishu.model.LaboratorySessionMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.laboratorySession.LaboratorySessionMappingVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 实验室场次预约安排表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ + @Repository +public interface LaboratorySessionMappingMapper extends BaseMapper { + + List getLaboratorySessionList(String startDate); + + LaboratorySessionMappingVO getOneById(Long id); + + List getLaboratorySessionDate(@Param("laboratoryType") String laboratoryType); + + List getList(@Param("studentId") Long studentId, String startDate, Long sessionsDictId); +} diff --git b/src/main/java/com/meishu/mapper/LaboratoryUserMappingMapper.java a/src/main/java/com/meishu/mapper/LaboratoryUserMappingMapper.java new file mode 100644 index 0000000..56f1a86 --- /dev/null +++ a/src/main/java/com/meishu/mapper/LaboratoryUserMappingMapper.java @@ -0,0 +1,29 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.model.LaboratoryUserMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.laboratoryUser.LaboratoryUserPageVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 实验室场次预约报名记录 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ + @Repository +public interface LaboratoryUserMappingMapper extends BaseMapper { + + List getLaboratoryUserPage(Long laboratorySessionId, @Param("startDate") String startDate); + + List getLaboratoryUserList(Long laboratorySessionId, @Param("startDate") String startDate); + + LaboratoryUserMappingDO getLaboratoryUserMapping(Long userRoleId, String startDate, Long sessionsDictId); +} diff --git b/src/main/java/com/meishu/mapper/PermissionsDictMapper.java a/src/main/java/com/meishu/mapper/PermissionsDictMapper.java new file mode 100644 index 0000000..b555720 --- /dev/null +++ a/src/main/java/com/meishu/mapper/PermissionsDictMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.PermissionsDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 权限表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ + @Repository +public interface PermissionsDictMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/RoleAdministerMappingMapper.java a/src/main/java/com/meishu/mapper/RoleAdministerMappingMapper.java new file mode 100644 index 0000000..03488ea --- /dev/null +++ a/src/main/java/com/meishu/mapper/RoleAdministerMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.RoleAdministerMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ + @Repository +public interface RoleAdministerMappingMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/RoleDictMapper.java a/src/main/java/com/meishu/mapper/RoleDictMapper.java new file mode 100644 index 0000000..a914a2b --- /dev/null +++ a/src/main/java/com/meishu/mapper/RoleDictMapper.java @@ -0,0 +1,26 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.role.GetRoleTeachersDTO; +import com.meishu.model.AdministerDO; +import com.meishu.model.RoleDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.role.GetRoleTeachersVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 角色表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ + @Repository +public interface RoleDictMapper extends BaseMapper { + + IPage getRoleTeachers(IPage page,Long roleId,String userName); + +} diff --git b/src/main/java/com/meishu/mapper/RolePermissionMappingMapper.java a/src/main/java/com/meishu/mapper/RolePermissionMappingMapper.java new file mode 100644 index 0000000..c51510d --- /dev/null +++ a/src/main/java/com/meishu/mapper/RolePermissionMappingMapper.java @@ -0,0 +1,26 @@ +package com.meishu.mapper; + +import com.meishu.model.PermissionsDictDO; +import com.meishu.model.RolePermissionMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 系统用户角色表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ + @Repository +public interface RolePermissionMappingMapper extends BaseMapper { + + /** + * 获取某个角色下的全部权限 + */ + List getRolePermission(Long roleId); + +} diff --git b/src/main/java/com/meishu/mapper/SessionsDictMapper.java a/src/main/java/com/meishu/mapper/SessionsDictMapper.java new file mode 100644 index 0000000..6b634d7 --- /dev/null +++ a/src/main/java/com/meishu/mapper/SessionsDictMapper.java @@ -0,0 +1,24 @@ +package com.meishu.mapper; + +import com.meishu.model.SessionsDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 场次字典表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ + @Repository +public interface SessionsDictMapper extends BaseMapper { + + List getListById(@Param("laboratoryDictId") Long laboratoryDictId); + + List getListSessionDictById(@Param("laboratoryDictId") Long laboratoryDictId, String startDate); +} diff --git b/src/main/java/com/meishu/mapper/SignInRecordMapper.java a/src/main/java/com/meishu/mapper/SignInRecordMapper.java new file mode 100644 index 0000000..a61c5fa --- /dev/null +++ a/src/main/java/com/meishu/mapper/SignInRecordMapper.java @@ -0,0 +1,25 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.model.SignInRecordDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.sign.ClassSignInVO; +import org.springframework.stereotype.Repository; + +import javax.xml.crypto.Data; +import java.util.Date; + +/** + *

+ * 学生签到表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ + @Repository +public interface SignInRecordMapper extends BaseMapper { + + IPage classSignIn(IPage page, Integer classId, Date startDate, Date endDate,String userName); + +} diff --git b/src/main/java/com/meishu/mapper/SmsCodeMapper.java a/src/main/java/com/meishu/mapper/SmsCodeMapper.java new file mode 100644 index 0000000..cb0baed --- /dev/null +++ a/src/main/java/com/meishu/mapper/SmsCodeMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.SmsCodeDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 短信验证码 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ + @Repository +public interface SmsCodeMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/StudentMapper.java a/src/main/java/com/meishu/mapper/StudentMapper.java new file mode 100644 index 0000000..c1bd826 --- /dev/null +++ a/src/main/java/com/meishu/mapper/StudentMapper.java @@ -0,0 +1,42 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.StudentDO; +import com.meishu.vo.student.ClassVO; +import com.meishu.vo.student.SubjectReportVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 白名单 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@Repository +public interface StudentMapper extends BaseMapper { + + /** + * 小程序 --- 学习 我的课程/拓展课程 + */ + List getStudentClass(Long id); + + /** + * 通过父母手机号获取学生信息 + */ + StudentDO getStudentInfo(String telephone); + + /** + * 通过学生id查询该学生学过的科目、课程 + */ + List getSubjectReport(Long studentId); + + /** + * 将所有学生的状态置为0 + */ + void changeStudentStatus(); + +} diff --git b/src/main/java/com/meishu/mapper/SubjectDictMapper.java a/src/main/java/com/meishu/mapper/SubjectDictMapper.java new file mode 100644 index 0000000..34772e8 --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectDictMapper.java @@ -0,0 +1,23 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 学校科目字典表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ + @Repository +public interface SubjectDictMapper extends BaseMapper { + + + List getClassSubjectName(String grade,String classes,String session); + +} diff --git b/src/main/java/com/meishu/mapper/SubjectDimensionDictMapper.java a/src/main/java/com/meishu/mapper/SubjectDimensionDictMapper.java new file mode 100644 index 0000000..3913ea3 --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectDimensionDictMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectDimensionDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 测评表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ + @Repository +public interface SubjectDimensionDictMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/SubjectDimensionStarDictMapper.java a/src/main/java/com/meishu/mapper/SubjectDimensionStarDictMapper.java new file mode 100644 index 0000000..2f8e2c3 --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectDimensionStarDictMapper.java @@ -0,0 +1,28 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectDimensionStarDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 维度星级字典表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +@Repository +public interface SubjectDimensionStarDictMapper extends BaseMapper { + + /** + * 通过维度星级 + * @param dimensionId + * @param star + * @return + */ + List getStar(Long dimensionId, Long star); + +} diff --git b/src/main/java/com/meishu/mapper/SubjectRuleMapper.java a/src/main/java/com/meishu/mapper/SubjectRuleMapper.java new file mode 100644 index 0000000..609b1a5 --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectRuleMapper.java @@ -0,0 +1,26 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.model.SubjectRuleDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.rule.GetAllRulesVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 规则字典表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-08 + */ + @Repository +public interface SubjectRuleMapper extends BaseMapper { + + IPage getAllRules(IPage iPage); + + List getRules(); + +} diff --git b/src/main/java/com/meishu/mapper/SubjectSemesterMapper.java a/src/main/java/com/meishu/mapper/SubjectSemesterMapper.java new file mode 100644 index 0000000..525d90f --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectSemesterMapper.java @@ -0,0 +1,34 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.semester.GetStudentDetailDTO; +import com.meishu.dto.semester.GetStudentRecordDTO; +import com.meishu.model.SubjectSemesterDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.semester.GetSemesterScoreVO; +import com.meishu.vo.semester.GetStudentDetailVO; +import com.meishu.vo.semester.GetStudentRecordVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +@Repository +public interface SubjectSemesterMapper extends BaseMapper { + + IPage getSemesterScore(IPage page, String semester, String grade,String classes,String session, String subject, String userName); + + List exportScore(String semester,String grade,String classes,String session, String subject, String userName); + + IPage getStudentDetail(IPage page, Integer id, Integer userId); + + List getStudentRecord(GetStudentRecordDTO getStudentRecordDTO); + +} diff --git b/src/main/java/com/meishu/mapper/SubjectStarTreeMappingMapper.java a/src/main/java/com/meishu/mapper/SubjectStarTreeMappingMapper.java new file mode 100644 index 0000000..427b2ff --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectStarTreeMappingMapper.java @@ -0,0 +1,27 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectStarTreeMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.SubjectTreeDO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 测评-知识点关联表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +@Repository +public interface SubjectStarTreeMappingMapper extends BaseMapper { + + /** + * 通过星级获取知识点数组 + */ + List getSubjectTrees(Long id); + + +} diff --git b/src/main/java/com/meishu/mapper/SubjectStudentAnswerStarMapper.java a/src/main/java/com/meishu/mapper/SubjectStudentAnswerStarMapper.java new file mode 100644 index 0000000..fcab92a --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectStudentAnswerStarMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectStudentAnswerStarDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 学生答卷星级表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ + @Repository +public interface SubjectStudentAnswerStarMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/SubjectTestDictMapper.java a/src/main/java/com/meishu/mapper/SubjectTestDictMapper.java new file mode 100644 index 0000000..38166cb --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectTestDictMapper.java @@ -0,0 +1,28 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.test.GetAllTestDTO; +import com.meishu.model.SubjectTestDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.test.GetAllTestVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 测评表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-20 + */ +@Repository +public interface SubjectTestDictMapper extends BaseMapper { + + IPage getAllTest(IPage page,Long ruleId,String testName); + + List getTest(Long ruleId, String testName); + + +} diff --git b/src/main/java/com/meishu/mapper/SubjectTestGradeExampleMappingMapper.java a/src/main/java/com/meishu/mapper/SubjectTestGradeExampleMappingMapper.java new file mode 100644 index 0000000..8468d72 --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectTestGradeExampleMappingMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectTestGradeExampleMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 样卷映射表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ + @Repository +public interface SubjectTestGradeExampleMappingMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/SubjectTestGradeStarMappingMapper.java a/src/main/java/com/meishu/mapper/SubjectTestGradeStarMappingMapper.java new file mode 100644 index 0000000..ec83eb2 --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectTestGradeStarMappingMapper.java @@ -0,0 +1,34 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectRuleDO; +import com.meishu.model.SubjectTestGradeStarMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.SubjectTestPublishGradeDO; +import com.meishu.vo.grade.DimensionStarVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 档次星级映射表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +@Repository +public interface SubjectTestGradeStarMappingMapper extends BaseMapper { + + + /** + * 星级 + */ + List getGradeStar(Long gradeId); + + /** + * 通过发布id找规则id + */ + SubjectRuleDO getRuleIdByPublishId(Long id); + +} diff --git b/src/main/java/com/meishu/mapper/SubjectTestPublishGradeMapper.java a/src/main/java/com/meishu/mapper/SubjectTestPublishGradeMapper.java new file mode 100644 index 0000000..7296642 --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectTestPublishGradeMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectTestPublishGradeDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 档次表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ + @Repository +public interface SubjectTestPublishGradeMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/SubjectTestPublishHistoryMapper.java a/src/main/java/com/meishu/mapper/SubjectTestPublishHistoryMapper.java new file mode 100644 index 0000000..53019a6 --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectTestPublishHistoryMapper.java @@ -0,0 +1,75 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.test.GetPublishHistoryDTO; +import com.meishu.model.StudentDO; +import com.meishu.model.SubjectStudentAnswerStarDO; +import com.meishu.model.SubjectTestPublishHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.model.SubjectTestStudentAnswerDO; +import com.meishu.vo.rule.GetOneExaminationDetailVO; +import com.meishu.vo.rule.GetStudentRulesVO; +import com.meishu.vo.rule.StudentStarVO; +import com.meishu.vo.test.CommentVO; +import com.meishu.vo.test.GetOnePublishVO; +import com.meishu.vo.test.GetPublishHistoryVO; +import com.meishu.vo.test.GetTestReportVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 测评发布记录表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-08 + */ +@Repository +public interface SubjectTestPublishHistoryMapper extends BaseMapper { + + /** + * 获取学生的月考列表 + * + * @param + * @return + */ + List getStudentExamination(Long id,Long subjectId); + + /** + * 获取学生某个月考的卷面 + * + * @param subjectTestStudentAnswerDO + * @return + */ + GetOneExaminationDetailVO getOneExaminationDetail(SubjectTestStudentAnswerDO subjectTestStudentAnswerDO); + + + /** + * 获取某个学生的星级评测 + */ + List studentStar(SubjectTestStudentAnswerDO subjectTestStudentAnswerDO); + + /** + * 获取发布历史 + */ + IPage getPublishHistory(IPage page, Long ruleId, String publishName); + + /** + * 测评报告列表 + */ + IPage getTestReport(IPage iPage, Long ruleId, String publishName); + + /** + * 某个测评报告的详情 + */ + IPage getOnePublish(IPage iPage, Long id, String userName,String commentStatus); + + /** + * 查看评析里的维度名称,老师名字 + */ + List getCommentDetail(GetOnePublishVO getOnePublishVO); + + +} diff --git b/src/main/java/com/meishu/mapper/SubjectTestStudentAnswerMapper.java a/src/main/java/com/meishu/mapper/SubjectTestStudentAnswerMapper.java new file mode 100644 index 0000000..36bbda0 --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectTestStudentAnswerMapper.java @@ -0,0 +1,24 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectTestStudentAnswerDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.student.StudentVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 学生月考答卷 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +@Repository +public interface SubjectTestStudentAnswerMapper extends BaseMapper { + + + List getPublishStudents(Long publishId); + +} diff --git b/src/main/java/com/meishu/mapper/SubjectTreeMapper.java a/src/main/java/com/meishu/mapper/SubjectTreeMapper.java new file mode 100644 index 0000000..7d39e13 --- /dev/null +++ a/src/main/java/com/meishu/mapper/SubjectTreeMapper.java @@ -0,0 +1,23 @@ +package com.meishu.mapper; + +import com.meishu.model.CourseDictDO; +import com.meishu.model.SubjectTreeDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Repository +public interface SubjectTreeMapper extends BaseMapper { + + void updateSubjectTree(SubjectTreeDO subjectTreeDO); + +} diff --git b/src/main/java/com/meishu/mapper/TaskCompletionStatusMapper.java a/src/main/java/com/meishu/mapper/TaskCompletionStatusMapper.java new file mode 100644 index 0000000..17b7ed1 --- /dev/null +++ a/src/main/java/com/meishu/mapper/TaskCompletionStatusMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.TaskCompletionStatusDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 作业任务完成状态 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ + @Repository +public interface TaskCompletionStatusMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/TaskContentDoneInfoMapper.java a/src/main/java/com/meishu/mapper/TaskContentDoneInfoMapper.java new file mode 100644 index 0000000..0540a52 --- /dev/null +++ a/src/main/java/com/meishu/mapper/TaskContentDoneInfoMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.TaskContentDoneInfoDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-30 + */ + @Repository +public interface TaskContentDoneInfoMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/TaskContentMapper.java a/src/main/java/com/meishu/mapper/TaskContentMapper.java new file mode 100644 index 0000000..7b4df2f --- /dev/null +++ a/src/main/java/com/meishu/mapper/TaskContentMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.TaskContentDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 作业内容表(取题目,视频,书面作业) Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ + @Repository +public interface TaskContentMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/TaskDoneHistoryMapper.java a/src/main/java/com/meishu/mapper/TaskDoneHistoryMapper.java new file mode 100644 index 0000000..978a246 --- /dev/null +++ a/src/main/java/com/meishu/mapper/TaskDoneHistoryMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.TaskDoneHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ + @Repository +public interface TaskDoneHistoryMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/UserRoleCopy1Mapper.java a/src/main/java/com/meishu/mapper/UserRoleCopy1Mapper.java new file mode 100644 index 0000000..c438468 --- /dev/null +++ a/src/main/java/com/meishu/mapper/UserRoleCopy1Mapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.UserRoleCopy1DO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 学生表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-23 + */ + @Repository +public interface UserRoleCopy1Mapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/UserRoleMapper.java a/src/main/java/com/meishu/mapper/UserRoleMapper.java new file mode 100644 index 0000000..e66349f --- /dev/null +++ a/src/main/java/com/meishu/mapper/UserRoleMapper.java @@ -0,0 +1,38 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.userrole.QueryStudentsDTO; +import com.meishu.model.ClassesDictDO; +import com.meishu.model.UserRoleDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.userrole.QueryStudentsVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 学生表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-08-16 + */ +@Repository +public interface UserRoleMapper extends BaseMapper { + + /** + * 分页查询学生 + */ + IPage queryStudents(IPage iPage, String userName, String grade, String session, String userStatus); + + /** + * 不分页 + */ + List exportStudents(String userName, String grade, String session, String userStatus); + + /** + * 通过班级id查找这个班级里所有人的openId + */ + List findOpenIdByClassId(Integer id); +} diff --git b/src/main/java/com/meishu/mapper/UserSubjectMappingMapper.java a/src/main/java/com/meishu/mapper/UserSubjectMappingMapper.java new file mode 100644 index 0000000..412ccca --- /dev/null +++ a/src/main/java/com/meishu/mapper/UserSubjectMappingMapper.java @@ -0,0 +1,27 @@ +package com.meishu.mapper; + +import com.meishu.model.AdministerDO; +import com.meishu.model.UserSubjectMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 老师-科目映射表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ + @Repository +public interface UserSubjectMappingMapper extends BaseMapper { + + /** + * 查询某个科目下的授课老师 + */ + List querySubjectTeachers(Integer subjectId); + + +} diff --git b/src/main/java/com/meishu/mapper/UserSubjectPermissionDictMapper.java a/src/main/java/com/meishu/mapper/UserSubjectPermissionDictMapper.java new file mode 100644 index 0000000..cd2906f --- /dev/null +++ a/src/main/java/com/meishu/mapper/UserSubjectPermissionDictMapper.java @@ -0,0 +1,23 @@ +package com.meishu.mapper; + +import com.meishu.model.SubjectDictDO; +import com.meishu.model.UserSubjectPermissionDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 平时成绩---老师班级权限 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-08-18 + */ + @Repository +public interface UserSubjectPermissionDictMapper extends BaseMapper { + + List getSubjects(Integer id); + +} diff --git b/src/main/java/com/meishu/mapper/UuidHistoryMapper.java a/src/main/java/com/meishu/mapper/UuidHistoryMapper.java new file mode 100644 index 0000000..0b92547 --- /dev/null +++ a/src/main/java/com/meishu/mapper/UuidHistoryMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.UuidHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-29 + */ + @Repository +public interface UuidHistoryMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/mapper/VodDictMapper.java a/src/main/java/com/meishu/mapper/VodDictMapper.java new file mode 100644 index 0000000..8190b97 --- /dev/null +++ a/src/main/java/com/meishu/mapper/VodDictMapper.java @@ -0,0 +1,53 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.student.SearchVodsDTO; +import com.meishu.dto.task.GetRecommendVodByTreeIdVO; +import com.meishu.model.SubjectTreeDO; +import com.meishu.model.VodDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.student.SearchVodsVO; +import com.meishu.vo.voddict.GetTreeVodsVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 视频字典表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Repository +public interface VodDictMapper extends BaseMapper { + + IPage getTreeVods(IPage iPage, Long treeId,String subjectEn, String vodName, String vodType,String shareStatus,Long userId,List longs,String checkStatus); + + /** + * 查找科目下某个视频的知识点 + * @param id + * @return + */ + List getTrees(Long id); + + /** + * 小程序搜索视频 + */ + List searchVods(SearchVodsDTO searchVodsDTO); + + /** + * 课程查找视频锁关联的知识点 + */ + List getVodTrees(Long vodId); + + /** + * 修改视频的审核状态 + */ + void updateStatus(Long id,String status); + + List getRecommendVodByTreeId(GetRecommendVodByTreeIdVO getRecommendVodByTreeIdVO); + + +} diff --git b/src/main/java/com/meishu/mapper/VodPlayHistoryMapper.java a/src/main/java/com/meishu/mapper/VodPlayHistoryMapper.java new file mode 100644 index 0000000..16f4f9e --- /dev/null +++ a/src/main/java/com/meishu/mapper/VodPlayHistoryMapper.java @@ -0,0 +1,57 @@ +package com.meishu.mapper; + +import com.meishu.dto.task.GetUserVodPlayDTO; +import com.meishu.model.VodDictDO; +import com.meishu.model.VodPlayHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.PerStudentComplicationVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 视频播放历史记录表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ + @Repository +public interface VodPlayHistoryMapper extends BaseMapper { + + /** + * 获取某个学生某个视频看到的最大位点 + * @param studentId + * @param vodId + * @return + */ + int getMaxPlayRecord(Long studentId,Long vodId); + + + /** + * 获取学生完成某课程所有视频中的多少个视频 + * @param studentId + * @param vodIds + * @return + */ + List getStudyVod(@Param("studentId") Long studentId,@Param("vodIds") List vodIds); + + /** + * 获取学生某个课程学习的总时长 + */ + Integer totalLength(Long studentId,List vodIds); + + /** + * 获取学生最近一次看视频的时间 + */ + String getMaxPlayTime(Long studentId,Long vodId); + + /** + * 查看视频的播放量 + */ + Integer queryPlayCounts(Long id); + + List getCurrentUserVodPlayVO(GetUserVodPlayDTO getUserVodPlayRequestVO); +} diff --git b/src/main/java/com/meishu/mapper/VodSubjectTreeMappingMapper.java a/src/main/java/com/meishu/mapper/VodSubjectTreeMappingMapper.java new file mode 100644 index 0000000..ca5cc2c --- /dev/null +++ a/src/main/java/com/meishu/mapper/VodSubjectTreeMappingMapper.java @@ -0,0 +1,33 @@ +package com.meishu.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.model.VodSubjectTreeMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.meishu.vo.subject.GetAllNoAuthenVodsVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 视频知识点映射表 Mapper 接口 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Repository +public interface VodSubjectTreeMappingMapper extends BaseMapper { + + + /** + * 获取已审核/未审核的视频列表 + */ + IPage getAllNoAuthenVods(IPage page, Long treeId, String status, String vodType); + + /** + * 查看挂在知识点上的视频数 + */ + Integer getTreeVodCount(Long userId,Long treeId,String shareStatus,String subject,String checkStatus); + +} diff --git b/src/main/java/com/meishu/mapper/WrittenHomeworkMapper.java a/src/main/java/com/meishu/mapper/WrittenHomeworkMapper.java new file mode 100644 index 0000000..1c13c89 --- /dev/null +++ a/src/main/java/com/meishu/mapper/WrittenHomeworkMapper.java @@ -0,0 +1,18 @@ +package com.meishu.mapper; + +import com.meishu.model.WrittenHomeworkDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 通知/附件作业表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ + @Repository +public interface WrittenHomeworkMapper extends BaseMapper { + +} diff --git b/src/main/java/com/meishu/model/AccessTokenDO.java a/src/main/java/com/meishu/model/AccessTokenDO.java new file mode 100644 index 0000000..9d44bec --- /dev/null +++ a/src/main/java/com/meishu/model/AccessTokenDO.java @@ -0,0 +1,31 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author Tuyp + * @since 2021-05-10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("access_token") +public class AccessTokenDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + private String accessToken; + + +} diff --git b/src/main/java/com/meishu/model/AdministerDO.java a/src/main/java/com/meishu/model/AdministerDO.java new file mode 100644 index 0000000..9d0f212 --- /dev/null +++ a/src/main/java/com/meishu/model/AdministerDO.java @@ -0,0 +1,77 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 中心管理账户表 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@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 password; + + /** + * 成员名称 + */ + private String userName; + + /** + * 头像 + */ + private String img; + + /** + * 管理员/超级管理员 + */ + private String role; + + /** + * 启用状态 0:禁用 1:启用 + */ + private String status; + + /** + * 介绍 + */ + private String intro; + + /** + * 部门id 废弃 + */ + private Long departmentId; + + /** + * openId + */ + private String openId; + + +} diff --git b/src/main/java/com/meishu/model/AdministerDepartmentMappingDO.java a/src/main/java/com/meishu/model/AdministerDepartmentMappingDO.java new file mode 100644 index 0000000..0a45278 --- /dev/null +++ a/src/main/java/com/meishu/model/AdministerDepartmentMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 老师部门映射表 + *

+ * + * @author Tuyp + * @since 2021-07-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("administer_department_mapping") +public class AdministerDepartmentMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 老师id + */ + private Long administerId; + + /** + * 部门id + */ + private Long departmentId; + + +} diff --git b/src/main/java/com/meishu/model/AdministerPermissionDO.java a/src/main/java/com/meishu/model/AdministerPermissionDO.java new file mode 100644 index 0000000..80fa20d --- /dev/null +++ a/src/main/java/com/meishu/model/AdministerPermissionDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 系统用户角色表 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@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; + + +} diff --git b/src/main/java/com/meishu/model/AdministerSubjectMappingDO.java a/src/main/java/com/meishu/model/AdministerSubjectMappingDO.java new file mode 100644 index 0000000..47ee52f --- /dev/null +++ a/src/main/java/com/meishu/model/AdministerSubjectMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 老师科目映射表 + *

+ * + * @author Tuyp + * @since 2021-07-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("administer_subject_mapping") +public class AdministerSubjectMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 科目id + */ + private Long subjectId; + + /** + * 老师id + */ + private Long administerId; + + +} diff --git b/src/main/java/com/meishu/model/AnsweringQuestionDO.java a/src/main/java/com/meishu/model/AnsweringQuestionDO.java new file mode 100644 index 0000000..6f51acd --- /dev/null +++ a/src/main/java/com/meishu/model/AnsweringQuestionDO.java @@ -0,0 +1,49 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 问题答疑表 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("answering_question") +public class AnsweringQuestionDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 科目id + */ + private Integer subjectId; + + /** + * 提问id + */ + private Integer askId; + + /** + * 问题 + */ + private String title; + + /** + * 答案 + */ + private String answer; + + +} diff --git b/src/main/java/com/meishu/model/CampusAdministerMappingDO.java a/src/main/java/com/meishu/model/CampusAdministerMappingDO.java new file mode 100644 index 0000000..5481f50 --- /dev/null +++ a/src/main/java/com/meishu/model/CampusAdministerMappingDO.java @@ -0,0 +1,33 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("campus_administer_mapping") +public class CampusAdministerMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long administerId; + + private Long campusId; + + +} diff --git b/src/main/java/com/meishu/model/CampusDictDO.java a/src/main/java/com/meishu/model/CampusDictDO.java new file mode 100644 index 0000000..5a5cff7 --- /dev/null +++ a/src/main/java/com/meishu/model/CampusDictDO.java @@ -0,0 +1,52 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import com.meishu.vo.campus.CampusListVO; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + *

+ * 校区字典表 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("campus_dict") +public class CampusDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 校区 + */ + private String campus; + + /** + * 父节点id + */ + private Long parentId; + + /** + * 负责人 + */ + private Long administerId; + + /** + * 子类 + */ + private List children; + + +} diff --git b/src/main/java/com/meishu/model/ClassSubjectTaskDO.java a/src/main/java/com/meishu/model/ClassSubjectTaskDO.java new file mode 100644 index 0000000..df7a579 --- /dev/null +++ a/src/main/java/com/meishu/model/ClassSubjectTaskDO.java @@ -0,0 +1,61 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-06-03 14:28 + */ +@Data +@TableName("class_subject_task") +public class ClassSubjectTaskDO { + + + @TableId(type = IdType.AUTO) + private Integer id; + + private Integer subjectId; + + private String treeId; + + private String treeName; + + private Date taskDate; + + private Integer teacherId; + + /** + * 作业类型 0:预习作业 1课后作业 + */ + private Integer taskType; + + private String subjectEn; + + private Integer classId; + + private String grade; + + private String classes; + + private String session; + + private String subjectType; + + private String className; + + private String semester; + + private Date createDate; + + private Date updateDate; + + private Date deleteDate; + + +} diff --git b/src/main/java/com/meishu/model/ClassesDictDO.java a/src/main/java/com/meishu/model/ClassesDictDO.java new file mode 100644 index 0000000..ad2cd6f --- /dev/null +++ a/src/main/java/com/meishu/model/ClassesDictDO.java @@ -0,0 +1,76 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 学校班级字典表 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("classes_dict") +public class ClassesDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 学校 + */ + private String school; + + /** + * 年级 + */ + private String grade; + + /** + * 班级 + */ + private String classes; + + /** + * 级 + */ + private String session; + + /** + * 小学/初中/高中 + */ + private String subjectType; + + /** + * 班级名称 + */ + private String className; + + /** + * 学期 --弃用 + */ + private String semester; + + /** + * 1:在读/0:往届 + */ + private String status; + + /** + * 晋升时间 + */ + private Date upgradeDate; + + +} diff --git b/src/main/java/com/meishu/model/ClassesDictHistoryDO.java a/src/main/java/com/meishu/model/ClassesDictHistoryDO.java new file mode 100644 index 0000000..56d54b9 --- /dev/null +++ a/src/main/java/com/meishu/model/ClassesDictHistoryDO.java @@ -0,0 +1,74 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 学校班级字典表 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("classes_dict_history") +public class ClassesDictHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * class_dict表的主键 + */ + private Integer classDictId; + + /** + * 学校 + */ + private String school; + + /** + * 年级 + */ + private String grade; + + /** + * 班级 + */ + private String classes; + + /** + * 级 + */ + private String session; + + /** + * 小学/初中/高中 + */ + private String subjectType; + + /** + * 班级名称 + */ + private String className; + + /** + * 学期 + */ + private String semester; + + /** + * 1:在读/0:往届 + */ + private String status; + + +} diff --git b/src/main/java/com/meishu/model/ClassesUserMappingDO.java a/src/main/java/com/meishu/model/ClassesUserMappingDO.java new file mode 100644 index 0000000..0cff2e5 --- /dev/null +++ a/src/main/java/com/meishu/model/ClassesUserMappingDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 班级--学生--映射表(包括以前的班级) + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("classes_user_mapping") +public class ClassesUserMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 班级id + */ + private Integer classesId; + + /** + * 学生id + */ + private Integer userId; + + /** + * 1 应届班级 0 以往班级 + */ + private Integer status; + + +} diff --git b/src/main/java/com/meishu/model/CourseAdministerMappingDO.java a/src/main/java/com/meishu/model/CourseAdministerMappingDO.java new file mode 100644 index 0000000..c53b9d2 --- /dev/null +++ a/src/main/java/com/meishu/model/CourseAdministerMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 课程老师映射表 + *

+ * + * @author Tuyp + * @since 2021-05-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_administer_mapping") +public class CourseAdministerMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 课程id + */ + private Long courseId; + + /** + * 老师id + */ + private Long administerId; + + +} diff --git b/src/main/java/com/meishu/model/CourseChapterDO.java a/src/main/java/com/meishu/model/CourseChapterDO.java new file mode 100644 index 0000000..8c80965 --- /dev/null +++ a/src/main/java/com/meishu/model/CourseChapterDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 科目章节字典表 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_chapter") +public class CourseChapterDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 科目id + */ + private Long courseId; + + /** + * 章节 + */ + private String chapter; + + /** + * 排序 + */ + private Integer orderNo; + + +} diff --git b/src/main/java/com/meishu/model/CourseDictDO.java a/src/main/java/com/meishu/model/CourseDictDO.java new file mode 100644 index 0000000..75328e1 --- /dev/null +++ a/src/main/java/com/meishu/model/CourseDictDO.java @@ -0,0 +1,59 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 课程字典表 + *

+ * + * @author Tuyp + * @since 2021-05-12 + */ +@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; + + /** + * 科目id + */ + private Long subjectId; + + /** + * 课程名称 + */ + private String courseName; + + /** + * 必修课程 拓展课程 + */ + private String courseType; + + /** + * courseIntro + */ + private String courseIntro; + + /** + * 课程封面 + */ + private String coverPage; + + /** + * 主页色值 + */ + private String pageColor; + + +} diff --git b/src/main/java/com/meishu/model/CourseStudentStatusHistoryDO.java a/src/main/java/com/meishu/model/CourseStudentStatusHistoryDO.java new file mode 100644 index 0000000..7bc781a --- /dev/null +++ a/src/main/java/com/meishu/model/CourseStudentStatusHistoryDO.java @@ -0,0 +1,60 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author Tuyp + * @since 2021-05-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_student_status_history") +public class CourseStudentStatusHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 课程id + */ + private Long courseId; + + /** + * 学生id + */ + private Long studentId; + + /** + * 状态 + */ + private String status; + + /** + * 开始时间 + */ + private String startDate; + + /** + * 结束时间 + */ + private String endDate; + + /** + * 授权人 + */ + private Long administerId; + + + +} diff --git b/src/main/java/com/meishu/model/CourseTreeDO.java a/src/main/java/com/meishu/model/CourseTreeDO.java new file mode 100644 index 0000000..32126f6 --- /dev/null +++ a/src/main/java/com/meishu/model/CourseTreeDO.java @@ -0,0 +1,85 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + *

+ * + *

+ * + * @author Tuyp + * @since 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_tree") +public class CourseTreeDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 知识树id,对应subject_tree的主键 + */ + private Long treeId; + + /** + * 课程id + */ + private Long courseId; + + /** + * 状态 0:禁用 1:启用 + */ + private String status; + + /** + * 父节点(tree_id的父节点) + */ + private Long parentId; + + /** + * 0:在学生端不展示 1:在学生端展示 + */ + private String isShow; + + /** + * 章节 + */ + private Integer chapterId; + + /** + * 知识点节点 + */ + private String treeNode; + + /** + * 知识点名称 + */ + private String treeName; + + /** + * 写程序使用,数据库不存值 + */ + private List children; + + /** + * 子节点个数 + */ + private Integer childNodeCounts; + + /** + * 课程顺序 + */ + private Integer treeOrder; + +} diff --git b/src/main/java/com/meishu/model/CourseTreeExerciseStudentResultDO.java a/src/main/java/com/meishu/model/CourseTreeExerciseStudentResultDO.java new file mode 100644 index 0000000..b6d7375 --- /dev/null +++ a/src/main/java/com/meishu/model/CourseTreeExerciseStudentResultDO.java @@ -0,0 +1,63 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 课程--学生做题记录 + *

+ * + * @author Tuyp + * @since 2021-05-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_tree_exercise_student_result") +public class CourseTreeExerciseStudentResultDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Long studentId; + + /** + * 课程id + */ + private Long courseId; + + /** + * 章节id + */ + private Long chapterId; + + /** + * 题目id + */ + private Long exerciseId; + + /** + * 答案 + */ + private String answer; + + /** + * 花费时间 + */ + private Integer length; + + /** + * 0:错误 1:正确 + */ + private String result; + +} diff --git b/src/main/java/com/meishu/model/CourseTreeVodStudentResultDO.java a/src/main/java/com/meishu/model/CourseTreeVodStudentResultDO.java new file mode 100644 index 0000000..3e36524 --- /dev/null +++ a/src/main/java/com/meishu/model/CourseTreeVodStudentResultDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 学生视频完成情况 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_tree_vod_student_result") +public class CourseTreeVodStudentResultDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Long studentId; + + /** + * 课程知识树id + */ + private Long courseTreeId; + + +} diff --git b/src/main/java/com/meishu/model/DepartmentDictDO.java a/src/main/java/com/meishu/model/DepartmentDictDO.java new file mode 100644 index 0000000..4458b6d --- /dev/null +++ a/src/main/java/com/meishu/model/DepartmentDictDO.java @@ -0,0 +1,53 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + *

+ * 部门字典表 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("department_dict") +public class DepartmentDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门负责人id + */ + private Long departmentLeaderId; + + /** + * 父节点id + */ + private Long parentId; + + /** + * 子节点 字段在数据库里没有值 + */ + private List children; + +} diff --git b/src/main/java/com/meishu/model/ExerciseCourseTreeMappingDO.java a/src/main/java/com/meishu/model/ExerciseCourseTreeMappingDO.java new file mode 100644 index 0000000..bcaa1f1 --- /dev/null +++ a/src/main/java/com/meishu/model/ExerciseCourseTreeMappingDO.java @@ -0,0 +1,51 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 课程知识树--题目字典表 + *

+ * + * @author Tuyp + * @since 2021-05-24 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_course_tree_mapping") +public class ExerciseCourseTreeMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 题目id + */ + private Long exerciseId; + + /** + * 课程id + */ + private Long courseId; + + /** + * 课程知识点course_treed的主键id + */ + private Long courseTreeId; + + /** + * 状态 + */ + private String status; + + + + +} diff --git b/src/main/java/com/meishu/model/ExerciseDictDO.java a/src/main/java/com/meishu/model/ExerciseDictDO.java new file mode 100644 index 0000000..69637c9 --- /dev/null +++ a/src/main/java/com/meishu/model/ExerciseDictDO.java @@ -0,0 +1,99 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springframework.beans.factory.annotation.Autowired; + +/** + *

+ * 习题库 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_dict") +public class ExerciseDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 科目id + */ + @TableField("subject") + private String subjectId; + + /** + * 题目类型 选择/填空 + */ + private String exerciseType; + + /** + * 提供者 + */ + @TableField("user_id") + private Long administerId; + + /** + * 难度 + */ + private Integer difficulty; + + /** + * 题目 + */ + private String title; + + /** + * 选项 + */ + private String items; + + /** + * 正确答案 + */ + private String rightAnswer; + + /** + * 解析 + */ + private String detail; + + /** + * 审核状态 + */ + private String status; + + /** + * 共享状态 + */ + private String shareStatus; + + /** + * 审核状态 + */ + private String checkStatus; + + /** + * 建议时长 + */ + private Integer adviceLength; + + /** + * 不通过原因 + */ + private String reason; + + + +} diff --git b/src/main/java/com/meishu/model/ExerciseDoneHistoryDO.java a/src/main/java/com/meishu/model/ExerciseDoneHistoryDO.java new file mode 100644 index 0000000..c3e6fc3 --- /dev/null +++ a/src/main/java/com/meishu/model/ExerciseDoneHistoryDO.java @@ -0,0 +1,69 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + *

+ * 学生做题记录表 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_done_history") +public class ExerciseDoneHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + + /** + * 习题id + */ + private Long exerciseId; + + /** + * 做题答案 /已读 + */ + private String answer; + + /** + * 结果 0:错误 1:正确 + */ + private Integer result; + + /** + * 做题时长 + */ + private Integer length; + + private Integer userId; + + //班级类型 0:行政班 1:进阶班 + private Integer classType; + + // 0:关联习题 1:拓展习题 + private Integer exerciseType; + + private Integer taskSubjectId; + + //作业内容id + private Integer contentId; + + private Integer completeId; + + private String doneType; + + +} diff --git b/src/main/java/com/meishu/model/ExerciseExpandMappingDO.java a/src/main/java/com/meishu/model/ExerciseExpandMappingDO.java new file mode 100644 index 0000000..7b668ce --- /dev/null +++ a/src/main/java/com/meishu/model/ExerciseExpandMappingDO.java @@ -0,0 +1,49 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 学生--拓展习题映射表 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_expand_mapping") +public class ExerciseExpandMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 任务id + */ + private Integer taskId; + + /** + * 拓展习题ids + */ + private String exerciseIds; + + /** + * 学生ids + */ + private String studentIds; + + /** + * 拓展习题名称 + */ + private String exerciseName; + + +} diff --git b/src/main/java/com/meishu/model/ExerciseRelatedMappingDO.java a/src/main/java/com/meishu/model/ExerciseRelatedMappingDO.java new file mode 100644 index 0000000..a7687cc --- /dev/null +++ a/src/main/java/com/meishu/model/ExerciseRelatedMappingDO.java @@ -0,0 +1,53 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 学生--拓展习题映射表 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_related_mapping") +public class ExerciseRelatedMappingDO extends BaseModel { + + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 任务id + */ + private Integer taskId; + + /** + * 知识点id + */ + private Integer treeId; + + /** + * 拓展习题ids + */ + private String exerciseIds; + + /** + * 学生ids + */ + private String studentIds; + + /** + * 拓展习题名称 + */ + private String exerciseName; + + +} diff --git b/src/main/java/com/meishu/model/ExerciseTreeMappingDO.java a/src/main/java/com/meishu/model/ExerciseTreeMappingDO.java new file mode 100644 index 0000000..e53ad36 --- /dev/null +++ a/src/main/java/com/meishu/model/ExerciseTreeMappingDO.java @@ -0,0 +1,36 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 科目下题目知识树映射表 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_related") +public class ExerciseTreeMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long exerciseId; + + private Long treeId; + + //private Long subjectId; + + private String status; + +} diff --git b/src/main/java/com/meishu/model/ExerciseUserInfoDO.java a/src/main/java/com/meishu/model/ExerciseUserInfoDO.java new file mode 100644 index 0000000..ab2f21d --- /dev/null +++ a/src/main/java/com/meishu/model/ExerciseUserInfoDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 题目收藏信息表 + *

+ * + * @author DengMin + * @since 2021-09-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_user_info") +public class ExerciseUserInfoDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 练习题id + */ + private Integer exerciseId; + + /** + * 学员id + */ + private Integer userId; + + /** + * 收藏状态 + */ + private Integer collectionStatus; + + +} diff --git b/src/main/java/com/meishu/model/KnowledgeSubjectDictDO.java a/src/main/java/com/meishu/model/KnowledgeSubjectDictDO.java new file mode 100644 index 0000000..e72a940 --- /dev/null +++ a/src/main/java/com/meishu/model/KnowledgeSubjectDictDO.java @@ -0,0 +1,49 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 学科字典表 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("knowledge_subject_dict") +public class KnowledgeSubjectDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学科名称 + */ + private String subjectName; + + + /** + * 科目缩写 + */ + private String subjectEn; + + /** + * 封面 + */ + private String coverPage; + + /** + * 学科类型 + */ + private String subjectType; + +} diff --git b/src/main/java/com/meishu/model/LaboratoryAttendanceMappingDO.java a/src/main/java/com/meishu/model/LaboratoryAttendanceMappingDO.java new file mode 100644 index 0000000..38dcdce --- /dev/null +++ a/src/main/java/com/meishu/model/LaboratoryAttendanceMappingDO.java @@ -0,0 +1,50 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 实验室场次预约考勤记录 + *

+ * + * @author DengMin + * @since 2021-09-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("laboratory_attendance_mapping") +public class LaboratoryAttendanceMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生ID + */ + private Long userRoleId; + + /** + * 实验室场次预约安排表ID + */ + private Long laboratorySessionId; + + /** + * 考勤时间 + */ + private LocalDateTime attendanceTime; + + /** + * 考勤方式 + */ + private String channel; + + +} diff --git b/src/main/java/com/meishu/model/LaboratoryDictDO.java a/src/main/java/com/meishu/model/LaboratoryDictDO.java new file mode 100644 index 0000000..f28922a --- /dev/null +++ a/src/main/java/com/meishu/model/LaboratoryDictDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 实验室 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("laboratory_dict") +public class LaboratoryDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 实验室名称 + */ + private String laboratoryName; + + /** + * 实验室类型 + */ + private String laboratoryType; + + /** + * 人数上限 + */ + private Integer maxNum; + + +} diff --git b/src/main/java/com/meishu/model/LaboratoryDictMappingDO.java a/src/main/java/com/meishu/model/LaboratoryDictMappingDO.java new file mode 100644 index 0000000..825e73f --- /dev/null +++ a/src/main/java/com/meishu/model/LaboratoryDictMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 实验室场次关联表 + *

+ * + * @author DengMin + * @since 2021-08-30 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("laboratory_dict_mapping") +public class LaboratoryDictMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 实验室ID + */ + private Long laboratoryDictId; + + /** + * 场次ID + */ + private Long sessionsDictId; + + +} diff --git b/src/main/java/com/meishu/model/LaboratorySessionMappingDO.java a/src/main/java/com/meishu/model/LaboratorySessionMappingDO.java new file mode 100644 index 0000000..a375033 --- /dev/null +++ a/src/main/java/com/meishu/model/LaboratorySessionMappingDO.java @@ -0,0 +1,59 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 实验室场次预约安排表 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("laboratory_session_mapping") +public class LaboratorySessionMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 场次ID + */ + private Long sessionsDictId; + + /** + * 实验室ID + */ + private Long laboratoryDictId; + + /** + * 开始时间 + */ + private String startDate; + + /** + * 报名开始时间 + */ + private String registerStartDate; + + /** + * 报名结束时间 + */ + private String registerEndDate; + + /** + * 年级 + */ + private String grade; + + +} diff --git b/src/main/java/com/meishu/model/LaboratoryUserMappingDO.java a/src/main/java/com/meishu/model/LaboratoryUserMappingDO.java new file mode 100644 index 0000000..bc59c52 --- /dev/null +++ a/src/main/java/com/meishu/model/LaboratoryUserMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 实验室场次预约报名记录 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("laboratory_user_mapping") +public class LaboratoryUserMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 实验室场次预约安排表ID + */ + private Long laboratorySessionId; + + /** + * 学生ID + */ + private Long userRoleId; + + +} diff --git b/src/main/java/com/meishu/model/PermissionsDictDO.java a/src/main/java/com/meishu/model/PermissionsDictDO.java new file mode 100644 index 0000000..254132d --- /dev/null +++ a/src/main/java/com/meishu/model/PermissionsDictDO.java @@ -0,0 +1,45 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + *

+ * 权限表 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("permissions_dict") +public class PermissionsDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 父级ID + */ + private Long parentId; + + /** + * 名称 + */ + private String name; + + /** + * 子节点 代码使用 无实际意义 + */ + private List children; + +} diff --git b/src/main/java/com/meishu/model/PtStudentScoreDO.java a/src/main/java/com/meishu/model/PtStudentScoreDO.java new file mode 100644 index 0000000..4ab62b8 --- /dev/null +++ a/src/main/java/com/meishu/model/PtStudentScoreDO.java @@ -0,0 +1,54 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author DengMin + * @since 2021-09-02 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("pt_student_score") +public class PtStudentScoreDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 学生id + */ + private Integer studentId; + + /** + * 科目id + */ + private Integer subjectId; + + /** + * 学科+学期id + */ + private Integer semesterId; + + /** + * 分数 + */ + private Double score; + + /** + * 和record表对应的分数 + */ + private Double scoreRecord; + + +} diff --git b/src/main/java/com/meishu/model/RoleAdministerMappingDO.java a/src/main/java/com/meishu/model/RoleAdministerMappingDO.java new file mode 100644 index 0000000..16a87fe --- /dev/null +++ a/src/main/java/com/meishu/model/RoleAdministerMappingDO.java @@ -0,0 +1,33 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("role_administer_mapping") +public class RoleAdministerMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long administerId; + + private Long roleId; + + +} diff --git b/src/main/java/com/meishu/model/RoleDictDO.java a/src/main/java/com/meishu/model/RoleDictDO.java new file mode 100644 index 0000000..2010693 --- /dev/null +++ a/src/main/java/com/meishu/model/RoleDictDO.java @@ -0,0 +1,34 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 角色表 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("role_dict") +public class RoleDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 角色 + */ + private String role; + + +} diff --git b/src/main/java/com/meishu/model/RolePermissionMappingDO.java a/src/main/java/com/meishu/model/RolePermissionMappingDO.java new file mode 100644 index 0000000..1303c8b --- /dev/null +++ a/src/main/java/com/meishu/model/RolePermissionMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 系统用户角色表 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("role_permission_mapping") +public class RolePermissionMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 权限ID + */ + private Long roleId; + + /** + * 角色ID + */ + private Long permissionId; + + +} diff --git b/src/main/java/com/meishu/model/SessionsDictDO.java a/src/main/java/com/meishu/model/SessionsDictDO.java new file mode 100644 index 0000000..af34282 --- /dev/null +++ a/src/main/java/com/meishu/model/SessionsDictDO.java @@ -0,0 +1,34 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 场次字典表 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sessions_dict") +public class SessionsDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 场次 + */ + private String timeSlot; + + +} diff --git b/src/main/java/com/meishu/model/SignInRecordDO.java a/src/main/java/com/meishu/model/SignInRecordDO.java new file mode 100644 index 0000000..65f6edf --- /dev/null +++ a/src/main/java/com/meishu/model/SignInRecordDO.java @@ -0,0 +1,45 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 学生签到表 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sign_in_record") +public class SignInRecordDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Integer studentId; + + /** + * 班级id + */ + private Integer classId; + + /** + * 签到时间 + */ + private LocalDateTime signInDate; + + +} diff --git b/src/main/java/com/meishu/model/SmsCodeDO.java a/src/main/java/com/meishu/model/SmsCodeDO.java new file mode 100644 index 0000000..f77d95a --- /dev/null +++ a/src/main/java/com/meishu/model/SmsCodeDO.java @@ -0,0 +1,41 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 短信验证码 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sms_verify_code") +public class SmsCodeDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 手机号 + */ + private String telephone; + + /** + * 验证码 + */ + @TableField("verify_code") + private String code; + + +} diff --git b/src/main/java/com/meishu/model/StudentCourseMappingDO.java a/src/main/java/com/meishu/model/StudentCourseMappingDO.java new file mode 100644 index 0000000..d7ab67c --- /dev/null +++ a/src/main/java/com/meishu/model/StudentCourseMappingDO.java @@ -0,0 +1,59 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author Tuyp + * @since 2021-05-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("student_course_mapping") +public class StudentCourseMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Long studentId; + + /** + * 课程id + */ + private Long courseId; + + /** + * 起始时间 + */ + private String startDate; + + /** + * 截止时间 + */ + private String endDate; + + /** + * 0:已暂停 1:已启用 + */ + private String status; + + /** + * 授权人 + */ + private Long administerId; + + +} diff --git b/src/main/java/com/meishu/model/StudentDO.java a/src/main/java/com/meishu/model/StudentDO.java new file mode 100644 index 0000000..52720aa --- /dev/null +++ a/src/main/java/com/meishu/model/StudentDO.java @@ -0,0 +1,66 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 白名单 + *

+ * + * @author Tuyp + * @since 2021-05-08 + */ +@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 wechatImg; + + /** + * openid + */ + private String openid; + + /** + * 手机号 + */ + private String telephone; + + /** + * 姓名 + */ + private String username; + + /** + * 0:禁用 1:弃用 + */ + private String status; + + /** + * 家长手机1 + */ + private String parentTelephone1; + + /** + * 家长电话2 + */ + private String parentTelephone2; + + /** + * 校区id + */ + private Long campusId; + + +} diff --git b/src/main/java/com/meishu/model/SubjectDictDO.java a/src/main/java/com/meishu/model/SubjectDictDO.java new file mode 100644 index 0000000..c7893df --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectDictDO.java @@ -0,0 +1,86 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 学校科目字典表 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_dict") +public class SubjectDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 学校 + */ + private String school; + + /** + * 年级(可为空) + */ + private String grade; + + /** + * 班级 + */ + private String classes; + + /** + * 班级名称 + */ + private String className; + + private String subject; + + /** + * 科目en + */ + private String subjectEn; + + /** + * 类型: 小学/初中/高中 + */ + private String subjectType; + + /** + * 届 + */ + private String session; + + /** + * 学期--弃用 + */ + private String semester; + + /** + * 状态:在读/结课 + */ + private String status; + + /** + * 班级-科目-封面 + */ + private String coverPageUrl; + + /** + * 班级-科目-首页 + */ + private String frontPageUrl; + + +} diff --git b/src/main/java/com/meishu/model/SubjectDimensionDictDO.java a/src/main/java/com/meishu/model/SubjectDimensionDictDO.java new file mode 100644 index 0000000..d103adb --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectDimensionDictDO.java @@ -0,0 +1,48 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 测评表 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_dimension_dict") +public class SubjectDimensionDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 规则id + */ + private Long ruleId; + + /** + * 维度 + */ + private String dimension; + + /** + * 维度顺序 + */ + private Long dimensionOrder; + + /** + * 0:禁用 1:启用 + */ + private String status; + +} diff --git b/src/main/java/com/meishu/model/SubjectDimensionStarDictDO.java a/src/main/java/com/meishu/model/SubjectDimensionStarDictDO.java new file mode 100644 index 0000000..60043a8 --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectDimensionStarDictDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 维度星级字典表 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_dimension_star_dict") +public class SubjectDimensionStarDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 维度id + */ + private Long dimensionId; + + /** + * 星级 + */ + private Long star; + + /** + * 评析 + */ + private String description; + + +} diff --git b/src/main/java/com/meishu/model/SubjectRuleDO.java a/src/main/java/com/meishu/model/SubjectRuleDO.java new file mode 100644 index 0000000..974def8 --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectRuleDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 规则字典表 + *

+ * + * @author Tuyp + * @since 2021-05-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_rule") +public class SubjectRuleDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 科目id + */ + private Long subjectId; + + /** + * 规则名称 + */ + private String ruleName; + + /** + * 0:禁用 1:启用 + */ + private String status; + + +} diff --git b/src/main/java/com/meishu/model/SubjectSemesterDO.java a/src/main/java/com/meishu/model/SubjectSemesterDO.java new file mode 100644 index 0000000..132c966 --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectSemesterDO.java @@ -0,0 +1,47 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_semester") +public class SubjectSemesterDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 科目id + */ + private Integer subjectId; + + /** + * 学期 上/下 + */ + private String semester; + + /** + * 1 :在读 + */ + private Integer status; + + +} diff --git b/src/main/java/com/meishu/model/SubjectStarTreeMappingDO.java a/src/main/java/com/meishu/model/SubjectStarTreeMappingDO.java new file mode 100644 index 0000000..fdabdf3 --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectStarTreeMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 测评-知识点关联表 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_star_tree_mapping") +public class SubjectStarTreeMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 测评星级id + */ + private Long subjectStarId; + + /** + * 知识点id + */ + private Long subjectTreeId; + + +} diff --git b/src/main/java/com/meishu/model/SubjectStudentAnswerStarDO.java a/src/main/java/com/meishu/model/SubjectStudentAnswerStarDO.java new file mode 100644 index 0000000..02de581 --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectStudentAnswerStarDO.java @@ -0,0 +1,53 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 学生答卷星级表 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_student_answer_star") +public class SubjectStudentAnswerStarDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Long studentId; + + /** + * 星级id + */ + private Long starId; + + /** + * 布置id + */ + private Long publishId; + + /** + * 评卷人id + */ + private Long administerId; + + /** + * 维度id + */ + private Long dimensionId; + +} diff --git b/src/main/java/com/meishu/model/SubjectTestDictDO.java a/src/main/java/com/meishu/model/SubjectTestDictDO.java new file mode 100644 index 0000000..33d6cf1 --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectTestDictDO.java @@ -0,0 +1,46 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 测评表 + *

+ * + * @author Tuyp + * @since 2021-05-20 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_test_dict") +public class SubjectTestDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long ruleId; + + /** + * 考试名称 + */ + private String testName; + + + /** + * 卷面 + */ + private String examination; + + /** + * 状态 + */ + private String status; + +} diff --git b/src/main/java/com/meishu/model/SubjectTestGradeExampleMappingDO.java a/src/main/java/com/meishu/model/SubjectTestGradeExampleMappingDO.java new file mode 100644 index 0000000..02cba95 --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectTestGradeExampleMappingDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 样卷映射表 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_test_grade_example_mapping") +public class SubjectTestGradeExampleMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 年级id + */ + private Long gradeId; + + /** + * 样卷 + */ + private String exampleView; + + +} diff --git b/src/main/java/com/meishu/model/SubjectTestGradeStarMappingDO.java a/src/main/java/com/meishu/model/SubjectTestGradeStarMappingDO.java new file mode 100644 index 0000000..6a91a6b --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectTestGradeStarMappingDO.java @@ -0,0 +1,33 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 档次星级映射表 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_test_grade_star_mapping") +public class SubjectTestGradeStarMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long gradeId; + + private Long starId; + + +} diff --git b/src/main/java/com/meishu/model/SubjectTestPublishGradeDO.java a/src/main/java/com/meishu/model/SubjectTestPublishGradeDO.java new file mode 100644 index 0000000..75472f0 --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectTestPublishGradeDO.java @@ -0,0 +1,41 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 档次表 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_test_publish_grade") +public class SubjectTestPublishGradeDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long publishId; + + /** + * 档次名称 + */ + private String gradeName; + + /** + * 综合评价 + */ + private String content; + + +} diff --git b/src/main/java/com/meishu/model/SubjectTestPublishHistoryDO.java a/src/main/java/com/meishu/model/SubjectTestPublishHistoryDO.java new file mode 100644 index 0000000..e7bb696 --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectTestPublishHistoryDO.java @@ -0,0 +1,59 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 测评发布记录表 + *

+ * + * @author Tuyp + * @since 2021-05-08 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_test_publish_history") +public class SubjectTestPublishHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 测评id + */ + private Long testId; + + /** + * 测评时间 + */ + private String testTime; + + /** + * 发布名称 + */ + private String publishName; + + /** + * 概要 + */ + private String outline; + + /** + * 测评分类 + */ + private String testType; + + /** + * 封面 + */ + private String coverPage; + + +} diff --git b/src/main/java/com/meishu/model/SubjectTestStudentAnswerDO.java a/src/main/java/com/meishu/model/SubjectTestStudentAnswerDO.java new file mode 100644 index 0000000..88cfe3e --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectTestStudentAnswerDO.java @@ -0,0 +1,53 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 学生月考答卷 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("subject_test_student_answer") +public class SubjectTestStudentAnswerDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Long studentId; + + /** + * 发布id + */ + private Long publishId; + + /** + * 答卷 + */ + private String answer; + + /** + * 提交状态 0:未提交 1:已提交 + */ + private String commitStatus; + + /** + * 评析状态 + */ + private String commentStatus; + +} diff --git b/src/main/java/com/meishu/model/SubjectTreeDO.java a/src/main/java/com/meishu/model/SubjectTreeDO.java new file mode 100644 index 0000000..9cecf9d --- /dev/null +++ a/src/main/java/com/meishu/model/SubjectTreeDO.java @@ -0,0 +1,71 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.List; + +/** + *

+ * + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("knowledge_tree") +public class SubjectTreeDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private String school; + + private Long subjectId; + + private String subjectType; + + private String subjectEn; + + private String subject; + + private String label; + + @TableField("chapter") + private String treeNode; + + @TableField("node_name") + private String treeName; + + private String contentIntroduction; + + /** + * 父节点 + */ + private Long parentId; + + /** + * 写程序使用,数据库不存值 + */ + private List children; + + /** + * 子节点个数 + */ + private Integer childNodeCounts; + + + @TableField("chapter_order") + private Integer treeOrder; + + +} diff --git b/src/main/java/com/meishu/model/TaskCompletionStatusDO.java a/src/main/java/com/meishu/model/TaskCompletionStatusDO.java new file mode 100644 index 0000000..6bfca31 --- /dev/null +++ a/src/main/java/com/meishu/model/TaskCompletionStatusDO.java @@ -0,0 +1,54 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 作业任务完成状态 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("task_completion_status") +public class TaskCompletionStatusDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 用户id + */ + private Integer userId; + + /** + * 作业类型 0:关联习题 1:拓展习题 + */ + private Integer exeType; + + /** + * 任务id + */ + private Integer subjectTaskId; + + /** + * 知识点id/拓展习题id + */ + private Integer treeId; + + /** + * 完成状态 + */ + private String status; + + +} diff --git b/src/main/java/com/meishu/model/TaskContentDO.java a/src/main/java/com/meishu/model/TaskContentDO.java new file mode 100644 index 0000000..dc7596f --- /dev/null +++ a/src/main/java/com/meishu/model/TaskContentDO.java @@ -0,0 +1,44 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 作业内容表(取题目,视频,书面作业) + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("task_content") +public class TaskContentDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 任务id + */ + private Integer taskId; + + /** + * 作业类型 0:短视频 1:关联习题 2:拓展习题 3:书面作业 + */ + private Integer contentType; + + /** + * 内容id/知识点id + */ + private Integer contentId; + + +} diff --git b/src/main/java/com/meishu/model/TaskContentDoneInfoDO.java a/src/main/java/com/meishu/model/TaskContentDoneInfoDO.java new file mode 100644 index 0000000..b332b37 --- /dev/null +++ a/src/main/java/com/meishu/model/TaskContentDoneInfoDO.java @@ -0,0 +1,49 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author DengMin + * @since 2021-09-30 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("task_content_done_info") +public class TaskContentDoneInfoDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 任务id + */ + private Integer taskId; + + /** + * 任务类型 + */ + private Integer contentType; + + /** + * 知识点id + */ + private Integer contentId; + + /** + * 用户ID + */ + private Integer userId; + + +} diff --git b/src/main/java/com/meishu/model/TaskDoneHistoryDO.java a/src/main/java/com/meishu/model/TaskDoneHistoryDO.java new file mode 100644 index 0000000..b7b4655 --- /dev/null +++ a/src/main/java/com/meishu/model/TaskDoneHistoryDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("task_done_history") +public class TaskDoneHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 任务id + */ + private Integer taskId; + + /** + * 用户id + */ + private Integer userId; + + +} diff --git b/src/main/java/com/meishu/model/UserRoleCopy1DO.java a/src/main/java/com/meishu/model/UserRoleCopy1DO.java new file mode 100644 index 0000000..66894a3 --- /dev/null +++ a/src/main/java/com/meishu/model/UserRoleCopy1DO.java @@ -0,0 +1,52 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 学生表 + *

+ * + * @author DengMin + * @since 2021-09-23 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("user_role_copy1") +public class UserRoleCopy1DO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 用户名 + */ + private String userName; + + /** + * 性别 + */ + private String gender; + + /** + * 届 + */ + private String session; + + /** + * 学号 + */ + private String studyCode; + + +} diff --git b/src/main/java/com/meishu/model/UserRoleDO.java a/src/main/java/com/meishu/model/UserRoleDO.java new file mode 100644 index 0000000..eb0599e --- /dev/null +++ a/src/main/java/com/meishu/model/UserRoleDO.java @@ -0,0 +1,112 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import java.time.LocalDateTime; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 学生表 + *

+ * + * @author Tuyp + * @since 2021-08-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("user_role") +public class UserRoleDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 用户id + */ + private Integer userId; + + /** + * 用户名 + */ + private String userName; + + /** + * 性别 + */ + private String gender; + + /** + * 生日 + */ + private LocalDateTime birthday; + + /** + * 邮箱 + */ + private String email; + + /** + * 图片 + */ + private String imgUrl; + + /** + * 账户状态 0禁用 1 启用 + */ + private String userStatus; + + /** + * 注册方式 + */ + private String registerMethod; + + /** + * 账户类型 0 学生/1:老师/2家长 + */ + private String roleType; + + /** + * 届 + */ + private String session; + + /** + * classes_id 主键 + */ + private Integer classesId; + + /** + * 手机号 + */ + private String phone; + + /** + * 密码 + */ + private String password; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 微信openid + */ + private String openId; + + /** + * 学籍号 + */ + private String studyCode; + +} diff --git b/src/main/java/com/meishu/model/UserSubjectMappingDO.java a/src/main/java/com/meishu/model/UserSubjectMappingDO.java new file mode 100644 index 0000000..d37b447 --- /dev/null +++ a/src/main/java/com/meishu/model/UserSubjectMappingDO.java @@ -0,0 +1,49 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 老师-科目映射表 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("user_subject_mapping") +public class UserSubjectMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 用户(老师) user_role id + */ + private Integer userId; + + /** + * 班级类型 0:行政班 1:进阶班 + */ + private Integer classType; + + /** + * 行政班:关联科目id + */ + private Integer subjectId; + + /** + * 进阶班:频道名称 + */ + private String subjectName; + + +} diff --git b/src/main/java/com/meishu/model/UserSubjectPermissionDictDO.java a/src/main/java/com/meishu/model/UserSubjectPermissionDictDO.java new file mode 100644 index 0000000..7d89fd5 --- /dev/null +++ a/src/main/java/com/meishu/model/UserSubjectPermissionDictDO.java @@ -0,0 +1,39 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 平时成绩---老师班级权限 + *

+ * + * @author Tuyp + * @since 2021-08-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("user_subject_permission_dict") +public class UserSubjectPermissionDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 老师id + */ + private Integer userId; + + /** + * 科目id + */ + private Integer subjectId; + + +} diff --git b/src/main/java/com/meishu/model/UuidHistoryDO.java a/src/main/java/com/meishu/model/UuidHistoryDO.java new file mode 100644 index 0000000..23d652b --- /dev/null +++ a/src/main/java/com/meishu/model/UuidHistoryDO.java @@ -0,0 +1,31 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * + *

+ * + * @author DengMin + * @since 2021-09-29 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("uuid_history") +public class UuidHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private String uuid; + + +} diff --git b/src/main/java/com/meishu/model/VodDictDO.java a/src/main/java/com/meishu/model/VodDictDO.java new file mode 100644 index 0000000..d48b57f --- /dev/null +++ a/src/main/java/com/meishu/model/VodDictDO.java @@ -0,0 +1,102 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 视频字典表 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@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 + */ + @TableField("subject") + private String subjectId; + + /** + * 视频名称 + */ + private String vodName; + + /** + * 视频地址 + */ + private String vodUrl; + + /** + * 课型 + */ + private String vodType; + + /** + * 视频介绍 + */ + private String vodIntro; + + /** + * 视频时长 + */ + private Integer vodLength; + + /** + * 视频在腾讯云上的code + */ + private String vodCode; + + /** + * 视频提供者 + */ + @TableField("teacher_id") + private Long administerId; + + /** + * 封面 + */ + private String coverPage; + + /** + * 0:待审核 1:已审核 + */ + private String status; + + /** + * 审核人 + */ + private Integer checkId; + + /** + * 分享状态 + */ + private String shareStatus; + + /** + * 审核状态 1:审核通过 3:未通过 2: 审核中 + */ + private String checkStatus; + + /** + * 通过/不通过原因 + */ + private String reason; + + +} diff --git b/src/main/java/com/meishu/model/VodPlayHistoryDO.java a/src/main/java/com/meishu/model/VodPlayHistoryDO.java new file mode 100644 index 0000000..6e53417 --- /dev/null +++ a/src/main/java/com/meishu/model/VodPlayHistoryDO.java @@ -0,0 +1,54 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 视频播放历史记录表 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("vod_play_history") +public class VodPlayHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 视频id + */ + private Long vodId; + + /** + * 学生id + */ + private Long studentId; + + /** + * 观看时长 + */ + private Integer playLength; + + /** + * 播放视频位置 + */ + private Integer playRecord; + + /** + * course_tree课程知识树的主键 + */ + private Long treeId; + + +} diff --git b/src/main/java/com/meishu/model/VodSubjectTreeMappingDO.java a/src/main/java/com/meishu/model/VodSubjectTreeMappingDO.java new file mode 100644 index 0000000..afbbd82 --- /dev/null +++ a/src/main/java/com/meishu/model/VodSubjectTreeMappingDO.java @@ -0,0 +1,49 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 视频知识点映射表 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("vod_related") +public class VodSubjectTreeMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 视频id + */ + private Long vodId; + + /** + * 科目知识树id + */ + private Long treeId; + + /** + * 状态 0:隐藏 1:启用 + */ + private String status; + + /** + * 关联学校 -- 同步用 + */ + private String isRelated; + + +} diff --git b/src/main/java/com/meishu/model/WrittenHomeworkDO.java a/src/main/java/com/meishu/model/WrittenHomeworkDO.java new file mode 100644 index 0000000..e78b0b7 --- /dev/null +++ a/src/main/java/com/meishu/model/WrittenHomeworkDO.java @@ -0,0 +1,59 @@ +package com.meishu.model; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.util.BaseModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 通知/附件作业表 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("written_homework") +public class WrittenHomeworkDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 书面作业类型 2 通知 1 附件 + */ + private Integer homeworkType; + + /** + * 内容/附件地址 + */ + private String homeworkContent; + + /** + * 建议时长 + */ + private Integer adviceLength; + + /** + * 附件大小 + */ + private String fileSize; + + /** + * 文件类型 + */ + private String fileType; + + /** + * 文件名称 + */ + private String fileName; + + +} diff --git b/src/main/java/com/meishu/service/AccessTokenService.java a/src/main/java/com/meishu/service/AccessTokenService.java new file mode 100644 index 0000000..d1a96d5 --- /dev/null +++ a/src/main/java/com/meishu/service/AccessTokenService.java @@ -0,0 +1,27 @@ +package com.meishu.service; + +import com.meishu.dto.token.GetAllStudentsDTO; +import com.meishu.dto.token.GetAllTeachersDTO; +import com.meishu.model.AccessTokenDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.AdministerDO; +import com.meishu.model.UserRoleDO; +import com.meishu.vo.accesstoken.GetAllStudentsVO; +import com.meishu.vo.accesstoken.GetAllTeachersVO; + +import java.util.List; + +/** + *

+ * 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-10 + */ +public interface AccessTokenService extends IService { + + List getAllTeachers(GetAllTeachersDTO getAllTeachersDTO); + + List getAllStudents(GetAllStudentsDTO getAllStudentsDTO); +} diff --git b/src/main/java/com/meishu/service/AdministerDepartmentMappingService.java a/src/main/java/com/meishu/service/AdministerDepartmentMappingService.java new file mode 100644 index 0000000..0b23955 --- /dev/null +++ a/src/main/java/com/meishu/service/AdministerDepartmentMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.AdministerDepartmentMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 老师部门映射表 服务类 + *

+ * + * @author Tuyp + * @since 2021-07-01 + */ +public interface AdministerDepartmentMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/AdministerPermissionService.java a/src/main/java/com/meishu/service/AdministerPermissionService.java new file mode 100644 index 0000000..80936e1 --- /dev/null +++ a/src/main/java/com/meishu/service/AdministerPermissionService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.AdministerPermissionDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 系统用户角色表 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +public interface AdministerPermissionService extends IService { + +} diff --git b/src/main/java/com/meishu/service/AdministerService.java a/src/main/java/com/meishu/service/AdministerService.java new file mode 100644 index 0000000..4fc5397 --- /dev/null +++ a/src/main/java/com/meishu/service/AdministerService.java @@ -0,0 +1,48 @@ +package com.meishu.service; + +import com.meishu.dto.administer.AddAdministerDTO; +import com.meishu.dto.administer.ChangeStatusDTO; +import com.meishu.dto.administer.PublishTasksDTO; +import com.meishu.dto.administer.UpdateAdministerDTO; +import com.meishu.dto.exercise.UpdateStatusDTO; +import com.meishu.model.AdministerDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.PermissionsDictDO; +import com.meishu.model.SmsCodeDO; +import com.meishu.vo.administer.AdministerPermissionVO; +import com.meishu.vo.administer.LoginVO; +import com.meishu.vo.administer.PermissionsVO; + +import java.util.List; + +/** + *

+ * 中心管理账户表 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +public interface AdministerService extends IService { + + String sendMsg(AdministerDO administerDO); + + LoginVO login(SmsCodeDO smsCodeDO); + + LoginVO passwordLogin(AdministerDO administerDO); + + AdministerPermissionVO getPermissions(); + + List getParentPermission(); + + String addAdminister(AddAdministerDTO addAdministerDTO); + + List getPermissionTree(); + + String changeStatus(ChangeStatusDTO changeStatusDTO); + + String updateAdminister(UpdateAdministerDTO updateAdministerDTO); + + List getAllAdminister(); + +} diff --git b/src/main/java/com/meishu/service/AdministerSubjectMappingService.java a/src/main/java/com/meishu/service/AdministerSubjectMappingService.java new file mode 100644 index 0000000..fd95956 --- /dev/null +++ a/src/main/java/com/meishu/service/AdministerSubjectMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.AdministerSubjectMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 老师科目映射表 服务类 + *

+ * + * @author Tuyp + * @since 2021-07-01 + */ +public interface AdministerSubjectMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/AnsweringQuestionService.java a/src/main/java/com/meishu/service/AnsweringQuestionService.java new file mode 100644 index 0000000..b2e5a86 --- /dev/null +++ a/src/main/java/com/meishu/service/AnsweringQuestionService.java @@ -0,0 +1,34 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.question.QueryQuestionsDTO; +import com.meishu.model.AnsweringQuestionDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.UserSubjectPermissionDictDO; +import com.meishu.vo.question.GetClassQuestionsVO; +import com.meishu.vo.question.QueryOneQuestionVO; + +import java.util.List; + +/** + *

+ * 问题答疑表 服务类 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +public interface AnsweringQuestionService extends IService { + + IPage queryQuestions(QueryQuestionsDTO queryQuestionsDTO); + + String deleteQuestion(AnsweringQuestionDO answeringQuestionDO); + + QueryOneQuestionVO queryOneQuestion(AnsweringQuestionDO answeringQuestionDO); + + List getClassQuestions(UserSubjectPermissionDictDO userSubjectPermissionDictDO); + + String addQuestion(AnsweringQuestionDO answeringQuestionDO); + + String answerQuestion(AnsweringQuestionDO answeringQuestionDO); +} diff --git b/src/main/java/com/meishu/service/ClassSubjectTaskService.java a/src/main/java/com/meishu/service/ClassSubjectTaskService.java new file mode 100644 index 0000000..78470da --- /dev/null +++ a/src/main/java/com/meishu/service/ClassSubjectTaskService.java @@ -0,0 +1,71 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.administer.PublishTasksDTO; +import com.meishu.dto.classes.GetClassesDTO; +import com.meishu.dto.exercise.GetExerciseRequestDTO; +import com.meishu.dto.task.*; +import com.meishu.model.*; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.PerStudentComplicationVO; +import com.meishu.vo.administer.GetClassesDetailResponseVO; +import com.meishu.vo.administer.GetTeacherClassVO; +import com.meishu.vo.exercise.GetExerciseDetailResponseVO; +import com.meishu.vo.task.*; + +import java.util.HashMap; +import java.util.List; + +/** + *

+ * 学习任务列表 服务类 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +public interface ClassSubjectTaskService extends IService { + + String code(String telephone); + + List getTeacherClass(GetClassesRequestVO getClassesRequestVO); + + String publishTasks(PublishTasksDTO publishTasksDTO); + + IPage getTaskById(GetTaskByIdRequestDTO getTaskByIdRequestDTO); + + String deletePreTasks(ClassSubjectTaskDO classSubjectTaskDO); + + QueryTaskDetailResponseVO queryTaskDetail(QueryTaskDetailDTO queryTaskDetailDTO); + + List getRelativeExercises(GetExerciseRequestDTO getExerciseRequestVO); + + List perStudentVod(GetUserVodPlayDTO getUserVodPlayRequestVO); + + PerStudentExesResponseVO perStudentRelateExes(PerStudentExesDTO perStudentExesRequestVO); + + List exeRightRatio(ExeRightRatioDTO exeRightRatioPO); + + StudentDoneInfoResponseVO studentRelateDoneInfo(StudentDoneInfoRequestVO studentDoneInfoRequestVO); + + GetExeByIdResponseVO getExeById(ExerciseDictDO exerciseDict); + + List getExpandings(GetExpandingsPO getExpandingsPO); + + StudentDoneInfoResponseVO studentxpandingDoneInfo(StudentDoneInfoRequestVO studentDoneInfoRequestVO); + + PerStudentExesResponseVO perStudentExpandingExes(PerStudentExesRequestVO perStudentExesRequestVO); + + List getRecommendVodByTreeId(GetRecommendVodByTreeIdVO getRecommendVodByTreeIdVO); + + List getRecommendExeByTreeId(GetRecommendExeByTreeIdVO getRecommendExeByTreeIdVO); + + List allNodes(SubjectTreeDO knowledgeTree); + + List getClassStudents(GetClassStudentsDTO getClassStudentsDTO); + + List queryTaskRelatedExercise(TaskContentDO taskContentDO); + + void data(); + +} diff --git b/src/main/java/com/meishu/service/ClassesDictHistoryService.java a/src/main/java/com/meishu/service/ClassesDictHistoryService.java new file mode 100644 index 0000000..f3341a5 --- /dev/null +++ a/src/main/java/com/meishu/service/ClassesDictHistoryService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ClassesDictHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 学校班级字典表 服务类 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +public interface ClassesDictHistoryService extends IService { + +} diff --git b/src/main/java/com/meishu/service/ClassesDictService.java a/src/main/java/com/meishu/service/ClassesDictService.java new file mode 100644 index 0000000..ce34780 --- /dev/null +++ a/src/main/java/com/meishu/service/ClassesDictService.java @@ -0,0 +1,45 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.classes.*; +import com.meishu.model.ClassesDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.ClassesDictHistoryDO; +import com.meishu.model.UserRoleDO; +import com.meishu.vo.classes.GetClassStudentsVO; +import com.meishu.vo.classes.GetClassesVO; + +import java.util.List; + +/** + *

+ * 学校班级字典表 服务类 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +public interface ClassesDictService extends IService { + + IPage getClasses(GetClassesDTO getClassesDTO); + + String addClass(AddClassDTO addClassDTO); + + String updateClass(AddClassDTO addClassDTO); + + String addSubjectTeacherMapping(AddSubjectTeacherDTO addSubjectTeacherDTO); + + List getClassStudents(GetClassStudentsDTO getClassStudentsDTO); + + IPage queryNoClassStudents(QueryNoClassStudentsDTO queryNoClassStudentsDTO); + + String batchAddStudentToClass(BatchAddStudentToClassDTO batchAddStudentToClassDTO); + + String batchDeleteStudent(BatchAddStudentToClassDTO batchAddStudentToClassDTO); + + List getClassesWithPage(); + + ClassesDictDO getClassesById(Long studentId); + + String batchUpGrade(BatchUpGradeDTO batchUpGradeDTO); +} diff --git b/src/main/java/com/meishu/service/ClassesUserMappingService.java a/src/main/java/com/meishu/service/ClassesUserMappingService.java new file mode 100644 index 0000000..4d437d9 --- /dev/null +++ a/src/main/java/com/meishu/service/ClassesUserMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ClassesUserMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 班级--学生--映射表(包括以前的班级) 服务类 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ +public interface ClassesUserMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/CourseAdministerMappingService.java a/src/main/java/com/meishu/service/CourseAdministerMappingService.java new file mode 100644 index 0000000..3724d08 --- /dev/null +++ a/src/main/java/com/meishu/service/CourseAdministerMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.CourseAdministerMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 课程老师映射表 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-25 + */ +public interface CourseAdministerMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/CourseStudentStatusHistoryService.java a/src/main/java/com/meishu/service/CourseStudentStatusHistoryService.java new file mode 100644 index 0000000..8a7c6c6 --- /dev/null +++ a/src/main/java/com/meishu/service/CourseStudentStatusHistoryService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.CourseStudentStatusHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-27 + */ +public interface CourseStudentStatusHistoryService extends IService { + +} diff --git b/src/main/java/com/meishu/service/CourseTreeExerciseStudentResultService.java a/src/main/java/com/meishu/service/CourseTreeExerciseStudentResultService.java new file mode 100644 index 0000000..3d101a3 --- /dev/null +++ a/src/main/java/com/meishu/service/CourseTreeExerciseStudentResultService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.CourseTreeExerciseStudentResultDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 课程--学生做题记录 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-25 + */ +public interface CourseTreeExerciseStudentResultService extends IService { + +} diff --git b/src/main/java/com/meishu/service/CourseTreeVodStudentResultService.java a/src/main/java/com/meishu/service/CourseTreeVodStudentResultService.java new file mode 100644 index 0000000..a046276 --- /dev/null +++ a/src/main/java/com/meishu/service/CourseTreeVodStudentResultService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.CourseTreeVodStudentResultDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 学生视频完成情况 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +public interface CourseTreeVodStudentResultService extends IService { + +} diff --git b/src/main/java/com/meishu/service/DepartmentDictService.java a/src/main/java/com/meishu/service/DepartmentDictService.java new file mode 100644 index 0000000..757df3d --- /dev/null +++ a/src/main/java/com/meishu/service/DepartmentDictService.java @@ -0,0 +1,40 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.department.BatchOprDTO; +import com.meishu.dto.department.GetAllDepartmentVO; +import com.meishu.dto.department.GetTeachersDTO; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.model.AdministerDO; +import com.meishu.model.DepartmentDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.administer.GetTeachersVO; + +import java.util.List; + +/** + *

+ * 部门字典表 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +public interface DepartmentDictService extends IService { + + + List getDepartmentInfo(); + + List getDepartmentList(GetSubjectTreeDTO getSubjectTreeDTO); + + String addDepartment(DepartmentDictDO departmentDictDO); + + IPage getTeachers(GetTeachersDTO getTeachersDTO); + + String batchOpr(BatchOprDTO batchOprDTO); + + String deleteDepartment(BatchOprDTO batchOprDTO); + + String updateDepartment(DepartmentDictDO departmentDictDO); + +} diff --git b/src/main/java/com/meishu/service/ExerciseCourseTreeMappingService.java a/src/main/java/com/meishu/service/ExerciseCourseTreeMappingService.java new file mode 100644 index 0000000..22dd70a --- /dev/null +++ a/src/main/java/com/meishu/service/ExerciseCourseTreeMappingService.java @@ -0,0 +1,22 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.exercise.QueryCourseTreeExerciseDTO; +import com.meishu.dto.exercise.UpdateStatusDTO; +import com.meishu.model.ExerciseCourseTreeMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.ExerciseTreeMappingDO; +import com.meishu.vo.exercise.QueryCourseTreeExerciseVO; + +/** + *

+ * 课程知识树--题目字典表 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-24 + */ +public interface ExerciseCourseTreeMappingService extends IService { + + String updateStatus(UpdateStatusDTO updateStatusDTO); +} diff --git b/src/main/java/com/meishu/service/ExerciseDictService.java a/src/main/java/com/meishu/service/ExerciseDictService.java new file mode 100644 index 0000000..cadd6ba --- /dev/null +++ a/src/main/java/com/meishu/service/ExerciseDictService.java @@ -0,0 +1,48 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.exercise.AddExerciseDTO; +import com.meishu.dto.exercise.CheckExerciseDTO; +import com.meishu.dto.exercise.GetTreeExercisesDTO; +import com.meishu.dto.voddict.GetToCheckVodCountsDTO; +import com.meishu.dto.voddict.PublicCheckingDTO; +import com.meishu.model.ExerciseDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.ExerciseTreeMappingDO; +import com.meishu.vo.exercise.GetExerciseDetailVO; +import com.meishu.vo.exercise.GetTreeExercisesVO; +import com.meishu.vo.voddict.GetToCheckCountsVO; + +/** + *

+ * 习题库 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +public interface ExerciseDictService extends IService { + + IPage getTreeExercises(GetTreeExercisesDTO getTreeExercisesDTO); + + IPage getCheckTreeExercises(GetTreeExercisesDTO getTreeExercisesDTO); + + String deleteExercise(ExerciseDictDO exerciseDictDO); + + String addExercise(AddExerciseDTO addExerciseDTO); + + String updateExercise(AddExerciseDTO addExerciseDTO); + + GetToCheckCountsVO getToCheckExeCounts(GetToCheckVodCountsDTO getToCheckVodCountsDTO); + + String checkExercise(CheckExerciseDTO checkExerciseDTO); + + IPage publicUpload(PublicCheckingDTO publicCheckingDTO); + + String withdraw(ExerciseDictDO exerciseDictDO); + + GetExerciseDetailVO getExerciseDetail(ExerciseDictDO exerciseDictDO); + + String setRelatedExercise(ExerciseTreeMappingDO exerciseTreeMappingDO); + +} diff --git b/src/main/java/com/meishu/service/ExerciseDoneHistoryService.java a/src/main/java/com/meishu/service/ExerciseDoneHistoryService.java new file mode 100644 index 0000000..f0e7883 --- /dev/null +++ a/src/main/java/com/meishu/service/ExerciseDoneHistoryService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ExerciseDoneHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 学生做题记录表 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +public interface ExerciseDoneHistoryService extends IService { + +} diff --git b/src/main/java/com/meishu/service/ExerciseExpandMappingService.java a/src/main/java/com/meishu/service/ExerciseExpandMappingService.java new file mode 100644 index 0000000..c7ca723 --- /dev/null +++ a/src/main/java/com/meishu/service/ExerciseExpandMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ExerciseExpandMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 学生--拓展习题映射表 服务类 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +public interface ExerciseExpandMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/ExerciseRelatedMappingService.java a/src/main/java/com/meishu/service/ExerciseRelatedMappingService.java new file mode 100644 index 0000000..7372453 --- /dev/null +++ a/src/main/java/com/meishu/service/ExerciseRelatedMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ExerciseRelatedMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 学生--拓展习题映射表 服务类 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +public interface ExerciseRelatedMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/ExerciseTreeMappingService.java a/src/main/java/com/meishu/service/ExerciseTreeMappingService.java new file mode 100644 index 0000000..dcc3c17 --- /dev/null +++ a/src/main/java/com/meishu/service/ExerciseTreeMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ExerciseTreeMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 题目知识树映射表 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +public interface ExerciseTreeMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/ExerciseUserInfoService.java a/src/main/java/com/meishu/service/ExerciseUserInfoService.java new file mode 100644 index 0000000..b703b88 --- /dev/null +++ a/src/main/java/com/meishu/service/ExerciseUserInfoService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.ExerciseUserInfoDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 题目收藏信息表 服务类 + *

+ * + * @author DengMin + * @since 2021-09-17 + */ +public interface ExerciseUserInfoService extends IService { + +} diff --git b/src/main/java/com/meishu/service/KnowledgeSubjectDictService.java a/src/main/java/com/meishu/service/KnowledgeSubjectDictService.java new file mode 100644 index 0000000..c985a20 --- /dev/null +++ a/src/main/java/com/meishu/service/KnowledgeSubjectDictService.java @@ -0,0 +1,41 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.subject.GetSubjectAdministerDTO; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.dto.subject.GetSubjectsDTO; +import com.meishu.model.AdministerDO; +import com.meishu.model.KnowledgeSubjectDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.subject.GetSubjectTreeVO; + +import java.util.List; + +/** + *

+ * 学科字典表 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +public interface KnowledgeSubjectDictService extends IService { + + + IPage getSubjects(GetSubjectsDTO getSubjectsDTO); + + List getAllSubjects(GetSubjectsDTO getSubjectsDTO); + + String updateSubject(KnowledgeSubjectDictDO subjectDictDO); + + String addSubject(KnowledgeSubjectDictDO subjectDictDO); + + String deleteSubject(KnowledgeSubjectDictDO subjectDictDO); + + List getSubjectTree(GetSubjectTreeDTO getSubjectTreeDTO); + + KnowledgeSubjectDictDO getSubject(KnowledgeSubjectDictDO subjectDictDO); + + List getSubjectAdminister(GetSubjectAdministerDTO getSubjectAdministerDTO); + +} diff --git b/src/main/java/com/meishu/service/LaboratoryAttendanceMappingService.java a/src/main/java/com/meishu/service/LaboratoryAttendanceMappingService.java new file mode 100644 index 0000000..7faf77c --- /dev/null +++ a/src/main/java/com/meishu/service/LaboratoryAttendanceMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.LaboratoryAttendanceMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 实验室场次预约考勤记录 服务类 + *

+ * + * @author DengMin + * @since 2021-09-15 + */ +public interface LaboratoryAttendanceMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/LaboratoryDictMappingService.java a/src/main/java/com/meishu/service/LaboratoryDictMappingService.java new file mode 100644 index 0000000..8d4524d --- /dev/null +++ a/src/main/java/com/meishu/service/LaboratoryDictMappingService.java @@ -0,0 +1,18 @@ +package com.meishu.service; + +import com.meishu.model.LaboratoryDictMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 实验室场次关联表 服务类 + *

+ * + * @author DengMin + * @since 2021-08-30 + */ +public interface LaboratoryDictMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/LaboratoryDictService.java a/src/main/java/com/meishu/service/LaboratoryDictService.java new file mode 100644 index 0000000..b6530ee --- /dev/null +++ a/src/main/java/com/meishu/service/LaboratoryDictService.java @@ -0,0 +1,29 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.laboratory.LaboratoryDictDTO; +import com.meishu.dto.laboratory.LaboratoryPageDTO; +import com.meishu.model.LaboratoryDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.laboratorySession.LaboratoryDictPageVO; + +/** + *

+ * 实验室 服务类 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +public interface LaboratoryDictService extends IService { + + IPage selectPage(LaboratoryPageDTO laboratoryPageDTO); + + void add(LaboratoryDictDTO laboratoryDictDO); + + void updateLaboratory(LaboratoryDictDTO laboratoryDictDO); + + void delete(Long id); + + LaboratoryDictDO getLaboratoryDicOne(String laboratoryType, String startDate); +} diff --git b/src/main/java/com/meishu/service/LaboratorySessionMappingService.java a/src/main/java/com/meishu/service/LaboratorySessionMappingService.java new file mode 100644 index 0000000..86525bb --- /dev/null +++ a/src/main/java/com/meishu/service/LaboratorySessionMappingService.java @@ -0,0 +1,40 @@ +package com.meishu.service; + +import com.meishu.dto.laboratorySession.CalendarStatusDTO; +import com.meishu.dto.laboratorySession.GetLaboratorySessionDTO; +import com.meishu.dto.laboratorySession.LaboratorySessionListDTO; +import com.meishu.dto.laboratorySession.SetLaboratorySessionDTO; +import com.meishu.model.LaboratorySessionMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.laboratorySession.*; + +import java.util.List; + +/** + *

+ * 实验室场次预约安排表 服务类 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +public interface LaboratorySessionMappingService extends IService { + + List getLaboratorySessionList(String startDate); + + void setLaboratorySession(SetLaboratorySessionDTO setLaboratorySessionDTO); + + void updateLaboratorySession(SetLaboratorySessionDTO setLaboratorySessionDTO); + + LaboratorySessionMappingVO getOneById(Long laboratorySessionId); + + List getCalendarStatus(CalendarStatusDTO calendarStatusDTO); + + StatisticsVO getLaboratorySessionStatistics(CalendarStatusDTO calendarStatusDTO); + + List getLaboratorySessionDate(GetLaboratorySessionDTO getLaboratorySessionDTO); + + List getLaboratorySession(GetLaboratorySessionDTO getLaboratorySessionDTO); + + void deleteLaboratorySession(SetLaboratorySessionDTO setLaboratorySessionDTO); +} diff --git b/src/main/java/com/meishu/service/LaboratoryUserMappingService.java a/src/main/java/com/meishu/service/LaboratoryUserMappingService.java new file mode 100644 index 0000000..f1a1f53 --- /dev/null +++ a/src/main/java/com/meishu/service/LaboratoryUserMappingService.java @@ -0,0 +1,29 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.laboratoryUser.ApplyDTO; +import com.meishu.dto.laboratoryUser.LaboratoryUserPageDTO; +import com.meishu.model.LaboratoryUserMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.laboratoryUser.LaboratoryUserPageVO; + +import java.util.List; + +/** + *

+ * 实验室场次预约报名记录 服务类 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +public interface LaboratoryUserMappingService extends IService { + + List getLaboratoryUserPage(LaboratoryUserPageDTO laboratoryUserPageDTO); + + void exportLaboratoryUser(LaboratoryUserPageDTO laboratoryUserPageDTO); + + void registration(ApplyDTO applyDTO); + + void cancelRegistration(ApplyDTO applyDTO); +} diff --git b/src/main/java/com/meishu/service/PermissionsDictService.java a/src/main/java/com/meishu/service/PermissionsDictService.java new file mode 100644 index 0000000..89edce0 --- /dev/null +++ a/src/main/java/com/meishu/service/PermissionsDictService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.PermissionsDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 权限表 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +public interface PermissionsDictService extends IService { + +} diff --git b/src/main/java/com/meishu/service/RoleAdministerMappingService.java a/src/main/java/com/meishu/service/RoleAdministerMappingService.java new file mode 100644 index 0000000..8c93cb8 --- /dev/null +++ a/src/main/java/com/meishu/service/RoleAdministerMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.RoleAdministerMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +public interface RoleAdministerMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/RoleDictService.java a/src/main/java/com/meishu/service/RoleDictService.java new file mode 100644 index 0000000..a029a7b --- /dev/null +++ a/src/main/java/com/meishu/service/RoleDictService.java @@ -0,0 +1,37 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.role.AddPermissionDTO; +import com.meishu.dto.role.DeletePermissionDTO; +import com.meishu.dto.role.GetRoleTeachersDTO; +import com.meishu.dto.role.RoleTeacherDTO; +import com.meishu.model.RoleDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.role.GetAllRolesVO; +import com.meishu.vo.role.GetRoleTeachersVO; + +import java.util.List; + +/** + *

+ * 角色表 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +public interface RoleDictService extends IService { + + List getAllRoles(); + + IPage getRoleTeachers(GetRoleTeachersDTO getRoleTeachersDTO); + + String removeTeacher(RoleTeacherDTO roleTeacherDTO); + + String roleTeacher(RoleTeacherDTO roleTeacherDTO); + + String addPermission(AddPermissionDTO addPermissionDTO); + + String deletePermission(DeletePermissionDTO deletePermissionDTO); + +} diff --git b/src/main/java/com/meishu/service/RolePermissionMappingService.java a/src/main/java/com/meishu/service/RolePermissionMappingService.java new file mode 100644 index 0000000..92c5281 --- /dev/null +++ a/src/main/java/com/meishu/service/RolePermissionMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.RolePermissionMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 系统用户角色表 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +public interface RolePermissionMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/SessionsDictService.java a/src/main/java/com/meishu/service/SessionsDictService.java new file mode 100644 index 0000000..e88a544 --- /dev/null +++ a/src/main/java/com/meishu/service/SessionsDictService.java @@ -0,0 +1,21 @@ +package com.meishu.service; + +import com.meishu.model.SessionsDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 场次字典表 服务类 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +public interface SessionsDictService extends IService { + + List getListById(Long laboratoryDictId); + + List getListSessionDictById(Long laboratoryDictId, String startDate); +} diff --git b/src/main/java/com/meishu/service/SignInRecordService.java a/src/main/java/com/meishu/service/SignInRecordService.java new file mode 100644 index 0000000..573e06f --- /dev/null +++ a/src/main/java/com/meishu/service/SignInRecordService.java @@ -0,0 +1,21 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.sign.ClassSignInDTO; +import com.meishu.model.SignInRecordDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.sign.ClassSignInVO; + +/** + *

+ * 学生签到表 服务类 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +public interface SignInRecordService extends IService { + + IPage classSignIn(ClassSignInDTO classSignInDTO); + +} diff --git b/src/main/java/com/meishu/service/SmsCodeService.java a/src/main/java/com/meishu/service/SmsCodeService.java new file mode 100644 index 0000000..2e053d3 --- /dev/null +++ a/src/main/java/com/meishu/service/SmsCodeService.java @@ -0,0 +1,18 @@ +package com.meishu.service; + +import com.meishu.dto.sms.SendVerifyCodeDTO; +import com.meishu.model.SmsCodeDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 短信验证码 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +public interface SmsCodeService extends IService { + + void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO); +} diff --git b/src/main/java/com/meishu/service/StudentService.java a/src/main/java/com/meishu/service/StudentService.java new file mode 100644 index 0000000..184e9c9 --- /dev/null +++ a/src/main/java/com/meishu/service/StudentService.java @@ -0,0 +1,41 @@ +package com.meishu.service; + +import com.meishu.dto.campus.BatchUpdateStatusDTO; +import com.meishu.dto.student.*; +import com.meishu.dto.subject.BatchStatusOprDTO; +import com.meishu.model.*; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.util.SMSUtils; +import com.meishu.vo.course.GetVodIndexVO; +import com.meishu.vo.course.QueryCourseInfoVO; +import com.meishu.vo.rule.GetOneExaminationDetailVO; +import com.meishu.vo.rule.GetStudentRulesVO; +import com.meishu.vo.student.*; + +import java.util.List; + +/** + *

+ * 白名单 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +public interface StudentService extends IService { + + String sendMsg(StudentDO studentDO); + + LoginVO login(SmsCodeDO smsCodeDO); + + String addStudent(StudentDO studentDO); + + String updateStudent(StudentDO studentDO); + + String batchUpdateStudent(BatchStatusOprDTO batchStatusOprDTO); + + String deleteStudent(DeleteStudentDTO deleteStudentDTO); + + QueryStudentVO queryStudent(StudentDO studentDO); + +} diff --git b/src/main/java/com/meishu/service/SubjectDictService.java a/src/main/java/com/meishu/service/SubjectDictService.java new file mode 100644 index 0000000..bb9717a --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectDictService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.SubjectDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 学校科目字典表 服务类 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ +public interface SubjectDictService extends IService { + +} diff --git b/src/main/java/com/meishu/service/SubjectDimensionDictService.java a/src/main/java/com/meishu/service/SubjectDimensionDictService.java new file mode 100644 index 0000000..adf7c0c --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectDimensionDictService.java @@ -0,0 +1,33 @@ +package com.meishu.service; + +import com.meishu.model.SubjectDimensionDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.SubjectDimensionStarDictDO; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.model.SubjectTestPublishGradeDO; +import com.meishu.vo.dimension.GetAllDimensionStarVO; + +import java.util.HashMap; +import java.util.List; + +/** + *

+ * 测评表 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +public interface SubjectDimensionDictService extends IService { + + List getAllDimensions(SubjectDimensionDictDO subjectDimensionDictDO); + + String deleteDimensionById(SubjectDimensionDictDO subjectDimensionDictDO); + + String updateDimension(SubjectDimensionDictDO subjectDimensionDictDO); + + String addDimension(SubjectDimensionDictDO subjectDimensionDictDO); + + List getAllDimensionStar(SubjectTestPublishGradeDO subjectTestPublishGradeDO); + +} diff --git b/src/main/java/com/meishu/service/SubjectDimensionStarDictService.java a/src/main/java/com/meishu/service/SubjectDimensionStarDictService.java new file mode 100644 index 0000000..f297ad8 --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectDimensionStarDictService.java @@ -0,0 +1,28 @@ +package com.meishu.service; + +import com.meishu.dto.dimension.AddStarDTO; +import com.meishu.dto.dimension.DeleteStarByIdDTO; +import com.meishu.model.SubjectDimensionStarDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.dimension.GetAllDimensionStarsVO; + +import java.util.List; + +/** + *

+ * 维度星级字典表 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +public interface SubjectDimensionStarDictService extends IService { + + List getAllDimensionStars(SubjectDimensionStarDictDO subjectDimensionStartDictDO); + + String deleteStarById(DeleteStarByIdDTO deleteDimensionByIdDTO); + + String addStar(AddStarDTO addStarDTO); + + String updateStar(AddStarDTO addStarDTO); +} diff --git b/src/main/java/com/meishu/service/SubjectRuleService.java a/src/main/java/com/meishu/service/SubjectRuleService.java new file mode 100644 index 0000000..832972b --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectRuleService.java @@ -0,0 +1,33 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.rule.GetAllRulesDTO; +import com.meishu.dto.rule.GetRuleReportDTO; +import com.meishu.model.SubjectRuleDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.rule.GetAllRulesVO; +import com.meishu.vo.rule.GetRuleReportVO; + +import java.util.List; + +/** + *

+ * 规则字典表 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-08 + */ +public interface SubjectRuleService extends IService { + + IPage getAllRules(GetAllRulesDTO getAllRulesDTO); + + List getRules(); + + String addRule(SubjectRuleDO subjectRuleDO); + + String updateRule(SubjectRuleDO subjectRuleDO); + + String deleteRule(SubjectRuleDO subjectRuleDO); + +} diff --git b/src/main/java/com/meishu/service/SubjectSemesterService.java a/src/main/java/com/meishu/service/SubjectSemesterService.java new file mode 100644 index 0000000..9fb0c17 --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectSemesterService.java @@ -0,0 +1,35 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.semester.GetSemesterScoreDTO; +import com.meishu.dto.semester.GetStudentDetailDTO; +import com.meishu.dto.semester.GetStudentRecordDTO; +import com.meishu.model.SubjectSemesterDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.semester.*; + +import java.util.List; + +/** + *

+ * 服务类 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +public interface SubjectSemesterService extends IService { + + List getAllStudyingSemester(); + + List getAllPastSemester(); + + IPage getSemesterScore(GetSemesterScoreDTO getSemesterScoreDTO); + + List exportScore(GetSemesterScoreDTO getSemesterScoreDTO); + + IPage getStudentDetail(GetStudentDetailDTO getStudentDetailDTO); + + List getStudentRecord(GetStudentRecordDTO getStudentRecordDTO); + +} diff --git b/src/main/java/com/meishu/service/SubjectStarTreeMappingService.java a/src/main/java/com/meishu/service/SubjectStarTreeMappingService.java new file mode 100644 index 0000000..400228c --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectStarTreeMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.SubjectStarTreeMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 测评-知识点关联表 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +public interface SubjectStarTreeMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/SubjectStudentAnswerStarService.java a/src/main/java/com/meishu/service/SubjectStudentAnswerStarService.java new file mode 100644 index 0000000..499d4eb --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectStudentAnswerStarService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.SubjectStudentAnswerStarDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 学生答卷星级表 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +public interface SubjectStudentAnswerStarService extends IService { + +} diff --git b/src/main/java/com/meishu/service/SubjectTestDictService.java a/src/main/java/com/meishu/service/SubjectTestDictService.java new file mode 100644 index 0000000..97edfba --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectTestDictService.java @@ -0,0 +1,32 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.dto.test.GetAllTestDTO; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.vo.test.GetAllTestVO; +import com.meishu.vo.test.GetTestReportVO; + +import java.util.List; + +/** + *

+ * 测评表 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-20 + */ +public interface SubjectTestDictService extends IService { + + IPage getAllTest(GetAllTestDTO getAllTestDTO); + + List getTest(GetAllTestDTO getAllTestDTO); + + String insertTest(SubjectTestDictDO subjectTestDictDO); + + String updateTest(SubjectTestDictDO subjectTestDictDO); + + String deleteByTestId(SubjectTestDictDO subjectTestDictDO); + +} diff --git b/src/main/java/com/meishu/service/SubjectTestGradeExampleMappingService.java a/src/main/java/com/meishu/service/SubjectTestGradeExampleMappingService.java new file mode 100644 index 0000000..f4d1f48 --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectTestGradeExampleMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.SubjectTestGradeExampleMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 样卷映射表 服务类 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +public interface SubjectTestGradeExampleMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/SubjectTestGradeStarMappingService.java a/src/main/java/com/meishu/service/SubjectTestGradeStarMappingService.java new file mode 100644 index 0000000..b0bda0f --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectTestGradeStarMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.SubjectTestGradeStarMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 档次星级映射表 服务类 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +public interface SubjectTestGradeStarMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/SubjectTestPublishGradeService.java a/src/main/java/com/meishu/service/SubjectTestPublishGradeService.java new file mode 100644 index 0000000..b89d876 --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectTestPublishGradeService.java @@ -0,0 +1,33 @@ +package com.meishu.service; + +import com.meishu.dto.grade.AddGradeDTO; +import com.meishu.model.SubjectRuleDO; +import com.meishu.model.SubjectTestPublishGradeDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.grade.QueryOneGradeVO; + +import java.util.List; + +/** + *

+ * 档次表 服务类 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +public interface SubjectTestPublishGradeService extends IService { + + String addGrade(AddGradeDTO addGradeDTO); + + String deleteGrade(SubjectTestPublishGradeDO subjectTestPublishGradeDO); + + List queryGrade(SubjectTestPublishGradeDO subjectTestPublishGradeDO); + + QueryOneGradeVO queryOneGrade(SubjectTestPublishGradeDO subjectTestPublishGradeDO); + + String updateGrade(AddGradeDTO addGradeDTO); + + SubjectRuleDO getRuleIdByPublishId(SubjectTestPublishGradeDO subjectTestPublishGradeDO); + +} diff --git b/src/main/java/com/meishu/service/SubjectTestPublishHistoryService.java a/src/main/java/com/meishu/service/SubjectTestPublishHistoryService.java new file mode 100644 index 0000000..282d2e5 --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectTestPublishHistoryService.java @@ -0,0 +1,37 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.test.*; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.model.SubjectTestPublishHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.test.GetOnePublishVO; +import com.meishu.vo.test.GetPublishHistoryVO; +import com.meishu.vo.test.GetTestReportVO; + +import java.util.List; + +/** + *

+ * 测评发布记录表 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-08 + */ +public interface SubjectTestPublishHistoryService extends IService { + + String publishTest(PublishTestDTO publishTestDTO); + + String updatePublish(PublishTestDTO publishTestDTO); + + IPage getPublishHistory(GetPublishHistoryDTO getPublishHistoryDTO); + + IPage getTestReport(GetTestReportDTO getTestReportDTO); + + IPage getOnePublish(GetOnePublishDTO getOnePublishDTO); + + String comment(CommentDTO commentDTO); + + String deletePublish(SubjectTestPublishHistoryDO subjectTestPublishHistoryDO); +} diff --git b/src/main/java/com/meishu/service/SubjectTestStudentAnswerService.java a/src/main/java/com/meishu/service/SubjectTestStudentAnswerService.java new file mode 100644 index 0000000..5d06a3e --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectTestStudentAnswerService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.SubjectTestStudentAnswerDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 学生月考答卷 服务类 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +public interface SubjectTestStudentAnswerService extends IService { + +} diff --git b/src/main/java/com/meishu/service/SubjectTreeService.java a/src/main/java/com/meishu/service/SubjectTreeService.java new file mode 100644 index 0000000..6427b2e --- /dev/null +++ a/src/main/java/com/meishu/service/SubjectTreeService.java @@ -0,0 +1,32 @@ +package com.meishu.service; + +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.dto.subject.UpdateTreeOrderDTO; +import com.meishu.model.SubjectTreeDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.subject.GetSubjectTreeVO; + +import java.util.List; + +/** + *

+ * 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +public interface SubjectTreeService extends IService { + + String updateSubjectTree(SubjectTreeDO subjectTreeDO); + + String addSubjectTree(SubjectTreeDO subjectTreeDO); + + String deleteSubjectTree(SubjectTreeDO subjectTreeDO); + + String updateTreeOrder(UpdateTreeOrderDTO updateTreeOrderDTO); + + List getTreesCnt(GetSubjectTreeDTO getSubjectTreeDTO); + + List getTreesCheckCnt(GetSubjectTreeDTO getSubjectTreeDTO); +} diff --git b/src/main/java/com/meishu/service/TaskCompletionStatusService.java a/src/main/java/com/meishu/service/TaskCompletionStatusService.java new file mode 100644 index 0000000..46d158d --- /dev/null +++ a/src/main/java/com/meishu/service/TaskCompletionStatusService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.TaskCompletionStatusDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 作业任务完成状态 服务类 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +public interface TaskCompletionStatusService extends IService { + +} diff --git b/src/main/java/com/meishu/service/TaskContentDoneInfoService.java a/src/main/java/com/meishu/service/TaskContentDoneInfoService.java new file mode 100644 index 0000000..db1e545 --- /dev/null +++ a/src/main/java/com/meishu/service/TaskContentDoneInfoService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.TaskContentDoneInfoDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author DengMin + * @since 2021-09-30 + */ +public interface TaskContentDoneInfoService extends IService { + +} diff --git b/src/main/java/com/meishu/service/TaskContentService.java a/src/main/java/com/meishu/service/TaskContentService.java new file mode 100644 index 0000000..9af7ae9 --- /dev/null +++ a/src/main/java/com/meishu/service/TaskContentService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.TaskContentDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 作业内容表(取题目,视频,书面作业) 服务类 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +public interface TaskContentService extends IService { + +} diff --git b/src/main/java/com/meishu/service/TaskDoneHistoryService.java a/src/main/java/com/meishu/service/TaskDoneHistoryService.java new file mode 100644 index 0000000..b423e88 --- /dev/null +++ a/src/main/java/com/meishu/service/TaskDoneHistoryService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.TaskDoneHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +public interface TaskDoneHistoryService extends IService { + +} diff --git b/src/main/java/com/meishu/service/UserRoleCopy1Service.java a/src/main/java/com/meishu/service/UserRoleCopy1Service.java new file mode 100644 index 0000000..c082a40 --- /dev/null +++ a/src/main/java/com/meishu/service/UserRoleCopy1Service.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.UserRoleCopy1DO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 学生表 服务类 + *

+ * + * @author DengMin + * @since 2021-09-23 + */ +public interface UserRoleCopy1Service extends IService { + +} diff --git b/src/main/java/com/meishu/service/UserRoleService.java a/src/main/java/com/meishu/service/UserRoleService.java new file mode 100644 index 0000000..a215605 --- /dev/null +++ a/src/main/java/com/meishu/service/UserRoleService.java @@ -0,0 +1,41 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.sms.VerifyCodeDTO; +import com.meishu.dto.userrole.AccountLoginDTO; +import com.meishu.dto.userrole.AddStudentsDTO; +import com.meishu.dto.userrole.QueryStudentsDTO; +import com.meishu.model.UserRoleDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.userrole.QueryStudentsVO; +import com.meishu.vo.userrole.UserInfoVO; +import com.meishu.vo.userrole.UserRoleVO; + +import java.util.List; + +/** + *

+ * 学生表 服务类 + *

+ * + * @author Tuyp + * @since 2021-08-16 + */ +public interface UserRoleService extends IService { + + IPage queryStudents(QueryStudentsDTO queryStudentsDTO); + + String addStudents(UserRoleDO userRoleDO); + + String updateStudent(UserRoleDO userRoleDO); + + List exportStudents(QueryStudentsDTO queryStudentsDTO); + + UserRoleVO login(VerifyCodeDTO verifyCodeDTO); + + UserInfoVO userInfo(Integer id); + + UserRoleVO accountLogin(AccountLoginDTO accountLoginDTO); + + void studycode(); +} diff --git b/src/main/java/com/meishu/service/UserSubjectMappingService.java a/src/main/java/com/meishu/service/UserSubjectMappingService.java new file mode 100644 index 0000000..7f57236 --- /dev/null +++ a/src/main/java/com/meishu/service/UserSubjectMappingService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.UserSubjectMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 老师-科目映射表 服务类 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ +public interface UserSubjectMappingService extends IService { + +} diff --git b/src/main/java/com/meishu/service/UserSubjectPermissionDictService.java a/src/main/java/com/meishu/service/UserSubjectPermissionDictService.java new file mode 100644 index 0000000..f5a0b06 --- /dev/null +++ a/src/main/java/com/meishu/service/UserSubjectPermissionDictService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.UserSubjectPermissionDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 平时成绩---老师班级权限 服务类 + *

+ * + * @author Tuyp + * @since 2021-08-18 + */ +public interface UserSubjectPermissionDictService extends IService { + +} diff --git b/src/main/java/com/meishu/service/UuidHistoryService.java a/src/main/java/com/meishu/service/UuidHistoryService.java new file mode 100644 index 0000000..40b980c --- /dev/null +++ a/src/main/java/com/meishu/service/UuidHistoryService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.UuidHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author DengMin + * @since 2021-09-29 + */ +public interface UuidHistoryService extends IService { + +} diff --git b/src/main/java/com/meishu/service/VodDictService.java a/src/main/java/com/meishu/service/VodDictService.java new file mode 100644 index 0000000..a92a9f1 --- /dev/null +++ a/src/main/java/com/meishu/service/VodDictService.java @@ -0,0 +1,53 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.voddict.*; +import com.meishu.model.VodDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.model.VodPlayHistoryDO; +import com.meishu.model.VodSubjectTreeMappingDO; +import com.meishu.vo.voddict.*; + +/** + *

+ * 视频字典表 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +public interface VodDictService extends IService { + + SignatureVO signature()throws Exception; + + IPage getTreeVods(GetTreeVodsDTO getTreeVodsDTO); + + IPage getCheckTreeVods(GetTreeVodsDTO getTreeVodsDTO); + + String deleteVod(VodDictDO vodDictDO); + + VodDictDO uploadVods(UploadVodsDTO uploadVodsDTO); + + String updateVod(UploadVodsDTO uploadVodsDTO); + + VodDictDO getVodInfo(VodDictDO vodDictDO); + + String insertPlayHistory(VodPlayHistoryDO vodPlayHistoryDO); + + GetToCheckCountsVO getToCheckVodCounts(GetToCheckVodCountsDTO getToCheckVodCountsDTO); + + String compressVodByCode(VodDictDO vodDictDO); + + String deleteOriginVod(DeleteOriginVodDTO deleteOriginVodDTO); + + String checkVod(CheckVodDTO checkVodDTO); + + IPage publicUpload(PublicCheckingDTO publicCheckingDTO); + + String withdraw(VodDictDO vodDictDO); + + GetVodDetailVO getVodDetail(VodDictDO vodDictDO); + + String setRelatedVod(VodSubjectTreeMappingDO vodSubjectTreeMappingDO); + +} diff --git b/src/main/java/com/meishu/service/VodPlayHistoryService.java a/src/main/java/com/meishu/service/VodPlayHistoryService.java new file mode 100644 index 0000000..69cd8c3 --- /dev/null +++ a/src/main/java/com/meishu/service/VodPlayHistoryService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.VodPlayHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 视频播放历史记录表 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +public interface VodPlayHistoryService extends IService { + +} diff --git b/src/main/java/com/meishu/service/VodSubjectTreeMappingService.java a/src/main/java/com/meishu/service/VodSubjectTreeMappingService.java new file mode 100644 index 0000000..7c9c461 --- /dev/null +++ a/src/main/java/com/meishu/service/VodSubjectTreeMappingService.java @@ -0,0 +1,23 @@ +package com.meishu.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.meishu.dto.subject.BatchStatusOprDTO; +import com.meishu.dto.subject.GetAllVodsStatusDTO; +import com.meishu.model.VodSubjectTreeMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.meishu.vo.subject.GetAllNoAuthenVodsVO; + +/** + *

+ * 视频知识点映射表 服务类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +public interface VodSubjectTreeMappingService extends IService { + + IPage getAllNoAuthenVods(GetAllVodsStatusDTO getAllNoAuthenVodsDTO); + + String batchStatusOpr(BatchStatusOprDTO batchStatusOprDTO); +} diff --git b/src/main/java/com/meishu/service/WrittenHomeworkService.java a/src/main/java/com/meishu/service/WrittenHomeworkService.java new file mode 100644 index 0000000..428feff --- /dev/null +++ a/src/main/java/com/meishu/service/WrittenHomeworkService.java @@ -0,0 +1,16 @@ +package com.meishu.service; + +import com.meishu.model.WrittenHomeworkDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 通知/附件作业表 服务类 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +public interface WrittenHomeworkService extends IService { + +} diff --git b/src/main/java/com/meishu/service/impl/AccessTokenServiceImpl.java a/src/main/java/com/meishu/service/impl/AccessTokenServiceImpl.java new file mode 100644 index 0000000..fe0c34f --- /dev/null +++ a/src/main/java/com/meishu/service/impl/AccessTokenServiceImpl.java @@ -0,0 +1,89 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.token.GetAllStudentsDTO; +import com.meishu.dto.token.GetAllTeachersDTO; +import com.meishu.mapper.AdministerMapper; +import com.meishu.mapper.UuidHistoryMapper; +import com.meishu.model.AccessTokenDO; +import com.meishu.mapper.AccessTokenMapper; +import com.meishu.model.AdministerDO; +import com.meishu.model.UserRoleDO; +import com.meishu.model.UuidHistoryDO; +import com.meishu.service.AccessTokenService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.SecretUtils; +import com.meishu.vo.accesstoken.GetAllStudentsVO; +import com.meishu.vo.accesstoken.GetAllTeachersVO; +import com.meishu.vo.administer.GetTeacherSubjectVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-10 + */ +@Service +public class AccessTokenServiceImpl extends ServiceImpl implements AccessTokenService { + + @Autowired + private AdministerMapper administerMapper; + + @Autowired + private UuidHistoryMapper uuidHistoryMapper; + + public List getAllTeachers(GetAllTeachersDTO getAllTeachersDTO){ + + int count = uuidHistoryMapper.selectCount(new QueryWrapper() + .lambda() + .eq(UuidHistoryDO::getUuid,getAllTeachersDTO.getUuid())); + + if (count>0){ + throw new HttpException(80001); + } + + String uuidSec = SecretUtils.hash(getAllTeachersDTO.getUuid()+"ixihs"); + if (!uuidSec.equals(getAllTeachersDTO.getUuidSecret())){ + throw new HttpException(80002); + } + + //查找所有老师 + List administerDOS = this.baseMapper.getAllTeachers(getAllTeachersDTO); + administerDOS.stream().forEach(x->{ + List getTeacherSubjectVOS = administerMapper.getTeacherSubject(x.getId()); + x.setSubjectDictDOS(getTeacherSubjectVOS); + }); + UuidHistoryDO uuidHistoryDO = new UuidHistoryDO(); + uuidHistoryDO.setUuid(getAllTeachersDTO.getUuid()); + uuidHistoryMapper.insert(uuidHistoryDO); + return administerDOS; + } + + public List getAllStudents(GetAllStudentsDTO getAllStudentsDTO){ + int count = uuidHistoryMapper.selectCount(new QueryWrapper() + .lambda() + .eq(UuidHistoryDO::getUuid,getAllStudentsDTO.getUuid())); + + if (count>0){ + throw new HttpException(80001); + } + + String uuidSec = SecretUtils.hash(getAllStudentsDTO.getUuid()+"ixihs"); + if (!uuidSec.equals(getAllStudentsDTO.getUuidSecret())){ + throw new HttpException(80002); + } + UuidHistoryDO uuidHistoryDO = new UuidHistoryDO(); + uuidHistoryDO.setUuid(getAllStudentsDTO.getUuid()); + uuidHistoryMapper.insert(uuidHistoryDO); + return this.baseMapper.getAllStudents(getAllStudentsDTO); + } + + +} diff --git b/src/main/java/com/meishu/service/impl/AdministerDepartmentMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/AdministerDepartmentMappingServiceImpl.java new file mode 100644 index 0000000..6c8d30a --- /dev/null +++ a/src/main/java/com/meishu/service/impl/AdministerDepartmentMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.AdministerDepartmentMappingDO; +import com.meishu.mapper.AdministerDepartmentMappingMapper; +import com.meishu.service.AdministerDepartmentMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 老师部门映射表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-07-01 + */ +@Service +public class AdministerDepartmentMappingServiceImpl extends ServiceImpl implements AdministerDepartmentMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/AdministerPermissionServiceImpl.java a/src/main/java/com/meishu/service/impl/AdministerPermissionServiceImpl.java new file mode 100644 index 0000000..a49c212 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/AdministerPermissionServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.AdministerPermissionDO; +import com.meishu.mapper.AdministerPermissionMapper; +import com.meishu.service.AdministerPermissionService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 系统用户角色表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@Service +public class AdministerPermissionServiceImpl extends ServiceImpl implements AdministerPermissionService { + +} diff --git b/src/main/java/com/meishu/service/impl/AdministerServiceImpl.java a/src/main/java/com/meishu/service/impl/AdministerServiceImpl.java new file mode 100644 index 0000000..2b5a112 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/AdministerServiceImpl.java @@ -0,0 +1,352 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.administer.*; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.AdministerService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.*; +import com.meishu.vo.administer.AdministerPermissionVO; +import com.meishu.vo.administer.LoginVO; +import com.meishu.vo.administer.PermissionsVO; +import com.meishu.vo.wechat.AccessTokenVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.StringUtils; + +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.List; + +/** + *

+ * 中心管理账户表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@Service +public class AdministerServiceImpl extends ServiceImpl implements AdministerService { + + @Autowired + private SmsCodeMapper smsCodeMapper; + + @Autowired + private AdministerPermissionMapper administerPermissionMapper; + + @Autowired + private PermissionsDictMapper permissionsDictMapper; + + @Autowired + private AdministerDepartmentMappingMapper administerDepartmentMappingMapper; + + @Autowired + private AdministerSubjectMappingMapper administerSubjectMappingMapper; + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + @Autowired + private SubjectTreeMapper subjectTreeMapper; + + @Autowired + private SubjectDictMapper subjectDictMapper; + + @Autowired + private ClassesDictMapper classesDictMapper; + + public String sendMsg(AdministerDO administerDO){ + + + //验证是否是白名单用户 + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(AdministerDO::getTelephone, administerDO.getTelephone())); + if (count == 0) { + throw new HttpException(10011); + } + + String verifyCode = RandomUtil.getRandomCode(6); + String param = "{ \"code\":\"" + verifyCode + "\"}"; + + //插入短信验证码 + smsCodeMapper.delete(new QueryWrapper() + .lambda() + .eq(SmsCodeDO::getTelephone,administerDO.getTelephone())); + + SmsCodeDO smsCodeDO = new SmsCodeDO(); + smsCodeDO.setTelephone(administerDO.getTelephone()); + smsCodeDO.setCode(verifyCode); + smsCodeDO.setCreateDate(LocalDateTime.now()); + smsCodeMapper.insert(smsCodeDO); + return SMSUtils.sendVerifySMS(ConstantUtils.TEMPLATE_CODE, smsCodeDO.getTelephone(), param); + + } + + public LoginVO login(SmsCodeDO smsCodeDO){ + + LoginVO loginVO = new LoginVO(); + Integer count = smsCodeMapper.selectCount(new QueryWrapper() + .lambda() + .eq(SmsCodeDO::getTelephone, smsCodeDO.getTelephone()) + .eq(SmsCodeDO::getCode, smsCodeDO.getCode()) + .gt(SmsCodeDO::getCreateDate, LocalDateTime.now().minusMinutes(10L)) + ); + + List admin = Arrays.asList("18111111111","18122222222","18133333333","18144444444","18155555555","18166666666","18177777777","18188888888","18199999999","18100000000"); + if (admin.contains(smsCodeDO.getTelephone())){ + if ("123456".equals(smsCodeDO.getCode())){ + AdministerDO administerDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(AdministerDO::getTelephone, smsCodeDO.getTelephone())); + if (administerDO == null) { + throw new HttpException(10013); + } + String token = JwtUtil.generateToken(administerDO.getId(), ConstantUtils.ADMINISTER_TERMINATE); + loginVO.setToken(token); + return loginVO; + }else { + throw new HttpException(10003); + } + } + + if (count > 0) { + AdministerDO administerDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(AdministerDO::getTelephone, smsCodeDO.getTelephone())); + if (administerDO == null) { + throw new HttpException(10013); + } + + String token = JwtUtil.generateToken(administerDO.getId(), ConstantUtils.ADMINISTER_TERMINATE); + loginVO.setToken(token); + return loginVO; + } else { + throw new HttpException(10003); + } + } + + public LoginVO passwordLogin(AdministerDO administerDO){ + + LoginVO loginVO = new LoginVO(); + AdministerDO administerDO1 = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(AdministerDO::getTelephone, administerDO.getTelephone()) + .eq(AdministerDO::getPassword,administerDO.getPassword())); + if (administerDO1 == null) { + throw new HttpException(10004); + } + + String token = JwtUtil.generateToken(administerDO1.getId(), ConstantUtils.ADMINISTER_TERMINATE); + loginVO.setToken(token); + return loginVO; + + } + + public AdministerPermissionVO getPermissions() { + + AdministerPermissionVO administerPermissionVO = new AdministerPermissionVO(); + AdministerDO administerDO = (AdministerDO) Localstorage.getUser(); +// AdministerDO administerDO = this.baseMapper.selectById(41); + if (administerDO == null) { + throw new HttpException(10012); + } + BeanUtils.copyProperties(administerDO, administerPermissionVO); + + //判断是否是超级管理员 + List roleAdministerMappingDOS = roleAdministerMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,administerDO.getId())); + + Boolean flag = false; + + for (RoleAdministerMappingDO roleAdministerMappingDO : roleAdministerMappingDOS){ + if (roleAdministerMappingDO.getRoleId()==1L){ + flag = true; + } + } + administerPermissionVO.setIsRole(flag); + List list = administerPermissionMapper.getPermissions(administerDO.getId()); + List treeList = new ArrayList(); + if (list != null) { + list.forEach(permission -> { + if (permission.getParentId() == null) { + treeList.add(permission); + } + + list.forEach(p -> { + if (null != p.getParentId() && p.getParentId().equals(permission.getId())) { + if (permission.getChildren() == null) { + permission.setChildren(new ArrayList<>()); + } + permission.getChildren().add(p); + } + }); + }); + } + administerPermissionVO.setPermissions(treeList); + return administerPermissionVO; + } + + public List getParentPermission(){ + return permissionsDictMapper.selectList(new QueryWrapper() + .lambda() + .isNull(PermissionsDictDO::getParentId)); + } + + @Transactional(rollbackFor = Exception.class) + public String addAdminister(AddAdministerDTO addAdministerDTO){ + + //老师手机号不能重复 + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(AdministerDO::getTelephone,addAdministerDTO.getTelephone())); + + if (count>0){ + throw new HttpException(60001); + } + + AdministerDO administerDO = new AdministerDO(); + BeanUtils.copyProperties(addAdministerDTO,administerDO); + administerDO.setStatus("1"); + this.baseMapper.insert(administerDO); + +// //多个校区 +// List campusIds = addAdministerDTO.getCampusIds(); +// for (Long lg : campusIds){ +// CampusAdministerMappingDO campusAdministerMappingDO = new CampusAdministerMappingDO(); +// campusAdministerMappingDO.setAdministerId(administerDO.getId()); +// campusAdministerMappingDO.setCampusId(lg); +// campusAdministerMappingMapper.insert(campusAdministerMappingDO); +// } + + //多个部门 + List departmentIds = addAdministerDTO.getDepartmentIds(); + for (Long lg : departmentIds){ + AdministerDepartmentMappingDO administerDepartmentMappingDO = new AdministerDepartmentMappingDO(); + administerDepartmentMappingDO.setAdministerId(administerDO.getId()); + administerDepartmentMappingDO.setDepartmentId(lg); + administerDepartmentMappingMapper.insert(administerDepartmentMappingDO); + } + + //多个科目 + List subjectIds = addAdministerDTO.getSubjectIds(); + for (Long lg : subjectIds){ + AdministerSubjectMappingDO administerSubjectMappingDO = new AdministerSubjectMappingDO(); + administerSubjectMappingDO.setAdministerId(administerDO.getId()); + administerSubjectMappingDO.setSubjectId(lg); + administerSubjectMappingMapper.insert(administerSubjectMappingDO); + } + + //角色 + List roleIds = addAdministerDTO.getRoleIds(); + for (Long lg : roleIds){ + RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO(); + roleAdministerMappingDO.setAdministerId(administerDO.getId()); + roleAdministerMappingDO.setRoleId(lg); + roleAdministerMappingMapper.insert(roleAdministerMappingDO); + } + + return ConstantUtils.ADD_SUCCESS; + } + + public List getPermissionTree(){ + List list = permissionsDictMapper.selectList(null); + List treeList = new ArrayList(); + if (list != null) { + list.forEach(permission -> { + if (permission.getParentId() == null) { + treeList.add(permission); + } + + list.forEach(p -> { + if (null != p.getParentId() && p.getParentId().equals(permission.getId())) { + if (permission.getChildren() == null) { + permission.setChildren(new ArrayList<>()); + } + permission.getChildren().add(p); + } + }); + }); + } + return treeList; + } + + public String changeStatus(ChangeStatusDTO changeStatusDTO){ + AdministerDO administerDO = new AdministerDO(); + administerDO.setStatus(changeStatusDTO.getStatus()); + this.baseMapper.update(administerDO,new QueryWrapper() + .lambda() + .in(AdministerDO::getId,changeStatusDTO.getIds())); +// this.baseMapper.updateById(administerDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + @Transactional(rollbackFor = Exception.class) + public String updateAdminister(UpdateAdministerDTO updateAdministerDTO){ + + AdministerDO administerDO = new AdministerDO(); + BeanUtils.copyProperties(updateAdministerDTO,administerDO); + this.baseMapper.updateById(administerDO); + + if (null!=updateAdministerDTO.getDepartmentIds()){ + administerDepartmentMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(AdministerDepartmentMappingDO::getAdministerId,updateAdministerDTO.getId())); + + List departmentIds = updateAdministerDTO.getDepartmentIds(); + for (Long lg : departmentIds){ + AdministerDepartmentMappingDO administerDepartmentMappingDO = new AdministerDepartmentMappingDO(); + administerDepartmentMappingDO.setDepartmentId(lg); + administerDepartmentMappingDO.setAdministerId(updateAdministerDTO.getId()); + administerDepartmentMappingMapper.insert(administerDepartmentMappingDO); + } + } + + if (null!=updateAdministerDTO.getSubjectIds()){ + + administerSubjectMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(AdministerSubjectMappingDO::getAdministerId,updateAdministerDTO.getId())); + //多个科目 + List subjectIds = updateAdministerDTO.getSubjectIds(); + for (Long lg : subjectIds){ + AdministerSubjectMappingDO administerSubjectMappingDO = new AdministerSubjectMappingDO(); + administerSubjectMappingDO.setAdministerId(administerDO.getId()); + administerSubjectMappingDO.setSubjectId(lg); + administerSubjectMappingMapper.insert(administerSubjectMappingDO); + } + } + + if (null!=updateAdministerDTO.getRoleIds()){ + roleAdministerMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,updateAdministerDTO.getId())); + List roleIds = updateAdministerDTO.getRoleIds(); + for (Long lg : roleIds){ + RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO(); + roleAdministerMappingDO.setAdministerId(updateAdministerDTO.getId()); + roleAdministerMappingDO.setRoleId(lg); + roleAdministerMappingMapper.insert(roleAdministerMappingDO); + } + + } + return ConstantUtils.SUCCESS_UPDATE; + } + + public List getAllAdminister(){ + return this.baseMapper.selectList(null); + } + + +} diff --git b/src/main/java/com/meishu/service/impl/AdministerSubjectMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/AdministerSubjectMappingServiceImpl.java new file mode 100644 index 0000000..e2f2f63 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/AdministerSubjectMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.AdministerSubjectMappingDO; +import com.meishu.mapper.AdministerSubjectMappingMapper; +import com.meishu.service.AdministerSubjectMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 老师科目映射表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-07-01 + */ +@Service +public class AdministerSubjectMappingServiceImpl extends ServiceImpl implements AdministerSubjectMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/AnsweringQuestionServiceImpl.java a/src/main/java/com/meishu/service/impl/AnsweringQuestionServiceImpl.java new file mode 100644 index 0000000..3b7b803 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/AnsweringQuestionServiceImpl.java @@ -0,0 +1,103 @@ +package com.meishu.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.meishu.dto.question.QueryQuestionsDTO; +import com.meishu.mapper.SubjectDictMapper; +import com.meishu.mapper.UserRoleMapper; +import com.meishu.mapper.UserSubjectPermissionDictMapper; +import com.meishu.model.AnsweringQuestionDO; +import com.meishu.mapper.AnsweringQuestionMapper; +import com.meishu.model.SubjectDictDO; +import com.meishu.model.UserRoleDO; +import com.meishu.model.UserSubjectPermissionDictDO; +import com.meishu.service.AnsweringQuestionService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.question.GetClassQuestionsVO; +import com.meishu.vo.question.QueryOneQuestionVO; +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; +import java.util.Queue; + +/** + *

+ * 问题答疑表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +@Service +public class AnsweringQuestionServiceImpl extends ServiceImpl implements AnsweringQuestionService { + + @Autowired + private UserRoleMapper userRoleMapper; + + @Autowired + private SubjectDictMapper subjectDictMapper; + + @Autowired + private UserSubjectPermissionDictMapper userSubjectPermissionDictMapper; + + public IPage queryQuestions(QueryQuestionsDTO queryQuestionsDTO){ + Page pager = new Page(queryQuestionsDTO.getPageNum(), queryQuestionsDTO.getPageSize()); + return this.baseMapper.queryQuestions(pager,queryQuestionsDTO.getSubjectId(),queryQuestionsDTO.getStartDate(),queryQuestionsDTO.getEndDate(),queryQuestionsDTO.getUserName()); + } + + public String deleteQuestion(AnsweringQuestionDO answeringQuestionDO){ + this.baseMapper.deleteById(answeringQuestionDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public QueryOneQuestionVO queryOneQuestion(AnsweringQuestionDO answeringQuestionDO){ + + QueryOneQuestionVO queryOneQuestionVO = new QueryOneQuestionVO(); + + AnsweringQuestionDO answeringQuestionDO1 = this.baseMapper.selectById(answeringQuestionDO.getId()); + BeanUtils.copyProperties(answeringQuestionDO1,queryOneQuestionVO); + + UserRoleDO userRoleDO = userRoleMapper.selectById(answeringQuestionDO1.getAskId()); + queryOneQuestionVO.setUserName(userRoleDO.getUserName()); + + return queryOneQuestionVO; + } + + public List getClassQuestions(UserSubjectPermissionDictDO userSubjectPermissionDictDO){ + + List userSubjectPermissionDictDOS = userSubjectPermissionDictMapper.getSubjects(userSubjectPermissionDictDO.getUserId()); + + List getClassQuestionsVOS = new ArrayList<>(); + userSubjectPermissionDictDOS.stream().forEach(x->{ + GetClassQuestionsVO getClassQuestionsVO = new GetClassQuestionsVO(); + + BeanUtils.copyProperties(x,getClassQuestionsVO); + + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .isNull(AnsweringQuestionDO::getAnswer)); + getClassQuestionsVO.setCount(count); + + getClassQuestionsVOS.add(getClassQuestionsVO); + + }); + + return getClassQuestionsVOS; + } + + public String addQuestion(AnsweringQuestionDO answeringQuestionDO){ + this.baseMapper.insert(answeringQuestionDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String answerQuestion(AnsweringQuestionDO answeringQuestionDO){ + this.baseMapper.updateById(answeringQuestionDO); + return ConstantUtils.SUCCESS_UPDATE; + } + +} diff --git b/src/main/java/com/meishu/service/impl/ClassSubjectTaskServiceImpl.java a/src/main/java/com/meishu/service/impl/ClassSubjectTaskServiceImpl.java new file mode 100644 index 0000000..7ce3529 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/ClassSubjectTaskServiceImpl.java @@ -0,0 +1,1280 @@ +package com.meishu.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.meishu.common.configure.RestTemplateConfig; +import com.meishu.common.configure.WechatConfig; +import com.meishu.common.constant.Code; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.administer.PublishExpandingVO; +import com.meishu.dto.administer.PublishHomeworkVO; +import com.meishu.dto.administer.PublishTasksDTO; +import com.meishu.dto.administer.PushMsgPO; +import com.meishu.dto.exercise.GetExerciseRequestDTO; +import com.meishu.dto.task.*; +import com.meishu.dto.wechat.PushMsgVO; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.ClassSubjectTaskService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.MathUtil; +import com.meishu.vo.PerStudentComplicationVO; +import com.meishu.vo.administer.GetClassesDetailResponseVO; +import com.meishu.vo.exercise.GetExerciseDetailResponseVO; +import com.meishu.vo.task.*; +import com.meishu.vo.wechat.AccessTokenVO; +import org.apache.commons.lang.text.StrBuilder; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.net.URLDecoder; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Stream; + +/** + *

+ * 学习任务列表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@Service +public class ClassSubjectTaskServiceImpl extends ServiceImpl implements ClassSubjectTaskService { + + @Autowired + private SubjectTreeMapper subjectTreeMapper; + + @Autowired + private SubjectDictMapper subjectDictMapper; + + @Autowired + private ClassesDictMapper classesDictMapper; + + @Autowired + private TaskContentMapper taskContentMapper; + + @Autowired + private WrittenHomeworkMapper writtenHomeworkMapper; + + @Autowired + private ExerciseExpandMappingMapper exerciseExpandMappingMapper; + + @Autowired + private ClassSubjectTaskMapper classSubjectTaskMapper; + + @Autowired + private AdministerMapper administerMapper; + + @Autowired + private UserRoleMapper userRoleMapper; + + @Autowired + private WechatConfig wechatConfig; + + @Autowired + private RestTemplateConfig restTemplateConfig; + + @Autowired + private TaskDoneHistoryMapper taskDoneHistoryMapper; + + @Autowired + private ClassesUserMappingMapper classesUserMappingMapper; + + @Autowired + private VodDictMapper vodDictMapper; + + @Autowired + private ExerciseDictMapper exerciseDictMapper; + + @Autowired + private ExerciseTreeMappingMapper exerciseTreeMappingMapper; + + @Autowired + private TaskCompletionStatusMapper taskCompletionStatusMapper; + + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + @Autowired + private ExerciseDoneHistoryMapper exerciseDoneHistoryMapper; + + @Autowired + private ExerciseUserInfoMapper exerciseUserInfoMapper; + + @Autowired + private KnowledgeSubjectDictMapper knowledgeSubjectDictMapper; + + @Autowired + private ExerciseRelatedMappingMapper exerciseRelatedMappingMapper; + + @Autowired + private TaskContentDoneInfoMapper taskContentDoneInfoMapper; + + public String code(String telephone) { + + SimpleDateFormat sj1 = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); + String current = sj1.format(new Date()); + String[] arrTemp = current.split(" "); + + String[] timeArr = arrTemp[1].split(":"); + Integer first = Integer.valueOf(timeArr[1].substring(0, 1)); + Integer second = Integer.valueOf(timeArr[0].substring(0, 1)); + Integer third = Integer.valueOf(timeArr[0].substring(1)); + Integer fourth = Integer.valueOf(timeArr[1].substring(1)); + return telephone.charAt(first) + "->" + telephone.charAt(second) + "->" + telephone.charAt(third) + "->" + telephone.charAt(fourth); + + } + + public List getTeacherClass(GetClassesRequestVO getClassesRequestVO) { + + List getTeacherClassVOS = new ArrayList<>(); + + HashMap> hashMap = new HashMap<>(); + + List getClassesDetailResponseVOS = null; + + List getClassesDetailResponseVOS1 = administerMapper.getClasses(getClassesRequestVO); + for (GetClassesDetailResponseVO gcr : getClassesDetailResponseVOS1) { + GetClassesDetailResponseVO getClassesDetailResponseVO = new GetClassesDetailResponseVO(); + if (!hashMap.containsKey(gcr.getSubject())) { + getClassesDetailResponseVOS = new ArrayList<>(); + BeanUtils.copyProperties(gcr, getClassesDetailResponseVO); + getClassesDetailResponseVOS.add(getClassesDetailResponseVO); + hashMap.put(gcr.getSubject(), getClassesDetailResponseVOS); + } else { + BeanUtils.copyProperties(gcr, getClassesDetailResponseVO); + hashMap.get(gcr.getSubject()).add(getClassesDetailResponseVO); + } + } + + for (String key : hashMap.keySet()) { + TeacherClassVO getTeachersVO = new TeacherClassVO(); + getTeachersVO.setSubject(key); + KnowledgeSubjectDictDO knowledgeSubjectDict = knowledgeSubjectDictMapper.selectOne(new QueryWrapper() + .lambda() + .eq(KnowledgeSubjectDictDO::getSubjectName, key)); + getTeachersVO.setSubjectId(knowledgeSubjectDict.getId()); + getTeachersVO.setGetClassesDetailResponseVOS(hashMap.get(key)); + getTeacherClassVOS.add(getTeachersVO); + } + + return getTeacherClassVOS; + } + + public String publishTasks(PublishTasksDTO publishTasksDTO) { + + //保存任务信息 + ClassSubjectTaskDO classSubjectTask = new ClassSubjectTaskDO(); + PushMsgPO pushMsgPO = new PushMsgPO(); + + if (null == publishTasksDTO.getTaskDate()) { + classSubjectTask.setTaskDate(new Date()); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String dateStr = simpleDateFormat.format(new Date()); + pushMsgPO.setDateTime(dateStr); + } else { + classSubjectTask.setTaskDate(publishTasksDTO.getTaskDate()); + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String dateStr = simpleDateFormat.format(publishTasksDTO.getTaskDate()); + pushMsgPO.setDateTime(dateStr); + } + classSubjectTask.setTreeId(publishTasksDTO.getTreeIds()); + classSubjectTask.setTaskType(publishTasksDTO.getTaskType()); + classSubjectTask.setTeacherId(publishTasksDTO.getUserId()); + classSubjectTask.setCreateDate(new Date()); + classSubjectTask.setUpdateDate(new Date()); + List subjectIds = publishTasksDTO.getSubjectIds(); + for (String subjectId : subjectIds) { + classSubjectTask.setSubjectId(Integer.valueOf(subjectId)); + if (StringUtils.isEmpty(publishTasksDTO.getTreeName())) { + String treeName = this.labels(publishTasksDTO.getTreeIds()); + classSubjectTask.setTreeName(treeName); + pushMsgPO.setTaskName(treeName); + } else { + classSubjectTask.setTreeName(publishTasksDTO.getTreeName()); + pushMsgPO.setTaskName(publishTasksDTO.getTreeName()); + } + SubjectDictDO subjectDict = subjectDictMapper.selectById(subjectId); + + //学期信息录入 + classSubjectTask.setGrade(subjectDict.getGrade()); + classSubjectTask.setClasses(subjectDict.getClasses()); + classSubjectTask.setSession(subjectDict.getSession()); + + ClassesDictDO classesDictTmp = classesDictMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ClassesDictDO::getGrade, subjectDict.getGrade()) + .eq(ClassesDictDO::getClasses, subjectDict.getClasses()) + .eq(ClassesDictDO::getSession, subjectDict.getSession())); + + classSubjectTask.setClassId(classesDictTmp.getId()); + this.baseMapper.insert(classSubjectTask); + addTaskContents(publishTasksDTO, classSubjectTask.getId(),classesDictTmp.getId(),classSubjectTask.getTreeName()); + + //立即发布的作业需要微信提醒,延时发布的作业定时任务通知 + //找到发布对象 + + List exerciseExpandMappings = exerciseExpandMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ExerciseExpandMappingDO::getTaskId, classSubjectTask.getId())); + List strings = new ArrayList<>(); + + AdministerDO administerDO = administerMapper.selectById(publishTasksDTO.getUserId()); + + List users1 = new ArrayList<>(); + if (classSubjectTask.getTaskType() == 2 && exerciseExpandMappings.size() > 0) { + pushMsgPO.setTaskName(exerciseExpandMappings.get(0).getExerciseName()); + strings = Arrays.asList(exerciseExpandMappings.get(0).getStudentIds().split(",")); + users1 = userRoleMapper.selectBatchIds(strings); + + } else { + ClassesDictDO classesDict = classesDictMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ClassesDictDO::getGrade, subjectDict.getGrade()) + .eq(ClassesDictDO::getClasses, subjectDict.getClasses()) + .eq(ClassesDictDO::getSession, subjectDict.getSession())); + users1 = userRoleMapper.findOpenIdByClassId(classesDict.getId()); + } + + pushMsgPO.setTitle("你有新任务,请注意查收"); + pushMsgPO.setSchool(subjectDict.getSchool()); + pushMsgPO.setTeacherName(administerDO.getUserName()); + + String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" + wechatConfig.getAppId() + "&secret=" + wechatConfig.getAppSecret(); + ResponseEntity response = restTemplateConfig.restTemplate() + .exchange(url, HttpMethod.GET, null, AccessTokenVO.class); + + String token = response.getBody().getAccess_token(); +// pushMsgPO.setRemark("这是一个备注"); //备注 + for (UserRoleDO user : users1) { + pushMsgPO.setOpenId(user.getOpenId()); + pushMsg(pushMsgPO, token); + } + } + return ConstantUtils.SUCCESS_SEND_OUT; + } + + public IPage getTaskById(GetTaskByIdRequestDTO getTaskByIdRequestDTO) { + + Page pager = new Page(getTaskByIdRequestDTO.getPageNum(), getTaskByIdRequestDTO.getPageSize()); + + //已经发布的任务 + getTaskByIdRequestDTO.setCurrentDate(new Date()); + + SubjectDictDO subjectDict = subjectDictMapper.selectById(getTaskByIdRequestDTO.getSubjectId()); + + //找到科目所在班级 + ClassesDictDO classesDict = classesDictMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ClassesDictDO::getClasses, subjectDict.getClasses()) + .eq(ClassesDictDO::getGrade, subjectDict.getGrade()) + .eq(ClassesDictDO::getSession, subjectDict.getSession()) + .eq(ClassesDictDO::getStatus, "在读")); + + if (null != classesDict) { + getTaskByIdRequestDTO.setClassId(classesDict.getId()); + } + + IPage classSubjectTasks = classSubjectTaskMapper.queryAlreadyTasks(pager, getTaskByIdRequestDTO.getClassId(), getTaskByIdRequestDTO.getSubjectId(), getTaskByIdRequestDTO.getStartDate(), getTaskByIdRequestDTO.getEndDate(), getTaskByIdRequestDTO.getTaskType()); + + List getTaskByIdVOS = classSubjectTasks.getRecords(); + getTaskByIdVOS.stream().forEach(x->{ + List ids = Arrays.asList(x.getTreeId().split(",")); + List subjectTreeDOS = subjectTreeMapper.selectBatchIds(ids); + x.setSubjectTreeDOS(subjectTreeDOS); + List knowledge = new ArrayList<>(); + for (SubjectTreeDO subjectTreeDO : subjectTreeDOS){ + knowledge.add(subjectTreeDO.getTreeName()); + } + x.setKnowledges(knowledge); + }); + + return classSubjectTasks; + } + + public String deletePreTasks(ClassSubjectTaskDO classSubjectTask) { + + //class_subject_task + classSubjectTaskMapper.deleteById(classSubjectTask.getId()); + + //task_content 微视频,关联习题,书面作业 + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("task_id", classSubjectTask.getId()); + taskContentMapper.delete(queryWrapper); + + //拓展习题 + exerciseExpandMappingMapper.delete(queryWrapper); + + //学生完成该任务的记录 + taskDoneHistoryMapper.delete(new QueryWrapper() + .lambda() + .eq(TaskDoneHistoryDO::getTaskId, classSubjectTask.getId())); + + return ConstantUtils.DELETE_SUCCESS; + } + + public QueryTaskDetailResponseVO queryTaskDetail(QueryTaskDetailDTO queryTaskDetailRequestVO) { + + QueryTaskDetailResponseVO queryTaskDetailResponseVO = new QueryTaskDetailResponseVO(); + + //作业内容 + ClassSubjectTaskDO classSubjectTask = classSubjectTaskMapper.selectById(queryTaskDetailRequestVO.getId()); + queryTaskDetailResponseVO.setTreeName(classSubjectTask.getTreeName()); + + + //查看班级 + int total = classesUserMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(ClassesUserMappingDO::getClassesId, classSubjectTask.getClassId())); + + GetPreTaskContentVO getPreTaskContentVO = getTaskContents(classSubjectTask); + queryTaskDetailResponseVO.setGetPreTaskContentVO(getPreTaskContentVO); + + //headers + queryTaskDetailResponseVO.setTaskType(classSubjectTask.getTaskType()); + UserRoleDO userRole = userRoleMapper.selectById(classSubjectTask.getTeacherId()); + queryTaskDetailResponseVO.setUserName(userRole != null ? userRole.getUserName() : null); + List strings = new ArrayList<>(); + strings.add(classSubjectTask.getTreeName()); + queryTaskDetailResponseVO.setKnowledges(strings); + + //完成度 + List exerciseDoneInfoVOS = new ArrayList<>(); + + //获取关联习题 完成度 + List preRelateExeVOS = getPreTaskContentVO.getPreRelateExeVOS(); + if (null != preRelateExeVOS && preRelateExeVOS.size() > 0) { + for (PreRelateExeVO preRelateExeVO : preRelateExeVOS) { + ExerciseDoneInfoVO exerciseDoneInfoVO = new ExerciseDoneInfoVO(); + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("tree_id", preRelateExeVO.getTreeId()); + queryWrapper.eq("exe_type", 0); + queryWrapper.eq("subject_task_id", queryTaskDetailRequestVO.getId()); + + Integer counts = taskCompletionStatusMapper.selectCount(queryWrapper); + exerciseDoneInfoVO.setRights(counts); + exerciseDoneInfoVO.setTotal(total); // 班级人数 + exerciseDoneInfoVO.setLabel(preRelateExeVO.getTreeName()); + exerciseDoneInfoVOS.add(exerciseDoneInfoVO); + } + } + //获取拓展习题 完成度 + for (PreExpandExerciseVO preExpandExerciseVO : getPreTaskContentVO.getPreExpandExerciseVOS()) { + ExerciseDoneInfoVO exerciseDoneInfoVO = new ExerciseDoneInfoVO(); + exerciseDoneInfoVO.setTotal(preExpandExerciseVO.getStudentCounts()); + exerciseDoneInfoVO.setLabel(preExpandExerciseVO.getExpandExerciseNames()); + QueryWrapper queryWrapper = new QueryWrapper(); + queryWrapper.eq("tree_id", preExpandExerciseVO.getTreeId()); + queryWrapper.eq("exe_type", 1); + queryWrapper.eq("subject_task_id", queryTaskDetailRequestVO.getId()); + queryWrapper.eq("status", ConstantUtils.ALREADY_DONE); + Integer counts = taskCompletionStatusMapper.selectCount(queryWrapper); + exerciseDoneInfoVO.setRights(counts); + exerciseDoneInfoVOS.add(exerciseDoneInfoVO); + } + queryTaskDetailResponseVO.setExerciseDoneInfoVOS(exerciseDoneInfoVOS); + return queryTaskDetailResponseVO; + } + + public List getRelativeExercises(GetExerciseRequestDTO getExerciseRequestVO) { + + List getExerciseDetailResponseVOS = exerciseDictMapper.getRelativeExercises(getExerciseRequestVO); + for (GetExerciseDetailResponseVO getExerciseDetailResponseVO : getExerciseDetailResponseVOS) { + getExerciseDetailResponseVO.setLengthSecond(getExerciseDetailResponseVO.getAdviceLength()); + getExerciseDetailResponseVO.setLength(MathUtil.exerciseLength(getExerciseDetailResponseVO.getAdviceLength())); + } + return getExerciseDetailResponseVOS; + } + + public List perStudentVod(GetUserVodPlayDTO getUserVodPlayPO) { + //查看任务时间 + ClassSubjectTaskDO classSubjectTaskDO = classSubjectTaskMapper.selectById(getUserVodPlayPO.getTaskId()); + getUserVodPlayPO.setClassesId(classSubjectTaskDO.getClassId()); + List perStudentComplicationVOS = vodPlayHistoryMapper.getCurrentUserVodPlayVO(getUserVodPlayPO); + return perStudentComplicationVOS; + } + + public PerStudentExesResponseVO perStudentRelateExes(PerStudentExesDTO perStudentExesRequestVO) { + + PerStudentExesResponseVO perStudentExesResponseVO = new PerStudentExesResponseVO(); + ClassSubjectTaskDO classSubjectTask = classSubjectTaskMapper.selectById(perStudentExesRequestVO.getTaskId()); + //查看班级人数 + Integer total = getClassStuCounts(classSubjectTask.getClassId()); + perStudentExesResponseVO.setTotalCount(total); + + //查看已提交的人数 + Integer submitCounts = taskCompletionStatusMapper.selectCount(new QueryWrapper() + .lambda() + .eq(TaskCompletionStatusDO::getSubjectTaskId, perStudentExesRequestVO.getTaskId()) + .eq(TaskCompletionStatusDO::getExeType, 0) + .eq(TaskCompletionStatusDO::getTreeId, perStudentExesRequestVO.getTreeId())); + + //查看该任务下,知识点一共有多少关联习题 + ExerciseRelatedMappingDO exerciseRelatedMappingDO = exerciseRelatedMappingMapper.selectById(perStudentExesRequestVO.getTreeId()); + + Integer relateCounts = exerciseRelatedMappingDO.getExerciseIds().split(",").length; + + List pser = new ArrayList<>(); + int totalLength = 0; + int rights = 0; + //查看学生完成度+名字 + List perStuExeDoneResponseVOS = exerciseDoneHistoryMapper.perStudentRelateExes(perStudentExesRequestVO); + //封装结果 + for (PerStuExeDoneResponseVO perStuExeDoneResponseVO : perStuExeDoneResponseVOS) { + totalLength += perStuExeDoneResponseVO.getLength(); + rights += perStuExeDoneResponseVO.getRightCounts(); + pser.add(perStuExeDoneResponseVO); + } + perStudentExesResponseVO.setPerStuExeDoneResponseVOS(pser); + + //平均用时 + if (submitCounts != 0) { + BigDecimal bigDecimal = new BigDecimal(totalLength).divide(new BigDecimal(submitCounts), RoundingMode.CEILING); + BigDecimal bigDecimal1 = new BigDecimal(rights).multiply(new BigDecimal(100)).divide((new BigDecimal(submitCounts).multiply(new BigDecimal(relateCounts))), RoundingMode.CEILING); + perStudentExesResponseVO.setAvgUseTimes(bigDecimal); + perStudentExesResponseVO.setRightPercent(bigDecimal1); + } + + perStudentExesResponseVO.setSubmitCount(submitCounts); + //平均正确率 + return perStudentExesResponseVO; + } + + public List exeRightRatio(ExeRightRatioDTO exeRightRatioPO) { + + List exeRightRatioVOS = new ArrayList<>(); + //获取关联习题/拓展习题:提交人数 + Integer submitCounts = taskCompletionStatusMapper.selectCount(new QueryWrapper() + .lambda() + .eq(TaskCompletionStatusDO::getExeType, exeRightRatioPO.getExerciseType()) + .eq(TaskCompletionStatusDO::getSubjectTaskId, exeRightRatioPO.getTaskId()) + .eq(TaskCompletionStatusDO::getTreeId, exeRightRatioPO.getTreeId())); + + //正确率 + HashMap classMap = new HashMap<>(); + HashMap totalMap = new HashMap<>(); + + //时长 + HashMap classLength = new HashMap<>(); + HashMap totalLength = new HashMap<>(); + + List integers = new ArrayList<>(); + + //0 关联习题 1 拓展习题 + if (exeRightRatioPO.getExerciseType() == 0) { + //找到该任务下 该知识点的关联习题 + ExerciseRelatedMappingDO exerciseRelatedMappingDO = exerciseRelatedMappingMapper.selectById(exeRightRatioPO.getTreeId()); + + String[] exerciseIds = exerciseRelatedMappingDO.getExerciseIds().split(","); + integers = Arrays.asList(exerciseIds); + //} + } else { + // + String[] strings = exerciseExpandMappingMapper.selectById(exeRightRatioPO.getTreeId()).getExerciseIds().split(","); + integers = Arrays.asList(strings); + } + + //获取班级做题情况 + ClassDoneInfoDTO classDoneInfoPO = new ClassDoneInfoDTO(); + classDoneInfoPO.setTaskId(exeRightRatioPO.getTaskId()); + classDoneInfoPO.setTreeId(exeRightRatioPO.getTreeId()); + classDoneInfoPO.setExerciseType(exeRightRatioPO.getExerciseType()); + List classDoneInfoVOS = exerciseDoneHistoryMapper.classDoneInfo(classDoneInfoPO); + for (ClassDoneInfoVO classDoneInfoVO : classDoneInfoVOS) { + classMap.put(classDoneInfoVO.getExerciseId(), MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(classDoneInfoVO.getResult()), new BigDecimal(submitCounts))); + classLength.put(classDoneInfoVO.getExerciseId(), MathUtil.getAvgIndex(new BigDecimal(classDoneInfoVO.getLength()), new BigDecimal(submitCounts))); + } + + //通过题目ids查询题目做题历史情况 + ExesDoneInfoPO exesDoneInfoPO = new ExesDoneInfoPO(); + exesDoneInfoPO.setExeIds(integers); + List classDoneInfoVOS1 = exerciseDoneHistoryMapper.exesDoneInfo(exesDoneInfoPO); + for (ClassDoneInfoVO classDoneInfoVO : classDoneInfoVOS1) { + totalMap.put(classDoneInfoVO.getExerciseId(), MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(classDoneInfoVO.getResult()), new BigDecimal(classDoneInfoVO.getCountNum()))); + totalLength.put(classDoneInfoVO.getExerciseId(), MathUtil.getAvgIndex(new BigDecimal(classDoneInfoVO.getLength()), new BigDecimal(classDoneInfoVO.getCountNum()))); + } + + int i = 1; + for (String integer : integers) { + ExeRightRatioVO exeRightRatioVO = new ExeRightRatioVO(); + + exeRightRatioVO.setType("class"); + exeRightRatioVO.setExercise("第" + i + "题目"); + exeRightRatioVO.setValue(classMap.get(Integer.valueOf(integer)) == null ? "0" : classMap.get(Integer.valueOf(integer))); + exeRightRatioVO.setLength(classLength.get(Integer.valueOf(integer)) == null ? "0" : classLength.get(Integer.valueOf(integer))); + exeRightRatioVOS.add(exeRightRatioVO); + + exeRightRatioVO = new ExeRightRatioVO(); + exeRightRatioVO.setExercise("第" + i + "题目"); + exeRightRatioVO.setType("total"); + exeRightRatioVO.setValue(totalMap.get(Integer.valueOf(integer)) == null ? "0" : totalMap.get(Integer.valueOf(integer))); + exeRightRatioVO.setLength(totalLength.get(Integer.valueOf(integer)) == null ? "0" : totalLength.get(Integer.valueOf(integer))); + exeRightRatioVOS.add(exeRightRatioVO); + i++; + } + return exeRightRatioVOS; + } + + public StudentDoneInfoResponseVO studentRelateDoneInfo(StudentDoneInfoRequestVO studentDoneInfoRequestVO) { + + StudentDoneInfoResponseVO studentDoneInfoResponseVO = new StudentDoneInfoResponseVO(); + + //个人完成情况 + 班级完成情况 exercise totalright totallength + GetClassExeDoneInfoRequestVO getClassExeDoneInfoRequestVO = new GetClassExeDoneInfoRequestVO(); + getClassExeDoneInfoRequestVO.setTaskId(studentDoneInfoRequestVO.getTaskId()); + getClassExeDoneInfoRequestVO.setTreeId(studentDoneInfoRequestVO.getTreeId()); + getClassExeDoneInfoRequestVO.setUserId(studentDoneInfoRequestVO.getUserId()); + List getClassExeDoneInfoResponseVOS = exerciseDoneHistoryMapper.getRelateExeDoneInfo(getClassExeDoneInfoRequestVO); + + //提交人数 + Integer submitCounts = taskCompletionStatusMapper.selectCount(new QueryWrapper() + .lambda() + .eq(TaskCompletionStatusDO::getSubjectTaskId, studentDoneInfoRequestVO.getTaskId()) + .eq(TaskCompletionStatusDO::getTreeId, studentDoneInfoRequestVO.getTreeId()) + .eq(TaskCompletionStatusDO::getExeType, 0)); + + //学生做对个数 + int rights = 0; + //学生用时 + int length = 0; + //int exeCount = 0 ; + //平均用时 + BigDecimal avgLength = new BigDecimal(0); + //全部做对个数 + BigDecimal totalRights = new BigDecimal(0); + //完成度明细 + for (GetClassExeDoneInfoResponseVO gcedv : getClassExeDoneInfoResponseVOS) { + + rights += gcedv.getResult(); + totalRights = totalRights.add(new BigDecimal(gcedv.getClassResult())); + length += gcedv.getLength(); + avgLength = avgLength.add(new BigDecimal(gcedv.getClassLength())); + gcedv.setClassResult(MathUtil.getPercentAvgIndex(new BigDecimal(gcedv.getClassResult()), new BigDecimal(submitCounts))); + gcedv.setClassLength(Integer.valueOf(MathUtil.getAvgIndex(new BigDecimal(gcedv.getClassLength()), new BigDecimal(submitCounts)))); + gcedv.setLabel(this.labels(gcedv.getTreeId())); + + } + studentDoneInfoResponseVO.setStudentDoneDetailVOS(getClassExeDoneInfoResponseVOS); + //关练习题个数 + Integer relatedCounts = getClassExeDoneInfoResponseVOS.size(); + studentDoneInfoResponseVO.setTotalCounts(relatedCounts); + + //做对个数 + studentDoneInfoResponseVO.setRightCounts(rights); + + //用时 + studentDoneInfoResponseVO.setUseLength(length); + + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + + //提交时间 + LocalDateTime date = taskCompletionStatusMapper.selectOne(new QueryWrapper() + .lambda() + .eq(TaskCompletionStatusDO::getUserId, studentDoneInfoRequestVO.getUserId()) + .eq(TaskCompletionStatusDO::getExeType, 0) + .eq(TaskCompletionStatusDO::getSubjectTaskId, studentDoneInfoRequestVO.getTaskId()) + .eq(TaskCompletionStatusDO::getTreeId, studentDoneInfoRequestVO.getTreeId())).getCreateDate(); + String createDate = dateTimeFormatter.format(date); + studentDoneInfoResponseVO.setSubmitTime(createDate); + + //平均正确率 + String avgRights = MathUtil.getPercentAvgIndex(new BigDecimal(rights), (new BigDecimal(relatedCounts))); + studentDoneInfoResponseVO.setAvgRightPercent(avgRights); + //平均用时 + studentDoneInfoResponseVO.setAvgUseLength(Integer.valueOf(MathUtil.getAvgIndex(new BigDecimal(avgLength.intValue()), new BigDecimal(submitCounts)))); + + return studentDoneInfoResponseVO; + } + + public GetExeByIdResponseVO getExeById(ExerciseDictDO exerciseDict) { + ExerciseDictDO ed = exerciseDictMapper.selectById(exerciseDict.getId()); + GetExeByIdResponseVO getExeByIdResponseVO = new GetExeByIdResponseVO(); + BeanUtils.copyProperties(ed, getExeByIdResponseVO); + return getExeByIdResponseVO; + } + + public List getExpandings(GetExpandingsPO getExpandingsPO) { + + List exerciseUserInfos = new ArrayList<>(); + ExerciseExpandMappingDO exerciseExpandMapping1 = exerciseExpandMappingMapper.selectById(getExpandingsPO.getId()); + + List ids = Arrays.asList(exerciseExpandMapping1.getExerciseIds().split(",")); + List exerciseDicts = exerciseDictMapper.selectList(new QueryWrapper() + .lambda() + .in(ExerciseDictDO::getId, ids) + .orderByAsc(ExerciseDictDO::getDifficulty)); + + for (ExerciseDictDO exerciseDict : exerciseDicts) { + ExerciseUserInfoVO exerciseUserInfoVO = new ExerciseUserInfoVO(); + BeanUtils.copyProperties(exerciseDict, exerciseUserInfoVO); + + //QueryWrapper queryWrapper = new QueryWrapper(); + //queryWrapper.eq("user_id", getExpandingsPO.getUserId()); + //queryWrapper.eq("exercise_id", exerciseDict.getId()); + //ExerciseUserInfoDO exerciseUserInfo = exerciseUserInfoMapper.selectOne(queryWrapper); + //if (null == exerciseUserInfo || exerciseUserInfo.getCollectionStatus() == 0) { + // exerciseUserInfoVO.setCollectionStatus(0); + //} else { + // exerciseUserInfoVO.setCollectionStatus(1); + //} + exerciseUserInfos.add(exerciseUserInfoVO); + } + return exerciseUserInfos; + } + + public StudentDoneInfoResponseVO studentxpandingDoneInfo(StudentDoneInfoRequestVO studentDoneInfoRequestVO) { + + StudentDoneInfoResponseVO studentDoneInfoResponseVO = new StudentDoneInfoResponseVO(); + + //题目总数 + ExerciseExpandMappingDO eem = exerciseExpandMappingMapper.selectById(studentDoneInfoRequestVO.getTreeId()); + Integer exerciseCounts = eem.getExerciseIds().split(",").length; + studentDoneInfoResponseVO.setTotalCounts(exerciseCounts); + + //提交人数 + QueryWrapper queryWrapper1 = new QueryWrapper(); + queryWrapper1.eq("exe_type", 1); + queryWrapper1.eq("subject_task_id", studentDoneInfoRequestVO.getTaskId()); + queryWrapper1.eq("tree_id", studentDoneInfoRequestVO.getTreeId()); + + Integer submitCounts = taskCompletionStatusMapper.selectCount(new QueryWrapper() + .lambda() + .eq(TaskCompletionStatusDO::getExeType, 1) + .eq(TaskCompletionStatusDO::getTreeId, studentDoneInfoRequestVO.getTreeId()) + .eq(TaskCompletionStatusDO::getSubjectTaskId, studentDoneInfoRequestVO.getTaskId())); + List userIds = Arrays.asList(eem.getStudentIds().split(",")); + + int rightCounts = 0; + int avgLength = 0; + int useLength = 0; + BigDecimal totalRights = new BigDecimal(0); + //完成度明细 + 班级总正确数,总用时 + GetClassExeDoneInfoRequestVO getClassExeDoneInfoRequestVO = new GetClassExeDoneInfoRequestVO(); + getClassExeDoneInfoRequestVO.setTreeId(studentDoneInfoRequestVO.getTreeId()); + getClassExeDoneInfoRequestVO.setUserId(studentDoneInfoRequestVO.getUserId()); + getClassExeDoneInfoRequestVO.setTaskId(studentDoneInfoRequestVO.getTaskId()); + getClassExeDoneInfoRequestVO.setUserIds(userIds); + List getClassExeDoneInfoResponseVOS = exerciseDoneHistoryMapper.getExpandingExeDoneInfo(getClassExeDoneInfoRequestVO); + for (GetClassExeDoneInfoResponseVO getClassExeDoneInfoResponseVO : getClassExeDoneInfoResponseVOS) { + rightCounts += getClassExeDoneInfoResponseVO.getResult(); + useLength += Integer.valueOf(getClassExeDoneInfoResponseVO.getLength()); + totalRights = totalRights.add(new BigDecimal(getClassExeDoneInfoResponseVO.getClassResult())); + avgLength += Integer.valueOf(getClassExeDoneInfoResponseVO.getClassLength()); + getClassExeDoneInfoResponseVO.setClassResult(MathUtil.getPercentAvgIndex(new BigDecimal(getClassExeDoneInfoResponseVO.getClassResult()), new BigDecimal(submitCounts))); + getClassExeDoneInfoResponseVO.setClassLength(Integer.valueOf(MathUtil.getAvgIndex(new BigDecimal(getClassExeDoneInfoResponseVO.getClassLength()), new BigDecimal(submitCounts)))); + getClassExeDoneInfoResponseVO.setLabel(this.labels(getClassExeDoneInfoResponseVO.getTreeId())); + } + studentDoneInfoResponseVO.setStudentDoneDetailVOS(getClassExeDoneInfoResponseVOS); + + //用时 + studentDoneInfoResponseVO.setUseLength(useLength); + + //正确率==>做对个数 + studentDoneInfoResponseVO.setRightCounts(rightCounts); + + DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + //提交时间 + LocalDateTime date = taskCompletionStatusMapper.selectOne(new QueryWrapper() + .lambda() + .eq(TaskCompletionStatusDO::getUserId, studentDoneInfoRequestVO.getUserId()) + .eq(TaskCompletionStatusDO::getTreeId, studentDoneInfoRequestVO.getTreeId()) + .eq(TaskCompletionStatusDO::getExeType, 1)).getCreateDate(); + + String createDate = dateTimeFormatter.format(date); + studentDoneInfoResponseVO.setSubmitTime(createDate); + //平均用时 + studentDoneInfoResponseVO.setAvgUseLength(Integer.valueOf(MathUtil.getAvgIndex(new BigDecimal(avgLength), new BigDecimal(submitCounts)))); + + //平均正确率 + String avgRights = MathUtil.getPercentAvgIndex(totalRights, (new BigDecimal(exerciseCounts).multiply(new BigDecimal(submitCounts)))); + studentDoneInfoResponseVO.setAvgRightPercent(avgRights); + return studentDoneInfoResponseVO; + } + + public PerStudentExesResponseVO perStudentExpandingExes(PerStudentExesRequestVO perStudentExesRequestVO) { + + PerStudentExesResponseVO perStudentExesResponseVO = new PerStudentExesResponseVO(); + + ExerciseExpandMappingDO exerciseExpandMapping = exerciseExpandMappingMapper.selectById(perStudentExesRequestVO.getTreeId()); + + //该作业总人数 + List totalCounts = Arrays.asList(exerciseExpandMapping.getStudentIds().split(",")); + perStudentExesResponseVO.setTotalCount(totalCounts.size()); + + //提交人数 + Integer submitCounts = taskCompletionStatusMapper.selectCount(new QueryWrapper() + .lambda() + .eq(TaskCompletionStatusDO::getExeType, 1) + .eq(TaskCompletionStatusDO::getSubjectTaskId, perStudentExesRequestVO.getTaskId()) + .eq(TaskCompletionStatusDO::getTreeId, perStudentExesRequestVO.getTreeId())); + perStudentExesResponseVO.setSubmitCount(submitCounts); + + int totalRithts = 0; + int totalLength = 0; + + //题目个数 + int exeCounts = exerciseExpandMapping.getExerciseIds().split(",").length; + + //完成度明细 + perStudentExesRequestVO.setUserIds(totalCounts); + List perStuExeDoneResponseVOS = exerciseDoneHistoryMapper.perStudentExpandingExes(perStudentExesRequestVO); + for (PerStuExeDoneResponseVO psed : perStuExeDoneResponseVOS) { + totalRithts += psed.getRightCounts(); + totalLength += psed.getLength(); + psed.setTotalCounts(exeCounts); + } + perStudentExesResponseVO.setPerStuExeDoneResponseVOS(perStuExeDoneResponseVOS); + + //正确率 + 平均用时 + if (submitCounts != 0) { + BigDecimal bigDecimal1 = new BigDecimal(totalRithts).multiply(new BigDecimal(100)).divide((new BigDecimal(submitCounts).multiply(new BigDecimal(exeCounts))), RoundingMode.CEILING); + perStudentExesResponseVO.setRightPercent(bigDecimal1); + BigDecimal bigDecimal = new BigDecimal(totalLength).divide(new BigDecimal(submitCounts), RoundingMode.CEILING); + perStudentExesResponseVO.setAvgUseTimes(bigDecimal); + } + + + return perStudentExesResponseVO; + } + + public List getRecommendVodByTreeId(GetRecommendVodByTreeIdVO getRecommendVodByTreeIdVO) { + List getVodDetailResponseVOS = new ArrayList<>(); + List relatedVods = JSON.parseArray(getRecommendVodByTreeIdVO.getTreeIds(), Integer.class); + + getRecommendVodByTreeIdVO.setTreeIdInteger(relatedVods); + + List vodDicts = vodDictMapper.getRecommendVodByTreeId(getRecommendVodByTreeIdVO); + for (VodDictDO vodDict : vodDicts) { + GetVodDetailResponseVO getVodDetailResponseVO = new GetVodDetailResponseVO(); + BeanUtils.copyProperties(vodDict, getVodDetailResponseVO); + getVodDetailResponseVO.setLengthSecond(vodDict.getVodLength()); + AdministerDO vodUserAlias = administerMapper.selectById(vodDict.getAdministerId()); + if (vodUserAlias != null) { + getVodDetailResponseVO.setUserName(vodUserAlias.getUserName()); + } + getVodDetailResponseVOS.add(getVodDetailResponseVO); + } + return getVodDetailResponseVOS; + } + + public List getRecommendExeByTreeId(GetRecommendExeByTreeIdVO getRecommendExeByTreeIdVO) { + + List getExercisesInfoByIdsResponseVOS = new ArrayList<>(); + List relatedExes = JSON.parseArray(getRecommendExeByTreeIdVO.getTreeIds(), Integer.class); + + for (Integer integer : relatedExes) { + GetExercisesInfoByIdsResponseVO getExercisesInfoByIdsResponseVO = new GetExercisesInfoByIdsResponseVO(); + + List exerciseDicts = exerciseTreeMappingMapper.getRelatedExercise(integer); + if (exerciseDicts.size() == 0) { + continue; + } + getExercisesInfoByIdsResponseVO.setExeCounts(exerciseDicts.size()); + int len = 0; + for (ExerciseDictDO ed : exerciseDicts) { + len += ed.getAdviceLength(); + } + getExercisesInfoByIdsResponseVO.setTreeId(integer); + getExercisesInfoByIdsResponseVO.setLength(MathUtil.exerciseLength(len)); + getExercisesInfoByIdsResponseVO.setLengthSecond(len); + SubjectTreeDO knowledgeTree = subjectTreeMapper.selectById(integer); + if (knowledgeTree != null) { + getExercisesInfoByIdsResponseVO.setLabel(knowledgeTree.getTreeName()); + } + getExercisesInfoByIdsResponseVOS.add(getExercisesInfoByIdsResponseVO); + } + return getExercisesInfoByIdsResponseVOS; + } + + public List allNodes(SubjectTreeDO knowledgeTree) { + + //SubjectTreeDO subjectTreeDO1 = subjectTreeMapper.selectById(knowledgeTree.getId()); + + //获取某科目下的所有父节点 + List knowledgeTrees = subjectTreeMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTreeDO::getSubjectId, knowledgeTree.getSubjectId()) + .isNull(SubjectTreeDO::getParentId)); + + //只展示三级节点 + + for (SubjectTreeDO kn : knowledgeTrees) { + //二级节点 + List subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTreeDO::getParentId, kn.getId())); + kn.setChildren(subjectTreeDOS); + + for (SubjectTreeDO subjectTreeDO : subjectTreeDOS) { + List subjectTreeDOS1 = subjectTreeMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTreeDO::getParentId, subjectTreeDO.getId())); + subjectTreeDO.setChildren(subjectTreeDOS1); + } + //kn.setChildren(getChildNodes(kn)); + } + + return knowledgeTrees; + } + + public List getClassStudents(GetClassStudentsDTO getClassStudentsDTO) { + return this.baseMapper.getClassStudents(getClassStudentsDTO); + } + + public List queryTaskRelatedExercise(TaskContentDO taskContentDO){ + ExerciseRelatedMappingDO exerciseRelatedMappingDO =exerciseRelatedMappingMapper.selectById(taskContentDO.getContentId()); + return exerciseDictMapper.selectBatchIds(Arrays.asList(exerciseRelatedMappingDO.getExerciseIds().split(","))); + } + + + /** + * 关联习题处理 + */ + public void data(){ + + List taskContentDOS = taskContentMapper.selectList(new QueryWrapper() + .lambda() + .eq(TaskContentDO::getContentType,"1") + .isNull(TaskContentDO::getDeleteDate)); + + for (TaskContentDO taskContentDO : taskContentDOS){ + + ExerciseRelatedMappingDO exerciseRelatedMappingDO = new ExerciseRelatedMappingDO(); + + exerciseRelatedMappingDO.setTaskId(taskContentDO.getTaskId()); + exerciseRelatedMappingDO.setTreeId(taskContentDO.getContentId()); + + ClassSubjectTaskDO classSubjectTaskDO = classSubjectTaskMapper.selectById(taskContentDO.getTaskId()); + if (null != classSubjectTaskDO){ + //exerciseRelatedMappingDO.setExerciseName(classSubjectTaskDO.getTreeName()); + SubjectTreeDO subjectTreeDO = subjectTreeMapper.selectById(taskContentDO.getContentId()); + exerciseRelatedMappingDO.setExerciseName(subjectTreeDO.getTreeName()); + + //班级里的人 + List classesUserMappingDOS = classesUserMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassesUserMappingDO::getClassesId,classSubjectTaskDO.getClassId())); + + if (classesUserMappingDOS.size()>0){ + StringBuilder temp = new StringBuilder(); + + for (ClassesUserMappingDO classesUserMappingDO : classesUserMappingDOS){ + temp.append(classesUserMappingDO.getUserId()); + temp.append(","); + } + + String stuentIds = temp.toString().substring(0,temp.length()-1); + exerciseRelatedMappingDO.setStudentIds(stuentIds); + } + + //题目去重 + Set sets = new HashSet<>(); + List exerciseDoneHistoryDOS = exerciseDoneHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(ExerciseDoneHistoryDO::getTaskSubjectId,taskContentDO.getTaskId()) + .eq(ExerciseDoneHistoryDO::getContentId,taskContentDO.getContentId())); + if (exerciseDoneHistoryDOS.size()>0){ + for (ExerciseDoneHistoryDO exerciseDoneHistoryDO : exerciseDoneHistoryDOS){ + sets.add(String.valueOf(exerciseDoneHistoryDO.getExerciseId())); + } + + StringBuilder stringBuilder = new StringBuilder(); + for (String str : sets){ + stringBuilder.append(str); + stringBuilder.append(","); + } + String exerciseids = stringBuilder.toString().substring(0,stringBuilder.length()-1); + exerciseRelatedMappingDO.setExerciseIds(exerciseids); + } + exerciseRelatedMappingMapper.insert(exerciseRelatedMappingDO); + + //更新history的contentId + ExerciseDoneHistoryDO exerciseDoneHistoryDO = new ExerciseDoneHistoryDO(); + exerciseDoneHistoryDO.setContentId(exerciseRelatedMappingDO.getId()); + exerciseDoneHistoryMapper.update(exerciseDoneHistoryDO,new QueryWrapper() + .lambda() + .eq(ExerciseDoneHistoryDO::getContentId,taskContentDO.getContentId()) + .eq(ExerciseDoneHistoryDO::getTaskSubjectId,taskContentDO.getTaskId())); + + //task_completion_status + TaskCompletionStatusDO taskCompletionStatusDO = new TaskCompletionStatusDO(); + taskCompletionStatusDO.setTreeId(exerciseRelatedMappingDO.getId()); + taskCompletionStatusMapper.update(taskCompletionStatusDO,new QueryWrapper() + .lambda() + .eq(TaskCompletionStatusDO::getSubjectTaskId,taskContentDO.getTaskId()) + .eq(TaskCompletionStatusDO::getExeType,0) + .eq(TaskCompletionStatusDO::getTreeId,taskContentDO.getContentId())); + + //task_content_done_info + TaskContentDoneInfoDO taskContentDoneInfoDO = new TaskContentDoneInfoDO(); + taskContentDoneInfoDO.setContentId(exerciseRelatedMappingDO.getId()); + taskContentDoneInfoMapper.update(taskContentDoneInfoDO,new QueryWrapper() + .lambda() + .eq(TaskContentDoneInfoDO::getTaskId,taskContentDO.getTaskId()) + .eq(TaskContentDoneInfoDO::getContentType,1) + .eq(TaskContentDoneInfoDO::getContentId,taskContentDO.getContentId())); + + //更新taskContent的contentId + taskContentDO.setContentId(exerciseRelatedMappingDO.getId()); + taskContentMapper.updateById(taskContentDO); + } + + } + } + + + ///** + // * 遍历子节点并赋值 + // */ + //public List getChildNodes(SubjectTreeDO knowledgeTree) { + // + // //查找该父节点下的子节点 + // List knowledgeTrees = subjectTreeMapper.selectList(new QueryWrapper() + // .lambda() + // .eq(SubjectTreeDO::getParentId, knowledgeTree.getId()) + // .orderByAsc(SubjectTreeDO::getTreeOrder)); + // + // for (SubjectTreeDO kn : knowledgeTrees) { + // kn.setChildren(getChildNodes(kn)); + // } + // if (knowledgeTrees.size() == 0) { + // return null; + // } + // return knowledgeTrees; + //} + + /** + * 获取某个班级的学生人数 + * + * @return + */ + public Integer getClassStuCounts(Integer classId) { + return classesUserMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(ClassesUserMappingDO::getClassesId, classId)); + } + + private GetPreTaskContentVO getTaskContents(ClassSubjectTaskDO cst) { + GetPreTaskContentVO getPreTaskIdResponseVO = new GetPreTaskContentVO(); + + List taskContents = taskContentMapper.selectList(new QueryWrapper() + .lambda() + .eq(TaskContentDO::getTaskId, cst.getId())); + if (taskContents.size() > 0) { + //微视频 + List vodIntegers = new ArrayList<>(); + //关联习题 + List relateIds = new ArrayList<>(); + //书面作业 + List homeIntegers = new ArrayList<>(); + for (TaskContentDO tc : taskContents) { + if (tc.getContentType() == 0) { + vodIntegers.add(tc.getContentId()); + } + if (tc.getContentType() == 1) { + relateIds.add(tc.getContentId()); + } + if (tc.getContentType() == 3) { + homeIntegers.add(tc.getContentId()); + } + } + //微视频列表 + if (vodIntegers.size() > 0) { + List preVodInfoVOS = new ArrayList<>(); + List vodDicts = vodDictMapper.selectBatchIds(vodIntegers); + for (VodDictDO vodDict : vodDicts) { + PreVodInfoVO preVodInfoVO = new PreVodInfoVO(); + BeanUtils.copyProperties(vodDict, preVodInfoVO); + AdministerDO administerDO = administerMapper.selectById(vodDict.getAdministerId()); + + if (null != administerDO) { + preVodInfoVO.setTeacherName(administerDO.getUserName()); + } + //preVodInfoVO.setTreeId(vodDict.getTreeId()); + preVodInfoVO.setLength(MathUtil.vodLength(vodDict.getVodLength())); + preVodInfoVO.setLengthSecond(vodDict.getVodLength()); + preVodInfoVO.setVodId(vodDict.getId()); + preVodInfoVOS.add(preVodInfoVO); + } + getPreTaskIdResponseVO.setPreVodInfoVOS(preVodInfoVOS); + } + + + //关联习题 +// String ids[] = cst.getTreeId().split(","); + List preRelateExeVOS = new ArrayList<>(); + for (Integer str : relateIds) { + ExerciseRelatedMappingDO exerciseRelatedMappingDO = exerciseRelatedMappingMapper.selectById(str); + List relatedExes = exerciseDictMapper.selectBatchIds(Arrays.asList(exerciseRelatedMappingDO.getExerciseIds().split(","))); + PreRelateExeVO preRelateExeVO = new PreRelateExeVO(); + preRelateExeVO.setExeCounts(relatedExes.size()); + preRelateExeVO.setTreeName(subjectTreeMapper.selectById(exerciseRelatedMappingDO.getTreeId()).getTreeName()); + int length = 0; + for (ExerciseDictDO ed : relatedExes) { + length += ed.getAdviceLength(); + } + preRelateExeVO.setTreeId(Integer.valueOf(str)); + preRelateExeVO.setLength(MathUtil.exerciseLength(length)); + preRelateExeVO.setLengthSecond(length); + preRelateExeVOS.add(preRelateExeVO); + } + getPreTaskIdResponseVO.setPreRelateExeVOS(preRelateExeVOS); + + //书面作业 + PreHomeWorkInfoVO preHomeWorkInfoVO = new PreHomeWorkInfoVO(); + if (homeIntegers.size() > 0) { + List writtenHomeworks = writtenHomeworkMapper.selectBatchIds(homeIntegers); + List whs = new ArrayList<>(); + for (WrittenHomeworkDO writtenHomework : writtenHomeworks) { + if (writtenHomework.getHomeworkType() == 2) { + preHomeWorkInfoVO.setNotice(writtenHomework.getHomeworkContent()); + } else { + writtenHomework.setHomeworkContent(URLDecoder.decode(writtenHomework.getHomeworkContent())); + whs.add(writtenHomework); + } + preHomeWorkInfoVO.setLengthSecond(writtenHomework.getAdviceLength()); + preHomeWorkInfoVO.setFileName(writtenHomework.getFileName()); + } + preHomeWorkInfoVO.setWrittenHomeworks(whs); + preHomeWorkInfoVO.setLength(MathUtil.exerciseLength(writtenHomeworks.get(0).getAdviceLength())); + + preHomeWorkInfoVO.setHomeworksCounts(writtenHomeworks.size()); + getPreTaskIdResponseVO.setPreHomeWorkInfoVO(preHomeWorkInfoVO); + } + //知识点 +// List treeIds = Arrays.asList(cst.getTreeId().split(",")); +// List knowledgeTrees = knowledgeTreeMapper.selectBatchIds(treeIds); +// getPreTaskIdResponseVO.setKnowledgeTrees(knowledgeTrees); + } + + //拓展习题 + List preExpandExerciseVOS = new ArrayList<>(); + QueryWrapper queryWrapper1 = new QueryWrapper(); + queryWrapper1.eq("task_id", cst.getId()); + List exerciseExpandMappings = exerciseExpandMappingMapper.selectList(queryWrapper1); + for (ExerciseExpandMappingDO eem : exerciseExpandMappings) { + PreExpandExerciseVO preExpandExerciseVO = new PreExpandExerciseVO(); + int length = 0; + String[] exerciseIds = eem.getExerciseIds().split(","); + for (String str : exerciseIds) { + length += exerciseDictMapper.selectById(str).getAdviceLength(); + } + preExpandExerciseVO.setExerciseCounts(exerciseIds.length); + preExpandExerciseVO.setLength(MathUtil.exerciseLength(length)); + String[] studentIds = eem.getStudentIds().split(","); + preExpandExerciseVO.setTreeId(eem.getId()); + preExpandExerciseVO.setExpandExerciseNames(eem.getExerciseName()); + preExpandExerciseVO.setStudentCounts(studentIds.length); + preExpandExerciseVO.setLengthSecond(length); + preExpandExerciseVOS.add(preExpandExerciseVO); + } + getPreTaskIdResponseVO.setPreExpandExerciseVOS(preExpandExerciseVOS); + + getPreTaskIdResponseVO.setTaskType(cst.getTaskType()); + UserRoleDO userRole = userRoleMapper.selectById(cst.getTeacherId()); + getPreTaskIdResponseVO.setTeacherName(userRole != null ? userRole.getUserName() : null); + getPreTaskIdResponseVO.setTaskId(cst.getId()); + return getPreTaskIdResponseVO; + } + + + public void pushMsg(PushMsgPO pushMsgPO, String token) { + + String msgUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + token; + + String input = "{\n" + + " \"touser\":\"" + pushMsgPO.getOpenId() + "\",\n" + + " \"template_id\":\"" + wechatConfig.getTemplateId() + "\",\n" + + " \"url\":\"" + wechatConfig.getMsgUrl() + "\",\n" + + " \"data\":{\n" + + " \"first\":{\n" + + " \"value\":\"" + pushMsgPO.getTitle() + "\",\n" + + " \"color\":\"#173177\"\n" + + " },\n" + + " \"keyword1\":{\n" + + " \"value\":\"" + pushMsgPO.getSchool() + "\",\n" + + " \"color\":\"#173177\"\n" + + " },\n" + + " \"keyword2\":{\n" + + " \"value\":\"" + pushMsgPO.getTeacherName() + "\",\n" + + " \"color\":\"#173177\"\n" + + " },\n" + + " \"keyword3\":{\n" + + " \"value\":\"" + pushMsgPO.getTaskName() + "\",\n" + + " \"color\":\"#173177\"\n" + + " },\n" + + " \"keyword4\":{\n" + + " \"value\":\"" + pushMsgPO.getDateTime() + "\",\n" + + " \"color\":\"#173177\"\n" + +// " },\n" + +// " \"remark\":{\n" + +// " \"value\":\""+pushMsgPO.getRemark()+"\",\n" + +// " \"color\":\"#173177\"\n" + + " }\n" + + " }\n" + + "}"; + + + HttpHeaders headers = new HttpHeaders(); + + ResponseEntity responseEntity = restTemplateConfig.restTemplate() + .exchange(msgUrl, HttpMethod.POST, new HttpEntity<>(input.getBytes(), headers), PushMsgVO.class); + } + + //新增微视频 书面作业 关联习题 拓展习题 + public void addTaskContents(PublishTasksDTO publishTasksDTO, Integer taskId,Integer classId,String taskName) { + + //保存微视频作业 + String[] vodIds = publishTasksDTO.getVodIds().split(","); + if (!StringUtils.isEmpty(publishTasksDTO.getVodIds()) && vodIds.length > 0) { + for (String integer : vodIds) { + TaskContentDO tc = new TaskContentDO(); + tc.setTaskId(taskId); + tc.setContentType(0); + tc.setContentId(Integer.valueOf(integer)); + tc.setCreateDate(LocalDateTime.now()); + tc.setUpdateDate(LocalDateTime.now()); + taskContentMapper.insert(tc); + } + } + + //保存关联习题 + //关联知识点 +// String[] treeIds = publishTasksRequestVO.getTreeIds().split(","); + //老师布置的关联习题 + List relatedIds = Arrays.asList(publishTasksDTO.getRelatedIds().split(",")); + if (!StringUtils.isEmpty(publishTasksDTO.getRelatedIds()) && relatedIds.size() > 0) { + for (String integer : relatedIds) { + //布置关联习题 + ExerciseRelatedMappingDO exerciseRelatedMappingDO = new ExerciseRelatedMappingDO(); + exerciseRelatedMappingDO.setTaskId(taskId); + exerciseRelatedMappingDO.setTreeId(Integer.valueOf(integer)); + exerciseRelatedMappingDO.setExerciseName(taskName); + + List exerciseTreeMappingDOS = exerciseTreeMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ExerciseTreeMappingDO::getTreeId,integer) + .eq(ExerciseTreeMappingDO::getStatus,1)); + + StringBuilder stringBuilder = new StringBuilder(); + + for (ExerciseTreeMappingDO exerciseTreeMappingDO : exerciseTreeMappingDOS){ + stringBuilder.append(exerciseTreeMappingDO.getExerciseId()); + stringBuilder.append(","); + } + String exerciseIds = stringBuilder.toString().substring(0,stringBuilder.length()-1); + exerciseRelatedMappingDO.setExerciseIds(exerciseIds); + + + List classesUserMappingDOS = classesUserMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassesUserMappingDO::getClassesId,classId)); + StrBuilder strBuilder = new StrBuilder(); + for (ClassesUserMappingDO classesUserMappingDO : classesUserMappingDOS){ + strBuilder.append(classesUserMappingDO.getUserId()); + strBuilder.append(","); + } + String userIds = strBuilder.toString().substring(0,strBuilder.length()-1); + exerciseRelatedMappingDO.setStudentIds(userIds); + exerciseRelatedMappingMapper.insert(exerciseRelatedMappingDO); + + TaskContentDO tc = new TaskContentDO(); + tc.setTaskId(taskId); + tc.setContentType(1); + tc.setContentId(exerciseRelatedMappingDO.getId()); + tc.setCreateDate(LocalDateTime.now()); + tc.setUpdateDate(LocalDateTime.now()); + taskContentMapper.insert(tc); + + } + } + + + + + //拓展习题 + List publishExpandingVOS = publishTasksDTO.getPublishExpandingVOS(); + if (publishExpandingVOS.size() > 0) { + for (PublishExpandingVO pev : publishExpandingVOS) { + ExerciseExpandMappingDO eem = new ExerciseExpandMappingDO(); + eem.setTaskId(taskId); + eem.setExerciseIds(pev.getExpandingExeIds()); + eem.setStudentIds(pev.getExpandingStudents()); + eem.setExerciseName(pev.getExpandingName()); + eem.setCreateDate(LocalDateTime.now()); + eem.setUpdateDate(LocalDateTime.now()); + exerciseExpandMappingMapper.insert(eem); + TaskContentDO taskContent = new TaskContentDO(); + taskContent.setTaskId(taskId); + taskContent.setContentType(2); + taskContent.setContentId(eem.getId()); + taskContent.setCreateDate(LocalDateTime.now()); + taskContent.setUpdateDate(LocalDateTime.now()); + taskContentMapper.insert(taskContent); + } + + } + + //附件作业 + List publishHomeworkVOS = publishTasksDTO.getPublishHomeworkVOS(); + if (publishHomeworkVOS.size() > 0) { + for (PublishHomeworkVO phk : publishHomeworkVOS) { + WrittenHomeworkDO writtenHomework = new WrittenHomeworkDO(); + writtenHomework.setHomeworkType(phk.getHomeworkType()); + writtenHomework.setHomeworkContent(phk.getHomeworkContent()); + writtenHomework.setFileName(phk.getFileName()); + writtenHomework.setAdviceLength(publishTasksDTO.getAdviceLength()); + writtenHomework.setFileSize(phk.getFileSize()); + writtenHomework.setFileType(phk.getFileType()); + writtenHomework.setCreateDate(LocalDateTime.now()); + writtenHomework.setUpdateDate(LocalDateTime.now()); + writtenHomeworkMapper.insert(writtenHomework); + TaskContentDO taskContent = new TaskContentDO(); + taskContent.setContentType(3); + taskContent.setTaskId(taskId); + taskContent.setContentId(writtenHomework.getId()); + taskContent.setUpdateDate(LocalDateTime.now()); + taskContent.setCreateDate(LocalDateTime.now()); + taskContentMapper.insert(taskContent); + } + } + + } + + public String labels(String ids) { + StringBuilder sb = new StringBuilder(); + if (!StringUtils.isEmpty(ids)) { + String[] arr = ids.split(","); + if (arr.length > 0) { + for (String str : arr) { + SubjectTreeDO knowledgeTree = subjectTreeMapper.selectById(str); + if (null != knowledgeTree) { + sb.append(knowledgeTree.getTreeName()).append(";"); + } + } + return sb.substring(0, sb.length() - 1); + } else { + return ""; + } + } else { + return ""; + } + + } + +} diff --git b/src/main/java/com/meishu/service/impl/ClassesDictHistoryServiceImpl.java a/src/main/java/com/meishu/service/impl/ClassesDictHistoryServiceImpl.java new file mode 100644 index 0000000..f14f4b9 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/ClassesDictHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ClassesDictHistoryDO; +import com.meishu.mapper.ClassesDictHistoryMapper; +import com.meishu.service.ClassesDictHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 学校班级字典表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +@Service +public class ClassesDictHistoryServiceImpl extends ServiceImpl implements ClassesDictHistoryService { + +} diff --git b/src/main/java/com/meishu/service/impl/ClassesDictServiceImpl.java a/src/main/java/com/meishu/service/impl/ClassesDictServiceImpl.java new file mode 100644 index 0000000..3665003 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/ClassesDictServiceImpl.java @@ -0,0 +1,373 @@ +package com.meishu.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.meishu.dto.classes.*; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.ClassesDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.classes.GetClassStudentsVO; +import com.meishu.vo.classes.GetClassesVO; +import com.meishu.vo.classes.SubjectDictVO; +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.*; + +/** + *

+ * 学校班级字典表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +@Service +public class ClassesDictServiceImpl extends ServiceImpl implements ClassesDictService { + + @Autowired + private SubjectDictMapper subjectDictMapper; + + @Autowired + private SubjectSemesterMapper subjectSemesterMapper; + + @Autowired + private UserSubjectMappingMapper userSubjectMappingMapper; + + @Autowired + private ClassesUserMappingMapper classesUserMappingMapper; + + @Autowired + private ClassesDictHistoryMapper classesDictHistoryMapper; + + @Autowired + private UserSubjectPermissionDictMapper userSubjectPermissionDictMapper; + + @Autowired + private KnowledgeSubjectDictMapper knowledgeSubjectDictMapper; + + public IPage getClasses(GetClassesDTO getClassesDTO) { + + Page pager = new Page(getClassesDTO.getPageNum(), getClassesDTO.getPageSize()); + + IPage getClassesVOIPage = this.baseMapper.getClasses(pager, getClassesDTO.getClassName(), getClassesDTO.getGrade(), getClassesDTO.getSession(), getClassesDTO.getStatus()); + + List getClassesVOS = getClassesVOIPage.getRecords(); + //找出班级所有的科目 + for (GetClassesVO getClassesVO : getClassesVOS) { + List subjectDictDOS = subjectDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectDictDO::getGrade, getClassesVO.getGrade()) + .eq(SubjectDictDO::getClasses, getClassesVO.getClasses()) + .eq(SubjectDictDO::getSession, getClassesVO.getSession())); + + List subjectDictVOS = new ArrayList<>(); + for (SubjectDictDO subjectDictDO : subjectDictDOS) { + SubjectDictVO subjectDictVO = new SubjectDictVO(); + BeanUtils.copyProperties(subjectDictDO, subjectDictVO); + //查询该科目下的授课老师 + List administerDOS = userSubjectMappingMapper.querySubjectTeachers(subjectDictDO.getId()); + subjectDictVO.setAdministerDOS(administerDOS); + + KnowledgeSubjectDictDO knowledgeSubjectDict = knowledgeSubjectDictMapper.selectOne(new QueryWrapper() + .lambda() + .eq(KnowledgeSubjectDictDO::getSubjectName, subjectDictDO.getSubject())); + if (null != knowledgeSubjectDict) { + subjectDictVO.setId(knowledgeSubjectDict.getId().intValue()); + } else { + subjectDictVO.setId(null); + } + subjectDictVOS.add(subjectDictVO); + } + getClassesVO.setSubjectDictDOS(subjectDictVOS); + } + getClassesVOIPage.setRecords(getClassesVOS); + return getClassesVOIPage; + } + + @Transactional(rollbackFor = Exception.class) + public String addClass(AddClassDTO addClassDTO) { + + ClassesDictDO classesDictDO = new ClassesDictDO(); + BeanUtils.copyProperties(addClassDTO, classesDictDO); + classesDictDO.setClassName(classesDictDO.getGrade() + "(" + classesDictDO.getClasses() + ")班"); + classesDictDO.setSchool(ConstantUtils.SCHOOL); + classesDictDO.setSubjectType("高中"); + classesDictDO.setStatus("在读"); + + + Calendar cal = Calendar.getInstance(); + int year = cal.get(Calendar.YEAR); + int month = cal.get(Calendar.MONTH)+1;//获取月份 + + Date date = new Date(); + if (month>=7){ + date.setYear(year-1899); + date.setMonth(7); + date.setDate(1); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + }else { + date.setYear(year-1900); + date.setMonth(7); + date.setDate(1); + date.setHours(0); + date.setMinutes(0); + date.setSeconds(0); + } + classesDictDO.setUpgradeDate(date); + this.baseMapper.insert(classesDictDO); + + ClassesDictHistoryDO classesDictHistoryDO = new ClassesDictHistoryDO(); + BeanUtils.copyProperties(addClassDTO, classesDictHistoryDO); + classesDictHistoryDO.setClassName(classesDictDO.getClassName()); + classesDictHistoryDO.setSchool(classesDictDO.getSchool()); + classesDictHistoryDO.setSubjectType(classesDictDO.getSubjectType()); + classesDictHistoryDO.setStatus("在读"); + classesDictHistoryDO.setClassDictId(classesDictDO.getId()); + classesDictHistoryMapper.insert(classesDictHistoryDO); + + //找到班级所有学生 + List classesUserMappingDOS = classesUserMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassesUserMappingDO::getClassesId,addClassDTO.getId())); + + + //添加 班级里的科目信息 + List subjects = addClassDTO.getSubjects(); + for (String str : subjects) { + SubjectDictDO subjectDictDO = new SubjectDictDO(); + subjectDictDO.setSchool(ConstantUtils.SCHOOL); + subjectDictDO.setGrade(addClassDTO.getGrade()); + subjectDictDO.setClasses(addClassDTO.getClasses()); + subjectDictDO.setClassName(classesDictDO.getClassName()); + subjectDictDO.setSubject(knowledgeSubjectDictMapper.selectById(str).getSubjectName()); + subjectDictDO.setSubjectType("高中"); + subjectDictDO.setSession(classesDictDO.getSession()); + subjectDictDO.setStatus("在读"); + subjectDictMapper.insert(subjectDictDO); + + SubjectSemesterDO subjectSemesterDO = new SubjectSemesterDO(); + subjectSemesterDO.setSubjectId(subjectDictDO.getId()); + subjectSemesterDO.setSemester("上"); + subjectSemesterMapper.insert(subjectSemesterDO); + +// for (ClassesUserMappingDO classesUserMappingDO : classesUserMappingDOS){ +// PtStudentScoreDO ptStudentScoreDO = new PtStudentScoreDO(); +// ptStudentScoreDO.setScore(30.0); +// ptStudentScoreDO.setScoreRecord(30.0); +// ptStudentScoreDO.setSemesterId(subjectSemesterDO.getId()); +// ptStudentScoreDO.setStudentId(classesUserMappingDO.getUserId()); +// ptStudentScoreDO.setSubjectId(subjectDictDO.getId()); +// } + + subjectSemesterDO.setSemester("下"); + subjectSemesterMapper.insert(subjectSemesterDO); + +// for (ClassesUserMappingDO classesUserMappingDO : classesUserMappingDOS){ +// PtStudentScoreDO ptStudentScoreDO = new PtStudentScoreDO(); +// ptStudentScoreDO.setScore(30.0); +// ptStudentScoreDO.setScoreRecord(30.0); +// ptStudentScoreDO.setSemesterId(subjectSemesterDO.getId()); +// ptStudentScoreDO.setStudentId(classesUserMappingDO.getUserId()); +// ptStudentScoreDO.setSubjectId(subjectDictDO.getId()); +// } + + } + + return ConstantUtils.ADD_SUCCESS; + } + + public String updateClass(AddClassDTO addClassDTO) { + + ClassesDictHistoryDO classesDictHistoryDO = classesDictHistoryMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ClassesDictHistoryDO::getStatus,"在读") + .eq(ClassesDictHistoryDO::getClassDictId,addClassDTO.getId())); + + classesDictHistoryDO.setGrade(addClassDTO.getGrade()); + classesDictHistoryDO.setClasses(addClassDTO.getClasses()); + classesDictHistoryDO.setSession(addClassDTO.getSession()); + classesDictHistoryDO.setClassName(classesDictHistoryDO.getGrade() + "(" + classesDictHistoryDO.getClasses() + ")班"); + classesDictHistoryMapper.updateById(classesDictHistoryDO); + + ClassesDictDO classesDictDO = new ClassesDictDO(); + BeanUtils.copyProperties(classesDictHistoryDO, classesDictDO); + classesDictDO.setId(addClassDTO.getId()); + classesDictDO.setClassName(classesDictDO.getGrade() + "(" + classesDictDO.getClasses() + ")班"); + this.baseMapper.updateById(classesDictDO); + + //查找该班级下已经有的科目 + List existSubject = subjectDictMapper.getClassSubjectName(classesDictHistoryDO.getGrade(),classesDictHistoryDO.getClasses(),classesDictHistoryDO.getSession()); + + //找到班级所有学生 + List classesUserMappingDOS = classesUserMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassesUserMappingDO::getClassesId,addClassDTO.getId())); + + List subjects = addClassDTO.getSubjects(); + for (String str : subjects) { + KnowledgeSubjectDictDO knowledgeSubjectDictDO = knowledgeSubjectDictMapper.selectById(str); + if (!existSubject.contains(knowledgeSubjectDictDO.getSubjectName())){ + SubjectDictDO subjectDictDO = new SubjectDictDO(); + subjectDictDO.setSchool(ConstantUtils.SCHOOL); + subjectDictDO.setGrade(addClassDTO.getGrade()); + subjectDictDO.setClasses(addClassDTO.getClasses()); + subjectDictDO.setClassName(classesDictDO.getClassName()); + subjectDictDO.setSubject(knowledgeSubjectDictMapper.selectById(str).getSubjectName()); + subjectDictDO.setSubjectType("高中"); + subjectDictDO.setSession(classesDictDO.getSession()); + subjectDictDO.setStatus("1"); + subjectDictMapper.insert(subjectDictDO); + + SubjectSemesterDO subjectSemesterDO = new SubjectSemesterDO(); + subjectSemesterDO.setSubjectId(subjectDictDO.getId()); + subjectSemesterDO.setSemester("上"); + subjectSemesterMapper.insert(subjectSemesterDO); + + for (ClassesUserMappingDO classesUserMappingDO : classesUserMappingDOS){ + PtStudentScoreDO ptStudentScoreDO = new PtStudentScoreDO(); + ptStudentScoreDO.setScore(30.0); + ptStudentScoreDO.setScoreRecord(30.0); + ptStudentScoreDO.setSemesterId(subjectSemesterDO.getId()); + ptStudentScoreDO.setStudentId(classesUserMappingDO.getUserId()); + ptStudentScoreDO.setSubjectId(subjectDictDO.getId()); + } + + subjectSemesterDO.setSemester("下"); + subjectSemesterMapper.insert(subjectSemesterDO); + for (ClassesUserMappingDO classesUserMappingDO : classesUserMappingDOS){ + PtStudentScoreDO ptStudentScoreDO = new PtStudentScoreDO(); + ptStudentScoreDO.setScore(30.0); + ptStudentScoreDO.setScoreRecord(30.0); + ptStudentScoreDO.setSemesterId(subjectSemesterDO.getId()); + ptStudentScoreDO.setStudentId(classesUserMappingDO.getUserId()); + ptStudentScoreDO.setSubjectId(subjectDictDO.getId()); + } + } + } + + return ConstantUtils.SUCCESS_UPDATE; + } + + @Transactional(rollbackFor = Exception.class) + public String addSubjectTeacherMapping(AddSubjectTeacherDTO addSubjectTeacherDTO) { + + ClassesDictDO classesDictDO = this.baseMapper.selectById(addSubjectTeacherDTO.getClassId()); + List addSubjectTeacherMappingDTOS = addSubjectTeacherDTO.getAddSubjectTeacherMappingDTOS(); + + for (AddSubjectTeacherMappingDTO addSubjectTeacherMappingDTO :addSubjectTeacherMappingDTOS){ + KnowledgeSubjectDictDO knowledgeSubjectDict = knowledgeSubjectDictMapper.selectById(addSubjectTeacherMappingDTO.getSubjectId()); + + List integers = addSubjectTeacherMappingDTO.getTeacherIds(); + + SubjectDictDO subjectDictDO = subjectDictMapper.selectOne(new QueryWrapper() + .lambda() + .eq(SubjectDictDO::getGrade, classesDictDO.getGrade()) + .eq(SubjectDictDO::getSession, classesDictDO.getSession()) + .eq(SubjectDictDO::getClasses, classesDictDO.getClasses()) + .eq(SubjectDictDO::getSubject, knowledgeSubjectDict.getSubjectName())); + + userSubjectMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(UserSubjectMappingDO::getSubjectId,subjectDictDO.getId())); + + userSubjectPermissionDictMapper.delete(new QueryWrapper() + .lambda() + .eq(UserSubjectPermissionDictDO::getSubjectId,subjectDictDO.getId())); + + if (null != subjectDictDO) { + + for (Integer integer : integers) { + + UserSubjectMappingDO userSubjectMappingDO = new UserSubjectMappingDO(); + userSubjectMappingDO.setSubjectId(subjectDictDO.getId()); + userSubjectMappingDO.setUserId(integer); + userSubjectMappingDO.setClassType(0); + userSubjectMappingMapper.insert(userSubjectMappingDO); + + UserSubjectPermissionDictDO userSubjectPermissionDictDO = new UserSubjectPermissionDictDO(); + userSubjectPermissionDictDO.setSubjectId(subjectDictDO.getId()); + userSubjectPermissionDictDO.setUserId(integer); + userSubjectPermissionDictMapper.insert(userSubjectPermissionDictDO); + } + } + } + return ConstantUtils.ADD_SUCCESS; + } + + public List getClassStudents(GetClassStudentsDTO getClassStudentsDTO) { + +// Page pager = new Page(getClassStudentsDTO.getPageNum(), getClassStudentsDTO.getPageSize()); + return this.baseMapper.getClassStudents(getClassStudentsDTO.getClassId(), getClassStudentsDTO.getUserName()); + } + + public IPage queryNoClassStudents(QueryNoClassStudentsDTO queryNoClassStudentsDTO) { + Page pager = new Page(queryNoClassStudentsDTO.getPageNum(), queryNoClassStudentsDTO.getPageSize()); + return this.baseMapper.queryNoClassStudents(pager, queryNoClassStudentsDTO.getUserName()); + } + + @Transactional(rollbackFor = Exception.class) + public String batchAddStudentToClass(BatchAddStudentToClassDTO batchAddStudentToClassDTO) { + + List integers = batchAddStudentToClassDTO.getIds(); + + for (Integer integer : integers) { + classesUserMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(ClassesUserMappingDO::getUserId, integer)); + + ClassesUserMappingDO classesUserMappingDO = new ClassesUserMappingDO(); + classesUserMappingDO.setClassesId(batchAddStudentToClassDTO.getClassId()); + classesUserMappingDO.setUserId(integer); + classesUserMappingDO.setStatus(1); + classesUserMappingMapper.insert(classesUserMappingDO); + } + return ConstantUtils.ADD_SUCCESS; + } + + public String batchDeleteStudent(BatchAddStudentToClassDTO batchAddStudentToClassDTO) { + + List integers = batchAddStudentToClassDTO.getIds(); + + for (Integer integer : integers) { + classesUserMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(ClassesUserMappingDO::getClassesId, batchAddStudentToClassDTO.getClassId()) + .eq(ClassesUserMappingDO::getUserId, integer)); + } + + return ConstantUtils.DELETE_SUCCESS; + } + + public List getClassesWithPage() { + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassesDictDO::getStatus, "在读")); + } + + @Override + public ClassesDictDO getClassesById(Long studentId) { + return this.baseMapper.getClassesById(studentId); + } + + public String batchUpGrade(BatchUpGradeDTO batchUpGradeDTO){ + + List ids = batchUpGradeDTO.getIds(); + + for (Integer id : ids){ + ClassesDictDO classesDictDO = new ClassesDictDO(); + classesDictDO.setId(id); + classesDictDO.setUpgradeDate(batchUpGradeDTO.getUpgradeDate()); + this.baseMapper.updateById(classesDictDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + +} diff --git b/src/main/java/com/meishu/service/impl/ClassesUserMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/ClassesUserMappingServiceImpl.java new file mode 100644 index 0000000..cb8a79c --- /dev/null +++ a/src/main/java/com/meishu/service/impl/ClassesUserMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ClassesUserMappingDO; +import com.meishu.mapper.ClassesUserMappingMapper; +import com.meishu.service.ClassesUserMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 班级--学生--映射表(包括以前的班级) 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ +@Service +public class ClassesUserMappingServiceImpl extends ServiceImpl implements ClassesUserMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/CourseAdministerMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/CourseAdministerMappingServiceImpl.java new file mode 100644 index 0000000..944831f --- /dev/null +++ a/src/main/java/com/meishu/service/impl/CourseAdministerMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.CourseAdministerMappingDO; +import com.meishu.mapper.CourseAdministerMappingMapper; +import com.meishu.service.CourseAdministerMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 课程老师映射表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-25 + */ +@Service +public class CourseAdministerMappingServiceImpl extends ServiceImpl implements CourseAdministerMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/CourseStudentStatusHistoryServiceImpl.java a/src/main/java/com/meishu/service/impl/CourseStudentStatusHistoryServiceImpl.java new file mode 100644 index 0000000..28da90c --- /dev/null +++ a/src/main/java/com/meishu/service/impl/CourseStudentStatusHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.CourseStudentStatusHistoryDO; +import com.meishu.mapper.CourseStudentStatusHistoryMapper; +import com.meishu.service.CourseStudentStatusHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-27 + */ +@Service +public class CourseStudentStatusHistoryServiceImpl extends ServiceImpl implements CourseStudentStatusHistoryService { + +} diff --git b/src/main/java/com/meishu/service/impl/CourseTreeExerciseStudentResultServiceImpl.java a/src/main/java/com/meishu/service/impl/CourseTreeExerciseStudentResultServiceImpl.java new file mode 100644 index 0000000..814b904 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/CourseTreeExerciseStudentResultServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.CourseTreeExerciseStudentResultDO; +import com.meishu.mapper.CourseTreeExerciseStudentResultMapper; +import com.meishu.service.CourseTreeExerciseStudentResultService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 课程--学生做题记录 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-25 + */ +@Service +public class CourseTreeExerciseStudentResultServiceImpl extends ServiceImpl implements CourseTreeExerciseStudentResultService { + +} diff --git b/src/main/java/com/meishu/service/impl/CourseTreeVodStudentResultServiceImpl.java a/src/main/java/com/meishu/service/impl/CourseTreeVodStudentResultServiceImpl.java new file mode 100644 index 0000000..8a62727 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/CourseTreeVodStudentResultServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.CourseTreeVodStudentResultDO; +import com.meishu.mapper.CourseTreeVodStudentResultMapper; +import com.meishu.service.CourseTreeVodStudentResultService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 学生视频完成情况 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-20 + */ +@Service +public class CourseTreeVodStudentResultServiceImpl extends ServiceImpl implements CourseTreeVodStudentResultService { + +} diff --git b/src/main/java/com/meishu/service/impl/CourseVodTreeStudentResultServiceImpl.java a/src/main/java/com/meishu/service/impl/CourseVodTreeStudentResultServiceImpl.java new file mode 100644 index 0000000..6c18a64 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/CourseVodTreeStudentResultServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.CourseTreeVodStudentResultDO; +import com.meishu.mapper.CourseVodTressStudentResultMapper; +import com.meishu.service.CourseTreeVodStudentResultService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 学生视频完成情况 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +@Service +public class CourseVodTreeStudentResultServiceImpl extends ServiceImpl implements CourseTreeVodStudentResultService { + +} diff --git b/src/main/java/com/meishu/service/impl/DepartmentDictServiceImpl.java a/src/main/java/com/meishu/service/impl/DepartmentDictServiceImpl.java new file mode 100644 index 0000000..7b0dc6c --- /dev/null +++ a/src/main/java/com/meishu/service/impl/DepartmentDictServiceImpl.java @@ -0,0 +1,285 @@ +package com.meishu.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.meishu.common.exception.HttpException; +import com.meishu.dto.department.BatchOprDTO; +import com.meishu.dto.department.GetAllDepartmentVO; +import com.meishu.dto.department.GetTeachersDTO; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.mapper.AdministerDepartmentMappingMapper; +import com.meishu.mapper.AdministerMapper; +import com.meishu.model.*; +import com.meishu.mapper.DepartmentDictMapper; +import com.meishu.service.DepartmentDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.administer.GetTeachersVO; +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; + +/** + *

+ * 部门字典表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@Service +public class DepartmentDictServiceImpl extends ServiceImpl implements DepartmentDictService { + + @Autowired + private AdministerMapper administerMapper; + + @Autowired + private AdministerDepartmentMappingMapper administerDepartmentMappingMapper; + + public List getDepartmentInfo() { + + //返回结果 + List getAllDepartmentVOS = new ArrayList<>(); + + //获取所有的父节点 + List parentNodes = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .isNull(DepartmentDictDO::getParentId)); + + //遍历父节点 + for (DepartmentDictDO departmentDictDO : parentNodes) { + GetAllDepartmentVO getAllDepartmentVO = new GetAllDepartmentVO(); + BeanUtils.copyProperties(departmentDictDO, getAllDepartmentVO); + if (null != departmentDictDO.getParentId()) { + DepartmentDictDO departmentDictDO1 = this.baseMapper.selectById(departmentDictDO.getParentId()); + getAllDepartmentVO.setParentDepartmentName(departmentDictDO1.getDepartmentName()); + } + getAllDepartmentVO.setChildren(getChildNodes(getAllDepartmentVO)); + AdministerDO administerDO = administerMapper.selectById(getAllDepartmentVO.getDepartmentLeaderId()); + if (null != administerDO) { + List administerDepartmentMappingDOS = administerDepartmentMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(AdministerDepartmentMappingDO::getAdministerId, administerDO.getId())); + getAllDepartmentVO.setAdministerDepartmentMappingDOS(administerDepartmentMappingDOS); + getAllDepartmentVO.setAdministerId(administerDO.getId()); + getAllDepartmentVO.setUserName(administerDO.getUserName()); + getAllDepartmentVO.setImg(administerDO.getImg()); + } + Integer count = administerDepartmentMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(AdministerDepartmentMappingDO::getDepartmentId, departmentDictDO.getId())); + getAllDepartmentVO.setCount(count); + //部门人员 + List administerDOS = administerMapper.getAdministerByDepartmentId(departmentDictDO.getId()); + getAllDepartmentVO.setAdministerDOS(administerDOS); + + getAllDepartmentVOS.add(getAllDepartmentVO); + } + return getAllDepartmentVOS; + } + + public List getDepartmentList(GetSubjectTreeDTO getSubjectTreeDTO) { + + //查看角色所在部门 + List departmentDictDOS = administerMapper.getDepartmentByAdministerId(getSubjectTreeDTO.getUserId()); + + List ids = new ArrayList<>(); + for (DepartmentDictDO departmentDictDO : departmentDictDOS) { + ids.add(departmentDictDO.getId()); + } + + List parentNodes = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getParentId, 1) + .in(DepartmentDictDO::getId, ids)); + + for (DepartmentDictDO departmentDictDO : parentNodes) { + departmentDictDO.setChildren(getChildNodes(departmentDictDO)); + } + return parentNodes; + } + + public String addDepartment(DepartmentDictDO departmentDictDO) { + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getDepartmentName, departmentDictDO.getDepartmentName())); + + if (count > 0) { + throw new HttpException(20001); + } + + this.baseMapper.insert(departmentDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public IPage getTeachers(GetTeachersDTO getTeachersDTO) { + + Page pager = new Page(getTeachersDTO.getPageNum(), getTeachersDTO.getPageSize()); + + List userIds = new ArrayList<>(); + + //查看该角色所在部门 + if (null == getTeachersDTO.getDepartmentId()){ + List departmentDictDOS = administerMapper.getDepartmentByAdministerId(getTeachersDTO.getUserId()); + for (DepartmentDictDO departmentDictDO : departmentDictDOS){ + userIds.add(departmentDictDO.getId()); + } + } + + IPage getTeachersVOIPage = administerMapper.getDepartmentTeachers(pager, getTeachersDTO.getDepartmentId(), getTeachersDTO.getCampusId(), getTeachersDTO.getUserName(),userIds); + List getTeachersVOS = getTeachersVOIPage.getRecords(); + for (GetTeachersVO getTeachersVO : getTeachersVOS) { +// List campusDictDOS = administerMapper.getTeacherCampus(getTeachersVO.getId()); +// getTeachersVO.setCampusDictDOS(campusDictDOS); + //部门 + List departmentDictDOS = administerMapper.getDepartmentByAdministerId(getTeachersVO.getId()); + getTeachersVO.setDepartmentDictDOS(departmentDictDOS); + + //科目 + List knowledgeSubjectDicts = administerMapper.getTeacherSubjects(getTeachersVO.getId()); + getTeachersVO.setKnowledgeSubjectDicts(knowledgeSubjectDicts); + + //角色 + List roleDictDOS = administerMapper.getTeacherRoles(getTeachersVO.getId()); + getTeachersVO.setRoleDictDOS(roleDictDOS); + + //多个在读班级 + List subjectDictDOS = administerMapper.getTeacherClasses(getTeachersVO.getId()); + getTeachersVO.setSubjectDictDOS(subjectDictDOS); + + } + return getTeachersVOIPage; + } + + public String batchOpr(BatchOprDTO batchOprDTO) { + + List longs = batchOprDTO.getIds(); + for (Long lg : longs) { + DepartmentDictDO departmentDictDO = this.baseMapper.selectById(lg); + if (null != batchOprDTO.getDepartmentLeaderId()) { + departmentDictDO.setDepartmentLeaderId(batchOprDTO.getDepartmentLeaderId()); + } + if (null != batchOprDTO.getParentId()) { + departmentDictDO.setParentId(batchOprDTO.getParentId()); + } + this.baseMapper.updateById(departmentDictDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + + + public String deleteDepartment(BatchOprDTO batchOprDTO) { + + List longs = batchOprDTO.getIds(); + + for (Long lg : longs) { + List departmentDictDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getParentId, lg) + ); + + for (DepartmentDictDO departmentDictDO1 : departmentDictDOS) { + deleteChildNode(departmentDictDO1); + } + this.baseMapper.deleteById(lg); + } + + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateDepartment(DepartmentDictDO departmentDictDO) { + this.baseMapper.updateById(departmentDictDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + void deleteChildNode(DepartmentDictDO departmentDictDO) { + + List departmentDictDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getParentId, departmentDictDO.getId())); + + for (DepartmentDictDO departmentDictDO1 : departmentDictDOS) { + deleteChildNode(departmentDictDO1); + } + this.baseMapper.deleteById(departmentDictDO.getId()); + } + + + /** + * 递归 带上部门总数,部门负责人等参数 + * + * @param getAllDepartmentVO 父节点查找该节点的children + * @return 子节点 + */ + public List getChildNodes(GetAllDepartmentVO getAllDepartmentVO) { + + List getAllDepartmentVOS = new ArrayList<>(); + + //查询该节点的子节点 + List departmentDictDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getParentId, getAllDepartmentVO.getId())); + + //递归 + for (DepartmentDictDO dd : departmentDictDOS) { + GetAllDepartmentVO getAllDepartmentVO1 = new GetAllDepartmentVO(); + BeanUtils.copyProperties(dd, getAllDepartmentVO1); + if (null != dd.getParentId()) { + DepartmentDictDO departmentDictDO = this.baseMapper.selectById(dd.getParentId()); + getAllDepartmentVO1.setParentDepartmentName(departmentDictDO.getDepartmentName()); + } + getAllDepartmentVO1.setChildren(getChildNodes(getAllDepartmentVO1)); + AdministerDO administerDO = administerMapper.selectById(getAllDepartmentVO1.getDepartmentLeaderId()); + if (null != administerDO) { + List administerDepartmentMappingDOS = administerDepartmentMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(AdministerDepartmentMappingDO::getAdministerId, administerDO.getId())); + getAllDepartmentVO1.setAdministerDepartmentMappingDOS(administerDepartmentMappingDOS); + getAllDepartmentVO1.setUserName(administerDO.getUserName()); + getAllDepartmentVO1.setImg(administerDO.getImg()); + getAllDepartmentVO1.setAdministerId(administerDO.getId()); + } + Integer count = administerDepartmentMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(AdministerDepartmentMappingDO::getDepartmentId, dd.getId())); + getAllDepartmentVO1.setCount(count); + //部门人员 + List administerDOS = administerMapper.getAdministerByDepartmentId(dd.getId()); + getAllDepartmentVO1.setAdministerDOS(administerDOS); + getAllDepartmentVOS.add(getAllDepartmentVO1); + } + if (departmentDictDOS.size() == 0) { + return null; + } + + return getAllDepartmentVOS; + } + + /** + * 递归部门列表 不包含老师信息和人数信息 + * + * @param departmentDictDO + * @return + */ + public List getChildNodes(DepartmentDictDO departmentDictDO) { + + List departmentDictDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getParentId, departmentDictDO.getId())); + + for (DepartmentDictDO departmentDictDO1 : departmentDictDOS) { + departmentDictDO1.setChildren(getChildNodes(departmentDictDO1)); + } + + if (departmentDictDOS.size() == 0) { + return null; + } + return departmentDictDOS; + } + + +} diff --git b/src/main/java/com/meishu/service/impl/ExerciseCourseTreeMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/ExerciseCourseTreeMappingServiceImpl.java new file mode 100644 index 0000000..e5112eb --- /dev/null +++ a/src/main/java/com/meishu/service/impl/ExerciseCourseTreeMappingServiceImpl.java @@ -0,0 +1,45 @@ +package com.meishu.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.meishu.dto.exercise.QueryCourseTreeExerciseDTO; +import com.meishu.dto.exercise.UpdateStatusDTO; +import com.meishu.model.CourseTreeDO; +import com.meishu.model.ExerciseCourseTreeMappingDO; +import com.meishu.mapper.ExerciseCourseTreeMappingMapper; +import com.meishu.service.ExerciseCourseTreeMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.exercise.QueryCourseTreeExerciseVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 课程知识树--题目字典表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-24 + */ +@Service +public class ExerciseCourseTreeMappingServiceImpl extends ServiceImpl implements ExerciseCourseTreeMappingService { + + @Autowired + private ExerciseCourseTreeMappingMapper exerciseCourseTreeMappingMapper; + + public String updateStatus(UpdateStatusDTO updateStatusDTO){ + + List ids = updateStatusDTO.getIds(); + for (Long lg : ids){ + ExerciseCourseTreeMappingDO exerciseCourseTreeMappingDO = this.baseMapper.selectById(lg); + exerciseCourseTreeMappingDO.setStatus(updateStatusDTO.getStatus()); + this.baseMapper.updateById(exerciseCourseTreeMappingDO); + } + return ConstantUtils.SET_SUCCESS; + } + +} diff --git b/src/main/java/com/meishu/service/impl/ExerciseDictServiceImpl.java a/src/main/java/com/meishu/service/impl/ExerciseDictServiceImpl.java new file mode 100644 index 0000000..4af7b0b --- /dev/null +++ a/src/main/java/com/meishu/service/impl/ExerciseDictServiceImpl.java @@ -0,0 +1,291 @@ +package com.meishu.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.meishu.dto.exercise.AddExerciseDTO; +import com.meishu.dto.exercise.CheckExerciseDTO; +import com.meishu.dto.exercise.GetTreeExercisesDTO; +import com.meishu.dto.voddict.GetToCheckVodCountsDTO; +import com.meishu.dto.voddict.PublicCheckingDTO; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.ExerciseDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.exercise.GetExerciseDetailVO; +import com.meishu.vo.exercise.GetTreeExercisesVO; +import com.meishu.vo.voddict.GetToCheckCountsVO; +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.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 习题库 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class ExerciseDictServiceImpl extends ServiceImpl implements ExerciseDictService { + + @Autowired + private ExerciseTreeMappingMapper exerciseTreeMappingMapper; + + @Autowired + private KnowledgeSubjectDictMapper knowledgeSubjectDictMapper; + + @Autowired + private AdministerMapper administerMapper; + + public IPage getTreeExercises(GetTreeExercisesDTO getTreeExercisesDTO) { + + Page pager = new Page(getTreeExercisesDTO.getPageNum(), getTreeExercisesDTO.getPageSize()); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getTreeExercisesDTO.getSubjectId()); + + if ("1".equals(getTreeExercisesDTO.getShareStatus())) { + getTreeExercisesDTO.setUserId(null); + } + + //查看该老师的科目信息 + List subjectDictDOS = administerMapper.getTeacherSubjects(getTreeExercisesDTO.getUserId()); + + List strings = new ArrayList<>(); + for (KnowledgeSubjectDictDO subjectDictDO1 : subjectDictDOS) { + strings.add(subjectDictDO1.getSubjectEn()); + } + + IPage getTreeExercisesVOIPage = this.baseMapper.getTreeExercises(pager, getTreeExercisesDTO.getUserId(), subjectDictDO.getSubjectEn(), getTreeExercisesDTO.getTreeId(), getTreeExercisesDTO.getExerciseType(), getTreeExercisesDTO.getDifficulty(), getTreeExercisesDTO.getTitle(), getTreeExercisesDTO.getShareStatus(),getTreeExercisesDTO.getCheckStatus(),strings); + + List getTreeExercisesVOS = getTreeExercisesVOIPage.getRecords(); + for (GetTreeExercisesVO getTreeExercisesVO : getTreeExercisesVOS) { + //找知识树 + List subjectTreeDOS = this.baseMapper.getTrees(getTreeExercisesVO.getId()); + getTreeExercisesVO.setSubjectTreeDOS(subjectTreeDOS); + } + getTreeExercisesVOIPage.setRecords(getTreeExercisesVOS); + return getTreeExercisesVOIPage; + } + + public IPage getCheckTreeExercises(GetTreeExercisesDTO getTreeExercisesDTO){ + + Page pager = new Page(getTreeExercisesDTO.getPageNum(), getTreeExercisesDTO.getPageSize()); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getTreeExercisesDTO.getSubjectId()); + + //查看该老师的科目信息 + List subjectDictDOS = administerMapper.getTeacherSubjects(getTreeExercisesDTO.getUserId()); + + List strings = new ArrayList<>(); + for (KnowledgeSubjectDictDO subjectDictDO1 : subjectDictDOS) { + strings.add(subjectDictDO1.getSubjectEn()); + } + + IPage getTreeExercisesVOIPage = this.baseMapper.getTreeExercises(pager, null, subjectDictDO.getSubjectEn(), getTreeExercisesDTO.getTreeId(), getTreeExercisesDTO.getExerciseType(), getTreeExercisesDTO.getDifficulty(), getTreeExercisesDTO.getTitle(), getTreeExercisesDTO.getShareStatus(),getTreeExercisesDTO.getCheckStatus(),strings); + + List getTreeExercisesVOS = getTreeExercisesVOIPage.getRecords(); + for (GetTreeExercisesVO getTreeExercisesVO : getTreeExercisesVOS) { + //找知识树 + List subjectTreeDOS = this.baseMapper.getTrees(getTreeExercisesVO.getId()); + getTreeExercisesVO.setSubjectTreeDOS(subjectTreeDOS); + } + getTreeExercisesVOIPage.setRecords(getTreeExercisesVOS); + return getTreeExercisesVOIPage; + + } + + @Transactional(rollbackFor = Exception.class) + public String deleteExercise(ExerciseDictDO exerciseDictDO) { + +// Integer count = exerciseCourseTreeMappingMapper.selectCount(new QueryWrapper() +// .lambda() +// .eq(ExerciseCourseTreeMappingDO::getExerciseId, exerciseDictDO.getId())); +// +// if (count > 0) { +// throw new HttpException(30003); +// } +// + this.baseMapper.deleteById(exerciseDictDO.getId()); + + //删相关树 + exerciseTreeMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(ExerciseTreeMappingDO::getExerciseId, exerciseDictDO.getId())); + +// //删相关做题记录 +// exerciseDoneHistoryMapper.delete(new QueryWrapper() +// .lambda() +// .eq(ExerciseDoneHistoryDO::getExerciseId, exerciseDictDO.getId())); + + return ConstantUtils.DELETE_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String addExercise(AddExerciseDTO addExerciseDTO) { + ExerciseDictDO exerciseDictDO = new ExerciseDictDO(); + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(addExerciseDTO.getSubjectId()); + BeanUtils.copyProperties(addExerciseDTO, exerciseDictDO); + exerciseDictDO.setShareStatus("0"); + exerciseDictDO.setCheckStatus("0"); + exerciseDictDO.setSubjectId(subjectDictDO.getSubjectEn()); + this.baseMapper.insert(exerciseDictDO); + + List longs = addExerciseDTO.getTreeIds(); + for (Long lg : longs) { + ExerciseTreeMappingDO exerciseTreeMappingDO = new ExerciseTreeMappingDO(); + exerciseTreeMappingDO.setTreeId(lg); + exerciseTreeMappingDO.setExerciseId(exerciseDictDO.getId()); + exerciseTreeMappingMapper.insert(exerciseTreeMappingDO); + +// //新增的题目也要加到courseTree里去 +// List courseTreeDOS = courseTreeMapper.selectList(new QueryWrapper() +// .lambda() +// .eq(CourseTreeDO::getTreeId, lg)); +// +// for (CourseTreeDO courseTreeDO : courseTreeDOS) { +// ExerciseCourseTreeMappingDO exerciseCourseTreeMappingDO = new ExerciseCourseTreeMappingDO(); +// exerciseCourseTreeMappingDO.setExerciseId(exerciseDictDO.getId()); +// exerciseCourseTreeMappingDO.setStatus("0"); +// exerciseCourseTreeMappingDO.setCourseTreeId(courseTreeDO.getId()); +// exerciseCourseTreeMappingDO.setCourseId(lg); +// exerciseCourseTreeMappingMapper.insert(exerciseCourseTreeMappingDO); +// } + } + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String updateExercise(AddExerciseDTO addExerciseDTO) { + ExerciseDictDO exerciseDictDO = new ExerciseDictDO(); + BeanUtils.copyProperties(addExerciseDTO, exerciseDictDO); + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(addExerciseDTO.getSubjectId()); + if (null!=subjectDictDO){ + exerciseDictDO.setSubjectId(subjectDictDO.getSubjectEn()); + } + this.baseMapper.updateById(exerciseDictDO); + + exerciseTreeMappingMapper.delete(new QueryWrapper() + .lambda() + .in(ExerciseTreeMappingDO::getExerciseId, addExerciseDTO.getId())); + + List longs = addExerciseDTO.getTreeIds(); + for (Long lg : longs) { + ExerciseTreeMappingDO exerciseTreeMappingDO = new ExerciseTreeMappingDO(); + exerciseTreeMappingDO.setTreeId(lg); + exerciseTreeMappingDO.setExerciseId(exerciseDictDO.getId()); + exerciseTreeMappingMapper.insert(exerciseTreeMappingDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + + public GetToCheckCountsVO getToCheckExeCounts(GetToCheckVodCountsDTO getToCheckVodCountsDTO) { + + GetToCheckCountsVO getToCheckCountsVO = new GetToCheckCountsVO(); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getToCheckVodCountsDTO.getSubjectId()); + + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(ExerciseDictDO::getCheckStatus, "2") + .eq(ExerciseDictDO::getSubjectId, subjectDictDO.getSubjectEn())); + getToCheckCountsVO.setToCheckCounts(count); + + //已审核 包括已通过 未通过 + Integer counts1 = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(ExerciseDictDO::getSubjectId, subjectDictDO.getSubjectEn()) + .in(ExerciseDictDO::getCheckStatus, new String[]{"1", "3"})); + getToCheckCountsVO.setCheckCounts(counts1); + + return getToCheckCountsVO; + } + + public String checkExercise(CheckExerciseDTO checkExerciseDTO) { + + //审核通过 + if ("1".equals(checkExerciseDTO.getCheckStatus())) { + ExerciseDictDO exerciseDictDO = this.baseMapper.selectById(checkExerciseDTO.getId()); + + exerciseDictDO.setCheckStatus("1");// 已通过审核 + this.baseMapper.updateById(exerciseDictDO); + + exerciseDictDO.setShareStatus("1"); //已共享 + exerciseDictDO.setDifficulty(checkExerciseDTO.getDifficulty()); + exerciseDictDO.setAdviceLength(checkExerciseDTO.getAdviceLength()); + exerciseDictDO.setCreateDate(LocalDateTime.now()); + exerciseDictDO.setUpdateDate(LocalDateTime.now()); + this.baseMapper.insert(exerciseDictDO); + + List ids = checkExerciseDTO.getTreeIds(); + +// //取消之前的关联 +// exerciseTreeMappingMapper.delete(new QueryWrapper() +// .lambda() +// .eq(ExerciseTreeMappingDO::getExerciseId, checkExerciseDTO.getId())); + + for (Long lg : ids) { + //知识点关联 + ExerciseTreeMappingDO exerciseTreeMappingDO = new ExerciseTreeMappingDO(); + exerciseTreeMappingDO.setExerciseId(exerciseDictDO.getId()); + exerciseTreeMappingDO.setTreeId(lg); + exerciseDictDO.setStatus("0"); //不是关联习题 + exerciseTreeMappingMapper.insert(exerciseTreeMappingDO); + } + } else { + //不通过 + ExerciseDictDO exerciseDictDO = new ExerciseDictDO(); + BeanUtils.copyProperties(checkExerciseDTO, exerciseDictDO); + this.baseMapper.updateById(exerciseDictDO); + } + + return ConstantUtils.CHECK_STATUS; + } + + public IPage publicUpload(PublicCheckingDTO publicCheckingDTO) { + + Page pager = new Page(publicCheckingDTO.getPageNum(), publicCheckingDTO.getPageSize()); + return this.baseMapper.selectPage(pager, new QueryWrapper() + .lambda() + .eq(ExerciseDictDO::getAdministerId, publicCheckingDTO.getUserId()) + .eq(ExerciseDictDO::getCheckStatus, publicCheckingDTO.getCheckStatus())); + } + + public String withdraw(ExerciseDictDO exerciseDictDO) { + exerciseDictDO.setShareStatus("0"); + exerciseDictDO.setCheckStatus("0"); + this.baseMapper.updateById(exerciseDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public GetExerciseDetailVO getExerciseDetail(ExerciseDictDO exerciseDictDO) { + + GetExerciseDetailVO getExerciseDetailVO = new GetExerciseDetailVO(); + ExerciseDictDO exerciseDictDO1 = this.baseMapper.selectById(exerciseDictDO.getId()); + BeanUtils.copyProperties(exerciseDictDO1, getExerciseDetailVO); + + List subjectTreeDOS = this.baseMapper.getTrees(exerciseDictDO.getId()); + getExerciseDetailVO.setSubjectTreeDOS(subjectTreeDOS); + return getExerciseDetailVO; + } + + public String setRelatedExercise(ExerciseTreeMappingDO exerciseTreeMappingDO){ + + ExerciseTreeMappingDO exerciseTreeMappingDO1 = new ExerciseTreeMappingDO(); + exerciseTreeMappingDO1.setStatus(exerciseTreeMappingDO.getStatus()); + + exerciseTreeMappingMapper.update(exerciseTreeMappingDO1,new QueryWrapper() + .lambda() + .eq(ExerciseTreeMappingDO::getExerciseId,exerciseTreeMappingDO.getExerciseId())); + + return ConstantUtils.SUCCESS_UPDATE; + } + +} diff --git b/src/main/java/com/meishu/service/impl/ExerciseDoneHistoryServiceImpl.java a/src/main/java/com/meishu/service/impl/ExerciseDoneHistoryServiceImpl.java new file mode 100644 index 0000000..930ea54 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/ExerciseDoneHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ExerciseDoneHistoryDO; +import com.meishu.mapper.ExerciseDoneHistoryMapper; +import com.meishu.service.ExerciseDoneHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 学生做题记录表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class ExerciseDoneHistoryServiceImpl extends ServiceImpl implements ExerciseDoneHistoryService { + +} diff --git b/src/main/java/com/meishu/service/impl/ExerciseExpandMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/ExerciseExpandMappingServiceImpl.java new file mode 100644 index 0000000..ee7e1b6 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/ExerciseExpandMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ExerciseExpandMappingDO; +import com.meishu.mapper.ExerciseExpandMappingMapper; +import com.meishu.service.ExerciseExpandMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 学生--拓展习题映射表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@Service +public class ExerciseExpandMappingServiceImpl extends ServiceImpl implements ExerciseExpandMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/ExerciseRelatedMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/ExerciseRelatedMappingServiceImpl.java new file mode 100644 index 0000000..3867fec --- /dev/null +++ a/src/main/java/com/meishu/service/impl/ExerciseRelatedMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ExerciseRelatedMappingDO; +import com.meishu.mapper.ExerciseRelatedMappingMapper; +import com.meishu.service.ExerciseRelatedMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 学生--拓展习题映射表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +@Service +public class ExerciseRelatedMappingServiceImpl extends ServiceImpl implements ExerciseRelatedMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/ExerciseTreeMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/ExerciseTreeMappingServiceImpl.java new file mode 100644 index 0000000..08c5df0 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/ExerciseTreeMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ExerciseTreeMappingDO; +import com.meishu.mapper.ExerciseTreeMappingMapper; +import com.meishu.service.ExerciseTreeMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 题目知识树映射表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class ExerciseTreeMappingServiceImpl extends ServiceImpl implements ExerciseTreeMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/ExerciseUserInfoServiceImpl.java a/src/main/java/com/meishu/service/impl/ExerciseUserInfoServiceImpl.java new file mode 100644 index 0000000..0c4af34 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/ExerciseUserInfoServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.ExerciseUserInfoDO; +import com.meishu.mapper.ExerciseUserInfoMapper; +import com.meishu.service.ExerciseUserInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 题目收藏信息表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-17 + */ +@Service +public class ExerciseUserInfoServiceImpl extends ServiceImpl implements ExerciseUserInfoService { + +} diff --git b/src/main/java/com/meishu/service/impl/KnowledgeSubjectDictServiceImpl.java a/src/main/java/com/meishu/service/impl/KnowledgeSubjectDictServiceImpl.java new file mode 100644 index 0000000..6d2a387 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/KnowledgeSubjectDictServiceImpl.java @@ -0,0 +1,171 @@ +package com.meishu.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.meishu.dto.subject.GetSubjectAdministerDTO; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.dto.subject.GetSubjectsDTO; +import com.meishu.mapper.AdministerMapper; +import com.meishu.mapper.SubjectTreeMapper; +import com.meishu.model.*; +import com.meishu.mapper.KnowledgeSubjectDictMapper; +import com.meishu.service.KnowledgeSubjectDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.tree.SerialNumber; +import com.meishu.vo.subject.GetSubjectTreeVO; +import com.meishu.vo.subject.SubjectTreeOrder; +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; + +/** + *

+ * 学科字典表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class KnowledgeSubjectDictServiceImpl extends ServiceImpl implements KnowledgeSubjectDictService { + + @Autowired + private SubjectTreeMapper subjectTreeMapper; + + @Autowired + private AdministerMapper administerMapper; + + public IPage getSubjects(GetSubjectsDTO getSubjectsDTO) { + Page pager = new Page(getSubjectsDTO.getPageNum(), getSubjectsDTO.getPageSize()); + return this.baseMapper.getAdministerSubjects(pager, getSubjectsDTO.getUserId(), getSubjectsDTO.getSubjectType(), getSubjectsDTO.getSubjectName()); + } + + public List getAllSubjects(GetSubjectsDTO getSubjectsDTO) { + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(false, KnowledgeSubjectDictDO::getSubjectName, getSubjectsDTO.getSubjectName()) + .eq(false, KnowledgeSubjectDictDO::getSubjectType, getSubjectsDTO.getSubjectType())); + } + + public String updateSubject(KnowledgeSubjectDictDO subjectDictDO) { + this.baseMapper.updateById(subjectDictDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + public String addSubject(KnowledgeSubjectDictDO subjectDictDO) { + this.baseMapper.insert(subjectDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteSubject(KnowledgeSubjectDictDO subjectDictDO) { + this.baseMapper.deleteById(subjectDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + + public KnowledgeSubjectDictDO getSubject(KnowledgeSubjectDictDO subjectDictDO) { + return this.baseMapper.selectById(subjectDictDO.getId()); + } + + + public List getSubjectAdminister(GetSubjectAdministerDTO getSubjectAdministerDTO) { + return this.baseMapper.getSubjectAdminister(getSubjectAdministerDTO.getSubjectId(), getSubjectAdministerDTO.getUserName()); + } + + /** + * 递归遍历子节点 + * + * @param getSubjectTreeVO 父节点填充子节点 + * @return + */ + public List getChildNodes(GetSubjectTreeVO getSubjectTreeVO, SubjectTreeOrder treeNode,Integer i,boolean flag,List nodeList,Integer chapterId) { + + List getSubjectTreeVOS = new ArrayList<>(); + + i++; + + if (i==4 && !flag){ //只看前三层 + return null; + } + getSubjectTreeVO.setLayer(chapterId+""); + if (!"10.1".equals(getSubjectTreeVO.getText()) && !"20.1".equals(getSubjectTreeVO.getText()) && !"30.1".equals(getSubjectTreeVO.getText()) && !"40.1".equals(getSubjectTreeVO.getText()) && !"50.1".equals(getSubjectTreeVO.getText())){ + getSubjectTreeVO.setText(getSubjectTreeVO.getText().replace("0.1",getSubjectTreeVO.getLayer())); + } + getSubjectTreeVO.setTreeNode(getSubjectTreeVO.getText()); + + //查找该父节点下的子节点 + List subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTreeDO::getParentId, getSubjectTreeVO.getId()) + .orderByAsc(SubjectTreeDO::getTreeOrder)); + + getSubjectTreeVO.setChildNodeCounts(subjectTreeDOS.size()); + + for (SubjectTreeDO subjectTreeDO1 : subjectTreeDOS) { +// GetSubjectTreeVO getSubjectTreeVO1 = new GetSubjectTreeVO(); + GetSubjectTreeVO getSubjectTreeVO1 =SubjectTreeOrder.getNextNode(treeNode,getSubjectTreeVO,nodeList); + BeanUtils.copyProperties(subjectTreeDO1, getSubjectTreeVO1); + getSubjectTreeVO1.setParentTreeName(getSubjectTreeVO.getTreeName()); + getSubjectTreeVOS.add(getSubjectTreeVO1); + getSubjectTreeVO1.setChildren(getChildNodes(getSubjectTreeVO1, treeNode,i,flag,nodeList,chapterId)); + } + if (subjectTreeDOS.size() == 0) { + return null; + } + return getSubjectTreeVOS; + } + + public List getSubjectTree(GetSubjectTreeDTO getSubjectTreeDTO) { + + List getSubjectTreeVOS = new ArrayList<>(); + + SerialNumber number = new SerialNumber(); + SubjectTreeOrder treeNode = new SubjectTreeOrder(".", number); + + //判断老师角色 + List roleDictDOS = administerMapper.getTeacherRoles(getSubjectTreeDTO.getUserId()); + + boolean flag = false; //true 可以看全部的 false 没权限或者是授课老师 只能看三级 + + for (RoleDictDO roleDictDO : roleDictDOS) { + if (roleDictDO.getId() == 1 || roleDictDO.getId() == 2 || roleDictDO.getId() == 4) { + flag = true; + } + } + + //获取科目的父节点 + List subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTreeDO::getSubjectId, getSubjectTreeDTO.getSubjectId()) + .isNull(SubjectTreeDO::getParentId) + .orderByAsc(SubjectTreeDO::getTreeOrder)); + + GetSubjectTreeVO root = treeNode.getRoot(treeNode.getNodeList()); + + List nodeList = new ArrayList<>(); + + //章节id + int chapterId = 1; + + for (SubjectTreeDO std : subjectTreeDOS) { + GetSubjectTreeVO getSubjectTreeVO = SubjectTreeOrder.getNextNode(treeNode,root,nodeList); + BeanUtils.copyProperties(std, getSubjectTreeVO); + int i = 1 ; //第几层 + + + getSubjectTreeVO.setChildren(getChildNodes(getSubjectTreeVO, treeNode,i,flag,nodeList,chapterId)); + getSubjectTreeVO.setLayer(chapterId+""); + chapterId++; + getSubjectTreeVO.setText(getSubjectTreeVO.getText().replace("0.1",getSubjectTreeVO.getLayer())); + getSubjectTreeVO.setTreeNode(getSubjectTreeVO.getText()); + getSubjectTreeVOS.add(getSubjectTreeVO); + } + return getSubjectTreeVOS; + } + +} diff --git b/src/main/java/com/meishu/service/impl/LaboratoryAttendanceMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/LaboratoryAttendanceMappingServiceImpl.java new file mode 100644 index 0000000..476d1aa --- /dev/null +++ a/src/main/java/com/meishu/service/impl/LaboratoryAttendanceMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.LaboratoryAttendanceMappingDO; +import com.meishu.mapper.LaboratoryAttendanceMappingMapper; +import com.meishu.service.LaboratoryAttendanceMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 实验室场次预约考勤记录 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-15 + */ +@Service +public class LaboratoryAttendanceMappingServiceImpl extends ServiceImpl implements LaboratoryAttendanceMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/LaboratoryDictMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/LaboratoryDictMappingServiceImpl.java new file mode 100644 index 0000000..9b9449a --- /dev/null +++ a/src/main/java/com/meishu/service/impl/LaboratoryDictMappingServiceImpl.java @@ -0,0 +1,22 @@ +package com.meishu.service.impl; + +import com.meishu.model.LaboratoryDictMappingDO; +import com.meishu.mapper.LaboratoryDictMappingMapper; +import com.meishu.service.LaboratoryDictMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 实验室场次关联表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-08-30 + */ +@Service +public class LaboratoryDictMappingServiceImpl extends ServiceImpl implements LaboratoryDictMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/LaboratoryDictServiceImpl.java a/src/main/java/com/meishu/service/impl/LaboratoryDictServiceImpl.java new file mode 100644 index 0000000..77def4b --- /dev/null +++ a/src/main/java/com/meishu/service/impl/LaboratoryDictServiceImpl.java @@ -0,0 +1,115 @@ +package com.meishu.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.meishu.dto.laboratory.LaboratoryDictDTO; +import com.meishu.dto.laboratory.LaboratoryPageDTO; +import com.meishu.model.LaboratoryDictDO; +import com.meishu.mapper.LaboratoryDictMapper; +import com.meishu.model.LaboratoryDictMappingDO; +import com.meishu.model.SessionsDictDO; +import com.meishu.service.LaboratoryDictMappingService; +import com.meishu.service.LaboratoryDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.service.SessionsDictService; +import com.meishu.vo.laboratorySession.LaboratoryDictPageVO; +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 java.util.List; + +/** + *

+ * 实验室 服务实现类 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +@Service +public class LaboratoryDictServiceImpl extends ServiceImpl implements LaboratoryDictService { + + @Autowired + private SessionsDictService sessionsDictService; + + @Autowired + private LaboratoryDictMappingService laboratoryDictMappingService; + + @Override + public IPage selectPage(LaboratoryPageDTO laboratoryPageDTO) { + IPage iPage = this.baseMapper.getLaboratoryPage(new Page(laboratoryPageDTO.getPageNo(), laboratoryPageDTO.getPageSize()), laboratoryPageDTO.getName(), laboratoryPageDTO.getLaboratoryType()); + for (LaboratoryDictPageVO record : iPage.getRecords()) { + List list = sessionsDictService.getListById(record.getId()); + record.setSessions(list); + } + return iPage; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void add(LaboratoryDictDTO laboratoryDictDTO) { + LaboratoryDictDO laboratoryDictDO = new LaboratoryDictDO(); + BeanUtils.copyProperties(laboratoryDictDTO, laboratoryDictDO); + this.baseMapper.insert(laboratoryDictDO); + + for (Long id : laboratoryDictDTO.getSessionDictId()) { + LaboratoryDictMappingDO laboratoryDictMappingDO = new LaboratoryDictMappingDO(); + laboratoryDictMappingDO.setLaboratoryDictId(laboratoryDictDO.getId()); + laboratoryDictMappingDO.setSessionsDictId(id); + laboratoryDictMappingService.save(laboratoryDictMappingDO); + } + } + + @Override + public void updateLaboratory(LaboratoryDictDTO laboratoryDictDTO) { + LaboratoryDictDO laboratoryDictDO = new LaboratoryDictDO(); + BeanUtils.copyProperties(laboratoryDictDTO, laboratoryDictDO); + this.baseMapper.updateById(laboratoryDictDO); + + List list = laboratoryDictMappingService.list(new QueryWrapper() + .lambda() + .eq(LaboratoryDictMappingDO::getLaboratoryDictId, laboratoryDictDTO.getId())); + for (LaboratoryDictMappingDO laboratoryDictMappingDO : list) { + if(laboratoryDictDTO.getSessionDictId().stream().filter(id -> id.equals(laboratoryDictMappingDO.getSessionsDictId())).findAny().isPresent()) { + continue; + } else { + laboratoryDictMappingService.removeById(laboratoryDictMappingDO.getId()); + } + } + + for (Long id : laboratoryDictDTO.getSessionDictId()) { + if(list.stream().filter(ldm -> ldm.getSessionsDictId().equals(id)).findAny().isPresent()) { + continue; + } else { + LaboratoryDictMappingDO laboratoryDictMappingDO = new LaboratoryDictMappingDO(); + laboratoryDictMappingDO.setLaboratoryDictId(laboratoryDictDO.getId()); + laboratoryDictMappingDO.setSessionsDictId(id); + laboratoryDictMappingService.save(laboratoryDictMappingDO); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(Long id) { + List list = laboratoryDictMappingService.list(new QueryWrapper() + .lambda() + .eq(LaboratoryDictMappingDO::getLaboratoryDictId, id)); + if(list != null) { + for (LaboratoryDictMappingDO laboratoryDictMappingDO : list) { + laboratoryDictMappingService.removeById(laboratoryDictMappingDO.getId()); + } + } + + this.baseMapper.deleteById(id); + } + + @Override + public LaboratoryDictDO getLaboratoryDicOne(String laboratoryType, String startDate) { + return this.baseMapper.getLaboratoryDicOne(laboratoryType, startDate); + } +} diff --git b/src/main/java/com/meishu/service/impl/LaboratorySessionMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/LaboratorySessionMappingServiceImpl.java new file mode 100644 index 0000000..e9d0d59 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/LaboratorySessionMappingServiceImpl.java @@ -0,0 +1,263 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.common.constant.AttendanceConstant; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.laboratorySession.CalendarStatusDTO; +import com.meishu.dto.laboratorySession.GetLaboratorySessionDTO; +import com.meishu.dto.laboratorySession.SetLaboratorySessionDTO; +import com.meishu.model.*; +import com.meishu.mapper.LaboratorySessionMappingMapper; +import com.meishu.service.*; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.DateFormatUtil; +import com.meishu.util.HttpUtil; +import com.meishu.vo.laboratorySession.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + *

+ * 实验室场次预约安排表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +@Service +public class LaboratorySessionMappingServiceImpl extends ServiceImpl implements LaboratorySessionMappingService { + + @Autowired + private SessionsDictService sessionsDictService; + + @Autowired + private LaboratoryDictService laboratoryDictService; + + @Autowired + private LaboratoryDictMappingService laboratoryDictMappingService; + + @Autowired + private LaboratoryUserMappingService laboratoryUserMappingService; + + @Autowired + private ClassesDictService classesDictService; + + @Override + public List getLaboratorySessionList(String startDate) { + List list = this.baseMapper.getLaboratorySessionList(startDate); + for (LaboratorySessionMappingVO laboratorySessionMappingVO : list) { + List sessionDictList = sessionsDictService.getListSessionDictById(laboratorySessionMappingVO.getLaboratoryDictId(), startDate); + laboratorySessionMappingVO.setTimeSlot(sessionDictList); + } + return list; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteLaboratorySession(SetLaboratorySessionDTO setLaboratorySessionDTO) { + List list = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(LaboratorySessionMappingDO::getLaboratoryDictId, setLaboratorySessionDTO.getLaboratoryDictId()) + .eq(LaboratorySessionMappingDO::getStartDate, setLaboratorySessionDTO.getStartDate())); + if(list != null) { + for (LaboratorySessionMappingDO laboratorySessionMappingDO : list) { + this.baseMapper.deleteById(laboratorySessionMappingDO.getId()); + } + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void setLaboratorySession(SetLaboratorySessionDTO setLaboratorySessionDTO) { + LaboratoryDictDO laboratoryDict = laboratoryDictService.getLaboratoryDicOne(setLaboratorySessionDTO.getLaboratoryType(), setLaboratorySessionDTO.getStartDate()); + if(laboratoryDict != null) { + throw new HttpException(70009); + } + + List laboratoryDictList = laboratoryDictService.list(new QueryWrapper() + .lambda() + .eq(LaboratoryDictDO::getLaboratoryType, setLaboratorySessionDTO.getLaboratoryType())); + if(laboratoryDictList == null) { + throw new HttpException(70001); + } + + /* 根据实验室类型查询关联数据 */ + for (LaboratoryDictDO laboratoryDictDO : laboratoryDictList) { + List list = laboratoryDictMappingService.list(new QueryWrapper() + .lambda() + .eq(LaboratoryDictMappingDO::getLaboratoryDictId, laboratoryDictDO.getId())); + /* 实验室场次关系 */ + for (LaboratoryDictMappingDO laboratoryDictMappingDO : list) { + SessionsDictDO sessionsDictDO = sessionsDictService.getById(laboratoryDictMappingDO.getSessionsDictId()); + if(sessionsDictDO == null) { + throw new HttpException(70002); + } + + /*Map params = new HashMap(); + params.put("organizerId", AttendanceConstant.organizerId); + params.put("date", setLaboratorySessionDTO.getStartDate()); + params.put("topic", setLaboratorySessionDTO.getStartDate() +"-"+ setLaboratorySessionDTO.getStartDate() + "-" + sessionsDictDO.getTimeSlot()); + params.put("startTime", AttendanceConstant.startTime); + params.put("endTime", AttendanceConstant.endTime); + HttpUtil.sendPost(params, "", AttendanceConstant.CREATE_TOPIC_URL, 1);*/ + + LaboratorySessionMappingDO laboratorySessionMappingDO = new LaboratorySessionMappingDO(); + laboratorySessionMappingDO.setSessionsDictId(laboratoryDictMappingDO.getSessionsDictId()); + laboratorySessionMappingDO.setLaboratoryDictId(laboratoryDictDO.getId()); + laboratorySessionMappingDO.setGrade(setLaboratorySessionDTO.getGrade()); + laboratorySessionMappingDO.setStartDate(setLaboratorySessionDTO.getStartDate()); + laboratorySessionMappingDO.setRegisterStartDate(setLaboratorySessionDTO.getRegisterStartDate()); + laboratorySessionMappingDO.setRegisterEndDate(setLaboratorySessionDTO.getRegisterEndDate()); + this.baseMapper.insert(laboratorySessionMappingDO); + } + } + } + + @Override + public void updateLaboratorySession(SetLaboratorySessionDTO setLaboratorySessionDTO) { + List list = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(LaboratorySessionMappingDO::getLaboratoryDictId, setLaboratorySessionDTO.getLaboratoryDictId()) + .eq(LaboratorySessionMappingDO::getStartDate, setLaboratorySessionDTO.getStartDate())); + if(list != null) { + for (LaboratorySessionMappingDO laboratorySessionMappingDO : list) { + if(setLaboratorySessionDTO.getSessionDictId().stream().filter(id -> id.equals(laboratorySessionMappingDO.getSessionsDictId())).findAny().isPresent()) { + continue; + } else { + this.baseMapper.deleteById(laboratorySessionMappingDO.getId()); + } + } + + if(setLaboratorySessionDTO.getSessionDictId() != null) { + for (Long id : setLaboratorySessionDTO.getSessionDictId()) { + LaboratorySessionMappingDO sessionMappingDO = new LaboratorySessionMappingDO(); + sessionMappingDO.setSessionsDictId(id); + sessionMappingDO.setLaboratoryDictId(setLaboratorySessionDTO.getLaboratoryDictId()); + sessionMappingDO.setGrade(setLaboratorySessionDTO.getGrade()); + sessionMappingDO.setStartDate(setLaboratorySessionDTO.getStartDate()); + sessionMappingDO.setRegisterStartDate(setLaboratorySessionDTO.getRegisterStartDate()); + sessionMappingDO.setRegisterEndDate(setLaboratorySessionDTO.getRegisterEndDate()); + if(list.stream().filter(ldm -> ldm.getSessionsDictId().equals(id)).findAny().isPresent()) { + LaboratorySessionMappingDO laboratorySessionMappingDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(LaboratorySessionMappingDO::getStartDate, setLaboratorySessionDTO.getStartDate()) + .eq(LaboratorySessionMappingDO::getSessionsDictId, id) + .eq(LaboratorySessionMappingDO::getLaboratoryDictId, setLaboratorySessionDTO.getLaboratoryDictId())); + if(laboratorySessionMappingDO != null) { + sessionMappingDO.setId(laboratorySessionMappingDO.getId()); + this.baseMapper.updateById(sessionMappingDO); + } + } else { + this.baseMapper.insert(sessionMappingDO); + } + } + } + } + } + + @Override + public LaboratorySessionMappingVO getOneById(Long laboratorySessionId) { + return this.baseMapper.getOneById(laboratorySessionId); + } + + @Override + public List getCalendarStatus(CalendarStatusDTO calendarStatusDTO) { + List data = new ArrayList<>(); + List list = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .like(LaboratorySessionMappingDO::getStartDate, calendarStatusDTO.getSelectDate()) + .groupBy(LaboratorySessionMappingDO::getStartDate)); + if(list != null) { + for (LaboratorySessionMappingDO laboratorySessionMappingDO : list) { + CalendarStatusVO calendarStatusVO = new CalendarStatusVO(); + calendarStatusVO.setStartDate(laboratorySessionMappingDO.getStartDate()); + calendarStatusVO.setStatus(1); + data.add(calendarStatusVO); + } + } + return data; + } + + @Override + public StatisticsVO getLaboratorySessionStatistics(CalendarStatusDTO calendarStatusDTO) { + StatisticsVO statisticsVO = new StatisticsVO(); + List list = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .like(LaboratorySessionMappingDO::getStartDate, calendarStatusDTO.getSelectDate())); + // 创建数量 + statisticsVO.setCreateNum(list.size()); + + // 占用场次数量 + Long sessionNum = list.stream().map(ls -> ls.getSessionsDictId()).distinct().count(); + statisticsVO.setSessionNum(Math.toIntExact(sessionNum)); + + // 占用实验室数量 + Long laboratoryNum = list.stream().map(ls -> ls.getLaboratoryDictId()).distinct().count(); + statisticsVO.setLaboratoryNum(Math.toIntExact(laboratoryNum)); + return statisticsVO; + } + + @Override + public List getLaboratorySessionDate(GetLaboratorySessionDTO getLaboratorySessionDTO) { + List list = this.baseMapper.getLaboratorySessionDate(getLaboratorySessionDTO.getLaboratoryType()); + + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DATE, -1); + return list.stream().filter(ls -> DateFormatUtil.parse(ls.getStartDate(), DateFormatUtil.FMT_sdf_yMd).after(cal.getTime())) + .map(ls -> ls.getStartDate()).collect(Collectors.toList()); + } + + @Override + @Async + public List getLaboratorySession(GetLaboratorySessionDTO getLaboratorySessionDTO) { + List data = new ArrayList<>(); + List list = this.baseMapper.getList(getLaboratorySessionDTO.getStudentId(), + getLaboratorySessionDTO.getStartDate(), + null); + if(list != null) { + for (LaboratorySessionMappingDO laboratorySessionMappingDO : list) { + LaboratoryDictDO laboratoryDict = laboratoryDictService.getById(laboratorySessionMappingDO.getLaboratoryDictId()); + if(laboratoryDict != null && laboratoryDict.getLaboratoryType().equals(getLaboratorySessionDTO.getLaboratoryType())) { + GetLaboratorySessionVO getLaboratorySessionVO = new GetLaboratorySessionVO(); + LaboratoryUserMappingDO laboratoryUserMappingDO = laboratoryUserMappingService.getOne(new QueryWrapper().lambda() + .eq(LaboratoryUserMappingDO::getUserRoleId, getLaboratorySessionDTO.getStudentId()) + .eq(LaboratoryUserMappingDO::getLaboratorySessionId, laboratorySessionMappingDO.getId())); + getLaboratorySessionVO.setId(laboratorySessionMappingDO.getId()); + if(laboratoryUserMappingDO != null) { + getLaboratorySessionVO.setStatus(1); + } else { + getLaboratorySessionVO.setStatus(0); + } + + getLaboratorySessionVO.setRegisterStartDate(laboratorySessionMappingDO.getRegisterStartDate()); + getLaboratorySessionVO.setRegisterEndDate(laboratorySessionMappingDO.getRegisterEndDate()); + + LaboratoryDictDO laboratoryDictDO = laboratoryDictService.getById(laboratorySessionMappingDO.getLaboratoryDictId()); + if(laboratoryDictDO != null) { + getLaboratorySessionVO.setLaboratoryName(laboratoryDictDO.getLaboratoryName()); + } + + SessionsDictDO sessionsDictDO = sessionsDictService.getById(laboratorySessionMappingDO.getSessionsDictId()); + if(sessionsDictDO != null) { + getLaboratorySessionVO.setTimeSlot(sessionsDictDO.getTimeSlot()); + } + + int count = laboratoryUserMappingService.count(new QueryWrapper().lambda() + .eq(LaboratoryUserMappingDO::getLaboratorySessionId, laboratorySessionMappingDO.getId())); + if(laboratoryDict.getMaxNum() >= count) { + getLaboratorySessionVO.setSurplus(laboratoryDict.getMaxNum() - count); + } else { + getLaboratorySessionVO.setSurplus(0); + } + data.add(getLaboratorySessionVO); + } + } + } + return data; + } +} \ No newline at end of file diff --git b/src/main/java/com/meishu/service/impl/LaboratoryUserMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/LaboratoryUserMappingServiceImpl.java new file mode 100644 index 0000000..b222591 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/LaboratoryUserMappingServiceImpl.java @@ -0,0 +1,162 @@ +package com.meishu.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.meishu.common.exception.HttpException; +import com.meishu.dto.laboratoryUser.ApplyDTO; +import com.meishu.dto.laboratoryUser.LaboratoryUserPageDTO; +import com.meishu.mapper.LaboratorySessionMappingMapper; +import com.meishu.model.LaboratoryDictDO; +import com.meishu.model.LaboratorySessionMappingDO; +import com.meishu.model.LaboratoryUserMappingDO; +import com.meishu.mapper.LaboratoryUserMappingMapper; +import com.meishu.model.SessionsDictDO; +import com.meishu.service.LaboratoryDictService; +import com.meishu.service.LaboratorySessionMappingService; +import com.meishu.service.LaboratoryUserMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.service.SessionsDictService; +import com.meishu.util.DateFormatUtil; +import com.meishu.util.excel.ExcelUtil; +import com.meishu.vo.laboratorySession.LaboratorySessionMappingVO; +import com.meishu.vo.laboratoryUser.LaboratoryUserPageVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; + +import javax.xml.crypto.Data; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +/** + *

+ * 实验室场次预约报名记录 服务实现类 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +@Service +public class LaboratoryUserMappingServiceImpl extends ServiceImpl implements LaboratoryUserMappingService { + + @Autowired + private LaboratorySessionMappingMapper laboratorySessionMappingService; + + @Autowired + private SessionsDictService sessionsDictService; + + @Autowired + private LaboratoryDictService laboratoryDictService; + + @Override + public List getLaboratoryUserPage(LaboratoryUserPageDTO laboratoryUserPageDTO) { + return this.baseMapper.getLaboratoryUserPage(laboratoryUserPageDTO.getLaboratorySessionId(), laboratoryUserPageDTO.getStartDate()); + } + + @Override + public void exportLaboratoryUser(LaboratoryUserPageDTO laboratoryUserPageDTO) { + List list = this.baseMapper.getLaboratoryUserList(laboratoryUserPageDTO.getLaboratorySessionId(), laboratoryUserPageDTO.getStartDate()); + if(list != null) { + for (LaboratoryUserPageVO laboratoryUserPageVO : list) { + LaboratorySessionMappingVO laboratorySessionMappingVO = laboratorySessionMappingService.getOneById(laboratoryUserPageVO.getLaboratorySessionId()); + if(laboratorySessionMappingVO != null) { + laboratoryUserPageVO.setLaboratoryName(laboratorySessionMappingVO.getLaboratoryName()); + } + + SessionsDictDO sessionsDictDO = sessionsDictService.getById(laboratoryUserPageVO.getSessionsDictId()); + if(sessionsDictDO != null) { + laboratoryUserPageVO.setTimeSlot(sessionsDictDO.getTimeSlot()); + } + } + } + ExcelUtil.writeExcel(list, LaboratoryUserPageVO.class); + } + + @Override + public void registration(ApplyDTO applyDTO) { + LaboratorySessionMappingDO laboratorySessionMappingDO = laboratorySessionMappingService.selectById(applyDTO.getLaboratorySessionId()); + if(laboratorySessionMappingDO == null) { + throw new HttpException(70003); + } + + // 未到达报名时间 + if(new Date().before(DateFormatUtil.parse(laboratorySessionMappingDO.getRegisterStartDate(), DateFormatUtil.FMT_sdf_yMd))) { + throw new HttpException(70004); + } + + String date = DateFormatUtil.format(new Date(), DateFormatUtil.FMT_sdf_yMd); + if(new Date().before(DateFormatUtil.parse(date+" 12:00:00", DateFormatUtil.FMT_sdf14_L))) { + throw new HttpException(70004); + } + + if(new Date().after(DateFormatUtil.parse(date+" 21:00:00", DateFormatUtil.FMT_sdf14_L))) { + throw new HttpException(70004); + } + + // 结束报名 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateFormatUtil.parse(laboratorySessionMappingDO.getRegisterEndDate(), DateFormatUtil.FMT_sdf_yMd)); + calendar.add(Calendar.DATE, 1); + if(new Date().after(calendar.getTime())) { + throw new HttpException(70005); + } + + LaboratoryDictDO laboratoryDictDO = laboratoryDictService.getById(laboratorySessionMappingDO.getLaboratoryDictId()); + + // 人数上限 + List list = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(LaboratoryUserMappingDO::getLaboratorySessionId, applyDTO.getLaboratorySessionId())); + if(laboratoryDictDO.getMaxNum() <= list.size()) { + throw new HttpException(70006); + } + + // 同类型的实验室相同的时间内场次相同不能进行报名 + LaboratoryUserMappingDO laboratoryUserMapping = this.baseMapper.getLaboratoryUserMapping(applyDTO.getStudentId(), laboratorySessionMappingDO.getStartDate(), laboratorySessionMappingDO.getSessionsDictId()); + if(laboratoryUserMapping != null) { + throw new HttpException(70013); + } + + // 已报名 + if(list != null && list.size() > 0 ) { + if(list.stream().filter(ls -> ls.getUserRoleId().equals(applyDTO.getStudentId()) + && ls.getLaboratorySessionId().equals(applyDTO.getLaboratorySessionId())).findAny().isPresent()) { + throw new HttpException(70007); + } + } + + LaboratoryUserMappingDO laboratoryUserMappingDO = new LaboratoryUserMappingDO(); + laboratoryUserMappingDO.setLaboratorySessionId(applyDTO.getLaboratorySessionId()); + laboratoryUserMappingDO.setUserRoleId(applyDTO.getStudentId()); + this.baseMapper.insert(laboratoryUserMappingDO); + } + + @Override + public void cancelRegistration(ApplyDTO applyDTO) { + LaboratorySessionMappingDO laboratorySessionMappingDO = laboratorySessionMappingService.selectById(applyDTO.getLaboratorySessionId()); + if(laboratorySessionMappingDO == null) { + throw new HttpException(70003); + } + + // 结束报名 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(DateFormatUtil.parse(laboratorySessionMappingDO.getRegisterEndDate(), DateFormatUtil.FMT_sdf_yMd)); + calendar.add(Calendar.DATE, 1); + if(new Date().after(calendar.getTime())) { + throw new HttpException(70014); + } + + // 已报名 + LaboratoryUserMappingDO laboratoryUserMappingDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(LaboratoryUserMappingDO::getUserRoleId, applyDTO.getStudentId()) + .eq(LaboratoryUserMappingDO::getLaboratorySessionId, applyDTO.getLaboratorySessionId())); + if(laboratoryUserMappingDO == null) { + throw new HttpException(70008); + } + + this.baseMapper.deleteById(laboratoryUserMappingDO.getId()); + } +} diff --git b/src/main/java/com/meishu/service/impl/PermissionsDictServiceImpl.java a/src/main/java/com/meishu/service/impl/PermissionsDictServiceImpl.java new file mode 100644 index 0000000..ec16689 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/PermissionsDictServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.PermissionsDictDO; +import com.meishu.mapper.PermissionsDictMapper; +import com.meishu.service.PermissionsDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 权限表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +@Service +public class PermissionsDictServiceImpl extends ServiceImpl implements PermissionsDictService { + +} diff --git b/src/main/java/com/meishu/service/impl/RoleAdministerMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/RoleAdministerMappingServiceImpl.java new file mode 100644 index 0000000..49c834c --- /dev/null +++ a/src/main/java/com/meishu/service/impl/RoleAdministerMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.RoleAdministerMappingDO; +import com.meishu.mapper.RoleAdministerMappingMapper; +import com.meishu.service.RoleAdministerMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +@Service +public class RoleAdministerMappingServiceImpl extends ServiceImpl implements RoleAdministerMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/RoleDictServiceImpl.java a/src/main/java/com/meishu/service/impl/RoleDictServiceImpl.java new file mode 100644 index 0000000..78de1bf --- /dev/null +++ a/src/main/java/com/meishu/service/impl/RoleDictServiceImpl.java @@ -0,0 +1,148 @@ +package com.meishu.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.meishu.dto.role.AddPermissionDTO; +import com.meishu.dto.role.DeletePermissionDTO; +import com.meishu.dto.role.GetRoleTeachersDTO; +import com.meishu.dto.role.RoleTeacherDTO; +import com.meishu.dto.rule.GetRuleReportDTO; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.RoleDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.role.GetAllRolesVO; +import com.meishu.vo.role.GetRoleTeachersVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.management.relation.Role; +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 角色表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +@Service +public class RoleDictServiceImpl extends ServiceImpl implements RoleDictService { + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + @Autowired + private RolePermissionMappingMapper rolePermissionMappingMapper; + + @Autowired + private AdministerMapper administerMapper; + + public List getAllRoles(){ + + List getAllRolesVOS = new ArrayList<>(); + + List roleDictDOS = this.baseMapper.selectList(null); + for (RoleDictDO roleDictDO : roleDictDOS){ + GetAllRolesVO getAllRolesVO = new GetAllRolesVO(); + List list = rolePermissionMappingMapper.getRolePermission(roleDictDO.getId()); + //树形结构 + List treeList = new ArrayList(); + if (list != null) { + list.forEach(permission -> { + if (permission.getParentId() == null) { + treeList.add(permission); + } + + list.forEach(p -> { + if (null != p.getParentId() && p.getParentId().equals(permission.getId())) { + if (permission.getChildren() == null) { + permission.setChildren(new ArrayList<>()); + } + permission.getChildren().add(p); + } + }); + }); + } + + BeanUtils.copyProperties(roleDictDO,getAllRolesVO); + getAllRolesVO.setPermissionsDictDOS(treeList); + getAllRolesVOS.add(getAllRolesVO); + } + return getAllRolesVOS; + } + + public IPage getRoleTeachers(GetRoleTeachersDTO getRoleTeachersDTO){ + Page pager = new Page(getRoleTeachersDTO.getPageNum(), getRoleTeachersDTO.getPageSize()); + IPage getRoleTeachersVOIPage = this.baseMapper.getRoleTeachers(pager,getRoleTeachersDTO.getRoleId(),getRoleTeachersDTO.getUserName()); + List getRoleTeachersVOS = getRoleTeachersVOIPage.getRecords(); + for (GetRoleTeachersVO getRoleTeachersVO : getRoleTeachersVOS){ + List departmentDictDOS = administerMapper.getDepartmentByAdministerId(getRoleTeachersVO.getAdministerId()); + getRoleTeachersVO.setDepartmentDictDOS(departmentDictDOS); + } + return getRoleTeachersVOIPage; + } + + public String removeTeacher(RoleTeacherDTO roleTeacherDTO){ + + roleAdministerMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(RoleAdministerMappingDO::getRoleId,roleTeacherDTO.getRoleId()) + .in(RoleAdministerMappingDO::getId,roleTeacherDTO.getIds())); + + return ConstantUtils.DELETE_SUCCESS; + } + + public String roleTeacher(RoleTeacherDTO roleTeacherDTO){ + + roleAdministerMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(RoleAdministerMappingDO::getRoleId,roleTeacherDTO.getRoleId())); + + List longs = roleTeacherDTO.getIds(); + for (Long lg : longs){ + RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO(); + roleAdministerMappingDO.setAdministerId(lg); + roleAdministerMappingDO.setRoleId(roleTeacherDTO.getRoleId()); + roleAdministerMappingMapper.insert(roleAdministerMappingDO); + } + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String addPermission(AddPermissionDTO addPermissionDTO){ + List longs = addPermissionDTO.getPermissionIds(); + + rolePermissionMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(RolePermissionMappingDO::getRoleId,addPermissionDTO.getRoleId())); + + for (Long lg : longs){ + RolePermissionMappingDO rolePermissionMappingDO = new RolePermissionMappingDO(); + rolePermissionMappingDO.setRoleId(addPermissionDTO.getRoleId()); + rolePermissionMappingDO.setPermissionId(lg); + rolePermissionMappingMapper.insert(rolePermissionMappingDO); + } + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String deletePermission(DeletePermissionDTO deletePermissionDTO){ + + List longs = deletePermissionDTO.getRoleIds(); + for (Long lg : longs){ + rolePermissionMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(RolePermissionMappingDO::getPermissionId,deletePermissionDTO.getPermissionId()) + .eq(RolePermissionMappingDO::getRoleId,lg)); + } + return ConstantUtils.DELETE_SUCCESS; + } + +} diff --git b/src/main/java/com/meishu/service/impl/RolePermissionMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/RolePermissionMappingServiceImpl.java new file mode 100644 index 0000000..831027e --- /dev/null +++ a/src/main/java/com/meishu/service/impl/RolePermissionMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.RolePermissionMappingDO; +import com.meishu.mapper.RolePermissionMappingMapper; +import com.meishu.service.RolePermissionMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 系统用户角色表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-26 + */ +@Service +public class RolePermissionMappingServiceImpl extends ServiceImpl implements RolePermissionMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/SessionsDictServiceImpl.java a/src/main/java/com/meishu/service/impl/SessionsDictServiceImpl.java new file mode 100644 index 0000000..5a13783 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SessionsDictServiceImpl.java @@ -0,0 +1,31 @@ +package com.meishu.service.impl; + +import com.meishu.model.SessionsDictDO; +import com.meishu.mapper.SessionsDictMapper; +import com.meishu.service.SessionsDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 场次字典表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-08-17 + */ +@Service +public class SessionsDictServiceImpl extends ServiceImpl implements SessionsDictService { + + @Override + public List getListById(Long laboratoryDictId) { + return this.baseMapper.getListById(laboratoryDictId); + } + + @Override + public List getListSessionDictById(Long laboratoryDictId, String startDate) { + return this.baseMapper.getListSessionDictById(laboratoryDictId, startDate); + } +} diff --git b/src/main/java/com/meishu/service/impl/SignInRecordServiceImpl.java a/src/main/java/com/meishu/service/impl/SignInRecordServiceImpl.java new file mode 100644 index 0000000..505d3fa --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SignInRecordServiceImpl.java @@ -0,0 +1,29 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.dto.sign.ClassSignInDTO; +import com.meishu.model.SignInRecordDO; +import com.meishu.mapper.SignInRecordMapper; +import com.meishu.service.SignInRecordService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.vo.sign.ClassSignInVO; +import org.springframework.stereotype.Service; + +/** + *

+ * 学生签到表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-28 + */ +@Service +public class SignInRecordServiceImpl extends ServiceImpl implements SignInRecordService { + + public IPage classSignIn(ClassSignInDTO classSignInDTO){ + Page pager = new Page(classSignInDTO.getPageNum(), classSignInDTO.getPageSize()); + return this.baseMapper.classSignIn(pager,classSignInDTO.getClassId(),classSignInDTO.getStartDate(),classSignInDTO.getEndDate(),classSignInDTO.getUserName()); + } + +} diff --git b/src/main/java/com/meishu/service/impl/SmsCodeServiceImpl.java a/src/main/java/com/meishu/service/impl/SmsCodeServiceImpl.java new file mode 100644 index 0000000..8393980 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SmsCodeServiceImpl.java @@ -0,0 +1,52 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.sms.SendVerifyCodeDTO; +import com.meishu.model.SmsCodeDO; +import com.meishu.mapper.SmsCodeMapper; +import com.meishu.model.UserRoleDO; +import com.meishu.service.SmsCodeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.service.UserRoleService; +import com.meishu.util.ConstantUtils; +import com.meishu.util.RandomUtil; +import com.meishu.util.SMSUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + *

+ * 短信验证码 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@Service +public class SmsCodeServiceImpl extends ServiceImpl implements SmsCodeService { + + @Autowired + private SMSUtils smsUtils; + + @Autowired + private UserRoleService userRoleService; + + @Override + public void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO) { + UserRoleDO userRoleDO =userRoleService.getOne(new QueryWrapper() + .lambda() + .eq(UserRoleDO::getPhone, sendVerifyCodeDTO.getPhone())); + if(userRoleDO == null) { + throw new HttpException(70012); + } + + String code = RandomUtil.getRandomCode(6); + smsUtils.send(sendVerifyCodeDTO.getPhone(), code); + + SmsCodeDO smsCodeDO = new SmsCodeDO(); + smsCodeDO.setCode(code); + smsCodeDO.setTelephone(sendVerifyCodeDTO.getPhone()); + this.baseMapper.insert(smsCodeDO); + } +} diff --git b/src/main/java/com/meishu/service/impl/StudentServiceImpl.java a/src/main/java/com/meishu/service/impl/StudentServiceImpl.java new file mode 100644 index 0000000..fc30174 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/StudentServiceImpl.java @@ -0,0 +1,172 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.course.GetExercisesByTreeDTO; +import com.meishu.dto.student.*; +import com.meishu.dto.subject.BatchStatusOprDTO; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.StudentService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.MathUtil; +import com.meishu.util.RandomUtil; +import com.meishu.util.SMSUtils; +import com.meishu.vo.course.*; +import com.meishu.vo.grade.DimensionStarVO; +import com.meishu.vo.grade.QueryOneGradeVO; +import com.meishu.vo.rule.GetOneExaminationDetailVO; +import com.meishu.vo.rule.GetStudentRulesVO; +import com.meishu.vo.rule.StudentStarVO; +import com.meishu.vo.student.*; +import com.meishu.vo.voddict.GetCourseTreesVodsVO; +import net.sf.json.JSONArray; +import org.apache.commons.lang.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 java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + *

+ * 白名单 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-25 + */ +@Service +public class StudentServiceImpl extends ServiceImpl implements StudentService { + + @Autowired + private SmsCodeMapper smsCodeMapper; + + + public String sendMsg(StudentDO studentDO) { + + //验证是否是白名单用户 + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(StudentDO::getTelephone, studentDO.getTelephone())); + + StudentDO studentDO1 = this.baseMapper.getStudentInfo(studentDO.getTelephone()); + + if (count == 0 && null == studentDO1) { + throw new HttpException(10010); + } + + String verifyCode = RandomUtil.getRandomCode(6); + String param = "{ \"code\":\"" + verifyCode + "\"}"; + + //插入短信验证码 + smsCodeMapper.delete(new QueryWrapper() + .lambda() + .eq(SmsCodeDO::getTelephone, studentDO.getTelephone())); + + SmsCodeDO smsCodeDO = new SmsCodeDO(); + smsCodeDO.setTelephone(studentDO.getTelephone()); + smsCodeDO.setCode(verifyCode); + smsCodeMapper.insert(smsCodeDO); + return SMSUtils.sendVerifySMS(ConstantUtils.TEMPLATE_CODE, smsCodeDO.getTelephone(), param); + } + + public LoginVO login(SmsCodeDO smsCodeDO) { + + LoginVO loginVO = new LoginVO(); + + Integer count = smsCodeMapper.selectCount(new QueryWrapper() + .lambda() + .eq(SmsCodeDO::getTelephone, smsCodeDO.getTelephone()) + .eq(SmsCodeDO::getCode, smsCodeDO.getCode()) + .gt(SmsCodeDO::getCreateDate, LocalDateTime.now().minusMinutes(10L)) + ); + + //提交小程序,验证专用 + if ("15666666666".equals(smsCodeDO.getTelephone())) { + count = 1; + } + + if (count > 0) { + StudentDO studentDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(StudentDO::getTelephone, smsCodeDO.getTelephone())); + if (smsCodeDO == null) { + throw new HttpException(10013); + } + //该手机号是学生账号 + if (null != studentDO) { + BeanUtils.copyProperties(studentDO, loginVO); + + loginVO.setIsStudent("1"); + } else { + StudentDO studentDO2 = this.baseMapper.getStudentInfo(smsCodeDO.getTelephone()); + loginVO.setUsername(studentDO2.getUsername()); + List subjectReportVOS = this.baseMapper.getSubjectReport(studentDO2.getId()); + loginVO.setSubjectReportVOS(subjectReportVOS); + loginVO.setId(studentDO2.getId()); + loginVO.setIsStudent("0"); + } + return loginVO; + } else { + throw new HttpException(10003); + } + } + + public String addStudent(StudentDO studentDO) { + + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(StudentDO::getTelephone,studentDO.getTelephone())); + + if (count>0){ + throw new HttpException(10014); + } + + studentDO.setStatus("1"); + this.baseMapper.insert(studentDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateStudent(StudentDO studentDO) { + this.baseMapper.updateById(studentDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + @Transactional(rollbackFor = Exception.class) + public String batchUpdateStudent(BatchStatusOprDTO batchStatusOprDTO) { + List longs = batchStatusOprDTO.getIds(); + for (Long lg : longs) { + StudentDO studentDO = new StudentDO(); + studentDO.setStatus(batchStatusOprDTO.getStatus()); + studentDO.setId(lg); + this.baseMapper.updateById(studentDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + + public String deleteStudent(DeleteStudentDTO deleteStudentDTO) { + + List ids = deleteStudentDTO.getIds(); + for (Long id : ids) { + this.baseMapper.deleteById(id); + } + return ConstantUtils.DELETE_SUCCESS; + } + + public QueryStudentVO queryStudent(StudentDO studentDO) { + QueryStudentVO queryStudentVO = new QueryStudentVO(); + StudentDO studentDO1 = this.baseMapper.selectById(studentDO.getId()); + BeanUtils.copyProperties(studentDO1, queryStudentVO); + return queryStudentVO; + } + + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectDictServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectDictServiceImpl.java new file mode 100644 index 0000000..d08e778 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectDictServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.SubjectDictDO; +import com.meishu.mapper.SubjectDictMapper; +import com.meishu.service.SubjectDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 学校科目字典表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ +@Service +public class SubjectDictServiceImpl extends ServiceImpl implements SubjectDictService { + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectDimensionDictServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectDimensionDictServiceImpl.java new file mode 100644 index 0000000..fa06aed --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectDimensionDictServiceImpl.java @@ -0,0 +1,96 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.mapper.SubjectDimensionStarDictMapper; +import com.meishu.mapper.SubjectTestGradeStarMappingMapper; +import com.meishu.model.*; +import com.meishu.mapper.SubjectDimensionDictMapper; +import com.meishu.service.SubjectDimensionDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.dimension.GetAllDimensionStarVO; +import com.meishu.vo.dimension.GetAllDimensionStarsVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + +/** + *

+ * 测评表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +@Service +public class SubjectDimensionDictServiceImpl extends ServiceImpl implements SubjectDimensionDictService { + + @Autowired + private SubjectDimensionStarDictMapper subjectDimensionStarDictMapper; + + @Autowired + private SubjectDimensionDictMapper subjectDimensionDictMapper; + + @Autowired + private SubjectTestGradeStarMappingMapper subjectTestGradeStarMappingMapper; + + public List getAllDimensions(SubjectDimensionDictDO subjectDimensionDictDO){ + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectDimensionDictDO::getRuleId,subjectDimensionDictDO.getRuleId())); + } + + public String deleteDimensionById(SubjectDimensionDictDO subjectDimensionDictDO){ + this.baseMapper.deleteById(subjectDimensionDictDO.getId()); + + //删除下面的星级 + subjectDimensionStarDictMapper.delete(new QueryWrapper() + .lambda() + .eq(SubjectDimensionStarDictDO::getDimensionId,subjectDimensionDictDO.getId())); + + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateDimension(SubjectDimensionDictDO subjectDimensionDictDO){ + this.baseMapper.updateById(subjectDimensionDictDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + public String addDimension(SubjectDimensionDictDO subjectDimensionDictDO){ + this.baseMapper.insert(subjectDimensionDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public List getAllDimensionStar(SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + + //通过发布id查询规则 + SubjectRuleDO subjectRuleDO = subjectTestGradeStarMappingMapper.getRuleIdByPublishId(subjectTestPublishGradeDO.getPublishId()); + + List getAllDimensionStarVOS = new ArrayList<>(); + + //获取所有的维度 + List subjectDimensionDictDOS = subjectDimensionDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectDimensionDictDO::getRuleId,subjectRuleDO.getId())); + + for (SubjectDimensionDictDO subjectDimensionDictDO: subjectDimensionDictDOS){ + + GetAllDimensionStarVO getAllDimensionStarsVO = new GetAllDimensionStarVO(); + //维度获取星级 + List subjectDimensionStarDictDOS = subjectDimensionStarDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectDimensionStarDictDO::getDimensionId,subjectDimensionDictDO.getId())); + + getAllDimensionStarsVO.setDimensionId(subjectDimensionDictDO.getId()); + getAllDimensionStarsVO.setDimension(subjectDimensionDictDO.getDimension()); + getAllDimensionStarsVO.setSubjectDimensionStarDictDOS(subjectDimensionStarDictDOS); + + getAllDimensionStarVOS.add(getAllDimensionStarsVO); + } + return getAllDimensionStarVOS; + } + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectDimensionStarDictServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectDimensionStarDictServiceImpl.java new file mode 100644 index 0000000..cdfe15c --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectDimensionStarDictServiceImpl.java @@ -0,0 +1,99 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.dto.dimension.AddStarDTO; +import com.meishu.mapper.SubjectStarTreeMappingMapper; +import com.meishu.dto.dimension.DeleteStarByIdDTO; +import com.meishu.model.SubjectDimensionStarDictDO; +import com.meishu.mapper.SubjectDimensionStarDictMapper; +import com.meishu.model.SubjectStarTreeMappingDO; +import com.meishu.model.SubjectTreeDO; +import com.meishu.service.SubjectDimensionStarDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.dimension.GetAllDimensionStarsVO; +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; + +/** + *

+ * 维度星级字典表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +@Service +public class SubjectDimensionStarDictServiceImpl extends ServiceImpl implements SubjectDimensionStarDictService { + + @Autowired + private SubjectStarTreeMappingMapper subjectStarTreeMappingMapper; + + + public List getAllDimensionStars(SubjectDimensionStarDictDO subjectDimensionStartDictDO) { + + List getAllDimensionStarsVOS = new ArrayList<>(); + + List subjectDimensionStartDictDOS = this.baseMapper.getStar(subjectDimensionStartDictDO.getDimensionId(),subjectDimensionStartDictDO.getStar()); + for (SubjectDimensionStarDictDO subjectDimensionStartDictDO1 : subjectDimensionStartDictDOS) { + GetAllDimensionStarsVO getAllDimensionStarsVO = new GetAllDimensionStarsVO(); + BeanUtils.copyProperties(subjectDimensionStartDictDO1, getAllDimensionStarsVO); + List subjectTreeDOS = subjectStarTreeMappingMapper.getSubjectTrees(subjectDimensionStartDictDO1.getId()); + getAllDimensionStarsVO.setSubjectTreeDOS(subjectTreeDOS); + getAllDimensionStarsVOS.add(getAllDimensionStarsVO); + } + return getAllDimensionStarsVOS; + } + + public String deleteStarById(DeleteStarByIdDTO deleteDimensionByIdDTO) { + + List longs = deleteDimensionByIdDTO.getIds(); + for (Long lg : longs) { + this.baseMapper.deleteById(lg); + } + return ConstantUtils.DELETE_SUCCESS; + } + + public String addStar(AddStarDTO addStarDTO) { + + SubjectDimensionStarDictDO subjectDimensionStartDictDO = new SubjectDimensionStarDictDO(); + BeanUtils.copyProperties(addStarDTO, subjectDimensionStartDictDO); + this.baseMapper.insert(subjectDimensionStartDictDO); + + List treeIds = addStarDTO.getTreeIds(); + for (Long lg : treeIds) { + SubjectStarTreeMappingDO subjectStarTreeMappingDO = new SubjectStarTreeMappingDO(); + subjectStarTreeMappingDO.setSubjectTreeId(lg); + subjectStarTreeMappingDO.setSubjectStarId(subjectDimensionStartDictDO.getId()); + subjectStarTreeMappingMapper.insert(subjectStarTreeMappingDO); + } + return ConstantUtils.ADD_SUCCESS; + } + + public String updateStar(AddStarDTO addStarDTO) { + + SubjectDimensionStarDictDO subjectDimensionStartDictDO = new SubjectDimensionStarDictDO(); + BeanUtils.copyProperties(addStarDTO, subjectDimensionStartDictDO); + this.baseMapper.updateById(subjectDimensionStartDictDO); + + //删除之前的知识树映射 + subjectStarTreeMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(SubjectStarTreeMappingDO::getSubjectStarId, addStarDTO.getId())); + + List treeIds = addStarDTO.getTreeIds(); + for (Long lg : treeIds) { + SubjectStarTreeMappingDO subjectStarTreeMappingDO = new SubjectStarTreeMappingDO(); + subjectStarTreeMappingDO.setSubjectTreeId(lg); + subjectStarTreeMappingDO.setSubjectStarId(subjectDimensionStartDictDO.getId()); + subjectStarTreeMappingMapper.insert(subjectStarTreeMappingDO); + } + + return ConstantUtils.SUCCESS_UPDATE; + } + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectRuleServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectRuleServiceImpl.java new file mode 100644 index 0000000..33d998f --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectRuleServiceImpl.java @@ -0,0 +1,68 @@ +package com.meishu.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.meishu.dto.rule.GetAllRulesDTO; +import com.meishu.mapper.SubjectTestDictMapper; +import com.meishu.model.SubjectRuleDO; +import com.meishu.mapper.SubjectRuleMapper; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.service.SubjectRuleService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.rule.GetAllRulesVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + *

+ * 规则字典表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-08 + */ +@Service +public class SubjectRuleServiceImpl extends ServiceImpl implements SubjectRuleService { + + @Autowired + private SubjectTestDictMapper subjectTestDictMapper; + + public IPage getAllRules(GetAllRulesDTO getAllRulesDTO) { + Page pager = new Page(getAllRulesDTO.getPageNum(), getAllRulesDTO.getPageSize()); + return this.baseMapper.getAllRules(pager); + } + + public List getRules(){ + return this.baseMapper.getRules(); + } + + public String addRule(SubjectRuleDO subjectRuleDO) { + subjectRuleDO.setStatus("1"); + this.baseMapper.insert(subjectRuleDO); + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String updateRule(SubjectRuleDO subjectRuleDO) { + this.baseMapper.updateById(subjectRuleDO); + List subjectTestDictDOS = subjectTestDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTestDictDO::getRuleId,subjectRuleDO.getId())); + for (SubjectTestDictDO subjectTestDictDO : subjectTestDictDOS){ + subjectTestDictDO.setStatus(subjectRuleDO.getStatus()); + subjectTestDictMapper.updateById(subjectTestDictDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + + public String deleteRule(SubjectRuleDO subjectRuleDO){ + this.baseMapper.deleteById(subjectRuleDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectSemesterServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectSemesterServiceImpl.java new file mode 100644 index 0000000..96b6b7f --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectSemesterServiceImpl.java @@ -0,0 +1,89 @@ +package com.meishu.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.meishu.dto.semester.GetSemesterScoreDTO; +import com.meishu.dto.semester.GetStudentDetailDTO; +import com.meishu.dto.semester.GetStudentRecordDTO; +import com.meishu.mapper.ClassesDictHistoryMapper; +import com.meishu.mapper.ClassesDictMapper; +import com.meishu.model.ClassesDictDO; +import com.meishu.model.ClassesDictHistoryDO; +import com.meishu.model.SubjectSemesterDO; +import com.meishu.mapper.SubjectSemesterMapper; +import com.meishu.service.SubjectSemesterService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.vo.semester.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-08-11 + */ +@Service +public class SubjectSemesterServiceImpl extends ServiceImpl implements SubjectSemesterService { + + @Autowired + private ClassesDictMapper classesDictMapper; + + @Autowired + private ClassesDictHistoryMapper classesDictHistoryMapper; + + public List getAllStudyingSemester() { + + List result = new ArrayList<>(); + + String[] array = new String[]{"高一", "高二", "高三"}; + + for (String str : array) { + GetAllStudyingSemesterVO subjectSemesterServiceVO = new GetAllStudyingSemesterVO(); + subjectSemesterServiceVO.setGradeType(str); + subjectSemesterServiceVO.setClassesDictDOS(classesDictMapper.getGradeClasses(str)); + result.add(subjectSemesterServiceVO); + } + return result; + } + + public List getAllPastSemester(){ + + List result = new ArrayList<>(); + + String[] array = new String[]{"高一", "高二", "高三"}; + + for (String str : array) { + GetAllPastSemesterVO getAllPastSemesterVO = new GetAllPastSemesterVO(); + getAllPastSemesterVO.setGradeType(str); + getAllPastSemesterVO.setClassesDictDOS(classesDictHistoryMapper.getAllPastSemester(str)); + result.add(getAllPastSemesterVO); + } + return result; + } + + public IPage getSemesterScore(GetSemesterScoreDTO getSemesterScoreDTO) { + Page pager = new Page(getSemesterScoreDTO.getPageNum(), getSemesterScoreDTO.getPageSize()); + return this.baseMapper.getSemesterScore(pager, getSemesterScoreDTO.getSemester(), getSemesterScoreDTO.getGrade(), getSemesterScoreDTO.getClasses(), getSemesterScoreDTO.getSession(), getSemesterScoreDTO.getSubject(), getSemesterScoreDTO.getUserName()); + } + + public List exportScore(GetSemesterScoreDTO getSemesterScoreDTO) { + return this.baseMapper.exportScore(getSemesterScoreDTO.getSemester(), getSemesterScoreDTO.getGrade(),getSemesterScoreDTO.getClasses(),getSemesterScoreDTO.getSession(), getSemesterScoreDTO.getSubject(), getSemesterScoreDTO.getUserName()); + } + + public IPage getStudentDetail(GetStudentDetailDTO getStudentDetailDTO) { + Page pager = new Page(getStudentDetailDTO.getPageNum(), getStudentDetailDTO.getPageSize()); + return this.baseMapper.getStudentDetail(pager, getStudentDetailDTO.getId(), getStudentDetailDTO.getUserId()); + } + + public List getStudentRecord(GetStudentRecordDTO getStudentRecordDTO){ + return this.baseMapper.getStudentRecord(getStudentRecordDTO); + } + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectStarTreeMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectStarTreeMappingServiceImpl.java new file mode 100644 index 0000000..565b9f7 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectStarTreeMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.SubjectStarTreeMappingDO; +import com.meishu.mapper.SubjectStarTreeMappingMapper; +import com.meishu.service.SubjectStarTreeMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 测评-知识点关联表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-06 + */ +@Service +public class SubjectStarTreeMappingServiceImpl extends ServiceImpl implements SubjectStarTreeMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectStudentAnswerStarServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectStudentAnswerStarServiceImpl.java new file mode 100644 index 0000000..8eefa5b --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectStudentAnswerStarServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.SubjectStudentAnswerStarDO; +import com.meishu.mapper.SubjectStudentAnswerStarMapper; +import com.meishu.service.SubjectStudentAnswerStarService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 学生答卷星级表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +@Service +public class SubjectStudentAnswerStarServiceImpl extends ServiceImpl implements SubjectStudentAnswerStarService { + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectTestDictServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectTestDictServiceImpl.java new file mode 100644 index 0000000..20e8732 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectTestDictServiceImpl.java @@ -0,0 +1,53 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.dto.test.GetAllTestDTO; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.mapper.SubjectTestDictMapper; +import com.meishu.service.SubjectTestDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.test.GetAllTestVO; +import com.meishu.vo.test.GetTestReportVO; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 测评表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-20 + */ +@Service +public class SubjectTestDictServiceImpl extends ServiceImpl implements SubjectTestDictService { + + + public IPage getAllTest(GetAllTestDTO getAllTestDTO){ + Page pager = new Page(getAllTestDTO.getPageNum(), getAllTestDTO.getPageSize()); + return this.baseMapper.getAllTest(pager,getAllTestDTO.getRuleId(),getAllTestDTO.getTestName()); + } + + public List getTest(GetAllTestDTO getAllTestDTO){ + return this.baseMapper.getTest(getAllTestDTO.getRuleId(),getAllTestDTO.getTestName()); + } + + public String insertTest(SubjectTestDictDO subjectTestDictDO){ + this.baseMapper.insert(subjectTestDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateTest(SubjectTestDictDO subjectTestDictDO){ + this.baseMapper.updateById(subjectTestDictDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + public String deleteByTestId(SubjectTestDictDO subjectTestDictDO){ + this.baseMapper.deleteById(subjectTestDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectTestGradeExampleMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectTestGradeExampleMappingServiceImpl.java new file mode 100644 index 0000000..52a1504 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectTestGradeExampleMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.SubjectTestGradeExampleMappingDO; +import com.meishu.mapper.SubjectTestGradeExampleMappingMapper; +import com.meishu.service.SubjectTestGradeExampleMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 样卷映射表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +@Service +public class SubjectTestGradeExampleMappingServiceImpl extends ServiceImpl implements SubjectTestGradeExampleMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectTestGradeStarMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectTestGradeStarMappingServiceImpl.java new file mode 100644 index 0000000..741b7eb --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectTestGradeStarMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.SubjectTestGradeStarMappingDO; +import com.meishu.mapper.SubjectTestGradeStarMappingMapper; +import com.meishu.service.SubjectTestGradeStarMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 档次星级映射表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +@Service +public class SubjectTestGradeStarMappingServiceImpl extends ServiceImpl implements SubjectTestGradeStarMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectTestPublishGradeServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectTestPublishGradeServiceImpl.java new file mode 100644 index 0000000..e8bd2f3 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectTestPublishGradeServiceImpl.java @@ -0,0 +1,188 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.dto.grade.AddGradeDTO; +import com.meishu.mapper.SubjectTestGradeExampleMappingMapper; +import com.meishu.mapper.SubjectTestGradeStarMappingMapper; +import com.meishu.model.SubjectRuleDO; +import com.meishu.model.SubjectTestGradeExampleMappingDO; +import com.meishu.model.SubjectTestGradeStarMappingDO; +import com.meishu.model.SubjectTestPublishGradeDO; +import com.meishu.mapper.SubjectTestPublishGradeMapper; +import com.meishu.service.SubjectTestPublishGradeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.grade.DimensionStarVO; +import com.meishu.vo.grade.QueryOneGradeVO; +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.List; +import java.util.concurrent.ExecutionException; + +/** + *

+ * 档次表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-06-21 + */ +@Service +public class SubjectTestPublishGradeServiceImpl extends ServiceImpl implements SubjectTestPublishGradeService { + + + @Autowired + private SubjectTestGradeExampleMappingMapper subjectTestGradeExampleMappingMapper; + + @Autowired + private SubjectTestGradeStarMappingMapper subjectTestGradeStarMappingMapper; + + + @Transactional(rollbackFor = Exception.class) + public String addGrade(AddGradeDTO addGradeDTO){ + + String gradeName = addGradeDTO.getGradeName(); + + SubjectTestPublishGradeDO subjectTestPublishGradeDO = new SubjectTestPublishGradeDO(); + subjectTestPublishGradeDO.setGradeName(gradeName); + subjectTestPublishGradeDO.setPublishId(addGradeDTO.getPublishId()); + subjectTestPublishGradeDO.setContent(addGradeDTO.getContent()); + this.baseMapper.insert(subjectTestPublishGradeDO); + + //样卷 + List subjectTestGradeExampleMappingDOS = addGradeDTO.getSubjectTestGradeExampleMappingDOS(); + for (String str : subjectTestGradeExampleMappingDOS){ + SubjectTestGradeExampleMappingDO subjectTestGradeExampleMappingDO = new SubjectTestGradeExampleMappingDO(); + subjectTestGradeExampleMappingDO.setExampleView(str); + subjectTestGradeExampleMappingDO.setGradeId(subjectTestPublishGradeDO.getId()); + subjectTestGradeExampleMappingMapper.insert(subjectTestGradeExampleMappingDO); + } + + //星级映射 + List subjectTestGradeStarMappingDOS = addGradeDTO.getSubjectTestGradeStarMappingDOS(); + for (Long lg : subjectTestGradeStarMappingDOS){ + SubjectTestGradeStarMappingDO subjectTestGradeStarMappingDO = new SubjectTestGradeStarMappingDO(); + subjectTestGradeStarMappingDO.setStarId(lg); + subjectTestGradeStarMappingDO.setGradeId(subjectTestPublishGradeDO.getId()); + subjectTestGradeStarMappingMapper.insert(subjectTestGradeStarMappingDO); + } + + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String deleteGrade(SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + + this.baseMapper.deleteById(subjectTestPublishGradeDO.getId()); + + subjectTestGradeStarMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(SubjectTestGradeStarMappingDO::getGradeId,subjectTestPublishGradeDO.getId())); + + subjectTestGradeExampleMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(SubjectTestGradeExampleMappingDO::getGradeId,subjectTestPublishGradeDO.getId())); + + return ConstantUtils.DELETE_SUCCESS; + } + + public List queryGrade(SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + + List queryOneGradeVOS = new ArrayList<>(); + + List subjectTestPublishGradeDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTestPublishGradeDO::getPublishId,subjectTestPublishGradeDO.getId())); + + for (SubjectTestPublishGradeDO subjectTestPublishGradeDO1 : subjectTestPublishGradeDOS){ + + QueryOneGradeVO queryOneGradeVO = new QueryOneGradeVO(); + queryOneGradeVO.setGradeName(subjectTestPublishGradeDO1.getGradeName()); + queryOneGradeVO.setId(subjectTestPublishGradeDO1.getId()); + queryOneGradeVO.setContent(subjectTestPublishGradeDO1.getContent()); + + //样卷 + List subjectTestGradeExampleMappingDOS = subjectTestGradeExampleMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTestGradeExampleMappingDO::getGradeId,subjectTestPublishGradeDO1.getId())); + queryOneGradeVO.setSubjectTestGradeExampleMappingDOS(subjectTestGradeExampleMappingDOS); + + //星级 + List dimensionStarVOS = subjectTestGradeStarMappingMapper.getGradeStar(subjectTestPublishGradeDO1.getId()); + queryOneGradeVO.setDimensionStarVOS(dimensionStarVOS); + + queryOneGradeVOS.add(queryOneGradeVO); + } + + return queryOneGradeVOS; + } + + public QueryOneGradeVO queryOneGrade(SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + + QueryOneGradeVO queryOneGradeVO = new QueryOneGradeVO(); + + //档次 + SubjectTestPublishGradeDO subjectTestPublishGradeDO1 = this.baseMapper.selectById(subjectTestPublishGradeDO.getId()); + queryOneGradeVO.setGradeName(subjectTestPublishGradeDO1.getGradeName()); + + //样卷 + List subjectTestGradeExampleMappingDOS = subjectTestGradeExampleMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTestGradeExampleMappingDO::getGradeId,subjectTestPublishGradeDO.getId())); + queryOneGradeVO.setSubjectTestGradeExampleMappingDOS(subjectTestGradeExampleMappingDOS); + + //星级 + List dimensionStarVOS = subjectTestGradeStarMappingMapper.getGradeStar(subjectTestPublishGradeDO.getId()); + queryOneGradeVO.setDimensionStarVOS(dimensionStarVOS); + + return queryOneGradeVO; + } + + public String updateGrade(AddGradeDTO addGradeDTO){ + + SubjectTestPublishGradeDO subjectTestPublishGradeDO = this.baseMapper.selectById(addGradeDTO.getId()); + subjectTestPublishGradeDO.setGradeName(addGradeDTO.getGradeName()); + subjectTestPublishGradeDO.setPublishId(addGradeDTO.getPublishId()); + subjectTestPublishGradeDO.setContent(addGradeDTO.getContent()); + this.baseMapper.updateById(subjectTestPublishGradeDO); + + //样卷 + subjectTestGradeExampleMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(SubjectTestGradeExampleMappingDO::getGradeId,addGradeDTO.getId())); + //样卷 + List subjectTestGradeExampleMappingDOS = addGradeDTO.getSubjectTestGradeExampleMappingDOS(); + for (String str : subjectTestGradeExampleMappingDOS){ + SubjectTestGradeExampleMappingDO subjectTestGradeExampleMappingDO = new SubjectTestGradeExampleMappingDO(); + subjectTestGradeExampleMappingDO.setExampleView(str); + subjectTestGradeExampleMappingDO.setGradeId(subjectTestPublishGradeDO.getId()); + subjectTestGradeExampleMappingMapper.insert(subjectTestGradeExampleMappingDO); + } + + //星级映射 + subjectTestGradeStarMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(SubjectTestGradeStarMappingDO::getGradeId,addGradeDTO.getId())); + + //星级映射 + List subjectTestGradeStarMappingDOS = addGradeDTO.getSubjectTestGradeStarMappingDOS(); + for (Long lg : subjectTestGradeStarMappingDOS){ + SubjectTestGradeStarMappingDO subjectTestGradeStarMappingDO = new SubjectTestGradeStarMappingDO(); + subjectTestGradeStarMappingDO.setStarId(lg); + subjectTestGradeStarMappingDO.setGradeId(subjectTestPublishGradeDO.getId()); + subjectTestGradeStarMappingMapper.insert(subjectTestGradeStarMappingDO); + } + + + return ConstantUtils.SUCCESS_UPDATE; + } + + public SubjectRuleDO getRuleIdByPublishId(SubjectTestPublishGradeDO subjectTestPublishGradeDO){ + return subjectTestGradeStarMappingMapper.getRuleIdByPublishId(subjectTestPublishGradeDO.getPublishId()); + } + + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectTestPublishHistoryServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectTestPublishHistoryServiceImpl.java new file mode 100644 index 0000000..5afdf33 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectTestPublishHistoryServiceImpl.java @@ -0,0 +1,153 @@ +package com.meishu.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.meishu.dto.test.*; +import com.meishu.mapper.SubjectStudentAnswerStarMapper; +import com.meishu.mapper.SubjectTestStudentAnswerMapper; +import com.meishu.model.SubjectStudentAnswerStarDO; +import com.meishu.model.SubjectTestDictDO; +import com.meishu.model.SubjectTestPublishHistoryDO; +import com.meishu.mapper.SubjectTestPublishHistoryMapper; +import com.meishu.model.SubjectTestStudentAnswerDO; +import com.meishu.service.SubjectTestPublishHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.MathUtil; +import com.meishu.vo.student.StudentVO; +import com.meishu.vo.test.CommentVO; +import com.meishu.vo.test.GetOnePublishVO; +import com.meishu.vo.test.GetPublishHistoryVO; +import com.meishu.vo.test.GetTestReportVO; +import io.swagger.annotations.ApiOperation; +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.ArrayList; +import java.util.List; +import java.util.Map; + +/** + *

+ * 测评发布记录表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-08 + */ +@Service +public class SubjectTestPublishHistoryServiceImpl extends ServiceImpl implements SubjectTestPublishHistoryService { + + @Autowired + private SubjectTestStudentAnswerMapper subjectTestStudentAnswerMapper; + + @Autowired + private SubjectStudentAnswerStarMapper subjectStudentAnswerStarMapper; + + @Transactional(rollbackFor = Exception.class) + public String publishTest(PublishTestDTO publishTestDTO) { + + SubjectTestPublishHistoryDO subjectTestPublishHistoryDO = new SubjectTestPublishHistoryDO(); + BeanUtils.copyProperties(publishTestDTO, subjectTestPublishHistoryDO); + this.baseMapper.insert(subjectTestPublishHistoryDO); + + List longs = publishTestDTO.getStudentIds(); + for (Long lg : longs) { + SubjectTestStudentAnswerDO subjectTestStudentAnswerDO = new SubjectTestStudentAnswerDO(); + subjectTestStudentAnswerDO.setAnswer(""); + subjectTestStudentAnswerDO.setStudentId(lg); + subjectTestStudentAnswerDO.setPublishId(subjectTestPublishHistoryDO.getId()); + subjectTestStudentAnswerDO.setCommitStatus("0"); + subjectTestStudentAnswerDO.setCommentStatus("0"); + subjectTestStudentAnswerMapper.insert(subjectTestStudentAnswerDO); + } + return ConstantUtils.ADD_SUCCESS; + } + + public String updatePublish(PublishTestDTO publishTestDTO){ + + SubjectTestPublishHistoryDO subjectTestPublishHistoryDO = new SubjectTestPublishHistoryDO(); + BeanUtils.copyProperties(publishTestDTO,subjectTestPublishHistoryDO); + subjectTestPublishHistoryDO.setId(publishTestDTO.getPublishId()); + this.baseMapper.updateById(subjectTestPublishHistoryDO); + + // + subjectTestStudentAnswerMapper.delete(new QueryWrapper() + .lambda() + .eq(SubjectTestStudentAnswerDO::getPublishId,publishTestDTO.getPublishId())); + + List longs = publishTestDTO.getStudentIds(); + for (Long lg : longs) { + SubjectTestStudentAnswerDO subjectTestStudentAnswerDO = new SubjectTestStudentAnswerDO(); + subjectTestStudentAnswerDO.setAnswer(""); + subjectTestStudentAnswerDO.setStudentId(lg); + subjectTestStudentAnswerDO.setPublishId(subjectTestPublishHistoryDO.getId()); + subjectTestStudentAnswerDO.setCommitStatus("0"); + subjectTestStudentAnswerDO.setCommentStatus("0"); + subjectTestStudentAnswerMapper.insert(subjectTestStudentAnswerDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + + public IPage getPublishHistory(GetPublishHistoryDTO getPublishHistoryDTO) { + Page pager = new Page(getPublishHistoryDTO.getPageNum(), getPublishHistoryDTO.getPageSize()); + + IPage getPublishHistoryVOIPage = this.baseMapper.getPublishHistory(pager,getPublishHistoryDTO.getRuleId(),getPublishHistoryDTO.getPublishName()); + + List getPublishHistoryVOS = getPublishHistoryVOIPage.getRecords(); + + for (GetPublishHistoryVO getPublishHistoryVO : getPublishHistoryVOS){ + List studentVOS = subjectTestStudentAnswerMapper.getPublishStudents(getPublishHistoryVO.getId()); + getPublishHistoryVO.setStudentVOS(studentVOS); + } + return getPublishHistoryVOIPage; + } + + + public IPage getTestReport(GetTestReportDTO getTestReportDTO){ + Page pager = new Page(getTestReportDTO.getPageNum(), getTestReportDTO.getPageSize()); + IPage getTestReportVOIPage = this.baseMapper.getTestReport(pager,getTestReportDTO.getRuleId(),getTestReportDTO.getPublishName()); + List getTestReportVOS = getTestReportVOIPage.getRecords(); + for (GetTestReportVO getTestReportVO : getTestReportVOS){ + List studentVOS = subjectTestStudentAnswerMapper.getPublishStudents(getTestReportVO.getId()); + getTestReportVO.setStudentVOS(studentVOS); + } + return getTestReportVOIPage; + } + + public IPage getOnePublish(GetOnePublishDTO getOnePublishDTO){ + Page pager = new Page(getOnePublishDTO.getPageNum(), getOnePublishDTO.getPageSize()); + IPage getOnePublishVOIPage = this.baseMapper.getOnePublish(pager,getOnePublishDTO.getId(),getOnePublishDTO.getUserName(),getOnePublishDTO.getCommentStatus()); + List getOnePublishVOS = getOnePublishVOIPage.getRecords(); + for (GetOnePublishVO getOnePublishVO : getOnePublishVOS){ + List commentVOS = this.baseMapper.getCommentDetail(getOnePublishVO); + getOnePublishVO.setCommentVOS(commentVOS); + int count = 0 ; + int sum = 0; + for (CommentVO cv : commentVOS){ + sum += cv.getStar(); + } + double score = MathUtil.intDivFloorPercent(sum,count); + getOnePublishVO.setTotalStar(score); + } + return this.baseMapper.getOnePublish(pager,getOnePublishDTO.getId(),getOnePublishDTO.getUserName(),getOnePublishDTO.getCommentStatus()); + } + + public String comment(CommentDTO commentDTO){ + + List subjectStudentAnswerStarDOS = commentDTO.getSubjectStudentAnswerStarDOS(); + + for (SubjectStudentAnswerStarDO subjectStudentAnswerStarDO : subjectStudentAnswerStarDOS){ + subjectStudentAnswerStarMapper.insert(subjectStudentAnswerStarDO); + } + return ConstantUtils.ADD_SUCCESS; + } + + public String deletePublish(SubjectTestPublishHistoryDO subjectTestPublishHistoryDO){ + this.baseMapper.deleteById(subjectTestPublishHistoryDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } +} diff --git b/src/main/java/com/meishu/service/impl/SubjectTestStudentAnswerServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectTestStudentAnswerServiceImpl.java new file mode 100644 index 0000000..1a8ca19 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectTestStudentAnswerServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.SubjectTestStudentAnswerDO; +import com.meishu.mapper.SubjectTestStudentAnswerMapper; +import com.meishu.service.SubjectTestStudentAnswerService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 学生月考答卷 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-05-13 + */ +@Service +public class SubjectTestStudentAnswerServiceImpl extends ServiceImpl implements SubjectTestStudentAnswerService { + +} diff --git b/src/main/java/com/meishu/service/impl/SubjectTreeServiceImpl.java a/src/main/java/com/meishu/service/impl/SubjectTreeServiceImpl.java new file mode 100644 index 0000000..2d2261f --- /dev/null +++ a/src/main/java/com/meishu/service/impl/SubjectTreeServiceImpl.java @@ -0,0 +1,439 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.meishu.dto.subject.GetSubjectTreeDTO; +import com.meishu.dto.subject.UpdateTreeOrderDTO; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.SubjectTreeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.tree.SerialNumber; +import com.meishu.vo.subject.GetSubjectTreeVO; +import com.meishu.vo.subject.SubjectTreeOrder; +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.ArrayList; +import java.util.List; + +/** + *

+ * 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class SubjectTreeServiceImpl extends ServiceImpl implements SubjectTreeService { + + @Autowired + private KnowledgeSubjectDictMapper knowledgeSubjectDictMapper; + + @Autowired + private SubjectTreeMapper subjectTreeMapper; + + @Autowired + private VodSubjectTreeMappingMapper vodSubjectTreeMappingMapper; + + @Autowired + private ExerciseTreeMappingMapper exerciseTreeMappingMapper; + + @Autowired + private AdministerMapper administerMapper; + + @Autowired + private VodDictMapper vodDictMapper; + + @Autowired + private ExerciseDictMapper exerciseDictMapper; + + public String updateSubjectTree(SubjectTreeDO subjectTreeDO) { + this.baseMapper.updateSubjectTree(subjectTreeDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + @Transactional(rollbackFor = Exception.class) + public String addSubjectTree(SubjectTreeDO subjectTreeDO) { + + KnowledgeSubjectDictDO subjectDict = knowledgeSubjectDictMapper.selectById(subjectTreeDO.getSubjectId()); + + + subjectTreeDO.setSchool(ConstantUtils.SCHOOL); + subjectTreeDO.setSubjectType("高中"); + subjectTreeDO.setSubject(subjectDict.getSubjectName()); + subjectTreeDO.setSubjectEn(subjectDict.getSubjectEn()); + + List subjectTreeDOS = new ArrayList<>(); + //编号 + if (null != subjectTreeDO.getParentId()) { + subjectTreeDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTreeDO::getParentId, subjectTreeDO.getParentId()) + .eq(SubjectTreeDO::getSubjectEn, subjectDict.getSubjectEn()) + .orderByDesc(SubjectTreeDO::getTreeOrder)); + } else { + subjectTreeDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .isNull(SubjectTreeDO::getParentId) + .eq(SubjectTreeDO::getSubjectEn, subjectDict.getSubjectEn()) + .orderByDesc(SubjectTreeDO::getTreeOrder)); + } + + if (subjectTreeDOS.size() == 0) { + subjectTreeDO.setTreeOrder(0); + } else { + subjectTreeDO.setTreeOrder(subjectTreeDOS.get(0).getTreeOrder() + 1); + } + + this.baseMapper.insert(subjectTreeDO); + + return ConstantUtils.ADD_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public String deleteSubjectTree(SubjectTreeDO subjectTreeDO) { + + List subjectTreeDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTreeDO::getParentId, subjectTreeDO.getId())); + + for (SubjectTreeDO subjectTreeDO1 : subjectTreeDOS) { + deleteChildNode(subjectTreeDO1); + } + + this.baseMapper.deleteById(subjectTreeDO.getId()); + + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateTreeOrder(UpdateTreeOrderDTO updateTreeOrderDTO) { + + List longs = updateTreeOrderDTO.getIds(); + for (int i = 0; i < longs.size(); i++) { + SubjectTreeDO subjectTreeDO = this.baseMapper.selectById(longs.get(i)); + subjectTreeDO.setTreeOrder(i); + subjectTreeDO.setParentId(updateTreeOrderDTO.getParentId()); + this.baseMapper.updateSubjectTree(subjectTreeDO); + +// //课程下的知识点的顺序也要跟着变 +// List courseDictDOS = courseTreeMapper.selectList(new QueryWrapper() +// .lambda() +// .eq(CourseTreeDO::getTreeId, longs.get(i))); +// +// for (CourseTreeDO courseTreeDO : courseDictDOS) { +// courseTreeDO.setTreeOrder(i); +// courseTreeDO.setParentId(updateTreeOrderDTO.getParentId()); +// courseTreeDO.setChapterId(null); +// courseTreeMapper.updateTreeOrderNo(courseTreeDO); +// } + } + return ConstantUtils.SUCCESS_UPDATE; + } + + + //科目递归删除 + public void deleteChildNode(SubjectTreeDO subjectTreeDO) { + + List subjectTreeDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTreeDO::getParentId, subjectTreeDO.getId())); + + for (SubjectTreeDO subjectTreeDO1 : subjectTreeDOS) { + deleteChildNode(subjectTreeDO1); + } + this.baseMapper.deleteById(subjectTreeDO.getId()); + + } + + public List getTreesCnt(GetSubjectTreeDTO getSubjectTreeDTO) { + + List getSubjectTreeVOS = new ArrayList<>(); + + //判断老师角色 + List roleDictDOS = administerMapper.getTeacherRoles(getSubjectTreeDTO.getUserId()); + + SerialNumber number = new SerialNumber(); + SubjectTreeOrder treeNode = new SubjectTreeOrder(".", number); + + boolean flag = false; //true 可以看全部的 false 没权限或者是授课老师 只能看三级 + + for (RoleDictDO roleDictDO : roleDictDOS) { + if (roleDictDO.getId() == 1 || roleDictDO.getId() == 2 || roleDictDO.getId() == 4) { + flag = true; + } + } + + GetSubjectTreeVO root = treeNode.getRoot(treeNode.getNodeList()); + + List nodeList = new ArrayList<>(); + + int chapterId = 1; + + //获取科目的父节点 + List subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTreeDO::getSubjectId, getSubjectTreeDTO.getSubjectId()) + .isNull(SubjectTreeDO::getParentId) + .orderByAsc(SubjectTreeDO::getTreeOrder)); + + for (SubjectTreeDO std : subjectTreeDOS) { + GetSubjectTreeVO getSubjectTreeVO = SubjectTreeOrder.getNextNode(treeNode,root,nodeList); + List vodCnt = new ArrayList<>(); + List publicVodCnt = new ArrayList<>(); + List exerciseCnt = new ArrayList<>(); + List publicExerciseCnt = new ArrayList<>(); + BeanUtils.copyProperties(std, getSubjectTreeVO); + + int k = 0; //第k层 + + getSubjectTreeVO.setChildren(getChildNodes(chapterId,getSubjectTreeDTO.getUserId(),getSubjectTreeVO,publicVodCnt,publicExerciseCnt, vodCnt, exerciseCnt, k, flag, getSubjectTreeDTO.getShareStatus(),treeNode,nodeList)); + int i = 0; + for (Integer integer : vodCnt) { + i += integer; + } + getSubjectTreeVO.setVodCounts(i); + int j = 0; + for (Integer integer : exerciseCnt) { + j += integer; + } + getSubjectTreeVO.setExerciseCounts(j); + int m =0; + for (Integer integer : publicVodCnt) { + m += integer; + } + getSubjectTreeVO.setPublicVodCounts(m); + int n =0; + for (Integer integer : publicExerciseCnt) { + n += integer; + } + getSubjectTreeVO.setPublicExerciseVodCounts(n); + getSubjectTreeVO.setLayer(chapterId+""); + chapterId++; + getSubjectTreeVO.setText(getSubjectTreeVO.getText().replace("0.1",getSubjectTreeVO.getLayer())); + getSubjectTreeVO.setTreeNode(getSubjectTreeVO.getText()); + + getSubjectTreeVOS.add(getSubjectTreeVO); + } + return getSubjectTreeVOS; + + } + + public List getTreesCheckCnt(GetSubjectTreeDTO getSubjectTreeDTO) { + + List getSubjectTreeVOS = new ArrayList<>(); + + //判断老师角色 + List roleDictDOS = administerMapper.getTeacherRoles(getSubjectTreeDTO.getUserId()); + + boolean flag = false; //true 可以看全部的 false 没权限或者是授课老师 只能看三级 + + for (RoleDictDO roleDictDO : roleDictDOS) { + if (roleDictDO.getId() == 1 || roleDictDO.getId() == 2 || roleDictDO.getId() == 4) { + flag = true; + } + } + + SerialNumber number = new SerialNumber(); + SubjectTreeOrder treeNode = new SubjectTreeOrder(".", number); + + + GetSubjectTreeVO root = treeNode.getRoot(treeNode.getNodeList()); + + List nodeList = new ArrayList<>(); + + //获取科目的父节点 + List subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTreeDO::getSubjectId, getSubjectTreeDTO.getSubjectId()) + .isNull(SubjectTreeDO::getParentId) + .orderByAsc(SubjectTreeDO::getTreeOrder)); + + int chapterId = 1 ; + + for (SubjectTreeDO std : subjectTreeDOS) { + GetSubjectTreeVO getSubjectTreeVO = SubjectTreeOrder.getNextNode(treeNode,root,nodeList); + List toCheckVodCnt = new ArrayList<>(); + List checkVodCnt = new ArrayList<>(); + List toCheckExerciseCnt = new ArrayList<>(); + List checkExerciseCnt = new ArrayList<>(); + BeanUtils.copyProperties(std, getSubjectTreeVO); + + int k = 0; + + + getSubjectTreeVO.setLayer(chapterId+""); + chapterId++; + getSubjectTreeVO.setText(getSubjectTreeVO.getText().replace("0.1",getSubjectTreeVO.getLayer())); + getSubjectTreeVO.setTreeNode(getSubjectTreeVO.getText()); + + getSubjectTreeVO.setChildren(getCheckChildNodes(chapterId,getSubjectTreeVO, toCheckVodCnt, checkVodCnt,toCheckExerciseCnt,checkExerciseCnt, k, flag, getSubjectTreeDTO.getShareStatus(),treeNode,nodeList)); + int i = 0; + for (Integer integer : toCheckExerciseCnt) { + i += integer; + } + getSubjectTreeVO.setToCheckExerciseCounts(i); + int j = 0; + for (Integer integer : toCheckVodCnt) { + j += integer; + } + getSubjectTreeVO.setToCheckVodCounts(j); + int m = 0; + for (Integer integer : checkExerciseCnt) { + m += integer; + } + getSubjectTreeVO.setCheckExerciseCounts(m); + int l = 0; + for (Integer integer : checkVodCnt) { + l += integer; + } + getSubjectTreeVO.setCheckVodCounts(l); + + getSubjectTreeVOS.add(getSubjectTreeVO); + } + return getSubjectTreeVOS; + + } + + + /** + * 递归遍历子节点 + * + * @param getSubjectTreeVO 父节点填充子节点 + * @return + */ + public List getChildNodes(Integer chapterId,Long userId,GetSubjectTreeVO getSubjectTreeVO, List publicVodCnt, List publicExerciseCnt,List vodCnt, List exerciseCnt, Integer k, boolean flag, String shareStatus,SubjectTreeOrder treeNode,List nodeList ) { + + List getSubjectTreeVOS = new ArrayList<>(); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getSubjectTreeVO.getSubjectId()); + + //查找该父节点下的子节点 + List subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTreeDO::getParentId, getSubjectTreeVO.getId()) + .orderByAsc(SubjectTreeDO::getTreeOrder)); + + getSubjectTreeVO.setChildNodeCounts(subjectTreeDOS.size()); + + getSubjectTreeVO.setLayer(chapterId+""); + getSubjectTreeVO.setText(getSubjectTreeVO.getText().replace("0.1",getSubjectTreeVO.getLayer())); + getSubjectTreeVO.setTreeNode(getSubjectTreeVO.getText()); + + //查找该节点下的视频数 个人库 + Integer vodCntTmp = vodSubjectTreeMappingMapper.getTreeVodCount(userId,getSubjectTreeVO.getId(),"0",subjectDictDO.getSubjectEn(),null); + getSubjectTreeVO.setVodCounts(vodCntTmp); + vodCnt.add(vodCntTmp); + + //查找该节点下的视频数 公共库 + Integer publicVodCntTmp = vodSubjectTreeMappingMapper.getTreeVodCount(null,getSubjectTreeVO.getId(),"1",subjectDictDO.getSubjectEn(),null); + getSubjectTreeVO.setPublicVodCounts(publicVodCntTmp); + publicVodCnt.add(publicVodCntTmp); + + //查找该节点下的题目数 个人库 + Integer exerciseTmp = exerciseTreeMappingMapper.getTreeExerciseCount(userId,getSubjectTreeVO.getId(),"0",subjectDictDO.getSubjectEn(),null); + getSubjectTreeVO.setExerciseCounts(exerciseTmp); + exerciseCnt.add(exerciseTmp); + + //查找该节点下的题目数 公共库 + Integer publicExerciseTmp = exerciseTreeMappingMapper.getTreeExerciseCount(null,getSubjectTreeVO.getId(),"1",subjectDictDO.getSubjectEn(),null); + getSubjectTreeVO.setPublicExerciseVodCounts(publicExerciseTmp); + publicExerciseCnt.add(publicExerciseTmp); + + getSubjectTreeVO.setCheckVodCounts(vodCntTmp); + getSubjectTreeVO.setCheckExerciseCounts(exerciseTmp); + + k++; + + if (k == 3 && !flag) { + return null; + } + + for (SubjectTreeDO subjectTreeDO1 : subjectTreeDOS) { + GetSubjectTreeVO getSubjectTreeVO1 = SubjectTreeOrder.getNextNode(treeNode,getSubjectTreeVO,nodeList); + BeanUtils.copyProperties(subjectTreeDO1, getSubjectTreeVO1); + getSubjectTreeVO1.setParentTreeName(getSubjectTreeVO.getTreeName()); + getSubjectTreeVOS.add(getSubjectTreeVO1); + getSubjectTreeVO1.setChildren(getChildNodes(chapterId,userId,getSubjectTreeVO1, publicVodCnt,publicExerciseCnt,vodCnt, exerciseCnt, k, flag, shareStatus,treeNode,nodeList)); + } + if (subjectTreeDOS.size() == 0) { + return null; + } + return getSubjectTreeVOS; + } + + /** + * 递归遍历子节点 + * + * @param getSubjectTreeVO 父节点填充子节点 + * @return + */ + public List getCheckChildNodes(Integer chapterId,GetSubjectTreeVO getSubjectTreeVO, List toCheckVodCnt, List checkVodCnt,List toCheckExerciseCnt, List checkExerciseCnt, Integer k, boolean flag, String shareStatus,SubjectTreeOrder treeNode,List nodeList ) { + + List getSubjectTreeVOS = new ArrayList<>(); + + //查找该父节点下的子节点 + List subjectTreeDOS = subjectTreeMapper.selectList(new QueryWrapper() + .lambda() + .eq(SubjectTreeDO::getParentId, getSubjectTreeVO.getId()) + .orderByAsc(SubjectTreeDO::getTreeOrder)); + + getSubjectTreeVO.setChildNodeCounts(subjectTreeDOS.size()); + + //查找该节点下的视频数 已审核的视频 + Integer checkVod = 0; + + //查找该节点下的题目数 已审核的题目 + Integer checkExercise = 0; + + //待审核的视频数 + Integer toCheckVod = 0; + + //待审核的题目数 + Integer toCheckExercise = 0; + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getSubjectTreeVO.getSubjectId()); + + //待审核 + toCheckVod = vodSubjectTreeMappingMapper.getTreeVodCount(null,getSubjectTreeVO.getId(),null,subjectDictDO.getSubjectEn(),"2"); + toCheckVodCnt.add(toCheckVod); + toCheckExercise = exerciseTreeMappingMapper.getTreeExerciseCount(null,getSubjectTreeVO.getId(),"0",subjectDictDO.getSubjectEn(),"2"); + getSubjectTreeVO.setToCheckExerciseCounts(toCheckExercise); + toCheckExerciseCnt.add(toCheckExercise); + //已审核 包括已通过 未通过 + checkVod = vodSubjectTreeMappingMapper.getTreeVodCount(null,getSubjectTreeVO.getId(),null,subjectDictDO.getSubjectEn(),"1"); + getSubjectTreeVO.setCheckVodCounts(checkVod); + checkVodCnt.add(checkVod); + checkExercise = exerciseTreeMappingMapper.getTreeExerciseCount(null,getSubjectTreeVO.getId(),"1",subjectDictDO.getSubjectEn(),"1"); + getSubjectTreeVO.setCheckExerciseCounts(checkExercise); + checkExerciseCnt.add(checkExercise); + getSubjectTreeVO.setToCheckVodCounts(toCheckVod); + + getSubjectTreeVO.setLayer(chapterId+""); + getSubjectTreeVO.setText(getSubjectTreeVO.getText().replace("0.1",getSubjectTreeVO.getLayer())); + getSubjectTreeVO.setTreeNode(getSubjectTreeVO.getText()); + + k++; + + if (k == 3 && !flag) { + return null; + } + + for (SubjectTreeDO subjectTreeDO1 : subjectTreeDOS) { + GetSubjectTreeVO getSubjectTreeVO1 = SubjectTreeOrder.getNextNode(treeNode,getSubjectTreeVO,nodeList); + BeanUtils.copyProperties(subjectTreeDO1, getSubjectTreeVO1); + getSubjectTreeVO1.setParentTreeName(getSubjectTreeVO.getTreeName()); + getSubjectTreeVOS.add(getSubjectTreeVO1); + getSubjectTreeVO1.setChildren(getCheckChildNodes(chapterId,getSubjectTreeVO1, toCheckVodCnt, checkVodCnt,toCheckExerciseCnt,checkExerciseCnt, k, flag, shareStatus,treeNode,nodeList)); + } + if (subjectTreeDOS.size() == 0) { + return null; + } + return getSubjectTreeVOS; + } + + +} diff --git b/src/main/java/com/meishu/service/impl/TaskCompletionStatusServiceImpl.java a/src/main/java/com/meishu/service/impl/TaskCompletionStatusServiceImpl.java new file mode 100644 index 0000000..e86c3c5 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/TaskCompletionStatusServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.TaskCompletionStatusDO; +import com.meishu.mapper.TaskCompletionStatusMapper; +import com.meishu.service.TaskCompletionStatusService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 作业任务完成状态 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@Service +public class TaskCompletionStatusServiceImpl extends ServiceImpl implements TaskCompletionStatusService { + +} diff --git b/src/main/java/com/meishu/service/impl/TaskContentDoneInfoServiceImpl.java a/src/main/java/com/meishu/service/impl/TaskContentDoneInfoServiceImpl.java new file mode 100644 index 0000000..6cfbffc --- /dev/null +++ a/src/main/java/com/meishu/service/impl/TaskContentDoneInfoServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.TaskContentDoneInfoDO; +import com.meishu.mapper.TaskContentDoneInfoMapper; +import com.meishu.service.TaskContentDoneInfoService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-30 + */ +@Service +public class TaskContentDoneInfoServiceImpl extends ServiceImpl implements TaskContentDoneInfoService { + +} diff --git b/src/main/java/com/meishu/service/impl/TaskContentServiceImpl.java a/src/main/java/com/meishu/service/impl/TaskContentServiceImpl.java new file mode 100644 index 0000000..8773e07 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/TaskContentServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.TaskContentDO; +import com.meishu.mapper.TaskContentMapper; +import com.meishu.service.TaskContentService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 作业内容表(取题目,视频,书面作业) 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@Service +public class TaskContentServiceImpl extends ServiceImpl implements TaskContentService { + +} diff --git b/src/main/java/com/meishu/service/impl/TaskDoneHistoryServiceImpl.java a/src/main/java/com/meishu/service/impl/TaskDoneHistoryServiceImpl.java new file mode 100644 index 0000000..2fc243e --- /dev/null +++ a/src/main/java/com/meishu/service/impl/TaskDoneHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.TaskDoneHistoryDO; +import com.meishu.mapper.TaskDoneHistoryMapper; +import com.meishu.service.TaskDoneHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@Service +public class TaskDoneHistoryServiceImpl extends ServiceImpl implements TaskDoneHistoryService { + +} diff --git b/src/main/java/com/meishu/service/impl/UserRoleCopy1ServiceImpl.java a/src/main/java/com/meishu/service/impl/UserRoleCopy1ServiceImpl.java new file mode 100644 index 0000000..0d0fae8 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/UserRoleCopy1ServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.UserRoleCopy1DO; +import com.meishu.mapper.UserRoleCopy1Mapper; +import com.meishu.service.UserRoleCopy1Service; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 学生表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-23 + */ +@Service +public class UserRoleCopy1ServiceImpl extends ServiceImpl implements UserRoleCopy1Service { + +} diff --git b/src/main/java/com/meishu/service/impl/UserRoleServiceImpl.java a/src/main/java/com/meishu/service/impl/UserRoleServiceImpl.java new file mode 100644 index 0000000..0a4957c --- /dev/null +++ a/src/main/java/com/meishu/service/impl/UserRoleServiceImpl.java @@ -0,0 +1,154 @@ +package com.meishu.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.meishu.common.exception.HttpException; +import com.meishu.dto.sms.VerifyCodeDTO; +import com.meishu.dto.userrole.AccountLoginDTO; +import com.meishu.dto.userrole.AddStudentsDTO; +import com.meishu.dto.userrole.QueryStudentsDTO; +import com.meishu.mapper.UserRoleCopy1Mapper; +import com.meishu.model.*; +import com.meishu.mapper.UserRoleMapper; +import com.meishu.service.ClassesDictService; +import com.meishu.service.ClassesUserMappingService; +import com.meishu.service.SmsCodeService; +import com.meishu.service.UserRoleService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.excel.ExcelUtil; +import com.meishu.vo.userrole.QueryStudentsVO; +import com.meishu.vo.userrole.UserInfoVO; +import com.meishu.vo.userrole.UserRoleVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + *

+ * 学生表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-08-16 + */ +@Service +public class UserRoleServiceImpl extends ServiceImpl implements UserRoleService { + + @Autowired + private SmsCodeService smsCodeService; + + @Autowired + private ClassesDictService classesDictService; + + @Autowired + private UserRoleCopy1Mapper userRoleCopy1Mapper; + + public IPage queryStudents(QueryStudentsDTO queryStudentsDTO){ + Page pager = new Page(queryStudentsDTO.getPageNum(), queryStudentsDTO.getPageSize()); + return this.baseMapper.queryStudents(pager,queryStudentsDTO.getUserName(),queryStudentsDTO.getGrade(),queryStudentsDTO.getSession(),queryStudentsDTO.getUserStatus()); + } + + public String addStudents(UserRoleDO userRoleDO){ + userRoleDO.setUserStatus("在读"); + userRoleDO.setRoleType("学生"); + this.baseMapper.insert(userRoleDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateStudent(UserRoleDO userRoleDO){ + this.baseMapper.updateById(userRoleDO); + return ConstantUtils.SUCCESS_UPDATE; + } + + public List exportStudents(QueryStudentsDTO queryStudentsDTO){ + return this.baseMapper.exportStudents(queryStudentsDTO.getUserName(),queryStudentsDTO.getGrade(),queryStudentsDTO.getSession(),queryStudentsDTO.getUserStatus()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public UserRoleVO login(VerifyCodeDTO verifyCodeDTO) { + UserRoleVO userRoleVO = new UserRoleVO(); + UserRoleDO userRoleDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(UserRoleDO::getPhone, verifyCodeDTO.getPhone())); + if(userRoleDO == null) { + throw new HttpException(10010); + } + BeanUtils.copyProperties(userRoleDO, userRoleVO); + + SmsCodeDO smsCodeDO = smsCodeService.getOne(new QueryWrapper() + .lambda() + .eq(SmsCodeDO::getTelephone, verifyCodeDTO.getPhone()) + .eq(SmsCodeDO::getCode, verifyCodeDTO.getVerifyCode())); + if(smsCodeDO == null) { + throw new HttpException(70010); + } + + smsCodeService.removeById(smsCodeDO.getId()); + return userRoleVO; + } + + @Override + public UserInfoVO userInfo(Integer id) { + UserInfoVO userInfoVO = new UserInfoVO(); + UserRoleDO userRoleDO = this.baseMapper.selectById(id); + if(userRoleDO != null) { + BeanUtils.copyProperties(userRoleDO, userInfoVO); + ClassesDictDO classesDictDO = classesDictService.getClassesById((long)id); + if(classesDictDO != null) { + userInfoVO.setClasses(classesDictDO.getClassName()); + } + } + return userInfoVO; + } + + @Override + public UserRoleVO accountLogin(AccountLoginDTO accountLoginDTO) { + UserRoleVO userRoleVO = new UserRoleVO(); + UserRoleDO userRoleDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(UserRoleDO::getPassword, accountLoginDTO.getPassword()) + .eq(UserRoleDO::getIdCard, accountLoginDTO.getIdCard())); + if(userRoleDO == null) { + throw new HttpException(10004); + } + + BeanUtils.copyProperties(userRoleDO, userRoleVO); + return userRoleVO; + } + + public void studycode(){ + + List userRoleDOS = this.baseMapper.selectList(null); + + for (UserRoleDO userRoleDO : userRoleDOS){ + + try { + + List userRoleCopy1DO = userRoleCopy1Mapper.selectList(new QueryWrapper() + .lambda() + .eq(UserRoleCopy1DO::getUserName,userRoleDO.getUserName()) + .eq(UserRoleCopy1DO::getGender,userRoleDO.getGender()) + .eq(UserRoleCopy1DO::getSession,userRoleDO.getSession())); + + if (userRoleCopy1DO.size()>0){ + userRoleDO.setStudyCode(userRoleCopy1DO.get(0).getStudyCode()); + this.baseMapper.updateById(userRoleDO); + } + }catch (Exception e){ + System.out.println("==========="+userRoleDO.getId()+"==="+userRoleDO.getUserName()); + } + + + } + + + } + +} diff --git b/src/main/java/com/meishu/service/impl/UserSubjectMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/UserSubjectMappingServiceImpl.java new file mode 100644 index 0000000..8e17a7b --- /dev/null +++ a/src/main/java/com/meishu/service/impl/UserSubjectMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.UserSubjectMappingDO; +import com.meishu.mapper.UserSubjectMappingMapper; +import com.meishu.service.UserSubjectMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 老师-科目映射表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-08-17 + */ +@Service +public class UserSubjectMappingServiceImpl extends ServiceImpl implements UserSubjectMappingService { + +} diff --git b/src/main/java/com/meishu/service/impl/UserSubjectPermissionDictServiceImpl.java a/src/main/java/com/meishu/service/impl/UserSubjectPermissionDictServiceImpl.java new file mode 100644 index 0000000..bf998b3 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/UserSubjectPermissionDictServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.UserSubjectPermissionDictDO; +import com.meishu.mapper.UserSubjectPermissionDictMapper; +import com.meishu.service.UserSubjectPermissionDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 平时成绩---老师班级权限 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-08-18 + */ +@Service +public class UserSubjectPermissionDictServiceImpl extends ServiceImpl implements UserSubjectPermissionDictService { + +} diff --git b/src/main/java/com/meishu/service/impl/UuidHistoryServiceImpl.java a/src/main/java/com/meishu/service/impl/UuidHistoryServiceImpl.java new file mode 100644 index 0000000..3386a34 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/UuidHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.UuidHistoryDO; +import com.meishu.mapper.UuidHistoryMapper; +import com.meishu.service.UuidHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-29 + */ +@Service +public class UuidHistoryServiceImpl extends ServiceImpl implements UuidHistoryService { + +} diff --git b/src/main/java/com/meishu/service/impl/VodDictServiceImpl.java a/src/main/java/com/meishu/service/impl/VodDictServiceImpl.java new file mode 100644 index 0000000..204a415 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/VodDictServiceImpl.java @@ -0,0 +1,507 @@ +package com.meishu.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.meishu.common.configure.VODConfig; +import com.meishu.common.exception.HttpException; +import com.meishu.dto.voddict.*; +import com.meishu.mapper.*; +import com.meishu.model.*; +import com.meishu.service.VodDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.util.Signature; +import com.meishu.vo.voddict.*; +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 org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +/** + *

+ * 视频字典表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class VodDictServiceImpl extends ServiceImpl implements VodDictService { + + @Autowired + private VODConfig vodConfig; + + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + @Autowired + private VodSubjectTreeMappingMapper vodSubjectTreeMappingMapper; + + @Autowired + private KnowledgeSubjectDictMapper knowledgeSubjectDictMapper; + + @Autowired + private VodDictMapper vodDictMapper; + + @Autowired + private AdministerMapper administerMapper; + + + public SignatureVO signature() throws Exception { +// + 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); + + String sign = ""; + try { + sign = signature.getUploadSignature(); + signatureVO.setSign(sign); + } catch (Exception ex) { + ex.printStackTrace(); +// throw new MyException(ResultEnum.UNKNOWN_ERROR); + } + return signatureVO; + } + + public IPage getTreeVods(GetTreeVodsDTO getTreeVodsDTO) { + + Page pager = new Page(getTreeVodsDTO.getPageNum(), getTreeVodsDTO.getPageSize()); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getTreeVodsDTO.getSubjectId()); + + //查看该老师的科目信息 + List subjectDictDOS = administerMapper.getTeacherSubjects(getTreeVodsDTO.getUserId()); + + if ("1".equals(getTreeVodsDTO.getShareStatus())) { + getTreeVodsDTO.setUserId(null); //查看所有公共库的视频 + } + + List strings = new ArrayList<>(); + for (KnowledgeSubjectDictDO subjectDictDO1 : subjectDictDOS) { + strings.add(subjectDictDO1.getSubjectEn()); + } + + IPage getTreeVodsVOIPage = this.baseMapper.getTreeVods(pager, getTreeVodsDTO.getTreeId(), subjectDictDO.getSubjectEn(), getTreeVodsDTO.getVodName(), getTreeVodsDTO.getVodType(), getTreeVodsDTO.getShareStatus(), getTreeVodsDTO.getUserId(), strings, getTreeVodsDTO.getCheckStatus()); + + List getTreeVodsVOS = getTreeVodsVOIPage.getRecords(); + for (GetTreeVodsVO getTreeVodsVO : getTreeVodsVOS) { + //获取视频播放量 + Integer count = vodPlayHistoryMapper.queryPlayCounts( getTreeVodsVO.getId()); + getTreeVodsVO.setPlayCounts(count); + + //视频知识点 + List vodTreeMappingDOS = this.baseMapper.getTrees(getTreeVodsVO.getId()); + getTreeVodsVO.setTrees(vodTreeMappingDOS); + } + getTreeVodsVOIPage.setRecords(getTreeVodsVOS); + + return getTreeVodsVOIPage; + } + + public IPage getCheckTreeVods(GetTreeVodsDTO getTreeVodsDTO) { + + Page pager = new Page(getTreeVodsDTO.getPageNum(), getTreeVodsDTO.getPageSize()); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getTreeVodsDTO.getSubjectId()); + + //查看该老师的科目信息 + List subjectDictDOS = administerMapper.getTeacherSubjects(getTreeVodsDTO.getUserId()); + + List strings = new ArrayList<>(); + for (KnowledgeSubjectDictDO subjectDictDO1 : subjectDictDOS) { + strings.add(subjectDictDO1.getSubjectEn()); + } + + IPage getTreeVodsVOIPage = this.baseMapper.getTreeVods(pager, getTreeVodsDTO.getTreeId(), subjectDictDO.getSubjectEn(), getTreeVodsDTO.getVodName(), getTreeVodsDTO.getVodType(), getTreeVodsDTO.getShareStatus(), null, strings, getTreeVodsDTO.getCheckStatus()); + + List getTreeVodsVOS = getTreeVodsVOIPage.getRecords(); + + for (GetTreeVodsVO getTreeVodsVO : getTreeVodsVOS) { + //获取视频播放量 + Integer count = vodPlayHistoryMapper.queryPlayCounts(getTreeVodsVO.getId()); + getTreeVodsVO.setPlayCounts(count); + + //视频知识点 + List vodTreeMappingDOS = this.baseMapper.getTrees(getTreeVodsVO.getId()); + getTreeVodsVO.setTrees(vodTreeMappingDOS); + } + getTreeVodsVOIPage.setRecords(getTreeVodsVOS); + + return getTreeVodsVOIPage; + } + + @Transactional(rollbackFor = Exception.class) + public String deleteVod(VodDictDO vodDictDO) { + + VodDictDO vodDictDO1 = this.baseMapper.selectById(vodDictDO.getId()); + + this.baseMapper.deleteById(vodDictDO.getId()); + + vodSubjectTreeMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(VodSubjectTreeMappingDO::getVodId, vodDictDO.getId())); + + try{ + + //上传后直接转码 + Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); + + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("vod.tencentcloudapi.com"); + + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + + VodClient client = new VodClient(cred, "", clientProfile); + + // 实例化一个请求对象,每个接口都会对应一个request对象 + DeleteMediaRequest req = new DeleteMediaRequest(); + req.setFileId(vodDictDO1.getVodCode()); + // 返回的resp是一个DeleteMediaResponse的实例,与请求对象对应 + client.DeleteMedia(req); + } catch (TencentCloudSDKException e) { + System.out.println(e.toString()); + } + + return ConstantUtils.DELETE_SUCCESS; + } + + @Transactional(rollbackFor = Exception.class) + public VodDictDO uploadVods(UploadVodsDTO uploadVodsDTO) { + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(uploadVodsDTO.getSubjectId()); + + VodDictDO vodDictDO = new VodDictDO(); + BeanUtils.copyProperties(uploadVodsDTO, vodDictDO); + vodDictDO.setStatus("0"); + vodDictDO.setShareStatus("0"); //刚上传的视频属于个人库 + vodDictDO.setCheckStatus("0"); //刚上传的视频,没有审核状态 + vodDictDO.setSubjectId(subjectDictDO.getSubjectEn()); + vodDictDO.setCreateDate(LocalDateTime.now()); + vodDictDO.setUpdateDate(LocalDateTime.now()); + this.baseMapper.insert(vodDictDO); + + List longs = uploadVodsDTO.getTreeIds(); + for (Long lg : longs) { + VodSubjectTreeMappingDO vodTreeMappingDO = new VodSubjectTreeMappingDO(); + vodTreeMappingDO.setTreeId(lg); + vodTreeMappingDO.setVodId(vodDictDO.getId()); + vodTreeMappingDO.setStatus("1"); + vodSubjectTreeMappingMapper.insert(vodTreeMappingDO); + +// //包含知识点的课程,也会传上该视频 +// //找到包含 该知识点的courseTree +// List courseTreeDOS = courseTreeMapper.selectList(new QueryWrapper() +// .lambda() +// .eq(CourseTreeDO::getTreeId, lg)); +// +// for (CourseTreeDO courseTreeDO : courseTreeDOS) { +// //新增记录 +// VodCourseTreeMappingDO vodCourseTreeMappingDO = new VodCourseTreeMappingDO(); +// vodCourseTreeMappingDO.setVodId(vodDictDO.getId()); +// vodCourseTreeMappingDO.setTreeId(courseTreeDO.getId()); +// vodCourseTreeMappingDO.setStatus("0"); +// vodCourseTreeMappingMapper.insert(vodCourseTreeMappingDO); +// } + } + + //上传后直接转码 + Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); + + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("vod.tencentcloudapi.com"); + + 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(ConstantUtils.TEMPLATE_VOD); + transcodeTaskInputs1[0] = transcodeTaskInput1; + mediaProcessTaskInput1.setTranscodeTaskSet(transcodeTaskInputs1); + processMediaRequest.setMediaProcessTask(mediaProcessTaskInput1); + processMediaRequest.setFileId(uploadVodsDTO.getVodCode()); + + ProcessMediaResponse processMediaResponse = null; + try { + processMediaResponse = client.ProcessMedia(processMediaRequest); + System.out.println(processMediaResponse); + } catch (Exception ex) { + throw new HttpException(50001); + } + + return vodDictDO; + } + + public String updateVod(UploadVodsDTO uploadVodsDTO) { + + VodDictDO vodDictDO = new VodDictDO(); + BeanUtils.copyProperties(uploadVodsDTO, vodDictDO); + this.baseMapper.updateById(vodDictDO); + + vodSubjectTreeMappingMapper.delete(new QueryWrapper() + .lambda() + .in(VodSubjectTreeMappingDO::getVodId, uploadVodsDTO.getId())); + +// //从新传了新视频,需要转码 +// if (!uploadVodsDTO.getVodUrl().contains("100030")){ +// //上传后直接转码 +// Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); +// +// HttpProfile httpProfile = new HttpProfile(); +// httpProfile.setEndpoint("vod.tencentcloudapi.com"); +// +// 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(ConstantUtils.TEMPLATE_VOD); +// transcodeTaskInputs1[0] = transcodeTaskInput1; +// mediaProcessTaskInput1.setTranscodeTaskSet(transcodeTaskInputs1); +// processMediaRequest.setMediaProcessTask(mediaProcessTaskInput1); +// processMediaRequest.setFileId(uploadVodsDTO.getVodCode()); +// +// ProcessMediaResponse processMediaResponse = null; +// try { +// processMediaResponse = client.ProcessMedia(processMediaRequest); +// System.out.println(processMediaResponse); +// +// //删除原视频 TODO +// } catch (Exception ex) { +// throw new HttpException(50001); +// } +// } + + List longs = uploadVodsDTO.getTreeIds(); + for (Long lg : longs) { + VodSubjectTreeMappingDO vodTreeMappingDO = new VodSubjectTreeMappingDO(); + vodTreeMappingDO.setTreeId(lg); + vodTreeMappingDO.setVodId(vodDictDO.getId()); + vodSubjectTreeMappingMapper.insert(vodTreeMappingDO); + } + return ConstantUtils.SUCCESS_UPDATE; + } + + public VodDictDO getVodInfo(VodDictDO vodDictDO) { + return this.baseMapper.selectById(vodDictDO.getId()); + } + + public String insertPlayHistory(VodPlayHistoryDO vodPlayHistoryDO) { + vodPlayHistoryMapper.insert(vodPlayHistoryDO); + return ConstantUtils.ADD_SUCCESS; + } + + public GetToCheckCountsVO getToCheckVodCounts(GetToCheckVodCountsDTO getToCheckVodCountsDTO) { + + GetToCheckCountsVO getToCheckVodCountsVO = new GetToCheckCountsVO(); + + KnowledgeSubjectDictDO subjectDictDO = knowledgeSubjectDictMapper.selectById(getToCheckVodCountsDTO.getSubjectId()); + + + Integer counts = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(VodDictDO::getSubjectId, subjectDictDO.getSubjectEn()) + .eq(VodDictDO::getCheckStatus, "2")); + + getToCheckVodCountsVO.setToCheckCounts(counts); + //已审核 包括已通过 未通过 + Integer counts1 = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(VodDictDO::getSubjectId, subjectDictDO.getSubjectEn()) + .in(VodDictDO::getCheckStatus, new String[]{"1", "3"})); + + + getToCheckVodCountsVO.setCheckCounts(counts1); + + return getToCheckVodCountsVO; + } + + @Transactional(rollbackFor = Exception.class) + public String compressVodByCode(VodDictDO vodDictDO) { + + VodDictDO vodDictDO1 = this.baseMapper.selectById(vodDictDO.getId()); + + //转码 + Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); + + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("vod.tencentcloudapi.com"); + + 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(ConstantUtils.TEMPLATE_VOD); + transcodeTaskInputs1[0] = transcodeTaskInput1; + mediaProcessTaskInput1.setTranscodeTaskSet(transcodeTaskInputs1); + processMediaRequest.setMediaProcessTask(mediaProcessTaskInput1); + processMediaRequest.setFileId(vodDictDO1.getVodCode()); + + ProcessMediaResponse processMediaResponse = null; + try { + processMediaResponse = client.ProcessMedia(processMediaRequest); + System.out.println(processMediaResponse); + } catch (Exception ex) { + throw new HttpException(50001); + } + + + return ConstantUtils.COMPRESS_SUCCESS; + } + + public String deleteOriginVod(DeleteOriginVodDTO deleteOriginVodDTO) { + //转码 + Credential cred = new Credential(vodConfig.getSecretId(), vodConfig.getSecretKey()); + + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("vod.tencentcloudapi.com"); + + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + + VodClient client = new VodClient(cred, "", clientProfile); + + //删除原视频 + try { + + //替换原视频的地址 + List mediaProcessResultSets = deleteOriginVodDTO.getProcedureStateChangeEvent() + .getMediaProcessResultSet(); + + VodDictDO vodDictDO = vodDictMapper.selectOne(new QueryWrapper() + .lambda() + .eq(VodDictDO::getVodCode, deleteOriginVodDTO.getProcedureStateChangeEvent().getFileId())); + + vodDictDO.setVodUrl(mediaProcessResultSets.get(0).getTranscodeTask().getOutput().getUrl()); + vodDictMapper.updateById(vodDictDO); + + DeleteMediaRequest req = new DeleteMediaRequest(); + req.setFileId(deleteOriginVodDTO.getProcedureStateChangeEvent().getFileId()); + + MediaDeleteItem[] mediaDeleteItems1 = new MediaDeleteItem[1]; + MediaDeleteItem mediaDeleteItem1 = new MediaDeleteItem(); + mediaDeleteItem1.setType("OriginFiles"); + mediaDeleteItems1[0] = mediaDeleteItem1; + + req.setDeleteParts(mediaDeleteItems1); + + client.DeleteMedia(req); + + } catch (Exception e) { + System.out.println(e.toString()); + } + + return ConstantUtils.DELETE_SUCCESS; + } + + public String checkVod(CheckVodDTO checkVodDTO) { + + //审核通过 + if ("1".equals(checkVodDTO.getCheckStatus())) { + VodDictDO vodDictDO1 = vodDictMapper.selectById(checkVodDTO.getId()); + + vodDictDO1.setVodName(checkVodDTO.getVodName()); + vodDictDO1.setVodType(checkVodDTO.getVodType()); + vodDictDO1.setShareStatus("1"); //已共享 + vodDictDO1.setCheckStatus("1");// 已通过审核 + vodDictMapper.updateById(vodDictDO1); + + List ids = checkVodDTO.getTreeIds(); + + //删除之前原视频的关联知识点 + vodSubjectTreeMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(VodSubjectTreeMappingDO::getVodId, vodDictDO1.getId())); + + for (Long lg : ids) { + //知识点关联 + VodSubjectTreeMappingDO vodSubjectTreeMappingDO = new VodSubjectTreeMappingDO(); + vodSubjectTreeMappingDO.setVodId(vodDictDO1.getId()); + vodSubjectTreeMappingDO.setTreeId(lg); + vodSubjectTreeMappingDO.setStatus("0"); //不是关联视频 + vodSubjectTreeMappingMapper.insert(vodSubjectTreeMappingDO); + } + } else { + //不通过 + VodDictDO vodDictDO = new VodDictDO(); + BeanUtils.copyProperties(checkVodDTO, vodDictDO); + this.baseMapper.updateById(vodDictDO); + } + return ConstantUtils.CHECK_STATUS; + } + + public IPage publicUpload(PublicCheckingDTO publicCheckingDTO) { + + Page pager = new Page(publicCheckingDTO.getPageNum(), publicCheckingDTO.getPageSize()); + return this.baseMapper.selectPage(pager, new QueryWrapper() + .lambda() + .eq(VodDictDO::getAdministerId, publicCheckingDTO.getUserId()) + .eq(VodDictDO::getCheckStatus, publicCheckingDTO.getCheckStatus()) + .orderByDesc(VodDictDO::getUpdateDate)); + } + + public String withdraw(VodDictDO vodDictDO) { + vodDictDO.setCheckStatus("0"); + vodDictDO.setShareStatus("0"); + this.baseMapper.updateById(vodDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public GetVodDetailVO getVodDetail(VodDictDO vodDictDO) { + + GetVodDetailVO getVodDetailVO = new GetVodDetailVO(); + + VodDictDO vodDictDO1 = this.baseMapper.selectById(vodDictDO.getId()); + BeanUtils.copyProperties(vodDictDO1, getVodDetailVO); + + List subjectTreeDOS = this.baseMapper.getTrees(vodDictDO.getId()); + + getVodDetailVO.setSubjectTreeDOS(subjectTreeDOS); + return getVodDetailVO; + } + + public String setRelatedVod(VodSubjectTreeMappingDO vodSubjectTreeMappingDO){ + + VodSubjectTreeMappingDO vodSubjectTreeMappingDO1 = new VodSubjectTreeMappingDO(); + vodSubjectTreeMappingDO1.setStatus(vodSubjectTreeMappingDO.getStatus()); + + vodSubjectTreeMappingMapper.update(vodSubjectTreeMappingDO1,new QueryWrapper() + .lambda() + .eq(VodSubjectTreeMappingDO::getVodId,vodSubjectTreeMappingDO.getVodId())); + + return ConstantUtils.SUCCESS_UPDATE; + } + +} diff --git b/src/main/java/com/meishu/service/impl/VodPlayHistoryServiceImpl.java a/src/main/java/com/meishu/service/impl/VodPlayHistoryServiceImpl.java new file mode 100644 index 0000000..9b0c9a0 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/VodPlayHistoryServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.VodPlayHistoryDO; +import com.meishu.mapper.VodPlayHistoryMapper; +import com.meishu.service.VodPlayHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 视频播放历史记录表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class VodPlayHistoryServiceImpl extends ServiceImpl implements VodPlayHistoryService { + +} diff --git b/src/main/java/com/meishu/service/impl/VodSubjectTreeMappingServiceImpl.java a/src/main/java/com/meishu/service/impl/VodSubjectTreeMappingServiceImpl.java new file mode 100644 index 0000000..12d179d --- /dev/null +++ a/src/main/java/com/meishu/service/impl/VodSubjectTreeMappingServiceImpl.java @@ -0,0 +1,51 @@ +package com.meishu.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.meishu.dto.subject.BatchStatusOprDTO; +import com.meishu.dto.subject.GetAllVodsStatusDTO; +import com.meishu.mapper.VodDictMapper; +import com.meishu.model.VodSubjectTreeMappingDO; +import com.meishu.mapper.VodSubjectTreeMappingMapper; +import com.meishu.service.VodSubjectTreeMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.meishu.util.ConstantUtils; +import com.meishu.vo.subject.GetAllNoAuthenVodsVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 视频知识点映射表 服务实现类 + *

+ * + * @author Tuyp + * @since 2021-04-27 + */ +@Service +public class VodSubjectTreeMappingServiceImpl extends ServiceImpl implements VodSubjectTreeMappingService { + + @Autowired + private VodDictMapper vodDictMapper; + + public IPage getAllNoAuthenVods(GetAllVodsStatusDTO getAllNoAuthenVodsDTO){ + Page pager = new Page(getAllNoAuthenVodsDTO.getPageNum(), getAllNoAuthenVodsDTO.getPageSize()); + IPage getAllNoAuthenVodsVOIPage = this.baseMapper.getAllNoAuthenVods(pager,getAllNoAuthenVodsDTO.getTreeId(),getAllNoAuthenVodsDTO.getStatus(),getAllNoAuthenVodsDTO.getVodType()); + List getAllNoAuthenVodsVOS = getAllNoAuthenVodsVOIPage.getRecords(); + for (GetAllNoAuthenVodsVO getAllNoAuthenVodsVO : getAllNoAuthenVodsVOS){ + getAllNoAuthenVodsVO.setSubjectTreeDOS(vodDictMapper.getVodTrees(getAllNoAuthenVodsVO.getId())); + } + return getAllNoAuthenVodsVOIPage; + } + + public String batchStatusOpr(BatchStatusOprDTO batchStatusOprDTO){ + + List ids = batchStatusOprDTO.getIds(); + for (Long lg : ids){ + vodDictMapper.updateStatus(lg,batchStatusOprDTO.getStatus()); + } + return ConstantUtils.SET_SUCCESS; + } +} diff --git b/src/main/java/com/meishu/service/impl/WrittenHomeworkServiceImpl.java a/src/main/java/com/meishu/service/impl/WrittenHomeworkServiceImpl.java new file mode 100644 index 0000000..fd1b7b6 --- /dev/null +++ a/src/main/java/com/meishu/service/impl/WrittenHomeworkServiceImpl.java @@ -0,0 +1,20 @@ +package com.meishu.service.impl; + +import com.meishu.model.WrittenHomeworkDO; +import com.meishu.mapper.WrittenHomeworkMapper; +import com.meishu.service.WrittenHomeworkService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 通知/附件作业表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-09-16 + */ +@Service +public class WrittenHomeworkServiceImpl extends ServiceImpl implements WrittenHomeworkService { + +} diff --git b/src/main/java/com/meishu/util/BaseModel.java a/src/main/java/com/meishu/util/BaseModel.java new file mode 100644 index 0000000..8017603 --- /dev/null +++ a/src/main/java/com/meishu/util/BaseModel.java @@ -0,0 +1,35 @@ +package com.meishu.util; + +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 abstract class BaseModel { + + /** + * 创建时间 + */ + @JsonIgnore + @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "create_date", fill = FieldFill.INSERT) + private LocalDateTime createDate; + + /** + * 更新时间 + */ + @JsonIgnore + @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "update_date", fill = FieldFill.UPDATE) + private LocalDateTime updateDate; + + /** + * 删除时间 + */ + @JsonIgnore + @TableLogic + private LocalDateTime deleteDate; +} diff --git b/src/main/java/com/meishu/util/CodeGenerator.java a/src/main/java/com/meishu/util/CodeGenerator.java new file mode 100644 index 0000000..64203ae --- /dev/null +++ a/src/main/java/com/meishu/util/CodeGenerator.java @@ -0,0 +1,124 @@ +package com.meishu.util; + +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 java.util.ArrayList; +import java.util.List; +import java.util.ResourceBundle; +import java.util.Scanner; + +/** + * Mybatis-Plus CodeGenerator + * + * @author DengMin + * @date 2020/07/02 + **/ +public class CodeGenerator { + + public static String scanner(String tip) { + StringBuilder help = new StringBuilder(); + help.append("1.生成全部表 2.输入需要生成表名"); + System.out.println(help.toString()); + 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.toString()); + 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-plus"); + // 代码生成器 + 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 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(); + } +} \ No newline at end of file diff --git b/src/main/java/com/meishu/util/CodeTrans.java a/src/main/java/com/meishu/util/CodeTrans.java new file mode 100644 index 0000000..e3835ba --- /dev/null +++ a/src/main/java/com/meishu/util/CodeTrans.java @@ -0,0 +1,31 @@ +package com.meishu.util; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Scanner; + +public class CodeTrans { + + public static void main(String[] args) { + + System.out.println("请输入手机号:"); + Scanner scanner = new Scanner(System.in); + String telephone = scanner.nextLine(); + //String telephone = "15201936167"; + SimpleDateFormat sj1 = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss"); + String current = sj1.format(new Date()); + //System.out.println(current); + String[] arrTemp = current.split(" "); + + String[] timeArr = arrTemp[1].split(":"); + Integer first = Integer.valueOf(timeArr[1].substring(0,1)); + Integer second = Integer.valueOf(timeArr[0].substring(0,1)); + Integer third = Integer.valueOf(timeArr[0].substring(1)); + Integer fourth = Integer.valueOf(timeArr[1].substring(1)); + //System.out.println(first +"===" + second +"===" +third+"===="+fourth); + System.err.println("验证码是:"+telephone.charAt(first)+"->"+telephone.charAt(second)+"->"+telephone.charAt(third)+"->"+telephone.charAt(fourth)); + System.exit(0); + + } + +} diff --git b/src/main/java/com/meishu/util/ConstantUtils.java a/src/main/java/com/meishu/util/ConstantUtils.java new file mode 100644 index 0000000..47e6ca9 --- /dev/null +++ a/src/main/java/com/meishu/util/ConstantUtils.java @@ -0,0 +1,89 @@ +package com.meishu.util; + + +/** + * 枚举类 + */ +public class ConstantUtils { + + public static final String DELETE_SUCCESS = "删除成功"; + + public static final String UPLOAD_FAIL = "上传失败"; + + public static final String ADD_SUCCESS = "新增成功"; + + public static final String COMMIT_SUCCESS = "提交成功"; + + public static final String SUCCESS_SEND_OUT = "发送成功"; + + public static final String FAIL_SEND_OUT = "发送失败"; + + public static final String SAVE_SUCCESS = "保存成功"; + + public static final String SHARE_SUCCESS = "共享成功"; + + public static final String SUBMIT_SUCCESS = "提交成功"; + + public static final String SUCCESS_UPDATE = "更新成功"; + + public static final String FAIL_UPDATE = "更新失败"; + + public static final String SET_SUCCESS = "设置成功"; + + public static final String SUCCESS_VERIFY = "验证成功"; + + public static final String FAIL_VERIFY = "验证失败"; + + public static final String COMPANY_NAME = "TeachAI"; + + public static final String ALREADY_DONE = "已完成"; + + public static final String ALREADY_RECOMMEND = "已推荐"; + + public static final String VERIFY_NAME = "有课互联"; + + public static final String NOTICE_NAME = "有课进度通知"; + + public static final String PUBLISH_SUCCESS = "发布成功"; + + public static final String LOGIN_OUT ="登出成功"; + + public static final String COMPRESS_SUCCESS = "压缩成功"; + + public static final String SCHOOL = "上海市市西中学"; + + public static final String CHECK_STATUS = "审核通过"; + + /** + * 短信模板---验证模板 + */ + public static final String TEMPLATE_CODE = "SMS_190945394"; + + /** + * 短信 地域ID + */ + public static final String REGION_ID = "cn-hangzhou"; + + /** + * 短信 RAM账号AccessKey ID + */ + public static final String ACCESS_KEY_ID = "LTAIOrpFKrDqsQ2c"; + + /** + * 短信 RAM账号AccessKey Secret + */ + public static final String SECRET = "1Qp8huLETbWiBBJvHXJ7MOIhtKuA1G"; + + /** + * 腾讯云点播视频转码模板 + */ + public static final Long TEMPLATE_VOD = 100030L; + + /** + * 手机端token + */ + public static final String MOBILE_TERMINATE = "mobile"; + + public static final String ADMINISTER_TERMINATE = "administer"; + +} diff --git b/src/main/java/com/meishu/util/DateFormatUtil.java a/src/main/java/com/meishu/util/DateFormatUtil.java new file mode 100644 index 0000000..b63f146 --- /dev/null +++ a/src/main/java/com/meishu/util/DateFormatUtil.java @@ -0,0 +1,82 @@ +package com.meishu.util; + +import java.text.SimpleDateFormat; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; + +/** + * 处理时间工具 + * + * @author DengMin + * @date 2019/08/27 13:56 + **/ +public class DateFormatUtil { + + public final static String YEAR = "yyyy"; + 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_yM = "yyyy-M"; + public final static String FMT_sdf_yMM = "yyyy-MM"; + public final static String FMT_sdf_Hm = "H:mm"; + public final static String FMT_sdf_HHmm = "HH: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 { + 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 { + SimpleDateFormat sdf = new SimpleDateFormat(pattern); + return sdf.parse(date); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 比较两个时间 + * .after 大于 + * .before 小于 + * @param d1 + * @param d2 + * @return + */ + public static boolean compare(Date d1, Date d2 ) { + if(d1.after(d2)) { + return false; + } + return true; + } + + /** + * Data转Cron + * @param date + * @return + */ + public static String getCron(Date date) { + SimpleDateFormat sdf = new SimpleDateFormat("s m H d M ? yyyy"); + return sdf.format(date); + } +} diff --git b/src/main/java/com/meishu/util/EncryptUtil.java a/src/main/java/com/meishu/util/EncryptUtil.java new file mode 100644 index 0000000..2416450 --- /dev/null +++ a/src/main/java/com/meishu/util/EncryptUtil.java @@ -0,0 +1,35 @@ +package com.meishu.util; + +import com.amdelamar.jhash.Hash; +import com.amdelamar.jhash.algorithms.Type; +import com.amdelamar.jhash.exception.InvalidHashException; + +public class EncryptUtil { + + /** + * 设置密文密码 + * + * @param password 原始密码 + * @return 加密密码 + */ + public static String encrypt(String password) { + char[] chars = password.toCharArray(); + return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).create(); + } + + /** + * 验证加密密码 + * + * @param encryptedPassword 密文密码 + * @param plainPassword 明文密码 + * @return 验证是否成功 + */ + public static boolean verify(String encryptedPassword, String plainPassword) { + char[] chars = plainPassword.toCharArray(); + try { + return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).verify(encryptedPassword); + } catch (InvalidHashException e) { + return false; + } + } +} diff --git b/src/main/java/com/meishu/util/HttpUtil.java a/src/main/java/com/meishu/util/HttpUtil.java new file mode 100644 index 0000000..e91b7c3 --- /dev/null +++ a/src/main/java/com/meishu/util/HttpUtil.java @@ -0,0 +1,64 @@ +package com.meishu.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.springframework.http.*; +import org.springframework.web.client.RestTemplate; + +import java.util.HashMap; +import java.util.Map; + +/** + * http请求 + */ +public class HttpUtil { + + /** + * GET 请求 + * @param params + * @param url + * @return + */ + public static JSONObject get(Map params, String url) { + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity responseEntity = restTemplate.getForEntity(url, String.class, params); + String body = responseEntity.getBody(); + JSONObject object = JSON.parseObject(body); + return object; + } + + /** + * POST 请求 + * @param params + * @param url + * @return + */ + public static JSONObject post(Map params, String url) { + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity responseEntity = restTemplate.postForEntity(url, params, String.class); + String body = responseEntity.getBody(); + JSONObject object = JSON.parseObject(body); + return object; + } + + /** + * POST 请求 带Token + * + * @param param + * @param token + * @param url + * @return + */ + public static JSONObject sendPost(Map param, String token, String url, Object obj) { + RestTemplate restTemplate = new RestTemplate(); + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + headers.add("Accept", MediaType.ALL_VALUE); + headers.add("Authorization", "Bearer " + token); + HttpEntity formEntity = new HttpEntity(param.toString(), headers); + ResponseEntity responseEntity = restTemplate.exchange(url, HttpMethod.POST, formEntity, String.class, obj); + String body = responseEntity.getBody(); + JSONObject object = JSON.parseObject(body); + return object; + } +} diff --git b/src/main/java/com/meishu/util/JwtUtil.java a/src/main/java/com/meishu/util/JwtUtil.java new file mode 100644 index 0000000..e4a4cfe --- /dev/null +++ a/src/main/java/com/meishu/util/JwtUtil.java @@ -0,0 +1,96 @@ +package com.meishu.util; + +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; + +/** + *

+ * Token工具 + *

+ * + * @author DengMin + * @since 2021/4/14 + */ +public class JwtUtil { + + private static Long EXPIRE_TIME = 24 * 60 * 60 * 1000L; + + private static 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 getClaims(String token) { + Algorithm algorithm = Algorithm.HMAC256(SECRET); + JWTVerifier verifier = JWT.require(algorithm).build(); + Map 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; + } + } +} diff --git b/src/main/java/com/meishu/util/LatexUtils.java a/src/main/java/com/meishu/util/LatexUtils.java new file mode 100644 index 0000000..dac38fc --- /dev/null +++ a/src/main/java/com/meishu/util/LatexUtils.java @@ -0,0 +1,124 @@ +package com.meishu.util; + +import org.scilab.forge.jlatexmath.TeXConstants; +import org.scilab.forge.jlatexmath.TeXFormula; +import org.scilab.forge.jlatexmath.TeXIcon; + +import javax.imageio.ImageIO; +import javax.swing.*; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.*; + +/** + * @author: tuyp + * @create: 2020-08-08 21:19 + */ +public class LatexUtils { + + /** + * @Description: 将base64编码字符串转换为图片 + * @Author: + * @CreateTime: + * @param imgStr + * base64编码字符串 + * @param path + * 图片路径-具体到文件 + * @return + */ + public static boolean generateImage(String imgStr, String path) { + if (imgStr == null) { + return false; + } +// BASE64Decoder decoder = new BASE64Decoder(); + try { +// byte[] b = decoder.decodeBuffer(imgStr); +// for (int i = 0; i < b.length; i++) { +// if (b[i] < 0) { +// b[i] += 256; +// } +// } +// OutputStream out = new FileOutputStream(path); +// out.write(b); +// out.flush(); +// out.close(); + return true; + } catch (Exception e) { + // TODO: handle exception + return false; + } + } + + /** + * @Description: 根据图片地址转换为base64编码字符串 + * @Author: + * @CreateTime: + * @return + */ +// public static String getImageStr(String imgFile) { +// InputStream inputStream = null; +// byte[] data = null; +// try { +// inputStream = new FileInputStream(imgFile); +// data = new byte[inputStream.available()]; +// inputStream.read(data); +// inputStream.close(); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// // 加密 +// BASE64Encoder encoder = new BASE64Encoder(); +// return encoder.encode(data); +// } + + // latex 转 imgbase64 + public static String latex2Png(String latex) { + try { + TeXFormula formula = new TeXFormula(latex); + // render the formla to an icon of the same size as the formula. + TeXIcon icon = formula.createTeXIcon(TeXConstants.STYLE_DISPLAY, 20); + // insert a border + icon.setInsets(new Insets(1, 1, 1, 1)); + // now create an actual image of the rendered equation + BufferedImage image = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_BYTE_GRAY); + Graphics2D g2 = image.createGraphics(); + g2.setColor(Color.white); + g2.fillRect(0, 0, icon.getIconWidth(), icon.getIconHeight()); + JLabel jl = new JLabel(); + jl.setForeground(new Color(0, 0, 0)); + icon.paintIcon(jl, g2, 0, 0); + // at this point the image is created, you could also save it with ImageIO + // saveImage(image, "png", "F:\\b.png"); +// ImageIO.write(image, "png", new File("F:\\c.png")); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try { + ImageIO.write(image, "png", outputStream); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return null; + } + byte[] buffer = outputStream.toByteArray(); +// BASE64Encoder encoder = new BASE64Encoder(); + return ("data:image/png;base64,"); + } catch (Exception e) { + // e.printStackTrace(); + // ExceptionUtil.log(log, e); + System.err.println("公式解析有误:\n" + latex); + // e.printStackTrace(); + return null; + } + } + + public static void main(String[] args) { + String str = latex2Png("\\(\\sqrt[3]{2+x}\\)"); + System.out.println(str); + + + + +// String omml =Latex_Word.latexToWord(str); +// System.out.println(omml); + } + +} diff --git b/src/main/java/com/meishu/util/Localstorage.java a/src/main/java/com/meishu/util/Localstorage.java new file mode 100644 index 0000000..926b833 --- /dev/null +++ a/src/main/java/com/meishu/util/Localstorage.java @@ -0,0 +1,21 @@ +package com.meishu.util; + +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class Localstorage { + + private static final ThreadLocal local = ThreadLocal.withInitial(() -> null); + + public static void setUser(Object admin) { + Localstorage.local.set(admin); + } + + public static Object getUser() { + return Localstorage.local.get(); + } + + public static void remove() { + Localstorage.local.remove(); + } +} diff --git b/src/main/java/com/meishu/util/MathUtil.java a/src/main/java/com/meishu/util/MathUtil.java new file mode 100644 index 0000000..086c4f0 --- /dev/null +++ a/src/main/java/com/meishu/util/MathUtil.java @@ -0,0 +1,129 @@ +package com.meishu.util; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Random; + +public class MathUtil { + + public static String getRandomCode(int randomLength) { + StringBuilder str = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < randomLength; i++) { + str.append(random.nextInt(10)); + } + return str.toString(); + } + + public static String getRandomString(int length) { + StringBuilder val = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < length; ++i) { + String charOrNum = random.nextInt(3) % 3 == 0 ? "num" : "char"; + if ("char".equalsIgnoreCase(charOrNum)) { + int temp = random.nextInt(2) % 2 == 0 ? 65 : 97; + val.append((char) (random.nextInt(26) + temp)); + } else { + val.append(random.nextInt(10)); + } + } + return val.toString(); + } + + //习题/视频 ==> 秒钟向上取整 + public static String ceilSecond(int length) { + return String.valueOf((int) Math.ceil((double) length / 60)); + } + + //视频秒数处理 + public static String vodLength(int i) { + if (i > 60) { + if (i % 60 >= 10) { + return i / 60 + ":" + i % 60; + } else { + return i / 60 + ":0" + i % 60; + } + } else { + if (i % 60 >= 10) { + return "00:" + i; + } else { + return "00:0" + i; + } + } + } + + //文件大小处理 + public static String fileUnit(int i) { + if (i / 1024 > 1024) { + return String.format("%.2f", (double) i / 1024 / 1024) + "M"; + } else { + return String.format("%.2f", (double) i / 1024) + "K"; + } + } + + //单个题目秒数处理 + public static String exerciseLength(int i) { + if (i >= 60 * 60) { + return i / 60 / 60 + "时" + (i - 60 * 60) / 60 + "分" + i % 60 + "秒"; + } else if (i >= 60) { + return i / 60 + "分" + i % 60 + "秒"; + } else { + return i % 60 + "秒"; + } + } + + // 除法取整 + public static String getAvgIndex(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total)) { + return "0"; + } else { + return counts.divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString(); + } + } + + //百分比 取整 返回字符串 + public static String getPercentAvgIndex(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { + return "0%"; + } else { + return counts.multiply(new BigDecimal(100)).divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString() + "%"; + } + } + + //百分比 不带%输出 + public static String getPercentAvgIndexWithPercent(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { + return "0"; + } else { + return counts.multiply(new BigDecimal(100)).divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString(); + } + } + + + //习题序号生成规则 sid 从数据取出某科目某知识点的最大的序号 + public static String getExeCode(String sid) { + Integer integer = Integer.valueOf(sid.substring(9)); + return sid.substring(0, 9) + (++integer); + } + + // 整型a 整型b a/b 向上取整 + public static Integer intDivCeil(long a, int b) { + return (int) Math.ceil((double) a / b); + } + + // 整型a 整型b a/b 向下取整 + public static Integer intDivFloorPercent(long a, int b) { + return (int) Math.floor((double) a * 100 / b); + } + + public static Integer getRandomNum(Integer i){ + Random random = new Random(); + return random.nextInt(i); + } + +// public static void main(String[] args) { +// for (int i= 1;i<100;i++){ +// System.out.println(getRandomNum(2)); +// } +// } +} diff --git b/src/main/java/com/meishu/util/RandomUtil.java a/src/main/java/com/meishu/util/RandomUtil.java new file mode 100644 index 0000000..63e1af6 --- /dev/null +++ a/src/main/java/com/meishu/util/RandomUtil.java @@ -0,0 +1,19 @@ +package com.meishu.util; + +import java.util.Random; + +public class RandomUtil { + + public static int getCode() { + return (int)((Math.random() * 9 + 1) * 100000); + } + + public static String getRandomCode(int randomLength) { + StringBuilder str = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < randomLength; i++) { + str.append(random.nextInt(10)); + } + return str.toString(); + } +} diff --git b/src/main/java/com/meishu/util/SMSUtils.java a/src/main/java/com/meishu/util/SMSUtils.java new file mode 100644 index 0000000..be412dc --- /dev/null +++ a/src/main/java/com/meishu/util/SMSUtils.java @@ -0,0 +1,137 @@ +package com.meishu.util; + +import com.aliyuncs.CommonRequest; +import com.aliyuncs.CommonResponse; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; +import com.aliyuncs.http.MethodType; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; +import com.meishu.common.configure.AliyunSmsProperties; +import com.meishu.common.exception.HttpException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 短信发送工具类 + */ + +@Component +public class SMSUtils { + + @Autowired + private AliyunSmsProperties aliyunSmsProperties; + + public SendSmsResponse send(String phone, String 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_190945394"); + //可选:模板中的变量替换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) { + throw new HttpException(70011); + } + } + + + /** + * 发送验证码短信 + * @param templateId 短信模板id + * @param telephone 手机号 + * @return + */ + public static String sendVerifySMS(String templateId,String telephone,String param){ + DefaultProfile profile = DefaultProfile.getProfile(ConstantUtils.REGION_ID, ConstantUtils.ACCESS_KEY_ID, ConstantUtils.SECRET); + IAcsClient client = new DefaultAcsClient(profile); + + CommonRequest request = new CommonRequest(); + request.setSysMethod(MethodType.POST); + request.setSysDomain("dysmsapi.aliyuncs.com"); + request.setSysVersion("2017-05-25"); + request.setSysAction("SendSms"); + request.putQueryParameter("RegionId",ConstantUtils.REGION_ID); + request.putQueryParameter("PhoneNumbers",telephone); + request.putQueryParameter("SignName",ConstantUtils.VERIFY_NAME); + request.putQueryParameter("TemplateCode",templateId); +// if (StringUtils.isEmpty(param)){ +// request.putQueryParameter("TemplateParam","{ \"code\":\""+verifyCode +"\"}"); +// } + request.putQueryParameter("TemplateParam",param); + CommonResponse response = null; + try { + response = client.getCommonResponse(request); + return ConstantUtils.SUCCESS_SEND_OUT; + } catch(Exception e) { + e.printStackTrace(); + return ConstantUtils.FAIL_SEND_OUT; + } + } + + /** + * 发送通知短信 + * @param templateId 短信模板id + * @param telephone 手机号 + * @return + */ + public static String sendNoticeSMS(String templateId,String telephone,String param){ + DefaultProfile profile = DefaultProfile.getProfile(ConstantUtils.REGION_ID, ConstantUtils.ACCESS_KEY_ID, ConstantUtils.SECRET); + IAcsClient client = new DefaultAcsClient(profile); + + CommonRequest request = new CommonRequest(); + request.setSysMethod(MethodType.POST); + request.setSysDomain("dysmsapi.aliyuncs.com"); + request.setSysVersion("2017-05-25"); + request.setSysAction("SendSms"); + request.putQueryParameter("RegionId",ConstantUtils.REGION_ID); + request.putQueryParameter("PhoneNumbers",telephone); + request.putQueryParameter("SignName",ConstantUtils.NOTICE_NAME); + request.putQueryParameter("TemplateCode",templateId); +// if (StringUtils.isEmpty(param)){ +// request.putQueryParameter("TemplateParam","{ \"code\":\""+verifyCode +"\"}"); +// } + request.putQueryParameter("TemplateParam",param); + CommonResponse response = null; + try + + { + response = client.getCommonResponse(request); + return ConstantUtils.SUCCESS_SEND_OUT; + } catch( + Exception e) + + { + e.printStackTrace(); + return ConstantUtils.FAIL_SEND_OUT; + } + } + + public static void main(String[] args) { + String param = "{ \"company\":\""+"基金会"+ "\",\"time\":\""+"2020-01-02" +"\",\"address\":\""+"上海市" +"\"}"; + sendNoticeSMS("SMS_215336604","15201936167",param); + } + +} diff --git b/src/main/java/com/meishu/util/SecretUtils.java a/src/main/java/com/meishu/util/SecretUtils.java new file mode 100644 index 0000000..f6a3e1e --- /dev/null +++ a/src/main/java/com/meishu/util/SecretUtils.java @@ -0,0 +1,119 @@ +package com.meishu.util; + +import org.apache.commons.codec.binary.Hex; + +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.util.Random; +import java.util.UUID; + +public class SecretUtils { + + /** + * 对用户登录密码进行MD5加密 + * + * @param str + * @return + */ + + public static String getMD5String(String str) { + try { + // 生成一个MD5加密计算摘要 + MessageDigest md = MessageDigest.getInstance("MD5"); + // 计算md5函数 + md.update(str.getBytes()); + // digest()最后确定返回md5 hash值,返回值为8位字符串。因为md5 hash值是16位的hex值,实际上就是8位的字符 + // BigInteger函数则将8位的字符串转换成16位hex值,用字符串来表示;得到字符串形式的hash值 + //一个byte是八位二进制,也就是2位十六进制字符(2的8次方等于16的2次方) + return new BigInteger(1, md.digest()).toString(16); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 对字符串进行SHA加密 + * + * @param + */ + public static String getSHAString(String str) { + try { + MessageDigest sha = MessageDigest.getInstance("SHA-1"); + + byte[] byteArray = str.getBytes(StandardCharsets.UTF_8); + byte[] md5Bytes = sha.digest(byteArray); + StringBuffer hexValue = new StringBuffer(); + for (int i = 0; i < md5Bytes.length; i++) { + int val = ((int) md5Bytes[i]) & 0xff; + if (val < 16) { + hexValue.append("0"); + } + hexValue.append(Integer.toHexString(val)); + } + + return hexValue.toString(); + } catch (Exception e) { + return null; + } + + } + + + private static byte[] md5(String s) + { + MessageDigest algorithm; + try + { + algorithm = MessageDigest.getInstance("MD5"); + algorithm.reset(); + algorithm.update(s.getBytes("UTF-8")); + byte[] messageDigest = algorithm.digest(); + return messageDigest; + } + catch (Exception e) + { + + } + return null; + } + + private static final String toHex(byte hash[]) + { + if (hash == null) + { + return null; + } + StringBuffer buf = new StringBuffer(hash.length * 2); + int i; + + for (i = 0; i < hash.length; i++) + { + if ((hash[i] & 0xff) < 0x10) + { + buf.append("0"); + } + buf.append(Long.toString(hash[i] & 0xff, 16)); + } + return buf.toString(); + } + + public static String hash(String s) + { + try + { + return new String(toHex(md5(s)).getBytes("UTF-8"), "UTF-8"); + } + catch (Exception e) + { + return s; + } + } + + public static void main(String[] args) { + String uuid = UUID.randomUUID().toString(); + System.out.println(uuid); + System.out.println(hash(uuid+"ixihs")); + } +} \ No newline at end of file diff --git b/src/main/java/com/meishu/util/Signature.java a/src/main/java/com/meishu/util/Signature.java new file mode 100644 index 0000000..94e99d2 --- /dev/null +++ a/src/main/java/com/meishu/util/Signature.java @@ -0,0 +1,79 @@ +package com.meishu.util; + +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 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 += "¤tTimeStamp=" + currentTime; + contextStr += "&expireTime=" + endTime; + contextStr += "&random=" + random; + + 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; + } +} diff --git b/src/main/java/com/meishu/util/TestMain.java a/src/main/java/com/meishu/util/TestMain.java new file mode 100644 index 0000000..588dabe --- /dev/null +++ a/src/main/java/com/meishu/util/TestMain.java @@ -0,0 +1,61 @@ +package com.meishu.util; + +import java.security.MessageDigest; +import java.util.Random; + +public class TestMain { + + public static void main(String[] args) { + String password = "123456"; + String saltCode = getRandomCharAndNumr(5); + String encryptString = encrypt("91ebn" + password); + System.out.println(encryptString); + } + + public static String encrypt(String string) { + + String encryptedString = string; + char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + try { + byte[] btInput = string.getBytes(); + MessageDigest mdInst = MessageDigest.getInstance("MD5"); + mdInst.update(btInput); + byte[] md = mdInst.digest(); + int j = md.length; + char[] str = new char[j * 2]; + int k = 0; + for (int i = 0; i < j; i++) { + byte byte0 = md[i]; + str[k++] = hexDigits[byte0 >>> 4 & 0xf]; + str[k++] = hexDigits[byte0 & 0xf]; + } + encryptedString = new String(str); + return encryptedString; + } catch (Exception e) { + e.printStackTrace(); + return encryptedString; + } + } + + /** + * 获取随机字母数字组合 + * + * @param length + * 字符串长度 + * @return + */ + public static String getRandomCharAndNumr(Integer length) { + String str = ""; + Random random = new Random(); + for (int i = 0; i < length; i++) { + boolean b = random.nextBoolean(); + if (b) { // 字符串 + // int choice = random.nextBoolean() ? 65 : 97; 取得65大写字母还是97小写字母 + str += (char) (97 + random.nextInt(26));// 取得大写字母 + } else { // 数字 + str += String.valueOf(random.nextInt(10)); + } + } + return str; + } +} diff --git b/src/main/java/com/meishu/util/WechatUtil.java a/src/main/java/com/meishu/util/WechatUtil.java new file mode 100644 index 0000000..93e7f5d --- /dev/null +++ a/src/main/java/com/meishu/util/WechatUtil.java @@ -0,0 +1,68 @@ +package com.meishu.util; + +import com.alibaba.fastjson.JSONObject; +import com.meishu.common.constant.WxConstant; +import com.meishu.vo.wechat.AccessTokenVO; +import com.meishu.vo.wechat.MemberVO; +import com.meishu.vo.wechat.QrConnectVO; +import com.meishu.vo.wechat.WXUserInfoVO; + +import java.util.HashMap; +import java.util.Map; + +public class WechatUtil { + + /** + * Access Token + * @return + */ + public static AccessTokenVO getAccessToken() { + Map param = new HashMap<>(); + param.put("appid", WxConstant.APPID); + param.put("secret", WxConstant.SECRENT); + JSONObject object = HttpUtil.get(param, WxConstant.GET_SUITE_TOKEN); + return JSONObject.toJavaObject(object, AccessTokenVO.class); + } + + /** + * 获取访问用户身份 + * @param accessToken + * @param code + * @return + */ + public static WXUserInfoVO getUserInfo(String accessToken, String code) { + Map param = new HashMap<>(); + param.put("access_token", accessToken); + param.put("code", code); + JSONObject object = HttpUtil.get(param, WxConstant.GETUSERINFO); + return JSONObject.toJavaObject(object, WXUserInfoVO.class); + } + + /** + * 读取成员 + * @param accessToken + * @param userId + * @return + */ + public static MemberVO getMember(String accessToken, String userId) { + Map param = new HashMap<>(); + param.put("access_token", accessToken); + param.put("userid", userId); + JSONObject object = HttpUtil.get(param, WxConstant.GET); + return JSONObject.toJavaObject(object, MemberVO.class); + } + + /** + * 扫码登陆参数 + * @return + */ + public static QrConnectVO getQRConnectParams() { + QrConnectVO qrConnectVO = new QrConnectVO(); + qrConnectVO.setId("双创系统"); + qrConnectVO.setAppId(WxConstant.APPID); +// qrConnectVO.setAgentId(WxConstant.AGENTID); + qrConnectVO.setRedirectUri(WxConstant.QR_REDIRECT_URL); + qrConnectVO.setState("MASS"); + return qrConnectVO; + } +} diff --git b/src/main/java/com/meishu/util/excel/ExcelColumn.java a/src/main/java/com/meishu/util/excel/ExcelColumn.java new file mode 100644 index 0000000..82d7e1c --- /dev/null +++ a/src/main/java/com/meishu/util/excel/ExcelColumn.java @@ -0,0 +1,13 @@ +package com.meishu.util.excel; + +import java.lang.annotation.*; + +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ExcelColumn { + + String value() default ""; + + int col() default 1; +} diff --git b/src/main/java/com/meishu/util/excel/ExcelColumnUtil.java a/src/main/java/com/meishu/util/excel/ExcelColumnUtil.java new file mode 100644 index 0000000..256820b --- /dev/null +++ a/src/main/java/com/meishu/util/excel/ExcelColumnUtil.java @@ -0,0 +1,21 @@ +package com.meishu.util.excel; + +import java.lang.annotation.*; + +/** + *

+ * excel 字段 + *

+ * + * @author DengMin + * @date Created in 2020/08/28 + */ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ExcelColumnUtil { + + String value() default ""; + + int col() default 0; +} diff --git b/src/main/java/com/meishu/util/excel/ExcelUtil.java a/src/main/java/com/meishu/util/excel/ExcelUtil.java new file mode 100644 index 0000000..4807cb8 --- /dev/null +++ a/src/main/java/com/meishu/util/excel/ExcelUtil.java @@ -0,0 +1,347 @@ +package com.meishu.util.excel; + +import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.CharUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.http.MediaType; +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.File; +import java.io.FileOutputStream; +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.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * Excel工具 + * + * @author DengMin + * @date 2019/08/27 13:57 + **/ +@Slf4j +public class ExcelUtil { + + private final static String EXCEL2003 = "xls"; + + private final static String EXCEL2007 = "xlsx"; + + /** + * 导入excel文件 + * @param path + * @param cls + * @param file + * @param + * @return + */ + public static List readExcel(String path, Class cls, MultipartFile file) { + String fileName = file.getOriginalFilename(); + if(!fileName.matches("^.+\\.(?i)(xls)$") && !fileName.matches("^.+\\.(?i)(xlsx)$")) { + log.info("上传文件格式不正确"); +// throw new HTTPException(10022); + } + + List dataList = new ArrayList<>(); + Workbook workbook = null; + try { + InputStream is = file.getInputStream(); + if (fileName.endsWith(EXCEL2007)) { + // FileInputStream is = new FileInputStream(new File(path)); + workbook = new XSSFWorkbook(is); + } + + if(fileName.endsWith(EXCEL2003)) { + // FileInputStream is = new FileInputStream(new File(path)); + workbook = new HSSFWorkbook(is); + } + + if (workbook != null) { + Map> classMap = new HashMap<>(); + List fields = Stream.of(cls.getDeclaredFields()).collect(Collectors.toList()); + fields.forEach(field -> { + ExcelColumnUtil annotation = field.getAnnotation(ExcelColumnUtil.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); + } + }); + //索引-->columns + Map> reflectionMap = new HashMap<>(); + //默认读取第一个sheet + Sheet sheet = workbook.getSheetAt(0); + + boolean firstRow = true; + for (int i = 0; i <= sheet.getLastRowNum(); i++) { + Row row = sheet.getRow(i); + //提取标题 + if (firstRow) { + for (int j = 0; j <= row.getLastCellNum(); j++) { + Cell cell = row.getCell(j); + String cellValue = getCellValue(cell); + if (classMap.containsKey(cellValue)) { + reflectionMap.put(j, classMap.get(cellValue)); + } + } + + firstRow = false; + } else { + //忽略空白行 + if (row == null) { + continue; + } + + try { + T t = cls.newInstance(); + //判断是否为空白行 + boolean allBlank = true; + for (int j = 0; j <= row.getLastCellNum(); j++) { + if (reflectionMap.containsKey(j)) { + Cell cell = row.getCell(j); + String cellValue = getCellValue(cell); + if (StringUtils.isNotBlank(cellValue)) { + allBlank = false; + } + List fieldList = reflectionMap.get(j); + fieldList.forEach(x -> { + try { + handleField(t, cellValue, x); + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("reflect field:%s value:%s exception!", x.getName(), cellValue), e); + } + }); + } + } + + if(!allBlank) { + dataList.add(t); + } + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse row:%s exception!", i), e); + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse excel exception!"), e); + } finally { + if (workbook != null) { + try { + workbook.close(); + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse excel exception!"), e); + } + } + } + return dataList; + } + + /** + * 导出excel文件 + * @param list + * @param cls + * @param + */ + public static void writeExcel(List list, Class cls) { + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = servletRequestAttributes.getResponse(); + Field[] fields = cls.getDeclaredFields(); + List fieldList = Arrays.stream(fields).filter(field -> { + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + if(annotation != null) { + field.setAccessible(true); + return true; + } + return false; + }).sorted(Comparator.comparing(field -> { + int col = 0; + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + if(annotation != null) { + col = annotation.col(); + } + return col; + })).collect(Collectors.toList()); + + Workbook wb = new XSSFWorkbook(); + Sheet sheet = wb.createSheet(); + AtomicInteger ai = new AtomicInteger(); + { + Row row = sheet.createRow(ai.getAndIncrement()); + AtomicInteger at = new AtomicInteger(); + fieldList.forEach(field -> { + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + String columnName = ""; + if (annotation != null) { + columnName = annotation.value(); + } + 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(columnName); + }); + + if (list != null) { + list.forEach(data -> { + Row r = sheet.createRow(ai.getAndIncrement()); + AtomicInteger a = new AtomicInteger(); + fieldList.forEach(field -> { + try { + Class type = field.getType(); + Object value = field.get(data); + Cell cell = r.createCell(a.getAndIncrement()); + if (value != null) { + cell.setCellValue(value.toString()); + } + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + }); + }); + for (int i = 0; i < list.size(); i++) { + sheet.autoSizeColumn(i); + } + } + String fileName = String.valueOf(new Date().getTime()); + buildExcelDocument(fileName + "." + EXCEL2007, wb, response); + } + } + + + private static void setStyle(CellStyle cellStyle) { + // 水平居中 + cellStyle.setAlignment(CellStyle.ALIGN_CENTER); + // 垂直居中 + cellStyle.setVerticalAlignment(CellStyle.ALIGN_CENTER); + // 边框 + cellStyle.setBorderTop(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderLeft(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderRight(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderBottom(CellStyle.BORDER_THIN); + } + + private static void handleField(T t, String value, Field field) throws Exception { + Class type = field.getType(); + if (type == null || type == void.class || StringUtils.isBlank(value)) { + return; + } + if (type == Object.class) { + field.set(t, value); + //数字类型 + } else if (type.getSuperclass() == null || type.getSuperclass() == Number.class) { + if (type == int.class || type == Integer.class) { + field.set(t, NumberUtils.toInt(value)); + } else if (type == long.class || type == Long.class) { + field.set(t, NumberUtils.toLong(value)); + } else if (type == byte.class || type == Byte.class) { + field.set(t, NumberUtils.toByte(value)); + } else if (type == short.class || type == Short.class) { + field.set(t, NumberUtils.toShort(value)); + } else if (type == double.class || type == Double.class) { + field.set(t, NumberUtils.toDouble(value)); + } else if (type == float.class || type == Float.class) { + field.set(t, NumberUtils.toFloat(value)); + } else if (type == char.class || type == Character.class) { + field.set(t, CharUtils.toChar(value)); + } else if (type == boolean.class) { + field.set(t, BooleanUtils.toBoolean(value)); + } else if (type == BigDecimal.class) { + field.set(t, new BigDecimal(value)); + } + } else if (type == Boolean.class) { + field.set(t, BooleanUtils.toBoolean(value)); + } else if (type == Date.class) { + // + field.set(t, value); + } else if (type == String.class) { + field.set(t, value); + } else { + Constructor constructor = type.getConstructor(String.class); + field.set(t, constructor.newInstance(value)); + } + } + + private static String getCellValue(Cell cell) { + if (cell == null) { + return ""; + } + + if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) { + if (DateUtil.isCellDateFormatted(cell)) { + return HSSFDateUtil.getJavaDate(cell.getNumericCellValue()).toString(); + } else { + return new BigDecimal(cell.getNumericCellValue()).toString(); + } + } else if (cell.getCellType() == Cell.CELL_TYPE_STRING) { + return StringUtils.trimToEmpty(cell.getStringCellValue()); + } else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) { + return StringUtils.trimToEmpty(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 if (cell.getCellType() == Cell.CELL_TYPE_ERROR) { + return "ERROR"; + } else { + return cell.toString().trim(); + } + } + + 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) { + log.error(String.format("downLoad excel exception"), e); + } + } + + private static void buildExcelFile(String path, Workbook wb){ + File file = new File(path); + if (file.exists()) { + file.delete(); + } + + try { + wb.write(new FileOutputStream(file)); + } catch (Exception e) { + log.error(String.format("downLoad excel exception"), e); + } + } +} diff --git b/src/main/java/com/meishu/util/tree/Node.java a/src/main/java/com/meishu/util/tree/Node.java new file mode 100644 index 0000000..fc443b5 --- /dev/null +++ a/src/main/java/com/meishu/util/tree/Node.java @@ -0,0 +1,42 @@ +package com.meishu.util.tree; + +import lombok.Data; + +@Data +public class Node implements Comparable { + + //主键 + private String id; + + //同级节点第几个元素 + private String number; + + //1.1 + private String text; + + //父节点 + private String parentId; + + private int level; + + public Node(String id, String number, String parentId, int level) { + this.id = id; + this.number = number; + this.parentId = parentId; + this.level = level; + } + + @Override + public int compareTo(Node o) { + if (this.level != o.level) { + return o.level - this.level; + } else { + if(this.number==null){ + return -1; + } + return this.number.compareTo(o.number); + } + } + + +} diff --git b/src/main/java/com/meishu/util/tree/NumberTree.java a/src/main/java/com/meishu/util/tree/NumberTree.java new file mode 100644 index 0000000..1f0d662 --- /dev/null +++ a/src/main/java/com/meishu/util/tree/NumberTree.java @@ -0,0 +1,212 @@ +package com.meishu.util.tree; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class NumberTree { + + private String id; + + private List nodeList; + + private String separator; + + private int idSeq; + + private SerialNumber number; + + public NumberTree(String separator, SerialNumber number) { + init(); + this.separator = separator; + this.number = number; + + } + + public void init() { + idSeq = 1; + this.separator = "."; + if (this.nodeList == null) { + nodeList = new ArrayList(); + } + } + + + /** + *

功能描述:根据父节点获取所有子节点。

+ */ + public List getChildNodes(Node pNode) { + String pId = pNode.getId(); + return getChildNodes(pId); + } + + /** + *

功能描述:根据父节点获取所有子节点。

+ */ + public List getChildNodes(String pId) { + List childNodes = new ArrayList(); + for (Node n : nodeList) { + if (pId.equals(n.getParentId())) { + childNodes.add(n); + } + } + + return childNodes; + } + + /** + *

功能描述:获取本级值最大的节点。

+ */ + public Node getMaxNodeForThisLevel(Node pNode) { + List childList = getChildNodes(pNode); + Node root = getRoot(nodeList); + if (childList.size() <= 0) { + return null; + } + Node maxNode = root; + for (Node node : childList) { + if (maxNode.getNumber().compareTo(node.getNumber()) < 0) { + maxNode = node; + } + } + return maxNode; + } + + /** + *

功能描述:生成下一个子节点。

+ */ + public Node generateNextChildNode(Node node) { + Node newNode = null; + Node maxNode = getMaxNodeForThisLevel(node); + String nextNumber = number.firstNumber(); + int level = node.getLevel(); + if (maxNode != null && !"0".equals(maxNode.getId())) {//本级存在子节点,且非根节点 + nextNumber = number.produceNext(maxNode.getNumber()); + level = maxNode.getLevel(); + } + newNode = new Node(String.valueOf(++idSeq), nextNumber, node.getId(), level); + + generateNodeText(newNode, nextNumber); + + return newNode; + } + + + /** + * + *

功能描述:获取父节点。

+ */ + public Node getParentNode(Node node) { + for (Node n : nodeList) { + if (node.getParentId() == n.getId()) { + return n; + } + } + return node; + } + + /** + *

功能描述:生成节点路径。

+ */ + public void generateNodeText(Node node, String text) { + + if (node == null || "0".equals(node.getId())) { + return; + } + + Node pNode = getParentNode(node); + + if (!"0".equals(pNode.getId())) { + text = pNode.getText() + separator + text; + } + + node.setText(text); + } + + /** + *

功能描述:遍历所有树节点。

+ */ + public void traverseNodeList(Node node) { + if(node==null){ + node = getRoot(nodeList); + } + List childNodes = getChildNodes(node); + System.out.println(node.getText()); + if (childNodes.size() > 0) { + for (Node n : childNodes) { + traverseNodeList(n); + } + } + } + public static void main(String[] args) { + SerialNumber number = new SerialNumber(); + NumberTree treeNode = new NumberTree(".", number); + + addSomeNodes(treeNode); + treeNode.traverseNodeList(null); + } + + /** + *

功能描述:获取根节点。

+ */ + public Node getRoot(List nodeList) { + Node root = null; + if (nodeList.size() <= 0 || (root = getNodeById(nodeList, "0")) == null) { + root = createRoot(); + nodeList.add(root); + } + return root; + } + + private Node getNodeById(List nodeList, String id) { + Node node = null; + if(id!=null){ + for (Node n : nodeList) { + if (id.equals(n.getId())) { + node = n; + break; + } + } + } + return node; + } + + private Node createRoot() { + Node root = new Node("0", number.rootNumber(), "-1", 0); + root.setText("0"); + return root; + } + + /** + *

功能描述:测试添加节点。

+ */ + private static Node addSomeNodes(NumberTree tree) { + Node root = tree.getRoot(tree.nodeList); + Node node1 = getNextNode(tree, root);//1 + Node node2 = getNextNode(tree, root);//2 + Node node3 = getNextNode(tree, root);//3 + Node node11 = getNextNode(tree, node1);//1.1 + Node node12 = getNextNode(tree, node1);//1.2 + Node node21 = getNextNode(tree, node2);//2.1 + Node node211 = getNextNode(tree, node21);//2.1.1 + Node node212 = getNextNode(tree, node21);//2.1.2 + Node node22 = getNextNode(tree, node2);//2.2 + Node node221 = getNextNode(tree, node22);//2.2.1 + Node node31 = getNextNode(tree, node3); + Node node32 = getNextNode(tree, node3); + Node node311 = getNextNode(tree, node31); + Node node3111 = getNextNode(tree, node311); + return root; + } + + public static Node getNextNode(NumberTree tree, Node pNode) { + Node node = tree.generateNextChildNode(pNode); + if (node != null) { + tree.nodeList.add(node); + } + return node; + } + +} diff --git b/src/main/java/com/meishu/util/tree/SerialNumber.java a/src/main/java/com/meishu/util/tree/SerialNumber.java new file mode 100644 index 0000000..767a0bb --- /dev/null +++ a/src/main/java/com/meishu/util/tree/SerialNumber.java @@ -0,0 +1,28 @@ +package com.meishu.util.tree; + +public class SerialNumber{ + + public String produceNext(String crrnt) { + + String next = "0"; + if (crrnt != null) { + try { + int crrntNum = Integer.parseInt(crrnt); + next = String.valueOf(crrntNum + 1); + } catch (Exception e) { + System.err.println("非数字类型的字符串!"); + } + } + return next; + } + + public String rootNumber() { + return "0"; + } + + public String firstNumber() { + return "1"; + } + + +} diff --git b/src/main/java/com/meishu/vo/PerStudentComplicationVO.java a/src/main/java/com/meishu/vo/PerStudentComplicationVO.java new file mode 100644 index 0000000..45527fd --- /dev/null +++ a/src/main/java/com/meishu/vo/PerStudentComplicationVO.java @@ -0,0 +1,20 @@ +package com.meishu.vo; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-22 18:20 + */ +@Data +public class PerStudentComplicationVO { + + private String studyCode; + + private String userName; + + private Integer studyLengthSecond; + + private Integer historyStudyLengthSecond; + +} diff --git b/src/main/java/com/meishu/vo/accesstoken/GetAllStudentsVO.java a/src/main/java/com/meishu/vo/accesstoken/GetAllStudentsVO.java new file mode 100644 index 0000000..d2c80da --- /dev/null +++ a/src/main/java/com/meishu/vo/accesstoken/GetAllStudentsVO.java @@ -0,0 +1,32 @@ +package com.meishu.vo.accesstoken; + +import lombok.Data; + +@Data +public class GetAllStudentsVO { + + private Integer id; + + private String userName; + + private String gender; + + private String imgUrl; + + private String userStatus; + + //private String roleType; + + private String session; + + private String phone; + + private String idCard; + + private String studyCode; + + private String className; + + private String password; + +} diff --git b/src/main/java/com/meishu/vo/accesstoken/GetAllTeachersVO.java a/src/main/java/com/meishu/vo/accesstoken/GetAllTeachersVO.java new file mode 100644 index 0000000..7e2114f --- /dev/null +++ a/src/main/java/com/meishu/vo/accesstoken/GetAllTeachersVO.java @@ -0,0 +1,22 @@ +package com.meishu.vo.accesstoken; + +import com.meishu.model.SubjectDictDO; +import com.meishu.vo.administer.GetTeacherSubjectVO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllTeachersVO { + + private Integer id; + + private String telephone; + + private String userName; + + private String intro; + + private List subjectDictDOS; + +} diff --git b/src/main/java/com/meishu/vo/administer/AdministerPermissionVO.java a/src/main/java/com/meishu/vo/administer/AdministerPermissionVO.java new file mode 100644 index 0000000..4fce222 --- /dev/null +++ a/src/main/java/com/meishu/vo/administer/AdministerPermissionVO.java @@ -0,0 +1,21 @@ +package com.meishu.vo.administer; + +import lombok.Data; + +import java.util.List; + +@Data +public class AdministerPermissionVO { + + private Long id; + + private String userName; + + private String role; + + private String img; + + private Boolean isRole; + + private List permissions; +} diff --git b/src/main/java/com/meishu/vo/administer/GetClassesDetailResponseVO.java a/src/main/java/com/meishu/vo/administer/GetClassesDetailResponseVO.java new file mode 100644 index 0000000..d466fd7 --- /dev/null +++ a/src/main/java/com/meishu/vo/administer/GetClassesDetailResponseVO.java @@ -0,0 +1,38 @@ +package com.meishu.vo.administer; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-20 22:32 + */ +@Data +public class GetClassesDetailResponseVO { + + private Integer subjectId; + + private String className; + + private String school; + + private String grade; + + private String classes; + + private String subjectType; + + private String session; + + private String status; + + private String subject; + + private String subjectEn; + + private String classId; + + private Integer userId; + + private String semester; + +} diff --git b/src/main/java/com/meishu/vo/administer/GetTeacherClassVO.java a/src/main/java/com/meishu/vo/administer/GetTeacherClassVO.java new file mode 100644 index 0000000..9752165 --- /dev/null +++ a/src/main/java/com/meishu/vo/administer/GetTeacherClassVO.java @@ -0,0 +1,7 @@ +package com.meishu.vo.administer; + +import lombok.Data; + +@Data +public class GetTeacherClassVO { +} diff --git b/src/main/java/com/meishu/vo/administer/GetTeacherSubjectVO.java a/src/main/java/com/meishu/vo/administer/GetTeacherSubjectVO.java new file mode 100644 index 0000000..b23eaad --- /dev/null +++ a/src/main/java/com/meishu/vo/administer/GetTeacherSubjectVO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.administer; + +import lombok.Data; + +@Data +public class GetTeacherSubjectVO { + + private String ClassName; + + private String subject; + +} diff --git b/src/main/java/com/meishu/vo/administer/GetTeachersVO.java a/src/main/java/com/meishu/vo/administer/GetTeachersVO.java new file mode 100644 index 0000000..d0607d0 --- /dev/null +++ a/src/main/java/com/meishu/vo/administer/GetTeachersVO.java @@ -0,0 +1,38 @@ +package com.meishu.vo.administer; + +import com.meishu.model.*; +import lombok.Data; + +import java.util.List; + +@Data +public class GetTeachersVO { + + private Long id; + + private Long depId; + + private Long depParentId; + + private String userName; + + private String status; + + private String intro; + + private String img; + + private String telephone; + + private String departmentName; + + private List campusDictDOS; + + private List departmentDictDOS; + + private List knowledgeSubjectDicts; + + private List roleDictDOS; + + private List subjectDictDOS; +} diff --git b/src/main/java/com/meishu/vo/administer/LoginVO.java a/src/main/java/com/meishu/vo/administer/LoginVO.java new file mode 100644 index 0000000..caaef45 --- /dev/null +++ a/src/main/java/com/meishu/vo/administer/LoginVO.java @@ -0,0 +1,10 @@ +package com.meishu.vo.administer; + +import lombok.Data; + +@Data +public class LoginVO { + + private String token; + +} diff --git b/src/main/java/com/meishu/vo/administer/PermissionsVO.java a/src/main/java/com/meishu/vo/administer/PermissionsVO.java new file mode 100644 index 0000000..4b81abb --- /dev/null +++ a/src/main/java/com/meishu/vo/administer/PermissionsVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.administer; + +import lombok.Data; + +import java.util.List; + +@Data +public class PermissionsVO { + + private Long id; + + private Long parentId; + + private String name; + + private List children; +} diff --git b/src/main/java/com/meishu/vo/campus/CampusListVO.java a/src/main/java/com/meishu/vo/campus/CampusListVO.java new file mode 100644 index 0000000..2161576 --- /dev/null +++ a/src/main/java/com/meishu/vo/campus/CampusListVO.java @@ -0,0 +1,57 @@ +package com.meishu.vo.campus; + +import com.meishu.model.AdministerDepartmentMappingDO; +import com.meishu.model.CampusDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class CampusListVO { + + private String administerName; + + private Long id; + + /** + * 校区 + */ + private String campus; + + /** + * 负责人所在部门 + */ + private List administerDepartments; + + /** + * 父节点id + */ + private Long parentId; + + /** + * 上级校区名称 + */ + private String parentCampusName; + + /** + * 负责人 + */ + private Long administerId; + + /** + * 学生人数 + */ + private Integer studentCounts; + + /** + * 老师人数 + */ + private Integer teacherCounts; + + + + /** + * 子类 + */ + private List children; +} diff --git b/src/main/java/com/meishu/vo/campus/CampusStudentVO.java a/src/main/java/com/meishu/vo/campus/CampusStudentVO.java new file mode 100644 index 0000000..f93fa17 --- /dev/null +++ a/src/main/java/com/meishu/vo/campus/CampusStudentVO.java @@ -0,0 +1,11 @@ +package com.meishu.vo.campus; + +import com.meishu.model.StudentDO; +import lombok.Data; + +@Data +public class CampusStudentVO extends StudentDO { + + private String campus; + +} diff --git b/src/main/java/com/meishu/vo/classes/GetClassStudentsVO.java a/src/main/java/com/meishu/vo/classes/GetClassStudentsVO.java new file mode 100644 index 0000000..a868a99 --- /dev/null +++ a/src/main/java/com/meishu/vo/classes/GetClassStudentsVO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.classes; + +import com.meishu.model.UserRoleDO; +import lombok.Data; + +@Data +public class GetClassStudentsVO extends UserRoleDO { + + + private String grade; + +} diff --git b/src/main/java/com/meishu/vo/classes/GetClassesVO.java a/src/main/java/com/meishu/vo/classes/GetClassesVO.java new file mode 100644 index 0000000..440ec20 --- /dev/null +++ a/src/main/java/com/meishu/vo/classes/GetClassesVO.java @@ -0,0 +1,30 @@ +package com.meishu.vo.classes; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetClassesVO { + + private String id; + + private String classId; + + private String className; + + private String grade; + + private Integer cnt; + + private String session; + + private String status; + + private String classes; + + private String upgradeDate; + + private List subjectDictDOS; + +} diff --git b/src/main/java/com/meishu/vo/classes/SubjectDictVO.java a/src/main/java/com/meishu/vo/classes/SubjectDictVO.java new file mode 100644 index 0000000..6408bf4 --- /dev/null +++ a/src/main/java/com/meishu/vo/classes/SubjectDictVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.classes; + +import com.meishu.model.AdministerDO; +import com.meishu.model.SubjectDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class SubjectDictVO extends SubjectDictDO { + + private List administerDOS; + +} diff --git b/src/main/java/com/meishu/vo/course/CourseAdministerVO.java a/src/main/java/com/meishu/vo/course/CourseAdministerVO.java new file mode 100644 index 0000000..e3d7676 --- /dev/null +++ a/src/main/java/com/meishu/vo/course/CourseAdministerVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.course; + +import lombok.Data; + +@Data +public class CourseAdministerVO { + + private String img; + + private String intro; + + private String userName; + +// private String subjectName; + +} diff --git b/src/main/java/com/meishu/vo/course/CourseProgressVO.java a/src/main/java/com/meishu/vo/course/CourseProgressVO.java new file mode 100644 index 0000000..6e9b6b0 --- /dev/null +++ a/src/main/java/com/meishu/vo/course/CourseProgressVO.java @@ -0,0 +1,41 @@ +package com.meishu.vo.course; + +import lombok.Data; + +@Data +public class CourseProgressVO { + + private String username; + + private String campus; + + private Integer totalCounts; + + private Integer studyCounts; + + private String studyPercent; + + private Long courseId; + + private Long studentId; + + private Long treeId; + + private Integer totalPlayLength; + + /** + * 最近学到的知识点 + */ + private String recentTreeName; + + /** + * 最近学习时间 + */ + private String recentTreeTime; + + /** + * 学习进度的知识点 + */ + private String treeNameProgress; + +} diff --git b/src/main/java/com/meishu/vo/course/CourseVodVO.java a/src/main/java/com/meishu/vo/course/CourseVodVO.java new file mode 100644 index 0000000..fd87c51 --- /dev/null +++ a/src/main/java/com/meishu/vo/course/CourseVodVO.java @@ -0,0 +1,22 @@ +package com.meishu.vo.course; + +import lombok.Data; + +@Data +public class CourseVodVO { + + private Long id; + + private Long vodId; + + private String vodName; + + private String vodUrl; + + private Integer vodLength; + + private String coverPage; + + private String vodType; + +} diff --git b/src/main/java/com/meishu/vo/course/GetAllCourseVO.java a/src/main/java/com/meishu/vo/course/GetAllCourseVO.java new file mode 100644 index 0000000..84a70d2 --- /dev/null +++ a/src/main/java/com/meishu/vo/course/GetAllCourseVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.course; + +import com.meishu.model.CourseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllCourseVO { + + private List innerCourse; + + private List outerCourse; + +} diff --git b/src/main/java/com/meishu/vo/course/GetCourseStudentsVO.java a/src/main/java/com/meishu/vo/course/GetCourseStudentsVO.java new file mode 100644 index 0000000..edf2d3a --- /dev/null +++ a/src/main/java/com/meishu/vo/course/GetCourseStudentsVO.java @@ -0,0 +1,34 @@ +package com.meishu.vo.course; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.Date; + +@Data +public class GetCourseStudentsVO { + + private Long id; + + private Long studentId; + + private Long courseId; + + private String username; + + private String campus; + + private String status; + + @JsonFormat(pattern = "yyyy-MM-dd") + private Date startDate; + + @JsonFormat(pattern = "yyyy-MM-dd") + private Date endDate; + + private Integer diff; + + private String courseName; + +} diff --git b/src/main/java/com/meishu/vo/course/GetCourseTreeVodsVO.java a/src/main/java/com/meishu/vo/course/GetCourseTreeVodsVO.java new file mode 100644 index 0000000..fbf3276 --- /dev/null +++ a/src/main/java/com/meishu/vo/course/GetCourseTreeVodsVO.java @@ -0,0 +1,34 @@ +package com.meishu.vo.course; + +import lombok.Data; + +@Data +public class GetCourseTreeVodsVO { + + private Long id; + + private Long treeId; + + private Long parentId; + + private Long courseTreeId; + + private Long vodId; + + private String parentTreeName; + + private String vodName; + + private String treeName; + + private String vodType; + + private String status; + + private String userName; + + private String updateTime; + + private Integer total; + +} diff --git b/src/main/java/com/meishu/vo/course/GetExerciseDetailVO.java a/src/main/java/com/meishu/vo/course/GetExerciseDetailVO.java new file mode 100644 index 0000000..71ead50 --- /dev/null +++ a/src/main/java/com/meishu/vo/course/GetExerciseDetailVO.java @@ -0,0 +1,38 @@ +package com.meishu.vo.course; + +import com.meishu.model.CourseTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetExerciseDetailVO { + + private Long id; + + private String exerciseType; + + private String title; + + private String rightAnswer; + + private Integer difficulty; + + private String items; + + private Integer adviceLength; + + private String answer; + + private String result; + + private Integer length; + + private String rightPercent; + + private String avgLength; + + private String createTime; + + private List courseTreeDOS; +} diff --git b/src/main/java/com/meishu/vo/course/GetStudentHistoryVO.java a/src/main/java/com/meishu/vo/course/GetStudentHistoryVO.java new file mode 100644 index 0000000..2b5332c --- /dev/null +++ a/src/main/java/com/meishu/vo/course/GetStudentHistoryVO.java @@ -0,0 +1,23 @@ +package com.meishu.vo.course; + +import lombok.Data; + +@Data +public class GetStudentHistoryVO { + + private String username; + + private String courseName; + + private String createTime; + + private String administer; + + private String startDate; + + private String endDate; + + private String campus; + + +} diff --git b/src/main/java/com/meishu/vo/course/GetVodIndexVO.java a/src/main/java/com/meishu/vo/course/GetVodIndexVO.java new file mode 100644 index 0000000..a675c2e --- /dev/null +++ a/src/main/java/com/meishu/vo/course/GetVodIndexVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.course; + +import com.meishu.vo.voddict.GetCourseTreesVodsVO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetVodIndexVO { + + private List mappingIds; + + private Long mappingId; + +} diff --git b/src/main/java/com/meishu/vo/course/QueryCourseInfoVO.java a/src/main/java/com/meishu/vo/course/QueryCourseInfoVO.java new file mode 100644 index 0000000..9d6c511 --- /dev/null +++ a/src/main/java/com/meishu/vo/course/QueryCourseInfoVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.course; + +import com.meishu.model.AdministerDO; +import com.meishu.model.CourseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class QueryCourseInfoVO { + + private CourseDictDO courseDictDO; + + private List courseAdministerVOS; +} diff --git b/src/main/java/com/meishu/vo/course/QueryCoursesVO.java a/src/main/java/com/meishu/vo/course/QueryCoursesVO.java new file mode 100644 index 0000000..0b7e733 --- /dev/null +++ a/src/main/java/com/meishu/vo/course/QueryCoursesVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.course; + +import com.meishu.model.AdministerDO; +import com.meishu.model.CourseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class QueryCoursesVO extends CourseDictDO { + + private String subjectName; + + private List administerDOS; + +} diff --git b/src/main/java/com/meishu/vo/course/StudentDetailVO.java a/src/main/java/com/meishu/vo/course/StudentDetailVO.java new file mode 100644 index 0000000..10dd5de --- /dev/null +++ a/src/main/java/com/meishu/vo/course/StudentDetailVO.java @@ -0,0 +1,35 @@ +package com.meishu.vo.course; + +import com.meishu.model.CourseChapterDO; +import lombok.Data; + +import java.util.List; + +@Data +public class StudentDetailVO { + + private String wechatImg; + + private String status; + + private String username; + + private String campus; + + private String courseName; + + private Integer totalCounts; + + private Integer studyCounts; + + private String studyPercent; + + private String recentTreeTime; + + private String recentTreeName; + + private Integer totalPlayLength; + + private List courseChapterDOS; + +} diff --git b/src/main/java/com/meishu/vo/dimension/GetAllDimensionStarVO.java a/src/main/java/com/meishu/vo/dimension/GetAllDimensionStarVO.java new file mode 100644 index 0000000..9a58a91 --- /dev/null +++ a/src/main/java/com/meishu/vo/dimension/GetAllDimensionStarVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.dimension; + +import com.meishu.model.SubjectDimensionStarDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllDimensionStarVO { + + private Long dimensionId; + + private String dimension; + + private List subjectDimensionStarDictDOS; + +} diff --git b/src/main/java/com/meishu/vo/dimension/GetAllDimensionStarsVO.java a/src/main/java/com/meishu/vo/dimension/GetAllDimensionStarsVO.java new file mode 100644 index 0000000..0ec7adc --- /dev/null +++ a/src/main/java/com/meishu/vo/dimension/GetAllDimensionStarsVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.dimension; + +import com.meishu.model.SubjectDimensionStarDictDO; +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllDimensionStarsVO extends SubjectDimensionStarDictDO { + + private List subjectTreeDOS; + +} diff --git b/src/main/java/com/meishu/vo/dimension/StarVO.java a/src/main/java/com/meishu/vo/dimension/StarVO.java new file mode 100644 index 0000000..4e404ae --- /dev/null +++ a/src/main/java/com/meishu/vo/dimension/StarVO.java @@ -0,0 +1,4 @@ +package com.meishu.vo.dimension; + +public class StarVO { +} diff --git b/src/main/java/com/meishu/vo/exercise/GetExerciseDetailResponseVO.java a/src/main/java/com/meishu/vo/exercise/GetExerciseDetailResponseVO.java new file mode 100644 index 0000000..37f0f2e --- /dev/null +++ a/src/main/java/com/meishu/vo/exercise/GetExerciseDetailResponseVO.java @@ -0,0 +1,21 @@ +package com.meishu.vo.exercise; + +import com.meishu.model.ExerciseDictDO; +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-19 16:27 + */ +@Data +public class GetExerciseDetailResponseVO extends ExerciseDictDO { + + private String collectionStatus; + + private String length; + + private String label; + + private Integer lengthSecond; + +} diff --git b/src/main/java/com/meishu/vo/exercise/GetExerciseDetailVO.java a/src/main/java/com/meishu/vo/exercise/GetExerciseDetailVO.java new file mode 100644 index 0000000..83e86cd --- /dev/null +++ a/src/main/java/com/meishu/vo/exercise/GetExerciseDetailVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.exercise; + +import com.meishu.model.ExerciseDictDO; +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetExerciseDetailVO extends ExerciseDictDO { + + private List subjectTreeDOS; + +} diff --git b/src/main/java/com/meishu/vo/exercise/GetTreeExercisesVO.java a/src/main/java/com/meishu/vo/exercise/GetTreeExercisesVO.java new file mode 100644 index 0000000..5ef8c9b --- /dev/null +++ a/src/main/java/com/meishu/vo/exercise/GetTreeExercisesVO.java @@ -0,0 +1,45 @@ +package com.meishu.vo.exercise; + +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetTreeExercisesVO { + + private Long id; + + private String title; + + private String items; + + private String rightAnswer; + + private String detail; + + private String difficulty; + + private Integer total; + + private Integer rights; + + private Integer adviceLength; + + private String userName; + + private String exerciseType; + + private String updateTime; + + private String percent; + + private String shareStatus; + + private String checkStatus; + + private String status; + + private List subjectTreeDOS; + +} diff --git b/src/main/java/com/meishu/vo/exercise/QueryCourseTreeExerciseVO.java a/src/main/java/com/meishu/vo/exercise/QueryCourseTreeExerciseVO.java new file mode 100644 index 0000000..10746b0 --- /dev/null +++ a/src/main/java/com/meishu/vo/exercise/QueryCourseTreeExerciseVO.java @@ -0,0 +1,39 @@ +package com.meishu.vo.exercise; + +import lombok.Data; + +@Data +public class QueryCourseTreeExerciseVO { + + private Long id; + + private String treeName; + + private String parentTreeName; + + private String exerciseType; + + private String title; + + private String items; + + private String detail; + + private String rightAnswer; + + private String difficulty; + + private String userName; + + private String updateTime; + + private String rightCnt; + + private String totalCnt; + + private String rightPercent; + + private String status; + + +} diff --git b/src/main/java/com/meishu/vo/grade/DimensionStarVO.java a/src/main/java/com/meishu/vo/grade/DimensionStarVO.java new file mode 100644 index 0000000..750d640 --- /dev/null +++ a/src/main/java/com/meishu/vo/grade/DimensionStarVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.grade; + +import lombok.Data; + +@Data +public class DimensionStarVO { + + private Long dimensionId; + + private String dimension; + + private Long starId; + + private Integer star; + + private String description; + +} diff --git b/src/main/java/com/meishu/vo/grade/QueryOneGradeVO.java a/src/main/java/com/meishu/vo/grade/QueryOneGradeVO.java new file mode 100644 index 0000000..013aea5 --- /dev/null +++ a/src/main/java/com/meishu/vo/grade/QueryOneGradeVO.java @@ -0,0 +1,21 @@ +package com.meishu.vo.grade; + +import com.meishu.model.SubjectTestGradeExampleMappingDO; +import lombok.Data; + +import java.util.List; + +@Data +public class QueryOneGradeVO { + + private Long id; + + private String gradeName; + + private String content; + + private List subjectTestGradeExampleMappingDOS; + + private List dimensionStarVOS; + +} diff --git b/src/main/java/com/meishu/vo/laboratorySession/CalendarStatusVO.java a/src/main/java/com/meishu/vo/laboratorySession/CalendarStatusVO.java new file mode 100644 index 0000000..f141de1 --- /dev/null +++ a/src/main/java/com/meishu/vo/laboratorySession/CalendarStatusVO.java @@ -0,0 +1,11 @@ +package com.meishu.vo.laboratorySession; + +import lombok.Data; + +@Data +public class CalendarStatusVO { + + private String startDate; + + private Integer status; +} diff --git b/src/main/java/com/meishu/vo/laboratorySession/GetLaboratorySessionVO.java a/src/main/java/com/meishu/vo/laboratorySession/GetLaboratorySessionVO.java new file mode 100644 index 0000000..8425e41 --- /dev/null +++ a/src/main/java/com/meishu/vo/laboratorySession/GetLaboratorySessionVO.java @@ -0,0 +1,21 @@ +package com.meishu.vo.laboratorySession; + +import lombok.Data; + +@Data +public class GetLaboratorySessionVO { + + private Long id; + + private String laboratoryName; + + private String timeSlot; + + private String registerStartDate; + + private String registerEndDate; + + private Integer surplus; + + private Integer status; +} diff --git b/src/main/java/com/meishu/vo/laboratorySession/LaboratoryDictPageVO.java a/src/main/java/com/meishu/vo/laboratorySession/LaboratoryDictPageVO.java new file mode 100644 index 0000000..abe0126 --- /dev/null +++ a/src/main/java/com/meishu/vo/laboratorySession/LaboratoryDictPageVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.laboratorySession; + +import com.meishu.model.SessionsDictDO; +import lombok.Data; +import java.util.List; + +@Data +public class LaboratoryDictPageVO { + + private Long id; + + private String laboratoryName; + + private Integer maxNum; + + private List sessions; +} diff --git b/src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionMappingVO.java a/src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionMappingVO.java new file mode 100644 index 0000000..4e76165 --- /dev/null +++ a/src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionMappingVO.java @@ -0,0 +1,23 @@ +package com.meishu.vo.laboratorySession; + +import com.meishu.model.SessionsDictDO; +import lombok.Data; +import java.util.List; + +@Data +public class LaboratorySessionMappingVO { + + private Long laboratoryDictId; + + private String laboratoryName; + + private String registerStartDate; + + private String registerEndDate; + + private Integer maxNum; + + private String grade; + + private List timeSlot; +} diff --git b/src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionVO.java a/src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionVO.java new file mode 100644 index 0000000..5a97a66 --- /dev/null +++ a/src/main/java/com/meishu/vo/laboratorySession/LaboratorySessionVO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.laboratorySession; + +import lombok.Data; +import java.util.List; + +@Data +public class LaboratorySessionVO { + + private List timeSlot; + + private List laboratoryList; +} diff --git b/src/main/java/com/meishu/vo/laboratorySession/StatisticsVO.java a/src/main/java/com/meishu/vo/laboratorySession/StatisticsVO.java new file mode 100644 index 0000000..f1323f2 --- /dev/null +++ a/src/main/java/com/meishu/vo/laboratorySession/StatisticsVO.java @@ -0,0 +1,13 @@ +package com.meishu.vo.laboratorySession; + +import lombok.Data; + +@Data +public class StatisticsVO { + + private Integer createNum; + + private Integer sessionNum; + + private Integer laboratoryNum; +} diff --git b/src/main/java/com/meishu/vo/laboratoryUser/LaboratoryUserPageVO.java a/src/main/java/com/meishu/vo/laboratoryUser/LaboratoryUserPageVO.java new file mode 100644 index 0000000..94c6e75 --- /dev/null +++ a/src/main/java/com/meishu/vo/laboratoryUser/LaboratoryUserPageVO.java @@ -0,0 +1,38 @@ +package com.meishu.vo.laboratoryUser; + +import com.meishu.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class LaboratoryUserPageVO { + + /** + * 用户表报名记录ID + */ + private Long id; + + /** + * 安排表ID + */ + private Long laboratorySessionId; + + /** + * 场次ID + */ + private Long sessionsDictId; + + @ExcelColumn(col = 1, value = "实验室名称") + private String laboratoryName; + + @ExcelColumn(col = 2, value = "场次") + private String timeSlot; + + @ExcelColumn(col = 3, value = "姓名") + private String userName; + + @ExcelColumn(col = 4, value = "学号") + private String studyCode; + + @ExcelColumn(col = 5, value = "班级") + private String classes; +} diff --git b/src/main/java/com/meishu/vo/question/GetClassQuestionsVO.java a/src/main/java/com/meishu/vo/question/GetClassQuestionsVO.java new file mode 100644 index 0000000..7aaac89 --- /dev/null +++ a/src/main/java/com/meishu/vo/question/GetClassQuestionsVO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.question; + +import com.meishu.model.SubjectDictDO; +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +@Data +public class GetClassQuestionsVO extends SubjectDictDO { + + private Integer count; + +} diff --git b/src/main/java/com/meishu/vo/question/QueryOneQuestionVO.java a/src/main/java/com/meishu/vo/question/QueryOneQuestionVO.java new file mode 100644 index 0000000..5c333e8 --- /dev/null +++ a/src/main/java/com/meishu/vo/question/QueryOneQuestionVO.java @@ -0,0 +1,11 @@ +package com.meishu.vo.question; + +import com.meishu.model.AnsweringQuestionDO; +import lombok.Data; + +@Data +public class QueryOneQuestionVO extends AnsweringQuestionDO { + + private String userName; + +} diff --git b/src/main/java/com/meishu/vo/question/QueryQuestionsVO.java a/src/main/java/com/meishu/vo/question/QueryQuestionsVO.java new file mode 100644 index 0000000..387350a --- /dev/null +++ a/src/main/java/com/meishu/vo/question/QueryQuestionsVO.java @@ -0,0 +1,20 @@ +package com.meishu.vo.question; + +import lombok.Data; + +@Data +public class QueryQuestionsVO { + + private Integer id; + + private String userName; + + private String createDate; + + private String title; + + private String answer; + + private String updateDate; + +} diff --git b/src/main/java/com/meishu/vo/role/GetAllRolesVO.java a/src/main/java/com/meishu/vo/role/GetAllRolesVO.java new file mode 100644 index 0000000..79b3c0f --- /dev/null +++ a/src/main/java/com/meishu/vo/role/GetAllRolesVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.role; + +import com.meishu.model.PermissionsDictDO; +import com.meishu.model.RoleDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllRolesVO extends RoleDictDO { + + private List permissionsDictDOS; + +} diff --git b/src/main/java/com/meishu/vo/role/GetRoleTeachersVO.java a/src/main/java/com/meishu/vo/role/GetRoleTeachersVO.java new file mode 100644 index 0000000..a81c905 --- /dev/null +++ a/src/main/java/com/meishu/vo/role/GetRoleTeachersVO.java @@ -0,0 +1,22 @@ +package com.meishu.vo.role; + +import com.meishu.model.DepartmentDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetRoleTeachersVO { + + private Long id; + + private Long administerId; + + private String userName; + + private String telephone; + + private String departmentName; + + private List departmentDictDOS; +} diff --git b/src/main/java/com/meishu/vo/rule/GetAllRulesVO.java a/src/main/java/com/meishu/vo/rule/GetAllRulesVO.java new file mode 100644 index 0000000..1ddfbe0 --- /dev/null +++ a/src/main/java/com/meishu/vo/rule/GetAllRulesVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.rule; + +import lombok.Data; + +@Data +public class GetAllRulesVO { + + private Long id; + + private String subjectName; + + private Long subjectId; + + private String ruleName; + + private String status; + +} diff --git b/src/main/java/com/meishu/vo/rule/GetOneExaminationDetailVO.java a/src/main/java/com/meishu/vo/rule/GetOneExaminationDetailVO.java new file mode 100644 index 0000000..60d1396 --- /dev/null +++ a/src/main/java/com/meishu/vo/rule/GetOneExaminationDetailVO.java @@ -0,0 +1,41 @@ +package com.meishu.vo.rule; + +import com.meishu.vo.grade.QueryOneGradeVO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetOneExaminationDetailVO { + + private Long id; + + private String subjectName; + + private String ruleName; + + private String publishName; + + private String examination; + + private String outline; + + private String deadline; + + private String answer; + + private String testTime; + + private String userName; + + private List studentStarVOS; + + private Double total; + + private String commitTime; + + private String testType; + + private List queryOneGradeVOS; + +} diff --git b/src/main/java/com/meishu/vo/rule/GetRuleReportVO.java a/src/main/java/com/meishu/vo/rule/GetRuleReportVO.java new file mode 100644 index 0000000..67701d0 --- /dev/null +++ a/src/main/java/com/meishu/vo/rule/GetRuleReportVO.java @@ -0,0 +1,7 @@ +package com.meishu.vo.rule; + +import lombok.Data; + +@Data +public class GetRuleReportVO { +} diff --git b/src/main/java/com/meishu/vo/rule/GetStudentRulesVO.java a/src/main/java/com/meishu/vo/rule/GetStudentRulesVO.java new file mode 100644 index 0000000..90568fb --- /dev/null +++ a/src/main/java/com/meishu/vo/rule/GetStudentRulesVO.java @@ -0,0 +1,28 @@ +package com.meishu.vo.rule; + +import lombok.Data; + +@Data +public class GetStudentRulesVO { + + private Long id; + + private String subjectName; + + private String ruleName; + + private String examination; + + private String outline; + + private String testTime; + + private String createTime; + + private String coverPage; + + private String testType; + + private String publishName; + +} diff --git b/src/main/java/com/meishu/vo/rule/StudentStarVO.java a/src/main/java/com/meishu/vo/rule/StudentStarVO.java new file mode 100644 index 0000000..f29e57b --- /dev/null +++ a/src/main/java/com/meishu/vo/rule/StudentStarVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.rule; + +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import lombok.Data; + +@Data +public class StudentStarVO { + + private String dimension; + + private Integer star; + + private String description; + + private String userName; + +} diff --git b/src/main/java/com/meishu/vo/semester/GetAllPastSemesterVO.java a/src/main/java/com/meishu/vo/semester/GetAllPastSemesterVO.java new file mode 100644 index 0000000..f73cbfc --- /dev/null +++ a/src/main/java/com/meishu/vo/semester/GetAllPastSemesterVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.semester; + +import com.meishu.model.ClassesDictHistoryDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllPastSemesterVO { + + + private String gradeType; + + private List classesDictDOS; + +} diff --git b/src/main/java/com/meishu/vo/semester/GetAllStudyingSemesterVO.java a/src/main/java/com/meishu/vo/semester/GetAllStudyingSemesterVO.java new file mode 100644 index 0000000..e46e04e --- /dev/null +++ a/src/main/java/com/meishu/vo/semester/GetAllStudyingSemesterVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.semester; + +import com.meishu.model.ClassesDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllStudyingSemesterVO { + + private String gradeType; + + private List classesDictDOS; + +} diff --git b/src/main/java/com/meishu/vo/semester/GetSemesterScoreVO.java a/src/main/java/com/meishu/vo/semester/GetSemesterScoreVO.java new file mode 100644 index 0000000..69660b5 --- /dev/null +++ a/src/main/java/com/meishu/vo/semester/GetSemesterScoreVO.java @@ -0,0 +1,25 @@ +package com.meishu.vo.semester; + +import com.meishu.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class GetSemesterScoreVO { + + private Integer id; + + private Integer userId; + + @ExcelColumn(col = 1,value = "姓名") + private String userName; + + @ExcelColumn(col = 2,value = "学号") + private String studyCode; + + @ExcelColumn(col = 3,value = "科目") + private String subject; + + @ExcelColumn(col = 4,value = "当前分数") + private String score; + +} diff --git b/src/main/java/com/meishu/vo/semester/GetStudentDetailVO.java a/src/main/java/com/meishu/vo/semester/GetStudentDetailVO.java new file mode 100644 index 0000000..e46205d --- /dev/null +++ a/src/main/java/com/meishu/vo/semester/GetStudentDetailVO.java @@ -0,0 +1,20 @@ +package com.meishu.vo.semester; + +import lombok.Data; + +@Data +public class GetStudentDetailVO { + + private String teacherName; + + private String itemDesc; + + private Double score; + + private Integer itemType; + + private Integer scoreType; + + private String createDate; + +} diff --git b/src/main/java/com/meishu/vo/semester/GetStudentRecordVO.java a/src/main/java/com/meishu/vo/semester/GetStudentRecordVO.java new file mode 100644 index 0000000..bc91864 --- /dev/null +++ a/src/main/java/com/meishu/vo/semester/GetStudentRecordVO.java @@ -0,0 +1,30 @@ +package com.meishu.vo.semester; + +import com.meishu.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class GetStudentRecordVO { + + @ExcelColumn(col = 1,value = "班级") + private String className; + + @ExcelColumn(col = 2,value = "学生名") + private String userName; + + @ExcelColumn(col = 3,value = "扣分项") + private String itemDesc; + + @ExcelColumn(col = 4,value = "分数") + private String score; + + @ExcelColumn(col = 5,value = "老师名") + private String teacherName; + + @ExcelColumn(col = 6,value = "科目") + private String subject; + + @ExcelColumn(col = 7,value = "时间") + private String createDate; + +} diff --git b/src/main/java/com/meishu/vo/sign/ClassSignInVO.java a/src/main/java/com/meishu/vo/sign/ClassSignInVO.java new file mode 100644 index 0000000..bcd85b4 --- /dev/null +++ a/src/main/java/com/meishu/vo/sign/ClassSignInVO.java @@ -0,0 +1,20 @@ +package com.meishu.vo.sign; + +import lombok.Data; + +@Data +public class ClassSignInVO { + + private Integer id; + + private String userName; + + private String studyCode; + + private String gender; + + private String phone; + + private String signInDate; + +} diff --git b/src/main/java/com/meishu/vo/student/ChapterTestVO.java a/src/main/java/com/meishu/vo/student/ChapterTestVO.java new file mode 100644 index 0000000..167f402 --- /dev/null +++ a/src/main/java/com/meishu/vo/student/ChapterTestVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.student; + +import com.meishu.model.ExerciseDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class ChapterTestVO { + + private List exerciseDictDOS; + + private Integer exerciseSize; + +} diff --git b/src/main/java/com/meishu/vo/student/ClassVO.java a/src/main/java/com/meishu/vo/student/ClassVO.java new file mode 100644 index 0000000..10c73df --- /dev/null +++ a/src/main/java/com/meishu/vo/student/ClassVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.student; + +import com.meishu.model.CourseDictDO; +import com.meishu.vo.course.CourseAdministerVO; +import lombok.Data; + +import java.util.List; + +@Data +public class ClassVO extends CourseDictDO { + + private List courseAdministerVOS; + + private String subjectName; + + private String publishTime; + +} diff --git b/src/main/java/com/meishu/vo/student/GetChildTreesVO.java a/src/main/java/com/meishu/vo/student/GetChildTreesVO.java new file mode 100644 index 0000000..0b4da2a --- /dev/null +++ a/src/main/java/com/meishu/vo/student/GetChildTreesVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.student; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetChildTreesVO { + + private StudentVodVO studentVodVO; + + private List studentTreeVodDoneVOS; + +} diff --git b/src/main/java/com/meishu/vo/student/GetStudyProgressVO.java a/src/main/java/com/meishu/vo/student/GetStudyProgressVO.java new file mode 100644 index 0000000..bfc96ae --- /dev/null +++ a/src/main/java/com/meishu/vo/student/GetStudyProgressVO.java @@ -0,0 +1,31 @@ +package com.meishu.vo.student; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetStudyProgressVO { + + private List treeVods; + + private Integer totalCounts; + + private Integer watchCounts; + + private Integer percent; + + private Integer toStudyTreeNodes; + + /** + * 是否做过习题 + */ + private String exerciseStatus; + + /** + * 是否能做习题 + */ + private String doExerciseStatus; + + +} diff --git b/src/main/java/com/meishu/vo/student/LoginVO.java a/src/main/java/com/meishu/vo/student/LoginVO.java new file mode 100644 index 0000000..c2480ec --- /dev/null +++ a/src/main/java/com/meishu/vo/student/LoginVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.student; + +import com.meishu.model.StudentDO; +import lombok.Data; + +import java.util.List; + +@Data +public class LoginVO extends StudentDO { + + private String campus; + + private String username; + + private List subjectReportVOS; + + private String isStudent; +} diff --git b/src/main/java/com/meishu/vo/student/ParentReportVO.java a/src/main/java/com/meishu/vo/student/ParentReportVO.java new file mode 100644 index 0000000..9466319 --- /dev/null +++ a/src/main/java/com/meishu/vo/student/ParentReportVO.java @@ -0,0 +1,30 @@ +package com.meishu.vo.student; + +import com.meishu.model.CourseTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class ParentReportVO { + + private Integer rightCount; + + private Integer exerciseCounts; + + private Integer rightPercent; + + private Integer totalVodCounts; + + private Integer watchCounts; + + private Integer watchPercent; + + private String treeName; + + private String subjectName; + + private List rightTree; + + private List wrongTree; +} diff --git b/src/main/java/com/meishu/vo/student/QueryChapterTestVO.java a/src/main/java/com/meishu/vo/student/QueryChapterTestVO.java new file mode 100644 index 0000000..07bd9b1 --- /dev/null +++ a/src/main/java/com/meishu/vo/student/QueryChapterTestVO.java @@ -0,0 +1,30 @@ +package com.meishu.vo.student; + +import lombok.Data; + +@Data +public class QueryChapterTestVO { + + private Long id; + + private String title; + + private String rightAnswer; + + private String items; + + private Integer difficulty; + + private String exerciseType; + + private String detail; + + private Integer adviceLength; + + private Integer length; + + private String result; + + private String answer; + +} diff --git b/src/main/java/com/meishu/vo/student/QueryClassVO.java a/src/main/java/com/meishu/vo/student/QueryClassVO.java new file mode 100644 index 0000000..d410619 --- /dev/null +++ a/src/main/java/com/meishu/vo/student/QueryClassVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.student; + +import lombok.Data; + +import java.util.List; + +@Data +public class QueryClassVO { + + private List innerSubjects; + + private List outerSubjects; + +} diff --git b/src/main/java/com/meishu/vo/student/QueryStudentVO.java a/src/main/java/com/meishu/vo/student/QueryStudentVO.java new file mode 100644 index 0000000..51bb202 --- /dev/null +++ a/src/main/java/com/meishu/vo/student/QueryStudentVO.java @@ -0,0 +1,11 @@ +package com.meishu.vo.student; + +import com.meishu.model.StudentDO; +import lombok.Data; + +@Data +public class QueryStudentVO extends StudentDO { + + private String campus; + +} diff --git b/src/main/java/com/meishu/vo/student/SearchVodsVO.java a/src/main/java/com/meishu/vo/student/SearchVodsVO.java new file mode 100644 index 0000000..aba8f4a --- /dev/null +++ a/src/main/java/com/meishu/vo/student/SearchVodsVO.java @@ -0,0 +1,27 @@ +package com.meishu.vo.student; + +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class SearchVodsVO { + + private List subjectTreeDOS; + + private Integer vodLength; + + private Long id; + + private String vodType; + + private String coverPage; + + private String vodName; + + private String vodUrl; + + private String status; + +} diff --git b/src/main/java/com/meishu/vo/student/StudentCampusVO.java a/src/main/java/com/meishu/vo/student/StudentCampusVO.java new file mode 100644 index 0000000..b81c0e6 --- /dev/null +++ a/src/main/java/com/meishu/vo/student/StudentCampusVO.java @@ -0,0 +1,24 @@ +package com.meishu.vo.student; + +import lombok.Data; + +@Data +public class StudentCampusVO { + + private Long studentId; + + private String username; + + private String campus; + + private String status; + + private String startDate; + + private String endDate; + + private Integer diff; + + private Long id; + +} diff --git b/src/main/java/com/meishu/vo/student/StudentCourseVO.java a/src/main/java/com/meishu/vo/student/StudentCourseVO.java new file mode 100644 index 0000000..604d8b7 --- /dev/null +++ a/src/main/java/com/meishu/vo/student/StudentCourseVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.student; + +import com.meishu.vo.voddict.GetCourseTreesVodsVO; +import lombok.Data; + +import java.util.List; + +@Data +public class StudentCourseVO { + + private String treeName; + + private List vodDictDOS; + + private List studentCourseVO; + +} diff --git b/src/main/java/com/meishu/vo/student/StudentTreeVodDoneVO.java a/src/main/java/com/meishu/vo/student/StudentTreeVodDoneVO.java new file mode 100644 index 0000000..354d965 --- /dev/null +++ a/src/main/java/com/meishu/vo/student/StudentTreeVodDoneVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.student; + +import lombok.Data; + +@Data +public class StudentTreeVodDoneVO { + + private Long id; // courseId + + private Long treeId; //知识点id + + private String treeName; + + private Boolean completeStatus; + +} diff --git b/src/main/java/com/meishu/vo/student/StudentVO.java a/src/main/java/com/meishu/vo/student/StudentVO.java new file mode 100644 index 0000000..80e334a --- /dev/null +++ a/src/main/java/com/meishu/vo/student/StudentVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.student; + +import lombok.Data; + +@Data +public class StudentVO { + + private Long id; + + private String username; + + private String telephone; + + private String campus; + + private String campusId; + +} diff --git b/src/main/java/com/meishu/vo/student/StudentVodVO.java a/src/main/java/com/meishu/vo/student/StudentVodVO.java new file mode 100644 index 0000000..8862183 --- /dev/null +++ a/src/main/java/com/meishu/vo/student/StudentVodVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.student; + +import com.meishu.vo.course.CourseVodVO; +import lombok.Data; + +import java.util.List; + +@Data +public class StudentVodVO { + + private List courseVodVOS; + + private Integer completePercent; + + private Boolean completeStatus; + + +} diff --git b/src/main/java/com/meishu/vo/student/StudyReportVO.java a/src/main/java/com/meishu/vo/student/StudyReportVO.java new file mode 100644 index 0000000..dee1d5f --- /dev/null +++ a/src/main/java/com/meishu/vo/student/StudyReportVO.java @@ -0,0 +1,31 @@ +package com.meishu.vo.student; + +import com.meishu.model.CourseTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class StudyReportVO { + + private Integer totalCounts; + + private Integer watchCounts; + + private String treeName; + + private Integer rightCount; + + private Integer exerciseCounts; + + private Integer rightPercent; + + private String subjectName; + + private Integer watchPercent; + + private List rightTree; + + private List wrongTree; + +} diff --git b/src/main/java/com/meishu/vo/student/SubjectReportVO.java a/src/main/java/com/meishu/vo/student/SubjectReportVO.java new file mode 100644 index 0000000..0d96dd6 --- /dev/null +++ a/src/main/java/com/meishu/vo/student/SubjectReportVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.student; + +import lombok.Data; + +@Data +public class SubjectReportVO { + + private Long courseId; + + private String subjectName; + + private String courseName; + + private String createTime; + + +} diff --git b/src/main/java/com/meishu/vo/subject/GetAllNoAuthenVodsVO.java a/src/main/java/com/meishu/vo/subject/GetAllNoAuthenVodsVO.java new file mode 100644 index 0000000..678ca97 --- /dev/null +++ a/src/main/java/com/meishu/vo/subject/GetAllNoAuthenVodsVO.java @@ -0,0 +1,24 @@ +package com.meishu.vo.subject; + +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllNoAuthenVodsVO { + + private Long id; + + private String vodName; + + private String vodType; + + private List subjectTreeDOS; + + private String userName; + + private String updateTime; + + +} diff --git b/src/main/java/com/meishu/vo/subject/GetNextNodeVO.java a/src/main/java/com/meishu/vo/subject/GetNextNodeVO.java new file mode 100644 index 0000000..3dd08eb --- /dev/null +++ a/src/main/java/com/meishu/vo/subject/GetNextNodeVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.subject; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetNextNodeVO { + + private GetSubjectTreeVO getSubjectTreeVO; + + private List getSubjectTreeVOS; + +} diff --git b/src/main/java/com/meishu/vo/subject/GetSubjectTreeVO.java a/src/main/java/com/meishu/vo/subject/GetSubjectTreeVO.java new file mode 100644 index 0000000..bcc452a --- /dev/null +++ a/src/main/java/com/meishu/vo/subject/GetSubjectTreeVO.java @@ -0,0 +1,119 @@ +package com.meishu.vo.subject; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetSubjectTreeVO implements Comparable { + + + private Long id; + + private Long subjectId; + + /** + * 章节 + */ + private Integer chapterId; + + /** + * 知识点名称 + */ + private String treeName; + + /** + * 写程序使用,数据库不存值 + */ + private List children; + + /** + * 父节点 + */ + private Long parentId; + + /** + * 子节点个数 + */ + private Integer childNodeCounts; + + private String parentTreeName; + + private String treeNode; + + /** + * 视频个数 个人库数量 + */ + private Integer vodCounts; + + /** + * 视频个数 公共库数量 + */ + private Integer publicVodCounts; + + /** + * 题目个数 + */ + private Integer exerciseCounts; + + /** + *视频个数 公共库数量 + */ + private Integer publicExerciseVodCounts; + + /** + * 视频审核个数 + */ + private Integer checkVodCounts; + + /** + * 题目审核个数 + */ + private Integer checkExerciseCounts; + + /** + * 视频待审核个数 + */ + private Integer toCheckVodCounts; + + /** + * 题目待审核个数 + */ + private Integer toCheckExerciseCounts; + + /** + * 子节点集合 + */ + private List childTreeIds; + + private String number; + + private String text; + + private String layer; + + private int level; + + public GetSubjectTreeVO(Long id, String number, Long parentId, int level) { + this.id = id; + this.number = number; + this.parentId = parentId; + this.level = level; + } + + @Override + public int compareTo(GetSubjectTreeVO o) { + if (this.level != o.level) { + return o.level - this.level; + } else { + if(this.number==null){ + return -1; + } + return this.number.compareTo(o.number); + } + } + + public GetSubjectTreeVO(){ + + } +} diff --git b/src/main/java/com/meishu/vo/subject/SubjectTreeOrder.java a/src/main/java/com/meishu/vo/subject/SubjectTreeOrder.java new file mode 100644 index 0000000..402eb14 --- /dev/null +++ a/src/main/java/com/meishu/vo/subject/SubjectTreeOrder.java @@ -0,0 +1,212 @@ +package com.meishu.vo.subject; + +import com.meishu.util.tree.SerialNumber; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class SubjectTreeOrder { + + private String id; + + public List nodeList; + + private String separator; + + private Long idSeq; + + private SerialNumber number; + + public SubjectTreeOrder(String separator, SerialNumber number) { + init(); + this.separator = separator; + this.number = number; + + } + + public void init() { + idSeq = 0L; + this.separator = "."; + if (this.nodeList == null) { + nodeList = new ArrayList<>(); + } + } + + + /** + *

功能描述:根据父节点获取所有子节点。

+ */ + public List getChildNodes(GetSubjectTreeVO pNode,List nodeList) { + Long pId = pNode.getId(); + return getChildNodes(pId,nodeList); + } + + /** + *

功能描述:根据父节点获取所有子节点。

+ */ + public List getChildNodes(Long pId,List nodeList) { + List childNodes = new ArrayList<>(); + for (GetSubjectTreeVO n : nodeList) { + if (pId.equals(n.getParentId())) { + childNodes.add(n); + } + } + + return childNodes; + } + + /** + *

功能描述:获取本级值最大的节点。

+ */ + public GetSubjectTreeVO getMaxNodeForThisLevel(GetSubjectTreeVO pNode,List nodeList) { + List childList = getChildNodes(pNode,nodeList); + GetSubjectTreeVO root = getRoot(nodeList); + if (childList.size() <= 0) { + return null; + } + GetSubjectTreeVO maxNode = root; + for (GetSubjectTreeVO node : childList) { + if (maxNode.getNumber().compareTo(node.getNumber()) <= 0) { + maxNode = node; + } + } + return maxNode; + } + + /** + *

功能描述:生成下一个子节点。

+ */ + public GetSubjectTreeVO generateNextChildNode(GetSubjectTreeVO node,List nodeList) { + GetSubjectTreeVO newNode = null; + GetSubjectTreeVO maxNode = getMaxNodeForThisLevel(node,nodeList); + String nextNumber = number.firstNumber(); + int level = node.getLevel(); + if (maxNode != null && !"0".equals(maxNode.getId())) {//本级存在子节点,且非根节点 + nextNumber = number.produceNext(maxNode.getNumber()); + level = maxNode.getLevel(); + } + newNode = new GetSubjectTreeVO(++idSeq, nextNumber, node.getId(), level); + + generateNodeText(newNode, nextNumber,nodeList); + + return newNode; + } + + + /** + * + *

功能描述:获取父节点。

+ */ + public GetSubjectTreeVO getParentNode(GetSubjectTreeVO node,List nodeList) { + for (GetSubjectTreeVO n : nodeList) { + if (node.getParentId().equals(n.getId())) { + return n; + } + } + return node; + } + + /** + *

功能描述:生成节点路径。

+ */ + public void generateNodeText(GetSubjectTreeVO node, String text,List nodeList) { + + if (node == null || "0".equals(node.getId())) { + return; + } + + GetSubjectTreeVO pNode = getParentNode(node,nodeList); + + if (!"0".equals(pNode.getId())) { + text = pNode.getText() + separator + text; + } + node.setText(text); + } + +// /** +// *

功能描述:遍历所有树节点。

+// */ +// public void traverseNodeList(GetSubjectTreeVO node) { +// if(node==null){ +// node = getRoot(nodeList); +// } +// List childNodes = getChildNodes(node); +// System.out.println(node.getText()); +// if (childNodes.size() > 0) { +// for (GetSubjectTreeVO n : childNodes) { +// traverseNodeList(n); +// } +// } +// } + public static void main(String[] args) { + SerialNumber number = new SerialNumber(); + SubjectTreeOrder treeNode = new SubjectTreeOrder(".", number); + +// addSomeNodes(treeNode); +// treeNode.traverseNodeList(null); + } + + /** + *

功能描述:获取根节点。

+ */ + public GetSubjectTreeVO getRoot(List nodeList) { + GetSubjectTreeVO root = null; + if (nodeList.size() <= 0 || (root = getNodeById(nodeList, "0")) == null) { + root = createRoot(); + nodeList.add(root); + } + return root; + } + + private GetSubjectTreeVO getNodeById(List nodeList, String id) { + GetSubjectTreeVO node = null; + if(id!=null){ + for (GetSubjectTreeVO n : nodeList) { + if (id.equals(n.getId())) { + node = n; + break; + } + } + } + return node; + } + + private GetSubjectTreeVO createRoot() { + GetSubjectTreeVO root = new GetSubjectTreeVO(0L, number.rootNumber(), -1L, 0); + root.setText("0"); + return root; + } + + /** + *

功能描述:测试添加节点。

+ */ +// private static GetSubjectTreeVO addSomeNodes(SubjectTreeOrder tree) { +// GetSubjectTreeVO root = tree.getRoot(tree.nodeList); +// GetSubjectTreeVO node1 = getNextNode(tree, root);//1 +// GetSubjectTreeVO node2 = getNextNode(tree, root);//2 +// GetSubjectTreeVO node3 = getNextNode(tree, root);//3 +// GetSubjectTreeVO node11 = getNextNode(tree, node1);//1.1 +// GetSubjectTreeVO node12 = getNextNode(tree, node1);//1.2 +// GetSubjectTreeVO node21 = getNextNode(tree, node2);//2.1 +// GetSubjectTreeVO node211 = getNextNode(tree, node21);//2.1.1 +// GetSubjectTreeVO node212 = getNextNode(tree, node21);//2.1.2 +// GetSubjectTreeVO node22 = getNextNode(tree, node2);//2.2 +// GetSubjectTreeVO node221 = getNextNode(tree, node22);//2.2.1 +// GetSubjectTreeVO node31 = getNextNode(tree, node3); +// GetSubjectTreeVO node32 = getNextNode(tree, node3); +// GetSubjectTreeVO node311 = getNextNode(tree, node31); +// GetSubjectTreeVO node3111 = getNextNode(tree, node311); +// return root; +// } + + public static GetSubjectTreeVO getNextNode(SubjectTreeOrder tree, GetSubjectTreeVO pNode,List nodeList) { + GetSubjectTreeVO node = tree.generateNextChildNode(pNode,nodeList); + if (node != null) { + nodeList.add(node); + } + return node; + } + +} diff --git b/src/main/java/com/meishu/vo/task/ClassDoneInfoVO.java a/src/main/java/com/meishu/vo/task/ClassDoneInfoVO.java new file mode 100644 index 0000000..3e78061 --- /dev/null +++ a/src/main/java/com/meishu/vo/task/ClassDoneInfoVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.task; + +import lombok.Data; + +@Data +public class ClassDoneInfoVO { + + private Integer exerciseId; + + private Integer length; + + private Integer result; + + private Integer countNum; + +} diff --git b/src/main/java/com/meishu/vo/task/ExeRightRatioVO.java a/src/main/java/com/meishu/vo/task/ExeRightRatioVO.java new file mode 100644 index 0000000..f41cd93 --- /dev/null +++ a/src/main/java/com/meishu/vo/task/ExeRightRatioVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.task; + +import lombok.Data; + +@Data +public class ExeRightRatioVO { + + private String exercise; + + private String type; + + private String value; + + private String length; +} diff --git b/src/main/java/com/meishu/vo/task/ExerciseDoneInfoVO.java a/src/main/java/com/meishu/vo/task/ExerciseDoneInfoVO.java new file mode 100644 index 0000000..3681a7f --- /dev/null +++ a/src/main/java/com/meishu/vo/task/ExerciseDoneInfoVO.java @@ -0,0 +1,18 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-20 09:40 + */ +@Data +public class ExerciseDoneInfoVO { + + private Integer rights; + + private Integer total; + + private String label; + +} diff --git b/src/main/java/com/meishu/vo/task/ExerciseUserInfoVO.java a/src/main/java/com/meishu/vo/task/ExerciseUserInfoVO.java new file mode 100644 index 0000000..b17f355 --- /dev/null +++ a/src/main/java/com/meishu/vo/task/ExerciseUserInfoVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.task; + + +import com.meishu.model.ExerciseDictDO; +import lombok.Data; + +@Data +public class ExerciseUserInfoVO extends ExerciseDictDO { + + private Integer collectionStatus; + + private Integer recommendStatus; + +} diff --git b/src/main/java/com/meishu/vo/task/GetClassExeDoneInfoRequestVO.java a/src/main/java/com/meishu/vo/task/GetClassExeDoneInfoRequestVO.java new file mode 100644 index 0000000..6e3d8d4 --- /dev/null +++ a/src/main/java/com/meishu/vo/task/GetClassExeDoneInfoRequestVO.java @@ -0,0 +1,27 @@ +package com.meishu.vo.task; + +import lombok.Data; + +import java.util.List; + +/** + * 获取班级某个关联习题做题情况 入参 + * @author: tuyp + * @create: 2020-07-24 10:41 + */ +@Data +public class GetClassExeDoneInfoRequestVO { + + private Integer subjectId; + + private Integer taskId; + + private String treeId; + + private Integer userId; + + private String subject; + + private List userIds; + +} diff --git b/src/main/java/com/meishu/vo/task/GetClassExeDoneInfoResponseVO.java a/src/main/java/com/meishu/vo/task/GetClassExeDoneInfoResponseVO.java new file mode 100644 index 0000000..d795418 --- /dev/null +++ a/src/main/java/com/meishu/vo/task/GetClassExeDoneInfoResponseVO.java @@ -0,0 +1,37 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * 获取班级某个关联习题做题情况 出参 + * @author: tuyp + * @create: 2020-07-24 10:57 + */ +@Data +public class GetClassExeDoneInfoResponseVO { + + private Integer exerciseId; + + private String exerciseType; + + private String label; + + private String treeId; + + private String title; + + private String answer; + + private String rightAnswer; + + private String exeType; + + private Integer result; + + private Integer length; + + private String classResult; + + private Integer classLength; + +} diff --git b/src/main/java/com/meishu/vo/task/GetExeByIdResponseVO.java a/src/main/java/com/meishu/vo/task/GetExeByIdResponseVO.java new file mode 100644 index 0000000..8f66b04 --- /dev/null +++ a/src/main/java/com/meishu/vo/task/GetExeByIdResponseVO.java @@ -0,0 +1,36 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-06-17 17:33 + */ +@Data +public class GetExeByIdResponseVO { + + private Integer id; + + private Integer adviceLength; + + private String treeId; + + private String exerciseType; + + private String title; + + private String rightAnswer; + + private String detail; + + private Integer status; + + private Integer userId; + + private Integer difficulty; + + private String items; + + private Integer collectionStatus; + +} diff --git b/src/main/java/com/meishu/vo/task/GetExercisesInfoByIdsResponseVO.java a/src/main/java/com/meishu/vo/task/GetExercisesInfoByIdsResponseVO.java new file mode 100644 index 0000000..1315a9a --- /dev/null +++ a/src/main/java/com/meishu/vo/task/GetExercisesInfoByIdsResponseVO.java @@ -0,0 +1,21 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-21 16:09 + */ +@Data +public class GetExercisesInfoByIdsResponseVO { + + private Integer exeCounts; + + private String length; + + private Integer lengthSecond; + + private Integer treeId; + + private String label; +} diff --git b/src/main/java/com/meishu/vo/task/GetExpandingsPO.java a/src/main/java/com/meishu/vo/task/GetExpandingsPO.java new file mode 100644 index 0000000..921ce4b --- /dev/null +++ a/src/main/java/com/meishu/vo/task/GetExpandingsPO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.task; + +import lombok.Data; + +@Data +public class GetExpandingsPO { + + private Integer id; + + private Integer userId; + +} diff --git b/src/main/java/com/meishu/vo/task/GetPreTaskContentVO.java a/src/main/java/com/meishu/vo/task/GetPreTaskContentVO.java new file mode 100644 index 0000000..c8b48c4 --- /dev/null +++ a/src/main/java/com/meishu/vo/task/GetPreTaskContentVO.java @@ -0,0 +1,32 @@ +package com.meishu.vo.task; + +import lombok.Data; + +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-17 11:10 + */ +@Data +public class GetPreTaskContentVO { + + private List preVodInfoVOS; + + private List preRelateExeVOS; + + private List preExpandExerciseVOS; + + private PreHomeWorkInfoVO preHomeWorkInfoVO; + +// private List knowledgeTrees; + + private String teacherName; + + private Integer taskType; + + private Integer taskId; + + private String treeName; + +} diff --git b/src/main/java/com/meishu/vo/task/GetTaskByIdVO.java a/src/main/java/com/meishu/vo/task/GetTaskByIdVO.java new file mode 100644 index 0000000..3c7af49 --- /dev/null +++ a/src/main/java/com/meishu/vo/task/GetTaskByIdVO.java @@ -0,0 +1,65 @@ +package com.meishu.vo.task; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.meishu.model.ClassSubjectTaskDO; +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-17 10:06 + */ +@Data +public class GetTaskByIdVO { + + @TableId(type = IdType.AUTO) + private Integer id; + + private Integer subjectId; + + private String treeId; + + private String treeName; + + private Integer teacherId; + + /** + * 作业类型 0:预习作业 1课后作业 + */ + private Integer taskType; + + private String subjectEn; + + private Integer classId; + + private String grade; + + private String classes; + + private String session; + + private String subjectType; + + private String className; + + private String semester; + + private Date createDate; + + private Date updateDate; + + private Date deleteDate; + + private List knowledges; + + private Integer taskId; + + private List subjectTreeDOS; + + private String taskDate; + +} diff --git b/src/main/java/com/meishu/vo/task/GetVodDetailResponseVO.java a/src/main/java/com/meishu/vo/task/GetVodDetailResponseVO.java new file mode 100644 index 0000000..3cad4da --- /dev/null +++ a/src/main/java/com/meishu/vo/task/GetVodDetailResponseVO.java @@ -0,0 +1,30 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-19 13:51 + */ +@Data +public class GetVodDetailResponseVO { + + private Long id; + + private String vodName; + + private String vodUrl; + + private String vodType; + + private String userName; + + private Integer treeId; + +// private String length; + + private Integer lengthSecond; + + private String collectionStatus; + +} diff --git b/src/main/java/com/meishu/vo/task/PerStuExeDoneResponseVO.java a/src/main/java/com/meishu/vo/task/PerStuExeDoneResponseVO.java new file mode 100644 index 0000000..5d864fe --- /dev/null +++ a/src/main/java/com/meishu/vo/task/PerStuExeDoneResponseVO.java @@ -0,0 +1,32 @@ +package com.meishu.vo.task; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; + +import java.util.Date; + +/** + * @author: tuyp + * @create: 2020-07-23 15:43 + */ +@Data +public class PerStuExeDoneResponseVO { + + private String userId; + + private String studyCode; + + private String userName; + + private Integer rightCounts; + + private Integer totalCounts; + + private Integer length; + + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") + private String submitDate; + + private String status; + +} diff --git b/src/main/java/com/meishu/vo/task/PerStudentExesResponseVO.java a/src/main/java/com/meishu/vo/task/PerStudentExesResponseVO.java new file mode 100644 index 0000000..99c0510 --- /dev/null +++ a/src/main/java/com/meishu/vo/task/PerStudentExesResponseVO.java @@ -0,0 +1,25 @@ +package com.meishu.vo.task; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-22 18:41 + */ +@Data +public class PerStudentExesResponseVO { + + private Integer submitCount; + + private Integer totalCount; + + private BigDecimal rightPercent; + + private BigDecimal avgUseTimes; + + private List perStuExeDoneResponseVOS; + +} diff --git b/src/main/java/com/meishu/vo/task/PreExpandExerciseVO.java a/src/main/java/com/meishu/vo/task/PreExpandExerciseVO.java new file mode 100644 index 0000000..814441a --- /dev/null +++ a/src/main/java/com/meishu/vo/task/PreExpandExerciseVO.java @@ -0,0 +1,24 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-18 19:49 + */ +@Data +public class PreExpandExerciseVO { + + private Integer treeId; + + private String expandExerciseNames; + + private Integer exerciseCounts; + + private Integer studentCounts; + + private String length; + + private Integer lengthSecond; + +} diff --git b/src/main/java/com/meishu/vo/task/PreHomeWorkInfoVO.java a/src/main/java/com/meishu/vo/task/PreHomeWorkInfoVO.java new file mode 100644 index 0000000..0103cab --- /dev/null +++ a/src/main/java/com/meishu/vo/task/PreHomeWorkInfoVO.java @@ -0,0 +1,27 @@ +package com.meishu.vo.task; + +import com.meishu.model.WrittenHomeworkDO; +import lombok.Data; + +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-17 14:21 + */ +@Data +public class PreHomeWorkInfoVO { + + private String length; + + private List writtenHomeworks; + + private Integer homeworksCounts; + + private String notice; + + private String fileName; + + private Integer lengthSecond; + +} diff --git b/src/main/java/com/meishu/vo/task/PreRelateExeVO.java a/src/main/java/com/meishu/vo/task/PreRelateExeVO.java new file mode 100644 index 0000000..5959352 --- /dev/null +++ a/src/main/java/com/meishu/vo/task/PreRelateExeVO.java @@ -0,0 +1,22 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-17 14:29 + */ +@Data +public class PreRelateExeVO { + + private Integer treeId; + + private String treeName; + + private Integer exeCounts; + + private String length; + + private Integer lengthSecond; + +} diff --git b/src/main/java/com/meishu/vo/task/PreVodInfoVO.java a/src/main/java/com/meishu/vo/task/PreVodInfoVO.java new file mode 100644 index 0000000..e69374d --- /dev/null +++ a/src/main/java/com/meishu/vo/task/PreVodInfoVO.java @@ -0,0 +1,28 @@ +package com.meishu.vo.task; + +import lombok.Data; + +/** + * @author: tuyp + * @create: 2020-07-17 11:26 + */ +@Data +public class PreVodInfoVO { + + private Long vodId; + + private String vodName; + + private String teacherName; + + private Integer treeId; + + private String length; + + private String vodType; + + private String vodUrl; + + private Integer lengthSecond; + +} diff --git b/src/main/java/com/meishu/vo/task/QueryTaskDetailResponseVO.java a/src/main/java/com/meishu/vo/task/QueryTaskDetailResponseVO.java new file mode 100644 index 0000000..8876f1d --- /dev/null +++ a/src/main/java/com/meishu/vo/task/QueryTaskDetailResponseVO.java @@ -0,0 +1,26 @@ +package com.meishu.vo.task; + +import lombok.Data; + +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-06-28 10:40 + */ +@Data +public class QueryTaskDetailResponseVO { + + private Integer taskType; + + private List knowledges; + + private String userName; + + private String treeName; + + private GetPreTaskContentVO getPreTaskContentVO; + + private List exerciseDoneInfoVOS; + +} diff --git b/src/main/java/com/meishu/vo/task/StudentDoneInfoResponseVO.java a/src/main/java/com/meishu/vo/task/StudentDoneInfoResponseVO.java new file mode 100644 index 0000000..224232a --- /dev/null +++ a/src/main/java/com/meishu/vo/task/StudentDoneInfoResponseVO.java @@ -0,0 +1,31 @@ +package com.meishu.vo.task; + +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author: tuyp + * @create: 2020-07-23 09:23 + */ +@Data +public class StudentDoneInfoResponseVO { + + private Integer rightCounts; + + private Integer totalCounts; + + private Integer useLength; + + private String avgRightPercent; + + private Integer avgUseLength; + + private String submitTime; + + private List studentDoneDetailVOS; + + + +} diff --git b/src/main/java/com/meishu/vo/task/TeacherClassVO.java a/src/main/java/com/meishu/vo/task/TeacherClassVO.java new file mode 100644 index 0000000..6607340 --- /dev/null +++ a/src/main/java/com/meishu/vo/task/TeacherClassVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.task; + +import com.meishu.vo.administer.GetClassesDetailResponseVO; +import lombok.Data; + +import java.util.List; + +@Data +public class TeacherClassVO { + + private Long subjectId; + + private String subject; + + private List getClassesDetailResponseVOS; + +} diff --git b/src/main/java/com/meishu/vo/test/CommentVO.java a/src/main/java/com/meishu/vo/test/CommentVO.java new file mode 100644 index 0000000..3ed5bf8 --- /dev/null +++ a/src/main/java/com/meishu/vo/test/CommentVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.test; + +import lombok.Data; + +@Data +public class CommentVO { + + private Long id; + + private String dimension; + + private Integer star; + + private String userName; + +} diff --git b/src/main/java/com/meishu/vo/test/GetAllTestVO.java a/src/main/java/com/meishu/vo/test/GetAllTestVO.java new file mode 100644 index 0000000..d4ffc28 --- /dev/null +++ a/src/main/java/com/meishu/vo/test/GetAllTestVO.java @@ -0,0 +1,19 @@ +package com.meishu.vo.test; + +import lombok.Data; + +@Data +public class GetAllTestVO { + + private Long id; + + private Long ruleId; + + private String ruleName; + + private String testName; + + private String examination; + + private String status; +} diff --git b/src/main/java/com/meishu/vo/test/GetOnePublishVO.java a/src/main/java/com/meishu/vo/test/GetOnePublishVO.java new file mode 100644 index 0000000..ad8dd75 --- /dev/null +++ a/src/main/java/com/meishu/vo/test/GetOnePublishVO.java @@ -0,0 +1,26 @@ +package com.meishu.vo.test; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetOnePublishVO { + + private Long id; + + private Long studentId; + + private Long publishId; + + private String username; + + private String answer; + + private String commentStatus; + + private Double totalStar; + + private List commentVOS; + +} diff --git b/src/main/java/com/meishu/vo/test/GetPublishHistoryVO.java a/src/main/java/com/meishu/vo/test/GetPublishHistoryVO.java new file mode 100644 index 0000000..519f206 --- /dev/null +++ a/src/main/java/com/meishu/vo/test/GetPublishHistoryVO.java @@ -0,0 +1,32 @@ +package com.meishu.vo.test; + + +import com.meishu.vo.student.StudentVO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetPublishHistoryVO { + + private Long id; + + private Long testId; + + private String testName; + + private String publishName; + + private String ruleName; + + private String testTime; + + private String outline; + + private String examination; + + private String coverPage; + + private List studentVOS; + +} diff --git b/src/main/java/com/meishu/vo/test/GetTestReportVO.java a/src/main/java/com/meishu/vo/test/GetTestReportVO.java new file mode 100644 index 0000000..ad48a45 --- /dev/null +++ a/src/main/java/com/meishu/vo/test/GetTestReportVO.java @@ -0,0 +1,26 @@ +package com.meishu.vo.test; + +import com.meishu.vo.student.StudentVO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetTestReportVO { + + private Long id; + + private String publishName; + + private String ruleName; + + private String testTime; + + private String testName; + + private Integer toCnt; + + private Integer doneCnt; + + private List studentVOS; +} diff --git b/src/main/java/com/meishu/vo/userrole/QueryStudentsVO.java a/src/main/java/com/meishu/vo/userrole/QueryStudentsVO.java new file mode 100644 index 0000000..0352105 --- /dev/null +++ a/src/main/java/com/meishu/vo/userrole/QueryStudentsVO.java @@ -0,0 +1,41 @@ +package com.meishu.vo.userrole; + +import com.meishu.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class QueryStudentsVO { + + private Integer id; + + @ExcelColumn(col = 1,value = "姓名") + private String userName; + + @ExcelColumn(col = 2,value = "学号") + private String studyCode; + + @ExcelColumn(col = 3,value = "手机号") + private String phone; + + @ExcelColumn(col = 4,value = "身份证号") + private String idCard; + + @ExcelColumn(col = 5,value = "年级") + private String grade; + + @ExcelColumn(col = 6,value = "入学年份") + private String session; + + @ExcelColumn(col = 7,value = "性别") + private String gender; + + @ExcelColumn(col = 8,value = "邮箱") + private String email; + + @ExcelColumn(col = 9,value = "所在行政班级") + private String className; + + @ExcelColumn(col = 10,value = "状态") + private String userStatus; + +} diff --git b/src/main/java/com/meishu/vo/userrole/UserInfoVO.java a/src/main/java/com/meishu/vo/userrole/UserInfoVO.java new file mode 100644 index 0000000..b48e683 --- /dev/null +++ a/src/main/java/com/meishu/vo/userrole/UserInfoVO.java @@ -0,0 +1,15 @@ +package com.meishu.vo.userrole; + +import lombok.Data; + +@Data +public class UserInfoVO { + + private Integer id; + + private String userName; + + private String classes; + + private String session; +} diff --git b/src/main/java/com/meishu/vo/userrole/UserRoleVO.java a/src/main/java/com/meishu/vo/userrole/UserRoleVO.java new file mode 100644 index 0000000..2c34e45 --- /dev/null +++ a/src/main/java/com/meishu/vo/userrole/UserRoleVO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.userrole; + +import lombok.Data; + +@Data +public class UserRoleVO { + + private Integer id; + + private String phone; + +} diff --git b/src/main/java/com/meishu/vo/voddict/GetCourseTreesVodsVO.java a/src/main/java/com/meishu/vo/voddict/GetCourseTreesVodsVO.java new file mode 100644 index 0000000..efbe271 --- /dev/null +++ a/src/main/java/com/meishu/vo/voddict/GetCourseTreesVodsVO.java @@ -0,0 +1,40 @@ +package com.meishu.vo.voddict; + +import lombok.Data; + +@Data +public class GetCourseTreesVodsVO { + + private Long id; + + private Long vodId; + + private String vodUrl; + + private String vodName; + + private String vodType; + + private String vodIntro; + + private String coverPage; + + private Integer playRecord; + + private Integer vodLength; + + /** + * 没用字段 + */ + private String watchStatus; + + /** + * 1:带锁 0:没有锁 + */ + private String lockStatus; + + private Long treeId; + + private Long mappingId; + +} diff --git b/src/main/java/com/meishu/vo/voddict/GetStatusVodsVO.java a/src/main/java/com/meishu/vo/voddict/GetStatusVodsVO.java new file mode 100644 index 0000000..52c4fe5 --- /dev/null +++ a/src/main/java/com/meishu/vo/voddict/GetStatusVodsVO.java @@ -0,0 +1,9 @@ +package com.meishu.vo.voddict; + +import lombok.Data; + +@Data +public class GetStatusVodsVO { + + +} diff --git b/src/main/java/com/meishu/vo/voddict/GetToCheckCountsVO.java a/src/main/java/com/meishu/vo/voddict/GetToCheckCountsVO.java new file mode 100644 index 0000000..9fd5364 --- /dev/null +++ a/src/main/java/com/meishu/vo/voddict/GetToCheckCountsVO.java @@ -0,0 +1,12 @@ +package com.meishu.vo.voddict; + +import lombok.Data; + +@Data +public class GetToCheckCountsVO { + + private Integer toCheckCounts; + + private Integer checkCounts; + +} diff --git b/src/main/java/com/meishu/vo/voddict/GetTreeVodsVO.java a/src/main/java/com/meishu/vo/voddict/GetTreeVodsVO.java new file mode 100644 index 0000000..ead95dc --- /dev/null +++ a/src/main/java/com/meishu/vo/voddict/GetTreeVodsVO.java @@ -0,0 +1,43 @@ +package com.meishu.vo.voddict; + +import com.meishu.model.SubjectTreeDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetTreeVodsVO { + + private Long id; + + private String vodName; + + private List trees; + + private String vodUrl; + + private String vodType; + + private String userName; + + private String updateTime; + + private Integer playCounts; + + private String vodSize; + + private Integer vodLength; + + private String vodIntro; + + private String vodCode; + + private String shareStatus; + + private String checkStatus; + + private String coverPage; + + private String status; + +} diff --git b/src/main/java/com/meishu/vo/voddict/GetVodDetailVO.java a/src/main/java/com/meishu/vo/voddict/GetVodDetailVO.java new file mode 100644 index 0000000..3088f43 --- /dev/null +++ a/src/main/java/com/meishu/vo/voddict/GetVodDetailVO.java @@ -0,0 +1,14 @@ +package com.meishu.vo.voddict; + +import com.meishu.model.SubjectTreeDO; +import com.meishu.model.VodDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetVodDetailVO extends VodDictDO { + + private List subjectTreeDOS; + +} diff --git b/src/main/java/com/meishu/vo/voddict/SignatureVO.java a/src/main/java/com/meishu/vo/voddict/SignatureVO.java new file mode 100644 index 0000000..4da6082 --- /dev/null +++ a/src/main/java/com/meishu/vo/voddict/SignatureVO.java @@ -0,0 +1,10 @@ +package com.meishu.vo.voddict; + +import lombok.Data; + +@Data +public class SignatureVO { + + private String sign; + +} diff --git b/src/main/java/com/meishu/vo/wechat/AccessTokenVO.java a/src/main/java/com/meishu/vo/wechat/AccessTokenVO.java new file mode 100644 index 0000000..4c93d2d --- /dev/null +++ a/src/main/java/com/meishu/vo/wechat/AccessTokenVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.wechat; + +import lombok.Data; + +/** + * Access_Token + */ +@Data +public class AccessTokenVO { + + private Integer errcode; + + private String errmsg; + + private String access_token; +} diff --git b/src/main/java/com/meishu/vo/wechat/AuthenTokenVO.java a/src/main/java/com/meishu/vo/wechat/AuthenTokenVO.java new file mode 100644 index 0000000..8d34406 --- /dev/null +++ a/src/main/java/com/meishu/vo/wechat/AuthenTokenVO.java @@ -0,0 +1,30 @@ +package com.meishu.vo.wechat; + + +import lombok.Data; + +@Data +public class AuthenTokenVO { + + private String access_token; + + private String openid; + + private String nickname; + + private String sex; + + private String province; + + private String city; + + private String country; + + private String headimgurl; + + private Object privilege; + + private String unionid; + + +} diff --git b/src/main/java/com/meishu/vo/wechat/MemberVO.java a/src/main/java/com/meishu/vo/wechat/MemberVO.java new file mode 100644 index 0000000..da1929c --- /dev/null +++ a/src/main/java/com/meishu/vo/wechat/MemberVO.java @@ -0,0 +1,23 @@ +package com.meishu.vo.wechat; + +import lombok.Data; + +/** + * Member + */ + +@Data +public class MemberVO { + + private Integer errcode; + + private String errmsg; + + private String userid; + + private String name; + + private String mobile; + + private String avatar; +} diff --git b/src/main/java/com/meishu/vo/wechat/QrConnectVO.java a/src/main/java/com/meishu/vo/wechat/QrConnectVO.java new file mode 100644 index 0000000..b1a1659 --- /dev/null +++ a/src/main/java/com/meishu/vo/wechat/QrConnectVO.java @@ -0,0 +1,17 @@ +package com.meishu.vo.wechat; + +import lombok.Data; + +@Data +public class QrConnectVO { + + private String id; + + private String appId; + + private String agentId; + + private String redirectUri; + + private String state; +} diff --git b/src/main/java/com/meishu/vo/wechat/WXUserInfoVO.java a/src/main/java/com/meishu/vo/wechat/WXUserInfoVO.java new file mode 100644 index 0000000..2a81e96 --- /dev/null +++ a/src/main/java/com/meishu/vo/wechat/WXUserInfoVO.java @@ -0,0 +1,16 @@ +package com.meishu.vo.wechat; + +import lombok.Data; + +/** + * UserInfo + */ +@Data +public class WXUserInfoVO { + + private Integer errcode; + + private String errmsg; + + private String UserId; +} \ No newline at end of file diff --git b/src/main/java/com/meishu/vo/wechat/WechatInviteVO.java a/src/main/java/com/meishu/vo/wechat/WechatInviteVO.java new file mode 100644 index 0000000..62035c2 --- /dev/null +++ a/src/main/java/com/meishu/vo/wechat/WechatInviteVO.java @@ -0,0 +1,20 @@ +package com.meishu.vo.wechat; + +import lombok.Data; + +import java.util.List; + +@Data +public class WechatInviteVO { + + private String errcode; + + private String errmsg; + + private List invaliduser; + + private List invalidparty; + + private List invalidtag; + +} diff --git b/src/main/java/com/subsidy/MeishuApplication.java a/src/main/java/com/subsidy/MeishuApplication.java new file mode 100644 index 0000000..d863709 --- /dev/null +++ a/src/main/java/com/subsidy/MeishuApplication.java @@ -0,0 +1,39 @@ +package com.subsidy; + +import com.alibaba.druid.support.http.StatViewServlet; +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@SpringBootApplication +@MapperScan(basePackages = {"com.subsidy.mapper"}) +@EnableScheduling +@EnableAsync +public class MeishuApplication { + + public static void main(String[] args) { + SpringApplication.run(MeishuApplication.class, args); + } + + @Bean + public ServletRegistrationBean druidStatViewServlet() { + //先配置管理后台的servLet,访问的入口为/druid/ + ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean( + new StatViewServlet(), "/druid/*"); + // IP白名单 (没有配置或者为空,则允许所有访问) + servletRegistrationBean.addInitParameter("allow", "127.0.0.1"); + // IP黑名单 (存在共同时,deny优先于allow) + servletRegistrationBean.addInitParameter("deny", ""); + servletRegistrationBean.addInitParameter("loginUsername", "admin"); + servletRegistrationBean.addInitParameter("loginPassword", "yhkl1234"); + servletRegistrationBean.addInitParameter("resetEnable", "false"); + return servletRegistrationBean; + } + +} diff --git b/src/main/java/com/subsidy/common/Code.java a/src/main/java/com/subsidy/common/Code.java new file mode 100644 index 0000000..91afe9e --- /dev/null +++ a/src/main/java/com/subsidy/common/Code.java @@ -0,0 +1,45 @@ +package com.subsidy.common; + +public enum Code { + + USERNAMENOTFOUND(10001, "用户不存在"), + BADCREDENTIALS(10002,"账户或者密码错误"), + ACCOUNTEXPIRED(10003,"账户过期"), + LOCKEDEXCEPTION(10004, "账户已锁定"), + DISABLEDEXCEPTION(10005,"账户已禁用"), + ACCESSDENIED(10006,"无权限访问"), + AUTHENTICATION(10007,"身份验证异常"), + NOHANDLERFOUND(10008,"找不到相应的视图处理器"), + PARAM_INVALID(10009, "参数不合法"), + TOKEN_EXCEPTION(10010, "Token不合法"), + TOKEN_EXPIRED(10011, "Token已过期"), + OSS_ERROR(10012, "OSS文件上传异常"), + Network_ERROR(90000, "网络请求失败"), + SERVER_INTERNAL_ERROR(99999, "服务器内部错误"), + ; + + private Integer code; + + private String message; + + Code(Integer code, String message) { + this.code = code; + this.message = message; + } + + public Integer getCode() { + return code; + } + + public void setCode(Integer code) { + this.code = code; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git b/src/main/java/com/subsidy/common/ResponseData.java a/src/main/java/com/subsidy/common/ResponseData.java new file mode 100644 index 0000000..fd45218 --- /dev/null +++ a/src/main/java/com/subsidy/common/ResponseData.java @@ -0,0 +1,54 @@ +package com.subsidy.common; + +import com.subsidy.common.configure.RemoteProperties; +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 ResponseVO generateCreatedResponse(int code) { + return (ResponseVO) ResponseVO.builder() + .code(code) + .message(RemoteProperties.getMessage(code)) + .build(); + } + + public static ResponseVO generateCreatedResponse(int code, String message) { + return (ResponseVO) ResponseVO.builder() + .code(code) + .message(message) + .build(); + } + + public static ResponseVO generateCreatedResponse(int code, T data) { + return (ResponseVO) ResponseVO.builder() + .code(code) + .message(RemoteProperties.getMessage(code)) + .data(data) + .build(); + } + + public static ResponseVO generateCreatedResponse(int code, String message, T data) { + return (ResponseVO) ResponseVO.builder() + .code(code) + .message(message) + .data(data) + .build(); + } + + public static ResponseVO generateCreatedResponse(int code, String message, String path) { + return (ResponseVO) ResponseVO.builder() + .code(code) + .message(message) + .path(path) + .build(); + } +} \ No newline at end of file diff --git b/src/main/java/com/subsidy/common/ResponseVO.java a/src/main/java/com/subsidy/common/ResponseVO.java new file mode 100644 index 0000000..afaa676 --- /dev/null +++ a/src/main/java/com/subsidy/common/ResponseVO.java @@ -0,0 +1,21 @@ +package com.subsidy.common; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ResponseVO { + + private Integer code; + + private String message; + + private T data; + + private String path; +} \ No newline at end of file diff --git b/src/main/java/com/subsidy/common/configure/AliyunSmsProperties.java a/src/main/java/com/subsidy/common/configure/AliyunSmsProperties.java new file mode 100644 index 0000000..bb827e2 --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/AliyunSmsProperties.java @@ -0,0 +1,19 @@ +package com.subsidy.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; +} diff --git b/src/main/java/com/subsidy/common/configure/MybatisPlusConfig.java a/src/main/java/com/subsidy/common/configure/MybatisPlusConfig.java new file mode 100644 index 0000000..c02a5b2 --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/MybatisPlusConfig.java @@ -0,0 +1,54 @@ +package com.subsidy.common.configure; + +import com.baomidou.mybatisplus.annotation.DbType; +import com.baomidou.mybatisplus.core.config.GlobalConfig; +import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor; +import com.subsidy.common.handler.MetaHandler; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author: tuyp + * @create: 2020-08-12 12:01 + */ +@Configuration +@ConditionalOnClass(value = {PaginationInterceptor.class}) +public class MybatisPlusConfig { + + /** + * 分页 + * @return + */ + @Bean + public PaginationInterceptor paginationInterceptor(){ + PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); + paginationInterceptor.setDialectType(DbType.MYSQL.getDb()); + return paginationInterceptor; + } +// +// /** +// * 打印 sql +// */ +// @Bean +// public PerformanceInterceptor performanceInterceptor() { +// PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor(); +// //格式化sql语句 +// Properties properties = new Properties(); +// properties.setProperty("format", "false"); +// performanceInterceptor.setProperties(properties); +// return performanceInterceptor; +// } + + /** + * 自动填充功能 + * @return + */ + @Bean + public GlobalConfig globalConfig() { + GlobalConfig globalConfig = new GlobalConfig(); + globalConfig.setMetaObjectHandler(new MetaHandler()); + return globalConfig; + } + +} diff --git b/src/main/java/com/subsidy/common/configure/RemoteProperties.java a/src/main/java/com/subsidy/common/configure/RemoteProperties.java new file mode 100644 index 0000000..23a42de --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/RemoteProperties.java @@ -0,0 +1,36 @@ +package com.subsidy.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; + +/** + *

+ * 读取状态码 + *

+ * + * @author DengMin + * @date Created in 2020/08/24 + */ +@Component +@ConfigurationProperties(prefix = "meishu") +@PropertySource(value = "classpath:code.properties", encoding = "UTF-8") +public class RemoteProperties { + + private static Map codeMessage = new HashMap<>(); + + public static String getMessage(Integer code) { + return codeMessage.get(code); + } + + public Map getCodeMessage() { + return codeMessage; + } + + public void setCodeMessage(Map codeMessage) { + RemoteProperties.codeMessage = codeMessage; + } +} \ No newline at end of file diff --git b/src/main/java/com/subsidy/common/configure/RestTemplateConfig.java a/src/main/java/com/subsidy/common/configure/RestTemplateConfig.java new file mode 100644 index 0000000..c4f692f --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/RestTemplateConfig.java @@ -0,0 +1,31 @@ +package com.subsidy.common.configure; + +import org.springframework.context.annotation.Bean; +import org.springframework.http.MediaType; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.stereotype.Component; +import org.springframework.web.client.RestTemplate; + +import java.util.ArrayList; +import java.util.List; + +@Component +public class RestTemplateConfig { + + @Bean + public RestTemplate restTemplate() { + RestTemplate restTemplate = new RestTemplate(); + restTemplate.getMessageConverters().add(new WxMappingJackson2HttpMessageConverter()); + return restTemplate; + } + + public class WxMappingJackson2HttpMessageConverter extends MappingJackson2HttpMessageConverter { + public WxMappingJackson2HttpMessageConverter(){ + List mediaTypes = new ArrayList<>(); + mediaTypes.add(MediaType.TEXT_PLAIN); + mediaTypes.add(MediaType.TEXT_HTML); + setSupportedMediaTypes(mediaTypes); + } + } + +} diff --git b/src/main/java/com/subsidy/common/configure/SwaggerConfig.java a/src/main/java/com/subsidy/common/configure/SwaggerConfig.java new file mode 100644 index 0000000..01b41bd --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/SwaggerConfig.java @@ -0,0 +1,31 @@ +package com.subsidy.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; + +@Configuration +@EnableSwagger2 +public class SwaggerConfig { + @Bean + public Docket createRestApi() { + return new Docket(DocumentationType.SWAGGER_2) + .pathMapping("/") + .select() + .apis(RequestHandlerSelectors.basePackage("com.subsidy")) + .paths(PathSelectors.any()) + .build().apiInfo(new ApiInfoBuilder() + .title("学习壮业") + .description("接口文档规范") + .version("1.0") +// .contact(new Contact("啊啊啊啊","www.youkehulian.com","tcp@meishu.com")) +// .license("The Apache License") +// .licenseUrl("http://www.baidu.com") + .build()); + } +} diff --git b/src/main/java/com/subsidy/common/configure/VODConfig.java a/src/main/java/com/subsidy/common/configure/VODConfig.java new file mode 100644 index 0000000..699cad7 --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/VODConfig.java @@ -0,0 +1,25 @@ +package com.subsidy.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; +} diff --git b/src/main/java/com/subsidy/common/configure/WebConfig.java a/src/main/java/com/subsidy/common/configure/WebConfig.java new file mode 100644 index 0000000..dc0d39f --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/WebConfig.java @@ -0,0 +1,63 @@ +package com.subsidy.common.configure; + +import com.subsidy.common.interceptor.AuthenticationInterceptor; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * @author DengMin + * @date 2020/07/06 + **/ +@Configuration +public class WebConfig implements WebMvcConfigurer { + + @Autowired + private AuthenticationInterceptor authenticationInterceptor; + + /** + * 跨域支持 + * + * @param registry + */ + @Override + public void addCorsMappings(CorsRegistry registry) { + registry.addMapping("/**") +// .allowCredentials(true) + .allowedOrigins("*") + .allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS") + .allowedHeaders("*") + .maxAge(3600); + } + + /** + * 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/"); + } + + /** + * 鉴权 + * + * @param registry + */ + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(authenticationInterceptor) + .excludePathPatterns("/static/*") + .addPathPatterns("/**"); + } + + +} \ No newline at end of file diff --git b/src/main/java/com/subsidy/common/configure/WebLogAspect.java a/src/main/java/com/subsidy/common/configure/WebLogAspect.java new file mode 100644 index 0000000..0f193cd --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/WebLogAspect.java @@ -0,0 +1,58 @@ +package com.subsidy.common.configure; + +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; +import java.util.Arrays; + +@Aspect +@Component +@Order(1) +public class WebLogAspect { + + private final Logger logger = LoggerFactory.getLogger(WebLogAspect.class); + + @Pointcut("execution(public * com.subsidy.controller.*.*(..))")//切入点描述 这个是controller包的切入点 + public void controllerLog(){}//签名,可以理解成这个切入点的一个名称 + + @Pointcut("execution(public * com.subsidy.controller.*.*(..))") + public void serviceImplLog(){} + + @Before("controllerLog()") //在切入点的方法run之前要干的 + public void logBeforeController(JoinPoint joinPoint) { + + + RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes(); + //这个RequestContextHolder是Springmvc提供来获得请求的东西 + HttpServletRequest request = ((ServletRequestAttributes)requestAttributes).getRequest(); + + // 记录下请求内容 + logger.info("####requestUrl : " + request.getRequestURL().toString()); + logger.info("####requestParam : " + Arrays.toString(joinPoint.getArgs())); + + } + +// @Around("serviceImplLog()") +// public Object afterController(ProceedingJoinPoint proceedingJoinPoint) { +// +// Object result = null; +// +// try{ +// result = proceedingJoinPoint.proceed(); +// logger.info("====reulst"+result); +// }catch (Throwable e){ +// MyException myException =(MyException)e; +// throw myException; +// } +// return result; +// } + +} \ No newline at end of file diff --git b/src/main/java/com/subsidy/common/configure/WechatConfig.java a/src/main/java/com/subsidy/common/configure/WechatConfig.java new file mode 100644 index 0000000..46e2034 --- /dev/null +++ a/src/main/java/com/subsidy/common/configure/WechatConfig.java @@ -0,0 +1,24 @@ +package com.subsidy.common.configure; + + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.context.annotation.Configuration; + +@Data +@Configuration +@ConfigurationProperties(prefix = "wechat") +public class WechatConfig { + + private String appId; + + private String appSecret; + + private String msgUrl; + + private String templateId; + + private String agentId; + + +} diff --git b/src/main/java/com/subsidy/common/constant/AttendanceConstant.java a/src/main/java/com/subsidy/common/constant/AttendanceConstant.java new file mode 100644 index 0000000..1305fc9 --- /dev/null +++ a/src/main/java/com/subsidy/common/constant/AttendanceConstant.java @@ -0,0 +1,29 @@ +package com.subsidy.common.constant; + +public class AttendanceConstant { + + /** + * 创建预约api + */ + public static final String CREATE_TOPIC_URL = "https://open.api.roomis.com.cn/api/my/booking/spaces/{spaceId}/events"; + + /** + * 考勤api + */ + public static final String GET_ATTENDANCE_URL = "https://open.api.roomis.com.cn/api/attendance/{id}"; + + /** + * 创建人ID + */ + public static Long organizerId = 200000222L; + + /** + * 开始时间 + */ + public static String startTime = "07:00:00"; + + /** + * 结束时间 + */ + public static String endTime = "21:00:00"; +} diff --git b/src/main/java/com/subsidy/common/constant/Code.java a/src/main/java/com/subsidy/common/constant/Code.java new file mode 100644 index 0000000..d4a02f9 --- /dev/null +++ a/src/main/java/com/subsidy/common/constant/Code.java @@ -0,0 +1,33 @@ +package com.subsidy.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(1013, "令牌验证失败"), + OSS_ERROR(1012, "OSS文件上传异常"), + Network_ERROR(9000, "网络请求失败"), + SERVER_INTERNAL_ERROR(99999, "服务器内部错误"), + ; + + private Integer code; + + private String message; + + Code(Integer code, String message) { + this.code = code; + this.message = message; + } +} diff --git b/src/main/java/com/subsidy/common/constant/WxConstant.java a/src/main/java/com/subsidy/common/constant/WxConstant.java new file mode 100644 index 0000000..41ed23a --- /dev/null +++ a/src/main/java/com/subsidy/common/constant/WxConstant.java @@ -0,0 +1,35 @@ +package com.subsidy.common.constant; + +public class WxConstant { + + /** + * app id + */ + public static final String APPID = "wx75ec06e9ce50ef73"; + + /** + * 秘钥 + */ + public static final String SECRENT = "c039d32804278503474dfcf7cb3944b9"; + + /** + * 获取访问用户身份 + */ + public static final String GETUSERINFO = "https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?access_token={access_token}&code={code}"; + + /** + * 读取成员 + */ + public static final String GET = "https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token={access_token}&userid={userid}"; + + /** + * 获取access_token + */ + public static final String GET_SUITE_TOKEN = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={appid}&secret={secret}"; + + + /** + * 扫码登陆回调地址 + */ + public static final String QR_REDIRECT_URL = "http://massadmin.youkehulian.com"; +} diff --git b/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java a/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java new file mode 100644 index 0000000..5f8117b --- /dev/null +++ a/src/main/java/com/subsidy/common/exception/GlobalExceptionHandler.java @@ -0,0 +1,118 @@ +package com.subsidy.common.exception; + +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.configure.RemoteProperties; +import com.subsidy.common.constant.Code; +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; + +/** + * 异常处理 + * @author DengMin + * @date 2020/07/14 + **/ +@Slf4j +@RestControllerAdvice +public class GlobalExceptionHandler { + + /** + * 自定义异常 + * @param e + * @return + */ + @ExceptionHandler(value = HttpException.class) + public ResponseVO 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 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 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 validateException(MethodArgumentNotValidException e){ + final List 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 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 BindException(BindException e){ + final List 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 serverInternalError(Exception e, HttpServletRequest request) { + String url = request.getRequestURI(); + log.error("path:"+url); + log.error("---- error message: ---"+e.toString()); + return ResponseData.generateCreatedResponse(Code.SERVER_INTERNAL_ERROR.getCode(), Code.SERVER_INTERNAL_ERROR.getMessage(), url); + } +} \ No newline at end of file diff --git b/src/main/java/com/subsidy/common/exception/HttpException.java a/src/main/java/com/subsidy/common/exception/HttpException.java new file mode 100644 index 0000000..291188b --- /dev/null +++ a/src/main/java/com/subsidy/common/exception/HttpException.java @@ -0,0 +1,45 @@ +package com.subsidy.common.exception; + + +import com.subsidy.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; + } +} diff --git b/src/main/java/com/subsidy/common/handler/MetaHandler.java a/src/main/java/com/subsidy/common/handler/MetaHandler.java new file mode 100644 index 0000000..9e83fcd --- /dev/null +++ a/src/main/java/com/subsidy/common/handler/MetaHandler.java @@ -0,0 +1,26 @@ +package com.subsidy.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("createDate", LocalDateTime.now(), metaObject); + } + + @Override + public void updateFill(MetaObject metaObject) { + this.setFieldValByName("updateDate", LocalDateTime.now(), metaObject); + } +} diff --git b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java new file mode 100644 index 0000000..94f2eeb --- /dev/null +++ a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java @@ -0,0 +1,84 @@ +package com.subsidy.common.interceptor; + +import com.auth0.jwt.interfaces.Claim; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.subsidy.common.exception.HttpException; +import com.subsidy.mapper.AdministerMapper; +import com.subsidy.model.AdministerDO; +import com.subsidy.util.JwtUtil; +import com.subsidy.util.Localstorage; +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.Map; + +/** + *

+ * 鉴权拦截器 + *

+ * + * @author DengMin + * @since 2021/4/14 + */ +@Component +public class AuthenticationInterceptor implements HandlerInterceptor { + + @Autowired + private AdministerMapper administerMapper; + + @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)) { + String token = authorization; + if (authorization.startsWith("Bearer")) { + token = authorization.replace("Bearer ", ""); + } + /*Token不存在*/ + if (token == null || JwtUtil.isExpired(token) || !JwtUtil.verifyToken(token)) { + throw new HttpException(1010); + } + + Map claimMap = JwtUtil.getClaims(token); + if (claimMap != null) { + String[] role = methodAnnotation.value(); + String type = claimMap.get("type").asString(); + if (role.length > 0) { + if ("administer".equals(type)) { + AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong()); + if (administerDO != null) { + Localstorage.setUser(administerDO); + return true; + } + } else { + throw new HttpException(1010); + } + } else { + AdministerDO administerDO = administerMapper.selectById(claimMap.get("id").asLong()); + if (administerDO != null) { + Localstorage.setUser(administerDO); + return true; + } + } + } + //return true; + } + throw new HttpException(1010); + } + return true; + } +} diff --git b/src/main/java/com/subsidy/common/interceptor/LoginRequired.java a/src/main/java/com/subsidy/common/interceptor/LoginRequired.java new file mode 100644 index 0000000..19e2615 --- /dev/null +++ a/src/main/java/com/subsidy/common/interceptor/LoginRequired.java @@ -0,0 +1,20 @@ +package com.subsidy.common.interceptor; + +import java.lang.annotation.*; + +/** + *

+ * 自定义验证登陆注解 + *

+ * + * @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 diff --git b/src/main/java/com/subsidy/controller/AdministerController.java a/src/main/java/com/subsidy/controller/AdministerController.java new file mode 100644 index 0000000..6725359 --- /dev/null +++ a/src/main/java/com/subsidy/controller/AdministerController.java @@ -0,0 +1,166 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.administer.ClassDetailDTO; +import com.subsidy.dto.administer.OperatorsDTO; +import com.subsidy.model.AdministerDO; +import com.subsidy.model.ClassDictDO; +import com.subsidy.service.AdministerService; +import com.subsidy.util.ConstantUtils; +import com.subsidy.util.excel.ExcelUtil; +import com.subsidy.vo.administer.ExerciseTestVO; +import com.subsidy.vo.classdict.ClassDetailVO; +import com.subsidy.vo.member.ClassSignVO; +import com.subsidy.vo.sign.AnswerRecordVO; +import com.subsidy.vo.sign.ClassSignInfoVO; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import io.swagger.annotations.Api; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.List; + +/** + *

+ * 管理平台用户 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "管理平台用户") +@RequestMapping("/administer") +public class AdministerController { + + @Autowired + private AdministerService administerService; + + @PostMapping("/login") + @ApiOperation("登录接口 accountName password") + public ResponseVO login(@RequestBody AdministerDO administerDO){ + return ResponseData.generateCreatedResponse(0,administerService.login(administerDO)); + } + + @PostMapping("/getPermissions") + @ApiOperation("权限查询") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getPermissions() { + return ResponseData.generateCreatedResponse(0, administerService.getPermissions()); + } + + @PostMapping("/administers") + @ApiOperation("查询所有运营者 { userName pageNum pageSize }") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){ + return ResponseData.generateCreatedResponse(0,administerService.operators(operatorsDTO)); + } + + @PostMapping("addAdminister") + @ApiOperation("添加运营者 id userName 名称 accountName 账号 ") + public ResponseVO addAdminister(@RequestBody AdministerDO administerDO){ + return ResponseData.generateCreatedResponse(0,administerService.addAdminister(administerDO)); + } + + @PostMapping("deleteAdminister") + @ApiOperation("添加运营者 id ") + public ResponseVO deleteAdminister(@RequestBody AdministerDO administerDO){ + return ResponseData.generateCreatedResponse(0,administerService.deleteAdminister(administerDO)); + } + + @PostMapping("updateAdminister") + @ApiOperation("编辑运营者 id userName 名称 accountName 账号 password") + public ResponseVO updateAdminister(@RequestBody AdministerDO administerDO){ + return ResponseData.generateCreatedResponse(0,administerService.updateAdminister(administerDO)); + } + + + @PostMapping("classSummary") + @ApiOperation("课程汇总 id 班级id ") + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO classSummary(@RequestBody ClassDetailDTO classDetailDTO){ + return ResponseData.generateCreatedResponse(0,administerService.classSummary(classDetailDTO)); + } + + @PostMapping("classDetail") + @ApiOperation("班级管理--班级成员 id 班级id userName") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO classDetail(@RequestBody ClassDetailDTO classDetailDTO){ + return ResponseData.generateCreatedResponse(0,administerService.classDetail(classDetailDTO)); + } + + @PostMapping("exportClassDetail") + @ApiOperation("班级管理--班级成员--导出 id 班级id userName") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public void exportClassDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ + classDetailDTO.setFlag(true); + administerService.exportClassDetail(classDetailDTO); + } + + @PostMapping("signDetail") + @ApiOperation("班级管理--注册签到 id 班级id userName") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO signDetail(@RequestBody ClassDetailDTO classDetailDTO){ + return ResponseData.generateCreatedResponse(0,administerService.signDetail(classDetailDTO)); + } + + @PostMapping("exportSignDetail") + @ApiOperation("班级管理--注册签到 id 班级id userName") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public void exportSignDetail(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ + classDetailDTO.setFlag(true); + administerService.exportSignDetail(classDetailDTO); + } + + @PostMapping("exerciseTest") + @ApiOperation("班级管理--测评成绩 id 班级id userName") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO exerciseTest(@RequestBody ClassDetailDTO classDetailDTO){ + return ResponseData.generateCreatedResponse(0,administerService.exerciseTest(classDetailDTO)); + } + + @PostMapping("exportExerciseTest") + @ApiOperation("班级管理--测评成绩 id 班级id userName") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public void exportExerciseTest(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ + classDetailDTO.setFlag(true); + administerService.exportExerciseTest(classDetailDTO); + } + + @PostMapping("answerRecord") + @ApiOperation("班级管理--答疑 id 班级id userName") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO answerRecord(@RequestBody ClassDetailDTO classDetailDTO){ + return ResponseData.generateCreatedResponse(0,administerService.answerRecord(classDetailDTO)); + } + + @PostMapping("exportAnswerRecord") + @ApiOperation("班级管理--答疑 id 班级id userName") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public void exportAnswerRecord(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ + classDetailDTO.setFlag(true); + administerService.exportAnswerRecord(classDetailDTO); + } + + @PostMapping("exportZip") + @ApiOperation("下载压缩包 id 班级id") + @CrossOrigin + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public void exportZip(@RequestBody ClassDetailDTO classDetailDTO)throws Exception{ + administerService.export(classDetailDTO); + } + + @PostMapping("importMember") + @ApiOperation("导入学生 {companyId 公司id file}") + public ResponseVO importMember(Long companyId,@RequestParam("file") MultipartFile file){ + return ResponseData.generateCreatedResponse(0,administerService.importMember(companyId,file)); + } + +} diff --git b/src/main/java/com/subsidy/controller/AnsweringQuestionController.java a/src/main/java/com/subsidy/controller/AnsweringQuestionController.java new file mode 100644 index 0000000..79f70ef --- /dev/null +++ a/src/main/java/com/subsidy/controller/AnsweringQuestionController.java @@ -0,0 +1,57 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.dto.GetCourseQuestionDTO; +import com.subsidy.model.AnsweringQuestionDO; +import com.subsidy.service.AnsweringQuestionService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import io.swagger.annotations.Api; + +/** + *

+ * 问题答疑表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +@RestController +@Api(tags = "问题答疑表") +@RequestMapping("/answeringQuestion") +public class AnsweringQuestionController { + + @Autowired + private AnsweringQuestionService answeringQuestionService; + + @PostMapping("getCourseQuestion") + @ApiOperation("获取某个课程的答疑 {classId pageSize pageNum memberId}") + public ResponseVO getCourseQuestion(@RequestBody GetCourseQuestionDTO getCourseQuestionDTO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.getCourseQuestion(getCourseQuestionDTO)); + } + + @PostMapping("addQuestion") + @ApiOperation("新增答疑 {classId askId title}") + public ResponseVO addQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.addQuestion(answeringQuestionDO)); + } + + @PostMapping("deleteQuestion") + @ApiOperation("删除答疑 {id}") + public ResponseVO deleteQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0,answeringQuestionService.deleteQuestion(answeringQuestionDO)); + } + + @PostMapping("updateQuestion") + @ApiOperation("编辑答疑 {id answerId answer}") + public ResponseVO updateQuestion(@RequestBody AnsweringQuestionDO answeringQuestionDO){ + return ResponseData.generateCreatedResponse(0, answeringQuestionService.updateQuestion(answeringQuestionDO)); + } + + + +} diff --git b/src/main/java/com/subsidy/controller/CategoryController.java a/src/main/java/com/subsidy/controller/CategoryController.java new file mode 100644 index 0000000..494576a --- /dev/null +++ a/src/main/java/com/subsidy/controller/CategoryController.java @@ -0,0 +1,71 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.category.GetCategoriesDTO; +import com.subsidy.model.CategoryDO; +import com.subsidy.service.CategoryService; +import com.subsidy.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 类目名称 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "类目") +@RequestMapping("/category") +public class CategoryController { + + @Autowired + private CategoryService categoryService; + + @PostMapping("getCategories") + @ApiOperation("查询类目 ** name 类目名称 companyId pageSize pageNum") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getCategories(@RequestBody GetCategoriesDTO getCategoriesDTO){ + return ResponseData.generateCreatedResponse(0,categoryService.getCategories(getCategoriesDTO)); + } + + @PostMapping("getAll") + @ApiOperation("查询所有类目 **companyId") + public ResponseVO getAll(@RequestBody GetCategoriesDTO getCategoriesDTO){ + return ResponseData.generateCreatedResponse(0,categoryService.getAll(getCategoriesDTO)); + } + + @PostMapping("addCategory") + @ApiOperation("新增类目 **name companyId") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addCategory(@RequestBody CategoryDO categoryDO){ + return ResponseData.generateCreatedResponse(0,categoryService.addCategory(categoryDO)); + } + + @PostMapping("deleteCategory") + @ApiOperation("删除类目 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteCategory(@RequestBody CategoryDO categoryDO){ + return ResponseData.generateCreatedResponse(0,categoryService.deleteCategory(categoryDO)); + } + + @PostMapping("updateCategory") + @ApiOperation("修改类目 ** id name companyId") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateCategory(@RequestBody CategoryDO categoryDO){ + return ResponseData.generateCreatedResponse(0,categoryService.updateCategory(categoryDO)); + } + + +} diff --git b/src/main/java/com/subsidy/controller/ClassDictController.java a/src/main/java/com/subsidy/controller/ClassDictController.java new file mode 100644 index 0000000..3c73ada --- /dev/null +++ a/src/main/java/com/subsidy/controller/ClassDictController.java @@ -0,0 +1,97 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.classDict.AddClassDTO; +import com.subsidy.dto.classDict.AddMemberToClassDTO; +import com.subsidy.dto.classDict.GetAllClassesDTO; +import com.subsidy.dto.classDict.GetSpareMembersDTO; +import com.subsidy.model.ClassDictDO; +import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.service.ClassDictService; +import com.subsidy.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 班级id 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +@RestController +@Api(tags = "班级") +@RequestMapping("/classDict") +public class ClassDictController { + + @Autowired + private ClassDictService classDictService; + + @PostMapping("getAllClasses") + @ApiOperation("获取某老师下的所有课程 ** companyId 所选企业id className 班级名称") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllClasses(@RequestBody ClassDictDO classDictDO){ + return ResponseData.generateCreatedResponse(0,classDictService.getAllClasses(classDictDO)); + } + + @PostMapping("deleteClasses") + @ApiOperation("删除课程 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteClasses(@RequestBody ClassDictDO classDictDO){ + return ResponseData.generateCreatedResponse(0,classDictService.deleteClasses(classDictDO)); + } + + @PostMapping("addClass") + @ApiOperation("添加课程 ** userId:登录人id companyId courseId className startDate endDate") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addClass(@RequestBody AddClassDTO addClassDTO){ + return ResponseData.generateCreatedResponse(0,classDictService.addClass(addClassDTO)); + } + + @PostMapping("updateClass") + @ApiOperation("修改课程 id ** companyId courseId className startDate endDate") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateClass(@RequestBody ClassDictDO classDictDO){ + return ResponseData.generateCreatedResponse(0,classDictService.updateClass(classDictDO)); + } + + @PostMapping("classDetail") + @ApiOperation("获取一个班级详情 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO classDetail(@RequestBody ClassDictDO classDictDO){ + return ResponseData.generateCreatedResponse(0,classDictService.classDetail(classDictDO)); + } + + @PostMapping("removeMember") + @ApiOperation("移除班级 classId 班级id memberId人员id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO removeMember(@RequestBody ClassMemberMappingDO classMemberMappingDO){ + return ResponseData.generateCreatedResponse(0,classDictService.removeMember(classMemberMappingDO)); + } + + @PostMapping("getSpareMembers") + @ApiOperation("获取不在某班级的某企业里所有成员 ** companyId 企业id classId 班级id") + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getSpareMembers(@RequestBody GetSpareMembersDTO getSpareMembersDTO){ + return ResponseData.generateCreatedResponse(0,classDictService.getSpareMembers(getSpareMembersDTO)); + } + + @PostMapping("addMemberToClass") + @ApiOperation("将某个成员加入到某个班级里 classId memberIds []") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addMemberToClass(@RequestBody AddMemberToClassDTO addMemberToClassDTO){ + return ResponseData.generateCreatedResponse(0,classDictService.addMemberToClass(addMemberToClassDTO)); + } + + +} diff --git b/src/main/java/com/subsidy/controller/ClassMemberMappingController.java a/src/main/java/com/subsidy/controller/ClassMemberMappingController.java new file mode 100644 index 0000000..ec9096f --- /dev/null +++ a/src/main/java/com/subsidy/controller/ClassMemberMappingController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 班级成员映射表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +@RestController +@Api(tags = "班级成员映射表") +@RequestMapping("/class-member-mapping-do") +public class ClassMemberMappingController { + +} diff --git b/src/main/java/com/subsidy/controller/CompanyDictController.java a/src/main/java/com/subsidy/controller/CompanyDictController.java new file mode 100644 index 0000000..49e7a97 --- /dev/null +++ a/src/main/java/com/subsidy/controller/CompanyDictController.java @@ -0,0 +1,66 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.administer.OperatorsDTO; +import com.subsidy.dto.company.AddCompanyDTO; +import com.subsidy.model.AdministerDO; +import com.subsidy.model.CompanyDictDO; +import com.subsidy.service.CompanyDictService; +import com.subsidy.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 企业字典表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-25 + */ +@RestController +@Api(tags = "企业字典表") +@RequestMapping("/companyDict") +public class CompanyDictController { + + @Autowired + private CompanyDictService companyDictService; + + @PostMapping("/administers") + @ApiOperation("查询所有企业 {id companyName pageNum pageSize }") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO operators(@RequestBody OperatorsDTO operatorsDTO){ + return ResponseData.generateCreatedResponse(0,companyDictService.operators(operatorsDTO)); + } + + @PostMapping("addCompany") + @ApiOperation("添加企业 {accountName:账号 companyName:企业名称 shortName 简称 banner:标语 field:领域 role 1:超级管理员 2:普通成员}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addOperator(@RequestBody AddCompanyDTO addCompanyDTO){ + return ResponseData.generateCreatedResponse(0,companyDictService.addOperator(addCompanyDTO)); + } + + @PostMapping("deleteCompany") + @ApiOperation("删除企业 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteAdminister(@RequestBody CompanyDictDO companyDictDO){ + return ResponseData.generateCreatedResponse(0,companyDictService.deleteAdminister(companyDictDO)); + } + + @PostMapping("updateCompany") + @ApiOperation("修改企业 id accountName:账号 companyName:企业名称 shortName 简称 banner:标语 field:领域 role 1:超级管理员 2:普通成员") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateAdminister(@RequestBody AddCompanyDTO addCompanyDTO){ + return ResponseData.generateCreatedResponse(0,companyDictService.updateAdminister(addCompanyDTO)); + } + +} diff --git b/src/main/java/com/subsidy/controller/CourseContentController.java a/src/main/java/com/subsidy/controller/CourseContentController.java new file mode 100644 index 0000000..6fc1c10 --- /dev/null +++ a/src/main/java/com/subsidy/controller/CourseContentController.java @@ -0,0 +1,65 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.model.CourseContentDO; +import com.subsidy.model.VodDictDO; +import com.subsidy.service.CourseContentService; +import com.subsidy.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 课程目录表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "课程目录表") +@RequestMapping("/courseContent") +public class CourseContentController { + + @Autowired + private CourseContentService courseContentService; + + @PostMapping("getContents") + @ApiOperation("获取课程目录 {courseId}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getContents(@RequestBody CourseContentDO courseContentDO){ + return ResponseData.generateCreatedResponse(0,courseContentService.getContents(courseContentDO)); + } + + @PostMapping("deleteContent") + @ApiOperation("删除一个目录 {id} ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteContent(@RequestBody CourseContentDO courseContentDO){ + return ResponseData.generateCreatedResponse(0,courseContentService.deleteContent(courseContentDO)); + } + + @PostMapping("addContent") + @ApiOperation("添加一个目录 {courseId content}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addContent(@RequestBody CourseContentDO courseContentDO){ + return ResponseData.generateCreatedResponse(0,courseContentService.addContent(courseContentDO)); + } + + @PostMapping("updateContent") + @ApiOperation("更新一个目录 {id courseId content}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateContent(@RequestBody CourseContentDO courseContentDO){ + return ResponseData.generateCreatedResponse(0,courseContentService.updateContent(courseContentDO)); + } + + +} diff --git b/src/main/java/com/subsidy/controller/CourseDictController.java a/src/main/java/com/subsidy/controller/CourseDictController.java new file mode 100644 index 0000000..570cd58 --- /dev/null +++ a/src/main/java/com/subsidy/controller/CourseDictController.java @@ -0,0 +1,68 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.course.QueryCoursesDTO; +import com.subsidy.model.CourseDictDO; +import com.subsidy.service.CourseDictService; +import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "课程表") +@RequestMapping("/courseDict") +public class CourseDictController { + + @Autowired + private CourseDictService courseDictService; + + @PostMapping("addCourse") + @ApiOperation("添加课程 **companyId courseName categoryId courseType courseSource") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addCourse(@RequestBody CourseDictDO courseDictDO){ + return ResponseData.generateCreatedResponse(0,courseDictService.addCourse(courseDictDO)); + } + + @PostMapping("deleteCourse") + @ApiOperation("删除课程 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteCourse(@RequestBody CourseDictDO courseDictDO){ + return ResponseData.generateCreatedResponse(0,courseDictService.deleteCourse(courseDictDO)); + } + + @PostMapping("queryCourses") + @ApiOperation("平台运营者--查询课程 pageSize pageNum administerId companyId courseName categoryId courseType courseSource") + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO queryCourses(@RequestBody QueryCoursesDTO queryCoursesDTO){ + return ResponseData.generateCreatedResponse(0,courseDictService.queryCourses(queryCoursesDTO)); + } + + @PostMapping("updateCourses") + @ApiOperation("编辑课程 id ** companyId courseName categoryId courseType courseSource") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateCourses(@RequestBody CourseDictDO courseDictDO){ + return ResponseData.generateCreatedResponse(0,courseDictService.updateCourses(courseDictDO)); + } + + @PostMapping("queryCompanyCourse") + @ApiOperation("企业内容管理-- { ** companyId 所选企业id}") + public ResponseVO queryCompanyCourse(@RequestBody QueryCoursesDTO queryCoursesDTO){ + return ResponseData.generateCreatedResponse(0,courseDictService.queryCompanyCourse(queryCoursesDTO)); + } + + +} diff --git b/src/main/java/com/subsidy/controller/DepartmentDictController.java a/src/main/java/com/subsidy/controller/DepartmentDictController.java new file mode 100644 index 0000000..3958245 --- /dev/null +++ a/src/main/java/com/subsidy/controller/DepartmentDictController.java @@ -0,0 +1,65 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.service.DepartmentDictService; +import com.subsidy.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 部门字典表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "部门字典表") +@RequestMapping("/departmentDict") +public class DepartmentDictController { + + @Autowired + private DepartmentDictService departmentDictService; + + @PostMapping("getDepartments") + @ApiOperation("获取所有部门 companyId 企业id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getDepartments(@RequestBody DepartmentDictDO departmentDictDO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.getDepartments(departmentDictDO)); + } + + @PostMapping("addDepartment") + @ApiOperation("添加部门 ** companyId departmentName leaderName parentId 父节点") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addDepartment(@RequestBody DepartmentDictDO departmentDictDO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.addDepartment(departmentDictDO)); + } + + @PostMapping("deleteDepartment") + @ApiOperation("删除部门 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteDepartment(@RequestBody DepartmentDictDO departmentDictDO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.deleteDepartment(departmentDictDO)); + } + + @PostMapping("updateDepartment") + @ApiOperation("编辑部门 id ** companyId departmentName leaderName parentId") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateDepartment(@RequestBody DepartmentDictDO departmentDictDO){ + return ResponseData.generateCreatedResponse(0,departmentDictService.updateDepartment(departmentDictDO)); + } + + + +} diff --git b/src/main/java/com/subsidy/controller/ExerciseDictController.java a/src/main/java/com/subsidy/controller/ExerciseDictController.java new file mode 100644 index 0000000..192755e --- /dev/null +++ a/src/main/java/com/subsidy/controller/ExerciseDictController.java @@ -0,0 +1,76 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.exercise.GetAllExercisesDTO; +import com.subsidy.dto.exercise.SubmitDTO; +import com.subsidy.model.CourseDictDO; +import com.subsidy.model.ExerciseDictDO; +import com.subsidy.service.ExerciseDictService; +import com.subsidy.util.ConstantUtils; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import io.swagger.annotations.Api; + +/** + *

+ * 习题库 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +@RestController +@Api(tags = "习题库") +@RequestMapping("/exerciseDict") +public class ExerciseDictController { + + @Autowired + private ExerciseDictService exerciseDictService; + + @PostMapping("getAllExercises") + @ApiOperation("查询所有题目 {courseId 课程id exerciseType 题目类型 difficulty 难度 title 题目 pageSize pageNum}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAllExercises(@RequestBody GetAllExercisesDTO getAllExercisesDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.getAllExercises(getAllExercisesDTO)); + } + + @PostMapping("addExercise") + @ApiOperation("添加题目 {courseId 课程id exerciseType 题目类型 difficulty 难度 title题目 items 选项 rightAnswer 正确答案 }") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addExercise(@RequestBody ExerciseDictDO exerciseDictDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.addExercise(exerciseDictDO)); + } + + @PostMapping("deleteExercise") + @ApiOperation("删除题目 id") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteExercise(@RequestBody ExerciseDictDO exerciseDictDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.deleteExercise(exerciseDictDO)); + } + + @PostMapping("updateExercise") + @ApiOperation("修改题目 id exerciseType 题目类型 difficulty 难度 title题目 items 选项 rightAnswer 正确答案") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateExercise(@RequestBody ExerciseDictDO exerciseDictDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.updateExercise(exerciseDictDO)); + } + + @PostMapping("getCourseExercises") + @ApiOperation("获取课程的习题 id 课程id") + public ResponseVO getCourseExercises(@RequestBody CourseDictDO courseDictDO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.getCourseExercises(courseDictDO)); + } + + @PostMapping("submit") + @ApiOperation("提交答案 {memberId 成员id classId课程 courseId 课程id memberExerciseVOS [ id selectAnswer ]} ") + public ResponseVO submit(@RequestBody SubmitDTO submitDTO){ + return ResponseData.generateCreatedResponse(0,exerciseDictService.submit(submitDTO)); + } + + +} diff --git b/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java a/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java new file mode 100644 index 0000000..8c7191f --- /dev/null +++ a/src/main/java/com/subsidy/controller/ExerciseDoneResultController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 学生课程习题完成情况 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-15 + */ +@RestController +@Api(tags = "学生课程习题完成情况") +@RequestMapping("/exerciseDoneResult") +public class ExerciseDoneResultController { + +} diff --git b/src/main/java/com/subsidy/controller/FileDictController.java a/src/main/java/com/subsidy/controller/FileDictController.java new file mode 100644 index 0000000..61f84ba --- /dev/null +++ a/src/main/java/com/subsidy/controller/FileDictController.java @@ -0,0 +1,64 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.model.FileDictDO; +import com.subsidy.model.VodDictDO; +import com.subsidy.service.FileDictService; +import com.subsidy.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 课件表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "课件表") +@RequestMapping("/fileDict") +public class FileDictController { + + @Autowired + private FileDictService fileDictService; + + @PostMapping("getContendFiles") + @ApiOperation("获取目录下的视频 {contentId fileName}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getContendFiles(@RequestBody FileDictDO fileDictDO){ + return ResponseData.generateCreatedResponse(0,fileDictService.getContendFiles(fileDictDO)); + } + + @PostMapping("deleteFile") + @ApiOperation("删除视频 id ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteFile(@RequestBody FileDictDO fileDictDO){ + return ResponseData.generateCreatedResponse(0,fileDictService.deleteFile(fileDictDO)); + } + + @PostMapping("addFile") + @ApiOperation("新增视频 contentId fileName fileSize fileType fileUrl") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addFile(@RequestBody FileDictDO fileDictDO){ + return ResponseData.generateCreatedResponse(0,fileDictService.addFile(fileDictDO)); + } + + @PostMapping("updateFile") + @ApiOperation("新增视频 id contentId fileName fileSize fileType fileUrl") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateFile(@RequestBody FileDictDO fileDictDO){ + return ResponseData.generateCreatedResponse(0,fileDictService.updateFile(fileDictDO)); + } + +} diff --git b/src/main/java/com/subsidy/controller/MemberController.java a/src/main/java/com/subsidy/controller/MemberController.java new file mode 100644 index 0000000..1a3d061 --- /dev/null +++ a/src/main/java/com/subsidy/controller/MemberController.java @@ -0,0 +1,124 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.administer.VerifyCodeDTO; +import com.subsidy.dto.member.AddMemberDTO; +import com.subsidy.dto.member.ContentMemberDTO; +import com.subsidy.dto.member.GetAllDTO; +import com.subsidy.dto.member.StudyHistoryDTO; +import com.subsidy.model.MemberDO; +import com.subsidy.service.MemberService; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.member.ContentVodVO; +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 io.swagger.annotations.Api; + +/** + *

+ * 学生表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "学生表") +@RequestMapping("/member") +public class MemberController { + + @Autowired + private MemberService memberService; + + @PostMapping("getAll") + @ApiOperation("查询某部门成员 pageNum pageSize departmentId userName status") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getAll(@RequestBody GetAllDTO getAllDTO){ + return ResponseData.generateCreatedResponse(0,memberService.getAll(getAllDTO)); + } + + @PostMapping("deleteMember") + @ApiOperation("删除成员 id ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteMember(@RequestBody MemberDO memberDO){ + return ResponseData.generateCreatedResponse(0,memberService.deleteMember(memberDO)); + } + + @PostMapping("addMember") + @ApiOperation("新增成员 departmentId userName accountName telephone gender image idCard") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addMember(@RequestBody AddMemberDTO addMemberDTO){ + return ResponseData.generateCreatedResponse(0,memberService.addMember(addMemberDTO)); + } + + @PostMapping("updateMember") + @ApiOperation("编辑成员 {id departmentId userName accountName telephone gender image idCard status}") + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateMember(@RequestBody AddMemberDTO addMemberDTO){ + return ResponseData.generateCreatedResponse(0,memberService.updateMember(addMemberDTO)); + } + + @PostMapping(value = "/login") + @ApiOperation("手机端:登录:telephone/手机号, verifyCode/验证码") + public ResponseVO login(@RequestBody VerifyCodeDTO verifyCodeDTO) { + return ResponseData.generateCreatedResponse(0, memberService.login(verifyCodeDTO)); + } + + @PostMapping("passwordLogin") + @ApiOperation("手机端:密码登录 {accountName password}") + public ResponseVO passwordLogin(@RequestBody MemberDO memberDO){ + return ResponseData.generateCreatedResponse(0,memberService.passwordLogin(memberDO)); + } + + @PostMapping("updatePassword") + @ApiOperation("修改密码 {id password}") + public ResponseVO updatePassword(@RequestBody MemberDO memberDO){ + return ResponseData.generateCreatedResponse(0,memberService.updatePassword(memberDO)); + } + + @PostMapping("studyPage") + @ApiOperation("手机端:学习主页 id 学员id") + public ResponseVO studyPage(@RequestBody MemberDO memberDO){ + return ResponseData.generateCreatedResponse(0,memberService.studyPage(memberDO)); + } + + @PostMapping("contentVod") + @ApiOperation("手机端:目录+视频 courseId 课程 memberId 学员id") + public ResponseVO contentVod(@RequestBody ContentMemberDTO contentVodDTO){ + return ResponseData.generateCreatedResponse(0,memberService.contentVod(contentVodDTO)); + } + + @PostMapping("contentFiles") + @ApiOperation("手机端:目录+课件 courseId 课程 memberId 学员id") + public ResponseVO contentFiles(@RequestBody ContentMemberDTO contentMemberDTO){ + return ResponseData.generateCreatedResponse(0,memberService.contentFiles(contentMemberDTO)); + } + + @PostMapping("studyHistory") + @ApiOperation("学习记录 id 成员id pageSize pageNum") + public ResponseVO studyHistory(@RequestBody StudyHistoryDTO studyHistoryDTO){ + return ResponseData.generateCreatedResponse(0,memberService.studyHistory(studyHistoryDTO)); + } + + @PostMapping("getCourseTest") + @ApiOperation("获取课程下的测试情况 {memberId 成员id courseId 课程id classId}") + public ResponseVO getCourseTest(@RequestBody ContentMemberDTO contentMemberDTO){ + return ResponseData.generateCreatedResponse(0,memberService.getCourseTest(contentMemberDTO)); + } + + @PostMapping("getStudyInfo") + @ApiOperation("获取学生完成课程情况 id 学员id") + public ResponseVO getStudyInfo(@RequestBody MemberDO memberDO){ + return ResponseData.generateCreatedResponse(0,memberService.getStudyInfo(memberDO)); + } + + +} diff --git b/src/main/java/com/subsidy/controller/MemberDepartmentMappingController.java a/src/main/java/com/subsidy/controller/MemberDepartmentMappingController.java new file mode 100644 index 0000000..640c491 --- /dev/null +++ a/src/main/java/com/subsidy/controller/MemberDepartmentMappingController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 老师部门映射表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-11-01 + */ +@RestController +@Api(tags = "老师部门映射表") +@RequestMapping("/member-department-mapping-do") +public class MemberDepartmentMappingController { + +} diff --git b/src/main/java/com/subsidy/controller/PermissionsDictController.java a/src/main/java/com/subsidy/controller/PermissionsDictController.java new file mode 100644 index 0000000..c257813 --- /dev/null +++ a/src/main/java/com/subsidy/controller/PermissionsDictController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 权限表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "权限表") +@RequestMapping("/permissions-dict-do") +public class PermissionsDictController { + +} diff --git b/src/main/java/com/subsidy/controller/RoleAdministerMappingController.java a/src/main/java/com/subsidy/controller/RoleAdministerMappingController.java new file mode 100644 index 0000000..bfc1119 --- /dev/null +++ a/src/main/java/com/subsidy/controller/RoleAdministerMappingController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "") +@RequestMapping("/role-administer-mapping-do") +public class RoleAdministerMappingController { + +} diff --git b/src/main/java/com/subsidy/controller/RoleDictController.java a/src/main/java/com/subsidy/controller/RoleDictController.java new file mode 100644 index 0000000..76b225c --- /dev/null +++ a/src/main/java/com/subsidy/controller/RoleDictController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 角色表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "角色表") +@RequestMapping("/role-dict-do") +public class RoleDictController { + +} diff --git b/src/main/java/com/subsidy/controller/RolePermissionMappingController.java a/src/main/java/com/subsidy/controller/RolePermissionMappingController.java new file mode 100644 index 0000000..a17f192 --- /dev/null +++ a/src/main/java/com/subsidy/controller/RolePermissionMappingController.java @@ -0,0 +1,22 @@ +package com.subsidy.controller; + + +import org.springframework.web.bind.annotation.RequestMapping; + +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *

+ * 系统用户角色表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "系统用户角色表") +@RequestMapping("/role-permission-mapping-do") +public class RolePermissionMappingController { + +} diff --git b/src/main/java/com/subsidy/controller/SignInRecordController.java a/src/main/java/com/subsidy/controller/SignInRecordController.java new file mode 100644 index 0000000..d2036b5 --- /dev/null +++ a/src/main/java/com/subsidy/controller/SignInRecordController.java @@ -0,0 +1,64 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.member.GetMemberSignInfoDTO; +import com.subsidy.dto.sign.ClassSignInfoDTO; +import com.subsidy.dto.sign.SignInDTO; +import com.subsidy.model.MemberDO; +import com.subsidy.model.SignInRecordDO; +import com.subsidy.service.SignInRecordService; +import com.subsidy.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 学生签到表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-18 + */ +@RestController +@Api(tags = "学生签到表") +@RequestMapping("/signIn") +public class SignInRecordController { + + @Autowired + private SignInRecordService signInRecordService; + + @PostMapping("getMemberSignInfo") + @ApiOperation("获取某个成员的签到记录 id 成员id pageSize pageNum") + public ResponseVO getMemberSignInfo(@RequestBody GetMemberSignInfoDTO getMemberSignInfoDTO){ + return ResponseData.generateCreatedResponse(0,signInRecordService.getMemberSignInfo(getMemberSignInfoDTO)); + } + + @PostMapping("signIn") + @ApiOperation("签到 memberId") + public ResponseVO signIn(@RequestBody SignInRecordDO signInRecordDO){ + return ResponseData.generateCreatedResponse(0,signInRecordService.signIn(signInRecordDO)); + } + + @PostMapping("classStudyHistory") + @ApiOperation("校区学习记录 id 校区id className courseName pageSize pageNum") + //@LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO classSignInfo(@RequestBody ClassSignInfoDTO classSignInfoDTO){ + return ResponseData.generateCreatedResponse(0,signInRecordService.classSignInfo(classSignInfoDTO)); + } + + @PostMapping("signInStatus") + @ApiOperation("判断学生当天有没有打卡 {memberId 学生id}") + public ResponseVO signInStatus(@RequestBody SignInRecordDO signInRecordDO){ + return ResponseData.generateCreatedResponse(0,signInRecordService.signInStatus(signInRecordDO)); + } + +} diff --git b/src/main/java/com/subsidy/controller/SmsVerifyCodeController.java a/src/main/java/com/subsidy/controller/SmsVerifyCodeController.java new file mode 100644 index 0000000..e8f1d91 --- /dev/null +++ a/src/main/java/com/subsidy/controller/SmsVerifyCodeController.java @@ -0,0 +1,41 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.dto.sms.SendVerifyCodeDTO; +import com.subsidy.service.SmsVerifyCodeService; +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 io.swagger.annotations.Api; + +/** + *

+ * 短信验证码记录表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +@RestController +@Api(tags = "短信验证码记录表") +@RequestMapping("/smsVerify") +public class SmsVerifyCodeController { + + @Autowired + private SmsVerifyCodeService smsVerifyCodeService; + + @PostMapping(value = "/send") + @ApiOperation("发送短信验证码 {telephone} ") + public ResponseVO sendVerifyCode(@RequestBody SendVerifyCodeDTO sendVerifyCodeDTO ) { + smsVerifyCodeService.sendVerifyCode(sendVerifyCodeDTO); + return ResponseData.generateCreatedResponse(0); + } + +} + diff --git b/src/main/java/com/subsidy/controller/VodDictController.java a/src/main/java/com/subsidy/controller/VodDictController.java new file mode 100644 index 0000000..f797c41 --- /dev/null +++ a/src/main/java/com/subsidy/controller/VodDictController.java @@ -0,0 +1,71 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.content.GetContendVodsDTO; +import com.subsidy.model.VodDictDO; +import com.subsidy.service.VodDictService; +import com.subsidy.util.ConstantUtils; +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 io.swagger.annotations.Api; + +/** + *

+ * 视频表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@RestController +@Api(tags = "视频表") +@RequestMapping("/vodDict") +public class VodDictController { + + @Autowired + private VodDictService vodDictService; + + @PostMapping("/signature") + @ApiOperation("获取签名") + public ResponseVO signature()throws Exception{ + return ResponseData.generateCreatedResponse(0,vodDictService.signature()); + } + + @PostMapping("getContendVods") + @ApiOperation("获取目录下的视频 {contentId vodName}") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO getContendVods(@RequestBody GetContendVodsDTO getContendVodsDTO){ + return ResponseData.generateCreatedResponse(0,vodDictService.getContendVods(getContendVodsDTO)); + } + + @PostMapping("deleteVod") + @ApiOperation("删除视频 id ") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.deleteVod(vodDictDO)); + } + + @PostMapping("addVod") + @ApiOperation("新增视频 contentId vodName vodLength vodType vodSize vodUrl vodCode") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO addVod(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.addVod(vodDictDO)); + } + + @PostMapping("updateVod") + @ApiOperation("新增视频 id contentId vodName vodLength vodType vodSize vodUrl vodCode") + @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE}) + public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO){ + return ResponseData.generateCreatedResponse(0,vodDictService.updateVod(vodDictDO)); + } + + +} diff --git b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java new file mode 100644 index 0000000..9d9b44d --- /dev/null +++ a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java @@ -0,0 +1,40 @@ +package com.subsidy.controller; + + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.model.VodPlayHistoryDO; +import com.subsidy.service.VodPlayHistoryService; +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 io.swagger.annotations.Api; + +/** + *

+ * 视频播放历史记录表 前端控制器 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +@RestController +@Api(tags = "视频播放历史记录表") +@RequestMapping("/vodPlayHistory") +public class VodPlayHistoryController { + + @Autowired + private VodPlayHistoryService vodPlayHistoryService; + + @PostMapping("insertHistory") + @ApiOperation("记录学生看视频位置 classId班级id vodId 视频id memberId 成员id playLength 播放时长 playRecord 位点") + public ResponseVO insertHistory(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){ + return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistory(vodPlayHistoryDO)); + } + + +} diff --git b/src/main/java/com/subsidy/dto/GetCourseQuestionDTO.java a/src/main/java/com/subsidy/dto/GetCourseQuestionDTO.java new file mode 100644 index 0000000..e544f88 --- /dev/null +++ a/src/main/java/com/subsidy/dto/GetCourseQuestionDTO.java @@ -0,0 +1,16 @@ +package com.subsidy.dto; + +import lombok.Data; + +@Data +public class GetCourseQuestionDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long classId; + + private Long memberId; + +} diff --git b/src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java a/src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java new file mode 100644 index 0000000..4615d99 --- /dev/null +++ a/src/main/java/com/subsidy/dto/administer/ClassDetailDTO.java @@ -0,0 +1,18 @@ +package com.subsidy.dto.administer; + +import lombok.Data; + +@Data +public class ClassDetailDTO { + + private Long id; + + private Integer pageSize; + + private Integer pageNum; + + private String userName; + + Boolean flag; + +} diff --git b/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java new file mode 100644 index 0000000..4e3ecbc --- /dev/null +++ a/src/main/java/com/subsidy/dto/administer/OperatorsDTO.java @@ -0,0 +1,20 @@ +package com.subsidy.dto.administer; + +import lombok.Data; + +@Data +public class OperatorsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Integer role; + + private String companyName; + + private String userName; + + private Integer id; + +} diff --git b/src/main/java/com/subsidy/dto/administer/VerifyCodeDTO.java a/src/main/java/com/subsidy/dto/administer/VerifyCodeDTO.java new file mode 100644 index 0000000..2d3dd68 --- /dev/null +++ a/src/main/java/com/subsidy/dto/administer/VerifyCodeDTO.java @@ -0,0 +1,11 @@ +package com.subsidy.dto.administer; + +import lombok.Data; + +@Data +public class VerifyCodeDTO { + + private String telephone; + + private String verifyCode; +} diff --git b/src/main/java/com/subsidy/dto/category/GetCategoriesDTO.java a/src/main/java/com/subsidy/dto/category/GetCategoriesDTO.java new file mode 100644 index 0000000..f7fee2e --- /dev/null +++ a/src/main/java/com/subsidy/dto/category/GetCategoriesDTO.java @@ -0,0 +1,16 @@ +package com.subsidy.dto.category; + +import lombok.Data; + +@Data +public class GetCategoriesDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String name; + + private Long companyId; + +} diff --git b/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java a/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java new file mode 100644 index 0000000..4736d2c --- /dev/null +++ a/src/main/java/com/subsidy/dto/classDict/AddClassDTO.java @@ -0,0 +1,11 @@ +package com.subsidy.dto.classDict; + +import com.subsidy.model.ClassDictDO; +import lombok.Data; + +@Data +public class AddClassDTO extends ClassDictDO { + + private Long userId; + +} diff --git b/src/main/java/com/subsidy/dto/classDict/AddMemberToClassDTO.java a/src/main/java/com/subsidy/dto/classDict/AddMemberToClassDTO.java new file mode 100644 index 0000000..6794de0 --- /dev/null +++ a/src/main/java/com/subsidy/dto/classDict/AddMemberToClassDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.classDict; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddMemberToClassDTO { + + private List memberIds; + + private Long classId; + +} diff --git b/src/main/java/com/subsidy/dto/classDict/GetAllClassesDTO.java a/src/main/java/com/subsidy/dto/classDict/GetAllClassesDTO.java new file mode 100644 index 0000000..a060723 --- /dev/null +++ a/src/main/java/com/subsidy/dto/classDict/GetAllClassesDTO.java @@ -0,0 +1,18 @@ +package com.subsidy.dto.classDict; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllClassesDTO { + + private Long administerId; + + private String className; + + private Long companyId; + + private List teacherIds; + +} diff --git b/src/main/java/com/subsidy/dto/classDict/GetSpareMembersDTO.java a/src/main/java/com/subsidy/dto/classDict/GetSpareMembersDTO.java new file mode 100644 index 0000000..2e81412 --- /dev/null +++ a/src/main/java/com/subsidy/dto/classDict/GetSpareMembersDTO.java @@ -0,0 +1,13 @@ +package com.subsidy.dto.classDict; + + +import lombok.Data; + +@Data +public class GetSpareMembersDTO { + + private Long companyId; + + private Long classId; + +} diff --git b/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java a/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java new file mode 100644 index 0000000..ef03529 --- /dev/null +++ a/src/main/java/com/subsidy/dto/company/AddCompanyDTO.java @@ -0,0 +1,17 @@ +package com.subsidy.dto.company; + +import com.subsidy.model.CompanyDictDO; +import lombok.Data; + +@Data +public class AddCompanyDTO extends CompanyDictDO { + + private String accountName; + + //private String accountType; + + private String password; + + private Integer role; + +} diff --git b/src/main/java/com/subsidy/dto/content/GetContendVodsDTO.java a/src/main/java/com/subsidy/dto/content/GetContendVodsDTO.java new file mode 100644 index 0000000..b9ca9a9 --- /dev/null +++ a/src/main/java/com/subsidy/dto/content/GetContendVodsDTO.java @@ -0,0 +1,16 @@ +package com.subsidy.dto.content; + +import lombok.Data; + +@Data +public class GetContendVodsDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long contentId; + + private String vodName; + +} diff --git b/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java a/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java new file mode 100644 index 0000000..4e424a0 --- /dev/null +++ a/src/main/java/com/subsidy/dto/course/QueryCoursesDTO.java @@ -0,0 +1,28 @@ +package com.subsidy.dto.course; + +import lombok.Data; + +import java.util.List; + +@Data +public class QueryCoursesDTO { + + private Integer pageSize; + + private Integer pageNum; + + private String courseName; + + private Long categoryId; + + private String courseType; + + private String courseSource; + + private Long administerId; + + private Long companyId; + + private List teacherIds; + +} diff --git b/src/main/java/com/subsidy/dto/department/GetDepartmentsVO.java a/src/main/java/com/subsidy/dto/department/GetDepartmentsVO.java new file mode 100644 index 0000000..5e92e23 --- /dev/null +++ a/src/main/java/com/subsidy/dto/department/GetDepartmentsVO.java @@ -0,0 +1,24 @@ +package com.subsidy.dto.department; + +import lombok.Data; + +import java.util.List; + +@Data +public class GetDepartmentsVO { + + private Long id; + + private String departmentName; + + private String leaderName; + + private Integer cnt; + + private Long parentId; + + private List children; + + private String parentDepartmentName; + +} diff --git b/src/main/java/com/subsidy/dto/exercise/GetAllExercisesDTO.java a/src/main/java/com/subsidy/dto/exercise/GetAllExercisesDTO.java new file mode 100644 index 0000000..7ad85bb --- /dev/null +++ a/src/main/java/com/subsidy/dto/exercise/GetAllExercisesDTO.java @@ -0,0 +1,15 @@ +package com.subsidy.dto.exercise; + +import com.subsidy.model.ExerciseDictDO; +import lombok.Data; + +@Data +public class GetAllExercisesDTO extends ExerciseDictDO { + + private Integer pageSize; + + private Integer pageNum; + + + +} diff --git b/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java a/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java new file mode 100644 index 0000000..2550af2 --- /dev/null +++ a/src/main/java/com/subsidy/dto/exercise/SubmitDTO.java @@ -0,0 +1,18 @@ +package com.subsidy.dto.exercise; + +import com.subsidy.vo.exercise.MemberExerciseVO; +import lombok.Data; + +import java.util.List; + +@Data +public class SubmitDTO { + + private List memberExerciseVOS; + + private Long memberId; + + private Long courseId; + + private Long classId; +} diff --git b/src/main/java/com/subsidy/dto/member/AddMemberDTO.java a/src/main/java/com/subsidy/dto/member/AddMemberDTO.java new file mode 100644 index 0000000..8511410 --- /dev/null +++ a/src/main/java/com/subsidy/dto/member/AddMemberDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.member; + +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.MemberDO; +import lombok.Data; + +import java.util.List; + +@Data +public class AddMemberDTO extends MemberDO { + + private List departmentIds; + +} diff --git b/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java a/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java new file mode 100644 index 0000000..452b39b --- /dev/null +++ a/src/main/java/com/subsidy/dto/member/ContentMemberDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.member; + +import lombok.Data; + +@Data +public class ContentMemberDTO { + + private Integer memberId; + + private Integer courseId; + + private Integer classId; + +} diff --git b/src/main/java/com/subsidy/dto/member/GetAllDTO.java a/src/main/java/com/subsidy/dto/member/GetAllDTO.java new file mode 100644 index 0000000..8dae9dd --- /dev/null +++ a/src/main/java/com/subsidy/dto/member/GetAllDTO.java @@ -0,0 +1,13 @@ +package com.subsidy.dto.member; + +import com.subsidy.model.MemberDO; +import lombok.Data; + +@Data +public class GetAllDTO extends MemberDO { + + private Integer pageNum; + + private Integer pageSize; + +} diff --git b/src/main/java/com/subsidy/dto/member/GetMemberSignInfoDTO.java a/src/main/java/com/subsidy/dto/member/GetMemberSignInfoDTO.java new file mode 100644 index 0000000..571466a --- /dev/null +++ a/src/main/java/com/subsidy/dto/member/GetMemberSignInfoDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.member; + +import lombok.Data; + +@Data +public class GetMemberSignInfoDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long id; + +} diff --git b/src/main/java/com/subsidy/dto/member/ImportMemberDTO.java a/src/main/java/com/subsidy/dto/member/ImportMemberDTO.java new file mode 100644 index 0000000..4ba1069 --- /dev/null +++ a/src/main/java/com/subsidy/dto/member/ImportMemberDTO.java @@ -0,0 +1,28 @@ +package com.subsidy.dto.member; + +import com.subsidy.util.excel.ExcelColumn; +import com.subsidy.util.excel.ExcelColumnUtil; +import lombok.Data; + +@Data +public class ImportMemberDTO { + + + @ExcelColumnUtil(value = "姓名", col = 1) + private String userName; + + @ExcelColumnUtil(value = "性别", col = 2) + private String gender; + + @ExcelColumnUtil(value = "账号", col = 3) + private String accountName; + + @ExcelColumnUtil(value = "手机", col = 4) + private String telephone; + + @ExcelColumnUtil(value = "身份证号", col = 5) + private String idCard; + + + +} diff --git b/src/main/java/com/subsidy/dto/member/StudyHistoryDTO.java a/src/main/java/com/subsidy/dto/member/StudyHistoryDTO.java new file mode 100644 index 0000000..09053b8 --- /dev/null +++ a/src/main/java/com/subsidy/dto/member/StudyHistoryDTO.java @@ -0,0 +1,14 @@ +package com.subsidy.dto.member; + +import lombok.Data; + +@Data +public class StudyHistoryDTO { + + private Integer pageSize; + + private Integer pageNum; + + private Long memberId; + +} diff --git b/src/main/java/com/subsidy/dto/sign/ClassSignInfoDTO.java a/src/main/java/com/subsidy/dto/sign/ClassSignInfoDTO.java new file mode 100644 index 0000000..57f6571 --- /dev/null +++ a/src/main/java/com/subsidy/dto/sign/ClassSignInfoDTO.java @@ -0,0 +1,19 @@ +package com.subsidy.dto.sign; + +import lombok.Data; + +@Data +public class ClassSignInfoDTO { + + + private String className; + + private String courseName; + + private Integer pageSize; + + private Integer pageNum; + + private Integer companyId; + +} diff --git b/src/main/java/com/subsidy/dto/sign/SignInDTO.java a/src/main/java/com/subsidy/dto/sign/SignInDTO.java new file mode 100644 index 0000000..6691299 --- /dev/null +++ a/src/main/java/com/subsidy/dto/sign/SignInDTO.java @@ -0,0 +1,12 @@ +package com.subsidy.dto.sign; + +import lombok.Data; + +@Data +public class SignInDTO { + + private Long memberId; + + private Long courseId; + +} diff --git b/src/main/java/com/subsidy/dto/sms/SendVerifyCodeDTO.java a/src/main/java/com/subsidy/dto/sms/SendVerifyCodeDTO.java new file mode 100644 index 0000000..6eaf8dd --- /dev/null +++ a/src/main/java/com/subsidy/dto/sms/SendVerifyCodeDTO.java @@ -0,0 +1,9 @@ +package com.subsidy.dto.sms; + +import lombok.Data; + +@Data +public class SendVerifyCodeDTO { + + private String telephone; +} diff --git b/src/main/java/com/subsidy/mapper/AdministerMapper.java a/src/main/java/com/subsidy/mapper/AdministerMapper.java new file mode 100644 index 0000000..313c9c5 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/AdministerMapper.java @@ -0,0 +1,51 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.administer.OperatorsDTO; +import com.subsidy.model.AdministerDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.administer.ExerciseTestVO; +import com.subsidy.vo.administer.OperatorsVO; +import com.subsidy.vo.administer.PermissionsVO; +import com.subsidy.vo.classdict.ClassDetailVO; +import com.subsidy.vo.member.ClassSignVO; +import com.subsidy.vo.sign.AnswerRecordVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 管理平台用户 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Repository +public interface AdministerMapper extends BaseMapper { + + List getPermissions(Long id); + + /** + * 获取班级成员详情---班级成员 + */ + IPage classMembers(IPage iPage,Long classId,String userName); + + /** + * 获取班级成员---注册签到 + */ + IPage classSign(IPage iPage,Long classId,String userName); + + /** + * 获取班级成员---测试成绩 + */ + IPage exerciseTest(IPage iPage, Long classId, String userName); + + /** + * 获取班级成员---答疑记录 + */ + IPage answerRecord(IPage iPage, Long classId, String userName); + + +} diff --git b/src/main/java/com/subsidy/mapper/AnsweringQuestionMapper.java a/src/main/java/com/subsidy/mapper/AnsweringQuestionMapper.java new file mode 100644 index 0000000..7fa17a8 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/AnsweringQuestionMapper.java @@ -0,0 +1,27 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.AnsweringQuestionDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.answer.GetCourseQuestionVO; +import com.subsidy.vo.vod.GetContendVodsVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 问题答疑表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +@Repository +public interface AnsweringQuestionMapper extends BaseMapper { + + /** + * 获取某个课程的答疑 + */ + IPage getCourseQuestion(IPage page, Long classId,Long memberId); +} diff --git b/src/main/java/com/subsidy/mapper/CategoryMapper.java a/src/main/java/com/subsidy/mapper/CategoryMapper.java new file mode 100644 index 0000000..8835bd5 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/CategoryMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CategoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 类目名称 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ + @Repository +public interface CategoryMapper extends BaseMapper { + +} diff --git b/src/main/java/com/subsidy/mapper/ClassDictMapper.java a/src/main/java/com/subsidy/mapper/ClassDictMapper.java new file mode 100644 index 0000000..bf30e6f --- /dev/null +++ a/src/main/java/com/subsidy/mapper/ClassDictMapper.java @@ -0,0 +1,42 @@ +package com.subsidy.mapper; + +import com.subsidy.dto.classDict.GetAllClassesDTO; +import com.subsidy.dto.classDict.GetSpareMembersDTO; +import com.subsidy.model.ClassDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.model.MemberDO; +import com.subsidy.model.VodDictDO; +import com.subsidy.vo.classdict.GetAllClassesVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 班级id Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +@Repository +public interface ClassDictMapper extends BaseMapper { + + /** + * 获取某企业的全部班级 + */ + List getAllClasses(ClassDictDO classDictDO); + + /** + * 获取某班级下的全部视频 + */ + List getClassVods(Long classId); + + /** + * 查看某企业里,不在某班级的成员 + * @return + */ + List getSpareMembers(GetSpareMembersDTO getSpareMembersDTO); + + +} diff --git b/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java a/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java new file mode 100644 index 0000000..c979186 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/ClassMemberMappingMapper.java @@ -0,0 +1,28 @@ +package com.subsidy.mapper; + +import com.subsidy.dto.classDict.GetSpareMembersDTO; +import com.subsidy.model.ClassDictDO; +import com.subsidy.model.ClassMemberMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.model.MemberDO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 班级成员映射表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +@Repository +public interface ClassMemberMappingMapper extends BaseMapper { + + /** + * 获取学生当前有效班级 + */ + List getMemberClass(Long memberId); + +} diff --git b/src/main/java/com/subsidy/mapper/CompanyDictMapper.java a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java new file mode 100644 index 0000000..fea1d20 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/CompanyDictMapper.java @@ -0,0 +1,33 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.AdministerDO; +import com.subsidy.model.CompanyDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.administer.OperatorsVO; +import org.springframework.stereotype.Repository; + +/** + *

+ * 企业字典表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-25 + */ +@Repository +public interface CompanyDictMapper extends BaseMapper { + + /** + * 查找运营者 + * + * @return + */ + IPage operators(IPage page, String companyName,Integer id, String userName,Integer role); + + /** + * 通过企业id查找企业的管理员 + */ + AdministerDO getAdministerByCompanyId(Long companyId); + +} diff --git b/src/main/java/com/subsidy/mapper/CourseContentMapper.java a/src/main/java/com/subsidy/mapper/CourseContentMapper.java new file mode 100644 index 0000000..c16dd53 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/CourseContentMapper.java @@ -0,0 +1,27 @@ +package com.subsidy.mapper; + +import com.subsidy.model.CourseContentDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.model.CourseDictDO; +import com.subsidy.model.VodDictDO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 课程目录表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Repository +public interface CourseContentMapper extends BaseMapper { + + /** + * 查看课程下有多少个视频 + */ + List getCourseVods(Integer courseId); + +} diff --git b/src/main/java/com/subsidy/mapper/CourseDictMapper.java a/src/main/java/com/subsidy/mapper/CourseDictMapper.java new file mode 100644 index 0000000..0aa8478 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/CourseDictMapper.java @@ -0,0 +1,48 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.model.CourseDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.model.MemberDO; +import com.subsidy.vo.course.QueryCoursesVO; +import com.subsidy.vo.member.StudyPageVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Repository +public interface CourseDictMapper extends BaseMapper { + + /** + * 查询全部课程 + * @return + */ + IPage queryCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId); + + /** + * 通过课程id查询课程下的学生-----弃用 + */ + List queryCourseMember(StudyPageVO studyPageVO); + + /** + * 查询全部公共课程 + * @return + */ + IPage queryPublicCourses(IPage page, String courseName, Long categoryId, String courseType, String courseSource); + + /** + * 查询企业内部课程 + */ + IPage queryCompanyCourse(IPage page, String courseName, Long categoryId, String courseType, String courseSource,Long companyId); + +} diff --git b/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java a/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java new file mode 100644 index 0000000..0d71522 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/DepartmentDictMapper.java @@ -0,0 +1,24 @@ +package com.subsidy.mapper; + +import com.subsidy.dto.department.GetDepartmentsVO; +import com.subsidy.model.DepartmentDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 部门字典表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Repository +public interface DepartmentDictMapper extends BaseMapper { + + //List getDepartments(DepartmentDictDO departmentDictDO); + + +} diff --git b/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java a/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java new file mode 100644 index 0000000..8fa63fa --- /dev/null +++ a/src/main/java/com/subsidy/mapper/ExerciseDictMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.ExerciseDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 习题库 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ + @Repository +public interface ExerciseDictMapper extends BaseMapper { + +} diff --git b/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java a/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java new file mode 100644 index 0000000..788d86d --- /dev/null +++ a/src/main/java/com/subsidy/mapper/ExerciseDoneResultMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.ExerciseDoneResultDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 学生课程习题完成情况 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-15 + */ + @Repository +public interface ExerciseDoneResultMapper extends BaseMapper { + +} diff --git b/src/main/java/com/subsidy/mapper/FileDictMapper.java a/src/main/java/com/subsidy/mapper/FileDictMapper.java new file mode 100644 index 0000000..4ee1912 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/FileDictMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.FileDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 课件表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ + @Repository +public interface FileDictMapper extends BaseMapper { + +} diff --git b/src/main/java/com/subsidy/mapper/MemberDepartmentMappingMapper.java a/src/main/java/com/subsidy/mapper/MemberDepartmentMappingMapper.java new file mode 100644 index 0000000..0dc8413 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/MemberDepartmentMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.MemberDepartmentMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 老师部门映射表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-11-01 + */ + @Repository +public interface MemberDepartmentMappingMapper extends BaseMapper { + +} diff --git b/src/main/java/com/subsidy/mapper/MemberMapper.java a/src/main/java/com/subsidy/mapper/MemberMapper.java new file mode 100644 index 0000000..ffc118b --- /dev/null +++ a/src/main/java/com/subsidy/mapper/MemberMapper.java @@ -0,0 +1,40 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.MemberDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.member.GetAllVO; +import com.subsidy.vo.member.StudyPageVO; +import io.swagger.models.auth.In; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 学生表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Repository +public interface MemberMapper extends BaseMapper { + + /** + * 查看学生的课程 + */ + List studyPage(MemberDO memberDO); + + /** + * 查询学生所在部门 + */ + List getDepartments(Long memberId); + + /** + * 查询部门所有的学生 + */ + IPage getMembers(IPage iPage,Long departmentId,String userName,String status); + +} diff --git b/src/main/java/com/subsidy/mapper/PermissionsDictMapper.java a/src/main/java/com/subsidy/mapper/PermissionsDictMapper.java new file mode 100644 index 0000000..2febf3c --- /dev/null +++ a/src/main/java/com/subsidy/mapper/PermissionsDictMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.PermissionsDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 权限表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ + @Repository +public interface PermissionsDictMapper extends BaseMapper { + +} diff --git b/src/main/java/com/subsidy/mapper/RoleAdministerMappingMapper.java a/src/main/java/com/subsidy/mapper/RoleAdministerMappingMapper.java new file mode 100644 index 0000000..f1c3259 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/RoleAdministerMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.RoleAdministerMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ + @Repository +public interface RoleAdministerMappingMapper extends BaseMapper { + +} diff --git b/src/main/java/com/subsidy/mapper/RoleDictMapper.java a/src/main/java/com/subsidy/mapper/RoleDictMapper.java new file mode 100644 index 0000000..931c13e --- /dev/null +++ a/src/main/java/com/subsidy/mapper/RoleDictMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.RoleDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 角色表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ + @Repository +public interface RoleDictMapper extends BaseMapper { + +} diff --git b/src/main/java/com/subsidy/mapper/RolePermissionMappingMapper.java a/src/main/java/com/subsidy/mapper/RolePermissionMappingMapper.java new file mode 100644 index 0000000..c39ed50 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/RolePermissionMappingMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.RolePermissionMappingDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 系统用户角色表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ + @Repository +public interface RolePermissionMappingMapper extends BaseMapper { + +} diff --git b/src/main/java/com/subsidy/mapper/SignInRecordMapper.java a/src/main/java/com/subsidy/mapper/SignInRecordMapper.java new file mode 100644 index 0000000..2e96e16 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/SignInRecordMapper.java @@ -0,0 +1,28 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.sign.ClassSignInfoDTO; +import com.subsidy.model.SignInRecordDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.sign.ClassSignInfoVO; +import org.springframework.stereotype.Repository; + +/** + *

+ * 学生签到表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-18 + */ + @Repository +public interface SignInRecordMapper extends BaseMapper { + + /** + * 公司学习记录 + */ + + IPage classSignInfo(IPage iPage,String className,String courseName,Integer id); + + +} diff --git b/src/main/java/com/subsidy/mapper/SmsVerifyCodeMapper.java a/src/main/java/com/subsidy/mapper/SmsVerifyCodeMapper.java new file mode 100644 index 0000000..77d2613 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/SmsVerifyCodeMapper.java @@ -0,0 +1,18 @@ +package com.subsidy.mapper; + +import com.subsidy.model.SmsVerifyCodeDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + *

+ * 短信验证码记录表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ + @Repository +public interface SmsVerifyCodeMapper extends BaseMapper { + +} diff --git b/src/main/java/com/subsidy/mapper/VodDictMapper.java a/src/main/java/com/subsidy/mapper/VodDictMapper.java new file mode 100644 index 0000000..71dd0e3 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/VodDictMapper.java @@ -0,0 +1,30 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.VodDictDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.vod.GetContendVodsVO; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + *

+ * 视频表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Repository +public interface VodDictMapper extends BaseMapper { + + /** + * 查看某个目录下的视频 + * @param page + * @param vodName + * @param contentId + * @return + */ + IPage getContendVods(IPage page,String vodName,Long contentId); +} diff --git b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java new file mode 100644 index 0000000..acae106 --- /dev/null +++ a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java @@ -0,0 +1,26 @@ +package com.subsidy.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.model.VodPlayHistoryDO; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.subsidy.vo.vod.StudyHistoryVO; +import org.springframework.stereotype.Repository; + +/** + *

+ * 视频播放历史记录表 Mapper 接口 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +@Repository +public interface VodPlayHistoryMapper extends BaseMapper { + + /** + * 查看某成员的学习历史 + */ + IPage studyHistory(IPage iPage,Long memberId); + + +} diff --git b/src/main/java/com/subsidy/model/AdministerDO.java a/src/main/java/com/subsidy/model/AdministerDO.java new file mode 100644 index 0000000..d76b33c --- /dev/null +++ a/src/main/java/com/subsidy/model/AdministerDO.java @@ -0,0 +1,77 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 管理平台用户 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@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 Long companyId; + + /** + * 账号 + */ + private String accountName; + + /** + * 手机号/企业账号 + */ + private String telephone; + + /** + * 密码 + */ + private String password; + + /** + * 成员名称 + */ + private String userName; + + /** + * 头像 + */ + private String img; + + /** + * 1:启用 0:禁用 + */ + private String status; + + ///** + // * 0:运营者账号 1:企业账号 + // */ + //private String accountType; + + /** + * role 0:平台运营者 1:超级管理员 2:普通成员 + */ + private Integer role; + + +} diff --git b/src/main/java/com/subsidy/model/AnsweringQuestionDO.java a/src/main/java/com/subsidy/model/AnsweringQuestionDO.java new file mode 100644 index 0000000..f844713 --- /dev/null +++ a/src/main/java/com/subsidy/model/AnsweringQuestionDO.java @@ -0,0 +1,54 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 问题答疑表 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("answering_question") +public class AnsweringQuestionDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 班级id + */ + private Long classId; + + /** + * 提问id + */ + private Long askId; + + /** + * 回答人id + */ + private Long answerId; + + /** + * 问题 + */ + private String title; + + /** + * 答案 + */ + private String answer; + + +} diff --git b/src/main/java/com/subsidy/model/CategoryDO.java a/src/main/java/com/subsidy/model/CategoryDO.java new file mode 100644 index 0000000..c82ebcb --- /dev/null +++ a/src/main/java/com/subsidy/model/CategoryDO.java @@ -0,0 +1,39 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 类目名称 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("category") +public class CategoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 企业id + */ + private Long companyId; + + /** + * 类目名称 + */ + private String name; + + +} diff --git b/src/main/java/com/subsidy/model/ClassDictDO.java a/src/main/java/com/subsidy/model/ClassDictDO.java new file mode 100644 index 0000000..ec59e43 --- /dev/null +++ a/src/main/java/com/subsidy/model/ClassDictDO.java @@ -0,0 +1,56 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 班级id + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("class_dict") +public class ClassDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 老师id + */ + private Long companyId; + + /** + * 班级名称 + */ + private String className; + + /** + * 班级类型 + */ + private String classType; + + /** + * 课程id + */ + private Long courseId; + + private String startDate; + + private String endDate; + + +} diff --git b/src/main/java/com/subsidy/model/ClassMemberMappingDO.java a/src/main/java/com/subsidy/model/ClassMemberMappingDO.java new file mode 100644 index 0000000..614000d --- /dev/null +++ a/src/main/java/com/subsidy/model/ClassMemberMappingDO.java @@ -0,0 +1,39 @@ +package com.subsidy.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 班级成员映射表 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("class_member_mapping") +public class ClassMemberMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 成员id + */ + private Long memberId; + + /** + * 班级id + */ + private Long classId; + + +} diff --git b/src/main/java/com/subsidy/model/CompanyDictDO.java a/src/main/java/com/subsidy/model/CompanyDictDO.java new file mode 100644 index 0000000..3e1700a --- /dev/null +++ a/src/main/java/com/subsidy/model/CompanyDictDO.java @@ -0,0 +1,55 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 企业字典表 + *

+ * + * @author DengMin + * @since 2021-10-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("company_dict") +public class CompanyDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 企业logo + */ + private String logo; + + /** + * 公司名称 + */ + private String companyName; + + /** + * 简称 + */ + private String shortName; + + /** + * 标语 + */ + private String banner; + + /** + * 领域 + */ + private String field; + + + +} diff --git b/src/main/java/com/subsidy/model/CourseContentDO.java a/src/main/java/com/subsidy/model/CourseContentDO.java new file mode 100644 index 0000000..f1e64a7 --- /dev/null +++ a/src/main/java/com/subsidy/model/CourseContentDO.java @@ -0,0 +1,41 @@ +package com.subsidy.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *

+ * 课程目录表 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("course_content") +public class CourseContentDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long courseId; + + /** + * 目录 + */ + private String content; + + /** + * 排序 + */ + private Integer orderNo; + + +} diff --git b/src/main/java/com/subsidy/model/CourseDictDO.java a/src/main/java/com/subsidy/model/CourseDictDO.java new file mode 100644 index 0000000..a79f975 --- /dev/null +++ a/src/main/java/com/subsidy/model/CourseDictDO.java @@ -0,0 +1,61 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@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 companyId; + + /** + * 课程名称 + */ + private String courseName; + + /** + * 类目id + */ + private Long categoryId; + + /** + * 课程类型 + */ + private String courseType; + + /** + * 课程来源 + */ + private String courseSource; + + ///** + // * 习题截止时间 + // */ + //private LocalDateTime deadline; + +} diff --git b/src/main/java/com/subsidy/model/DepartmentDictDO.java a/src/main/java/com/subsidy/model/DepartmentDictDO.java new file mode 100644 index 0000000..f2215ed --- /dev/null +++ a/src/main/java/com/subsidy/model/DepartmentDictDO.java @@ -0,0 +1,60 @@ +package com.subsidy.model; + +import com.subsidy.dto.department.GetDepartmentsVO; +import com.subsidy.util.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.List; + +/** + *

+ * 部门字典表 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("department_dict") +public class DepartmentDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 企业id + */ + private Long companyId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门负责人id + */ + private String leaderName; + + /** + * 父节点id + */ + private Long parentId; + + /** + * 为写程序方便,数据库里为null + */ + private List children; + + +} diff --git b/src/main/java/com/subsidy/model/ExerciseDictDO.java a/src/main/java/com/subsidy/model/ExerciseDictDO.java new file mode 100644 index 0000000..05347d8 --- /dev/null +++ a/src/main/java/com/subsidy/model/ExerciseDictDO.java @@ -0,0 +1,69 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 习题库 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_dict") +public class ExerciseDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 题目类型:单选/多选/是非 + */ + private String exerciseType; + + /** + * 课程id + */ + private Long courseId; + + /** + * 难度:容易/适中/困难 + */ + private String difficulty; + + /** + * 题目 + */ + private String title; + + /** + * 选项 + */ + private String items; + + /** + * 正确答案 + */ + private String rightAnswer; + + /** + * 解析 + */ + private String detail; + + /** + * 排序 + */ + private Integer orderNo; + + +} diff --git b/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java a/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java new file mode 100644 index 0000000..3398bf1 --- /dev/null +++ a/src/main/java/com/subsidy/model/ExerciseDoneResultDO.java @@ -0,0 +1,54 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 学生课程习题完成情况 + *

+ * + * @author DengMin + * @since 2021-10-15 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("exercise_done_result") +public class ExerciseDoneResultDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 成员id + */ + private Long memberId; + + /** + * 班级id + */ + private Long classId; + + /** + * 课程id + */ + private Long courseId; + + /** + * 正确个数 + */ + private Integer rightCounts; + + /** + * 总共个数 + */ + private Integer totalCounts; + + +} diff --git b/src/main/java/com/subsidy/model/FileDictDO.java a/src/main/java/com/subsidy/model/FileDictDO.java new file mode 100644 index 0000000..7143b28 --- /dev/null +++ a/src/main/java/com/subsidy/model/FileDictDO.java @@ -0,0 +1,53 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 课件表 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("file_dict") +public class FileDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 目录id + */ + private Long contentId; + + /** + * 文件名称 + */ + private String fileName; + + /** + * 文件大小 + */ + private String fileSize; + + private String fileType; + + private String fileUrl; + + /** + * 排序 + */ + private Integer orderNo; + + +} diff --git b/src/main/java/com/subsidy/model/MemberDO.java a/src/main/java/com/subsidy/model/MemberDO.java new file mode 100644 index 0000000..6212c79 --- /dev/null +++ a/src/main/java/com/subsidy/model/MemberDO.java @@ -0,0 +1,74 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 学生表 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("member") +public class MemberDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 部门id + */ + private Long departmentId; + + /** + * 账号 + */ + private String accountName; + + /** + * 姓名 + */ + private String userName; + + /** + * 手机号 + */ + private String telephone; + + /** + * 密码 + */ + private String password; + + /** + * 性别 + */ + private String gender; + + /** + * 头像 + */ + private String image; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 状态 + */ + private String status; + + +} diff --git b/src/main/java/com/subsidy/model/MemberDepartmentMappingDO.java a/src/main/java/com/subsidy/model/MemberDepartmentMappingDO.java new file mode 100644 index 0000000..9d74c5f --- /dev/null +++ a/src/main/java/com/subsidy/model/MemberDepartmentMappingDO.java @@ -0,0 +1,46 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 老师部门映射表 + *

+ * + * @author DengMin + * @since 2021-11-01 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("member_department_mapping") +public class MemberDepartmentMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 老师id + */ + private Long memberId; + + /** + * 部门id + */ + private Long departmentId; + + private LocalDateTime createTime; + + private LocalDateTime updateTime; + + private LocalDateTime deleteTime; + + +} diff --git b/src/main/java/com/subsidy/model/PermissionsDictDO.java a/src/main/java/com/subsidy/model/PermissionsDictDO.java new file mode 100644 index 0000000..7bcbbd3 --- /dev/null +++ a/src/main/java/com/subsidy/model/PermissionsDictDO.java @@ -0,0 +1,41 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 权限表 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("permissions_dict") +public class PermissionsDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 父级ID + */ + private Long parentId; + + /** + * 名称 + */ + private String name; + + private String children; + + +} diff --git b/src/main/java/com/subsidy/model/RoleAdministerMappingDO.java a/src/main/java/com/subsidy/model/RoleAdministerMappingDO.java new file mode 100644 index 0000000..34e957b --- /dev/null +++ a/src/main/java/com/subsidy/model/RoleAdministerMappingDO.java @@ -0,0 +1,33 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("role_administer_mapping") +public class RoleAdministerMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + private Long administerId; + + private Long roleId; + + +} diff --git b/src/main/java/com/subsidy/model/RoleDictDO.java a/src/main/java/com/subsidy/model/RoleDictDO.java new file mode 100644 index 0000000..6246c5d --- /dev/null +++ a/src/main/java/com/subsidy/model/RoleDictDO.java @@ -0,0 +1,34 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 角色表 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("role_dict") +public class RoleDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 角色 + */ + private String role; + + +} diff --git b/src/main/java/com/subsidy/model/RolePermissionMappingDO.java a/src/main/java/com/subsidy/model/RolePermissionMappingDO.java new file mode 100644 index 0000000..24d494a --- /dev/null +++ a/src/main/java/com/subsidy/model/RolePermissionMappingDO.java @@ -0,0 +1,39 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 系统用户角色表 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("role_permission_mapping") +public class RolePermissionMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 权限ID + */ + private Long roleId; + + /** + * 角色ID + */ + private Long permissionId; + + +} diff --git b/src/main/java/com/subsidy/model/SignInRecordDO.java a/src/main/java/com/subsidy/model/SignInRecordDO.java new file mode 100644 index 0000000..ce9fd79 --- /dev/null +++ a/src/main/java/com/subsidy/model/SignInRecordDO.java @@ -0,0 +1,45 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 学生签到表 + *

+ * + * @author DengMin + * @since 2021-10-18 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sign_in_record") +public class SignInRecordDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 学生id + */ + private Long memberId; + + /** + * 班级id + */ + private Long classId; + + /** + * 签到时间 + */ + private LocalDateTime signInDate; + + +} diff --git b/src/main/java/com/subsidy/model/SmsVerifyCodeDO.java a/src/main/java/com/subsidy/model/SmsVerifyCodeDO.java new file mode 100644 index 0000000..67ad9e3 --- /dev/null +++ a/src/main/java/com/subsidy/model/SmsVerifyCodeDO.java @@ -0,0 +1,39 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 短信验证码记录表 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("sms_verify_code") +public class SmsVerifyCodeDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 手机号 + */ + private String telephone; + + /** + * 验证码 + */ + private String verifyCode; + + +} diff --git b/src/main/java/com/subsidy/model/VodDictDO.java a/src/main/java/com/subsidy/model/VodDictDO.java new file mode 100644 index 0000000..3661321 --- /dev/null +++ a/src/main/java/com/subsidy/model/VodDictDO.java @@ -0,0 +1,73 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 视频表 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@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 contentId; + + /** + * 视频名称 + */ + private String vodName; + + /** + * 视频时长 + */ + private Integer vodLength; + + /** + * 视频格式 + */ + private String vodType; + + /** + * 视频大小 + */ + private String vodSize; + + /** + * 视频地址 + */ + private String vodUrl; + + /** + * 视频编码 + */ + private String vodCode; + + /** + * 讲师名称 + */ + private String teacherName; + + /** + * 封面 + */ + private String coverPage; + +} diff --git b/src/main/java/com/subsidy/model/VodPlayHistoryDO.java a/src/main/java/com/subsidy/model/VodPlayHistoryDO.java new file mode 100644 index 0000000..1635b64 --- /dev/null +++ a/src/main/java/com/subsidy/model/VodPlayHistoryDO.java @@ -0,0 +1,54 @@ +package com.subsidy.model; + +import com.subsidy.util.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; + +/** + *

+ * 视频播放历史记录表 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("vod_play_history") +public class VodPlayHistoryDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 班级id + */ + private Long classId; + + /** + * 视频id + */ + private Long vodId; + + /** + * 学生id + */ + private Long memberId; + + /** + * 观看时长 + */ + private Integer playLength; + + /** + * 播放视频位置 + */ + private Integer playRecord; + + +} diff --git b/src/main/java/com/subsidy/service/AdministerService.java a/src/main/java/com/subsidy/service/AdministerService.java new file mode 100644 index 0000000..ead20d2 --- /dev/null +++ a/src/main/java/com/subsidy/service/AdministerService.java @@ -0,0 +1,63 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.administer.ClassDetailDTO; +import com.subsidy.dto.administer.OperatorsDTO; +import com.subsidy.model.AdministerDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.model.ClassDictDO; +import com.subsidy.model.MemberDO; +import com.subsidy.vo.administer.*; +import com.subsidy.vo.classdict.ClassDetailVO; +import com.subsidy.vo.member.ClassSignVO; +import com.subsidy.vo.sign.AnswerRecordVO; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; + +/** + *

+ * 管理平台用户 服务类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +public interface AdministerService extends IService { + + LoginVO login(AdministerDO administerDO); + + AdministerPermissionVO getPermissions(); + + IPage operators(OperatorsDTO operatorsDTO); + + String addAdminister(AdministerDO administerDO); + + String deleteAdminister(AdministerDO administerDO); + + String updateAdminister(AdministerDO administerDO); + + ClassSummaryVO classSummary(ClassDetailDTO classDetailDTO); + + IPage classDetail(ClassDetailDTO classDetailDTO); + + List exportClassDetail(ClassDetailDTO classDetailDTO)throws Exception; + + IPage signDetail(ClassDetailDTO classDetailDTO); + + List exportSignDetail(ClassDetailDTO classDetailDTO)throws Exception; + + IPage exerciseTest(ClassDetailDTO classDetailDTO); + + List exportExerciseTest(ClassDetailDTO classDetailDTO)throws Exception; + + IPage answerRecord(ClassDetailDTO classDetailDTO); + + List exportAnswerRecord(ClassDetailDTO classDetailDTO)throws Exception; + + void export(ClassDetailDTO classDetailDTO)throws Exception; + + String importMember(Long companyId, MultipartFile multipartFile); + +} diff --git b/src/main/java/com/subsidy/service/AnsweringQuestionService.java a/src/main/java/com/subsidy/service/AnsweringQuestionService.java new file mode 100644 index 0000000..7af3159 --- /dev/null +++ a/src/main/java/com/subsidy/service/AnsweringQuestionService.java @@ -0,0 +1,25 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.GetCourseQuestionDTO; +import com.subsidy.model.AnsweringQuestionDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 问题答疑表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +public interface AnsweringQuestionService extends IService { + + IPage getCourseQuestion(GetCourseQuestionDTO getCourseQuestionDTO); + + String addQuestion(AnsweringQuestionDO answeringQuestionDO); + + String deleteQuestion(AnsweringQuestionDO answeringQuestionDO); + + String updateQuestion(AnsweringQuestionDO answeringQuestionDO); +} diff --git b/src/main/java/com/subsidy/service/CategoryService.java a/src/main/java/com/subsidy/service/CategoryService.java new file mode 100644 index 0000000..8647c82 --- /dev/null +++ a/src/main/java/com/subsidy/service/CategoryService.java @@ -0,0 +1,29 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.category.GetCategoriesDTO; +import com.subsidy.model.CategoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 类目名称 服务类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +public interface CategoryService extends IService { + + IPage getCategories(GetCategoriesDTO getCategoriesDTO); + + List getAll(GetCategoriesDTO getCategoriesDTO); + + String addCategory(CategoryDO categoryDO); + + String deleteCategory(CategoryDO categoryDO); + + String updateCategory(CategoryDO categoryDO); +} diff --git b/src/main/java/com/subsidy/service/ClassDictService.java a/src/main/java/com/subsidy/service/ClassDictService.java new file mode 100644 index 0000000..6b3e03e --- /dev/null +++ a/src/main/java/com/subsidy/service/ClassDictService.java @@ -0,0 +1,41 @@ +package com.subsidy.service; + +import com.subsidy.dto.classDict.AddClassDTO; +import com.subsidy.dto.classDict.AddMemberToClassDTO; +import com.subsidy.dto.classDict.GetAllClassesDTO; +import com.subsidy.dto.classDict.GetSpareMembersDTO; +import com.subsidy.model.ClassDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.model.MemberDO; +import com.subsidy.vo.classdict.GetAllClassesVO; + +import java.util.List; + +/** + *

+ * 班级id 服务类 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +public interface ClassDictService extends IService { + + List getAllClasses(ClassDictDO classDictDO); + + String deleteClasses(ClassDictDO classDictDO); + + String addClass(AddClassDTO addClassDTO); + + String updateClass(ClassDictDO classDictDO); + + ClassDictDO classDetail(ClassDictDO classDictDO); + + String removeMember(ClassMemberMappingDO classMemberMappingDO); + + List getSpareMembers(GetSpareMembersDTO getSpareMembersDTO); + + String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO); + +} diff --git b/src/main/java/com/subsidy/service/ClassMemberMappingService.java a/src/main/java/com/subsidy/service/ClassMemberMappingService.java new file mode 100644 index 0000000..e5e7430 --- /dev/null +++ a/src/main/java/com/subsidy/service/ClassMemberMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.ClassMemberMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 班级成员映射表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +public interface ClassMemberMappingService extends IService { + +} diff --git b/src/main/java/com/subsidy/service/CompanyDictService.java a/src/main/java/com/subsidy/service/CompanyDictService.java new file mode 100644 index 0000000..7d4fa7f --- /dev/null +++ a/src/main/java/com/subsidy/service/CompanyDictService.java @@ -0,0 +1,29 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.administer.OperatorsDTO; +import com.subsidy.dto.company.AddCompanyDTO; +import com.subsidy.model.AdministerDO; +import com.subsidy.model.CompanyDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.administer.OperatorsVO; + +/** + *

+ * 企业字典表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-25 + */ +public interface CompanyDictService extends IService { + + IPage operators(OperatorsDTO operatorsDTO); + + String addOperator(AddCompanyDTO addCompanyDTO); + + String deleteAdminister(CompanyDictDO companyDictDO); + + String updateAdminister(AddCompanyDTO addCompanyDTO); + +} diff --git b/src/main/java/com/subsidy/service/CourseContentService.java a/src/main/java/com/subsidy/service/CourseContentService.java new file mode 100644 index 0000000..128b5c8 --- /dev/null +++ a/src/main/java/com/subsidy/service/CourseContentService.java @@ -0,0 +1,29 @@ +package com.subsidy.service; + +import com.subsidy.controller.CourseDictController; +import com.subsidy.model.CourseContentDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.model.CourseDictDO; +import com.subsidy.model.VodDictDO; +import com.subsidy.vo.vod.GetContendVodsVO; + +import java.util.List; + +/** + *

+ * 课程目录表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +public interface CourseContentService extends IService { + + List getContents(CourseContentDO courseContentDO); + + String deleteContent(CourseContentDO courseContentDO); + + String addContent(CourseContentDO courseContentDO); + + String updateContent(CourseContentDO courseContentDO); +} diff --git b/src/main/java/com/subsidy/service/CourseDictService.java a/src/main/java/com/subsidy/service/CourseDictService.java new file mode 100644 index 0000000..59f9db7 --- /dev/null +++ a/src/main/java/com/subsidy/service/CourseDictService.java @@ -0,0 +1,27 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.course.QueryCoursesDTO; +import com.subsidy.model.CourseDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +public interface CourseDictService extends IService { + + String addCourse(CourseDictDO courseDictDO); + + String deleteCourse(CourseDictDO courseDictDO); + + IPage queryCourses(QueryCoursesDTO queryCoursesDTO); + + String updateCourses(CourseDictDO courseDictDO); + + IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO); +} diff --git b/src/main/java/com/subsidy/service/DepartmentDictService.java a/src/main/java/com/subsidy/service/DepartmentDictService.java new file mode 100644 index 0000000..be78168 --- /dev/null +++ a/src/main/java/com/subsidy/service/DepartmentDictService.java @@ -0,0 +1,26 @@ +package com.subsidy.service; + +import com.subsidy.dto.department.GetDepartmentsVO; +import com.subsidy.model.DepartmentDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 部门字典表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +public interface DepartmentDictService extends IService { + + List getDepartments(DepartmentDictDO departmentDictDO); + + String addDepartment(DepartmentDictDO departmentDictDO); + + String deleteDepartment(DepartmentDictDO departmentDictDO); + + String updateDepartment(DepartmentDictDO departmentDictDO); +} diff --git b/src/main/java/com/subsidy/service/ExerciseDictService.java a/src/main/java/com/subsidy/service/ExerciseDictService.java new file mode 100644 index 0000000..8f9782d --- /dev/null +++ a/src/main/java/com/subsidy/service/ExerciseDictService.java @@ -0,0 +1,35 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.exercise.GetAllExercisesDTO; +import com.subsidy.dto.exercise.SubmitDTO; +import com.subsidy.model.CourseDictDO; +import com.subsidy.model.ExerciseDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.course.ExerciseVO; + +import java.util.List; + +/** + *

+ * 习题库 服务类 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +public interface ExerciseDictService extends IService { + + IPage getAllExercises(GetAllExercisesDTO getAllExercisesDTO); + + String addExercise(ExerciseDictDO exerciseDictDO); + + String deleteExercise(ExerciseDictDO exerciseDictDO); + + String updateExercise(ExerciseDictDO exerciseDictDO); + + List getCourseExercises(CourseDictDO courseDictDO); + + String submit(SubmitDTO submitDTO); + +} diff --git b/src/main/java/com/subsidy/service/ExerciseDoneResultService.java a/src/main/java/com/subsidy/service/ExerciseDoneResultService.java new file mode 100644 index 0000000..5628acb --- /dev/null +++ a/src/main/java/com/subsidy/service/ExerciseDoneResultService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.ExerciseDoneResultDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 学生课程习题完成情况 服务类 + *

+ * + * @author DengMin + * @since 2021-10-15 + */ +public interface ExerciseDoneResultService extends IService { + +} diff --git b/src/main/java/com/subsidy/service/FileDictService.java a/src/main/java/com/subsidy/service/FileDictService.java new file mode 100644 index 0000000..29a8f71 --- /dev/null +++ a/src/main/java/com/subsidy/service/FileDictService.java @@ -0,0 +1,26 @@ +package com.subsidy.service; + +import com.subsidy.model.FileDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + *

+ * 课件表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +public interface FileDictService extends IService { + + List getContendFiles(FileDictDO fileDictDO); + + String deleteFile(FileDictDO fileDictDO); + + String addFile(FileDictDO fileDictDO); + + String updateFile(FileDictDO fileDictDO); + +} diff --git b/src/main/java/com/subsidy/service/MemberDepartmentMappingService.java a/src/main/java/com/subsidy/service/MemberDepartmentMappingService.java new file mode 100644 index 0000000..ebe5990 --- /dev/null +++ a/src/main/java/com/subsidy/service/MemberDepartmentMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.MemberDepartmentMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 老师部门映射表 服务类 + *

+ * + * @author DengMin + * @since 2021-11-01 + */ +public interface MemberDepartmentMappingService extends IService { + +} diff --git b/src/main/java/com/subsidy/service/MemberService.java a/src/main/java/com/subsidy/service/MemberService.java new file mode 100644 index 0000000..d501328 --- /dev/null +++ a/src/main/java/com/subsidy/service/MemberService.java @@ -0,0 +1,53 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.administer.VerifyCodeDTO; +import com.subsidy.dto.member.AddMemberDTO; +import com.subsidy.dto.member.ContentMemberDTO; +import com.subsidy.dto.member.GetAllDTO; +import com.subsidy.dto.member.StudyHistoryDTO; +import com.subsidy.model.MemberDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.administer.UserRoleVO; +import com.subsidy.vo.member.*; + +import java.util.List; + +/** + *

+ * 学生表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +public interface MemberService extends IService { + + IPage getAll(GetAllDTO getAllDTO); + + String deleteMember(MemberDO memberDO); + + String addMember(AddMemberDTO addMemberDTO); + + String updateMember(AddMemberDTO addMemberDTO); + + UserRoleVO login(VerifyCodeDTO verifyCodeDTO); + + UserRoleVO passwordLogin(MemberDO memberDO); + + String updatePassword(MemberDO memberDO); + + MemberStudyPageVO studyPage(MemberDO memberDO); + + ContentVodNewVO contentVod(ContentMemberDTO contentVodDTO); + + List contentFiles(ContentMemberDTO contentMemberDTO); + + IPage studyHistory(StudyHistoryDTO studyHistoryDTO); + + GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO); + + GetStudyInfoVO getStudyInfo(MemberDO memberDO); + + +} diff --git b/src/main/java/com/subsidy/service/PermissionsDictService.java a/src/main/java/com/subsidy/service/PermissionsDictService.java new file mode 100644 index 0000000..5599332 --- /dev/null +++ a/src/main/java/com/subsidy/service/PermissionsDictService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.PermissionsDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 权限表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +public interface PermissionsDictService extends IService { + +} diff --git b/src/main/java/com/subsidy/service/RoleAdministerMappingService.java a/src/main/java/com/subsidy/service/RoleAdministerMappingService.java new file mode 100644 index 0000000..22089da --- /dev/null +++ a/src/main/java/com/subsidy/service/RoleAdministerMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.RoleAdministerMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +public interface RoleAdministerMappingService extends IService { + +} diff --git b/src/main/java/com/subsidy/service/RoleDictService.java a/src/main/java/com/subsidy/service/RoleDictService.java new file mode 100644 index 0000000..757a2d8 --- /dev/null +++ a/src/main/java/com/subsidy/service/RoleDictService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.RoleDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 角色表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +public interface RoleDictService extends IService { + +} diff --git b/src/main/java/com/subsidy/service/RolePermissionMappingService.java a/src/main/java/com/subsidy/service/RolePermissionMappingService.java new file mode 100644 index 0000000..dfedd54 --- /dev/null +++ a/src/main/java/com/subsidy/service/RolePermissionMappingService.java @@ -0,0 +1,16 @@ +package com.subsidy.service; + +import com.subsidy.model.RolePermissionMappingDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 系统用户角色表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +public interface RolePermissionMappingService extends IService { + +} diff --git b/src/main/java/com/subsidy/service/SignInRecordService.java a/src/main/java/com/subsidy/service/SignInRecordService.java new file mode 100644 index 0000000..f285364 --- /dev/null +++ a/src/main/java/com/subsidy/service/SignInRecordService.java @@ -0,0 +1,31 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.member.GetMemberSignInfoDTO; +import com.subsidy.dto.sign.ClassSignInfoDTO; +import com.subsidy.dto.sign.SignInDTO; +import com.subsidy.model.MemberDO; +import com.subsidy.model.SignInRecordDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.member.GetMemberSignInfoVO; +import com.subsidy.vo.sign.SignInStatusVO; +import com.tencentcloudapi.common.Sign; + +/** + *

+ * 学生签到表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-18 + */ +public interface SignInRecordService extends IService { + + IPage getMemberSignInfo(GetMemberSignInfoDTO getMemberSignInfoDTO); + + String signIn(SignInRecordDO signInRecordDO); + + IPage classSignInfo(ClassSignInfoDTO classSignInfoDTO); + + SignInStatusVO signInStatus(SignInRecordDO signInRecordDO); +} diff --git b/src/main/java/com/subsidy/service/SmsVerifyCodeService.java a/src/main/java/com/subsidy/service/SmsVerifyCodeService.java new file mode 100644 index 0000000..706fa89 --- /dev/null +++ a/src/main/java/com/subsidy/service/SmsVerifyCodeService.java @@ -0,0 +1,19 @@ +package com.subsidy.service; + +import com.subsidy.dto.sms.SendVerifyCodeDTO; +import com.subsidy.model.SmsVerifyCodeDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 短信验证码记录表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +public interface SmsVerifyCodeService extends IService { + + void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO); + +} diff --git b/src/main/java/com/subsidy/service/VodDictService.java a/src/main/java/com/subsidy/service/VodDictService.java new file mode 100644 index 0000000..1d5183a --- /dev/null +++ a/src/main/java/com/subsidy/service/VodDictService.java @@ -0,0 +1,31 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.content.GetContendVodsDTO; +import com.subsidy.model.VodDictDO; +import com.baomidou.mybatisplus.extension.service.IService; +import com.subsidy.vo.vod.GetContendVodsVO; +import com.subsidy.vo.vod.SignatureVO; + +import java.util.List; + +/** + *

+ * 视频表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +public interface VodDictService extends IService { + + SignatureVO signature()throws Exception; + + IPage getContendVods(GetContendVodsDTO getContendVodsDTO); + + String deleteVod(VodDictDO vodDictDO); + + String addVod(VodDictDO vodDictDO); + + String updateVod(VodDictDO vodDictDO); +} diff --git b/src/main/java/com/subsidy/service/VodPlayHistoryService.java a/src/main/java/com/subsidy/service/VodPlayHistoryService.java new file mode 100644 index 0000000..3b850e3 --- /dev/null +++ a/src/main/java/com/subsidy/service/VodPlayHistoryService.java @@ -0,0 +1,18 @@ +package com.subsidy.service; + +import com.subsidy.model.VodPlayHistoryDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 视频播放历史记录表 服务类 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +public interface VodPlayHistoryService extends IService { + + String insertHistory(VodPlayHistoryDO vodPlayHistoryDO); + +} diff --git b/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java new file mode 100644 index 0000000..4f84195 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/AdministerServiceImpl.java @@ -0,0 +1,1710 @@ +package com.subsidy.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.subsidy.common.exception.HttpException; +import com.subsidy.dto.administer.ClassDetailDTO; +import com.subsidy.dto.administer.OperatorsDTO; +import com.subsidy.dto.member.ImportMemberDTO; +import com.subsidy.mapper.*; +import com.subsidy.model.*; +import com.subsidy.service.AdministerService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.*; +import com.subsidy.util.excel.ExcelColumn; +import com.subsidy.util.excel.ExcelUtil; +import com.subsidy.vo.administer.*; +import com.subsidy.vo.classdict.ClassDetailVO; +import com.subsidy.vo.member.ClassSignVO; +import com.subsidy.vo.sign.AnswerRecordVO; +import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.*; +import org.apache.poi.hssf.util.CellRangeAddress; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.xssf.streaming.SXSSFCell; +import org.apache.poi.xssf.streaming.SXSSFRow; +import org.apache.poi.xssf.streaming.SXSSFSheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +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.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.math.BigDecimal; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + + +/** + *

+ * 管理平台用户 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class AdministerServiceImpl extends ServiceImpl implements AdministerService { + + @Autowired + private ClassDictMapper classDictMapper; + + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + @Autowired + private ExerciseDoneResultMapper exerciseDoneResultMapper; + + @Autowired + private AnsweringQuestionMapper answeringQuestionMapper; + + @Autowired + private ClassMemberMappingMapper classMemberMappingMapper; + + @Autowired + private CourseDictMapper courseDictMapper; + + @Autowired + private SignInRecordMapper signInRecordMapper; + + @Autowired + private CompanyDictMapper companyDictMapper; + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + @Autowired + private MemberMapper memberMapper; + + @Autowired + private DepartmentDictMapper departmentDictMapper; + + @Autowired + private MemberDepartmentMappingMapper memberDepartmentMappingMapper; + + public LoginVO login(AdministerDO administerDO) { + + LoginVO loginVO = new LoginVO(); + + AdministerDO administerDO1 = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(AdministerDO::getAccountName, administerDO.getAccountName())); + + if (null != administerDO1) { + if (administerDO.getPassword().equals(administerDO1.getPassword())) { + String token = JwtUtil.generateToken(administerDO1.getId(), ConstantUtils.ADMINISTER_TERMINATE); + loginVO.setToken(token); + return loginVO; + } else { + throw new HttpException(10004); + } + } else { + throw new HttpException(10011); + } + } + + public AdministerPermissionVO getPermissions() { + + AdministerPermissionVO administerPermissionVO = new AdministerPermissionVO(); + AdministerDO administerDO = (AdministerDO) Localstorage.getUser(); + if (administerDO == null) { + throw new HttpException(10012); + } + BeanUtils.copyProperties(administerDO, administerPermissionVO); + + List list = this.baseMapper.getPermissions(administerDO.getId()); + List treeList = new ArrayList(); + if (list != null) { + list.forEach(permission -> { + if (permission.getParentId() == null) { + treeList.add(permission); + } + + list.forEach(p -> { + if (null != p.getParentId() && p.getParentId().equals(permission.getId())) { + if (permission.getChildren() == null) { + permission.setChildren(new ArrayList<>()); + } + permission.getChildren().add(p); + } + }); + }); + } + administerPermissionVO.setPermissions(treeList); + return administerPermissionVO; + } + + public IPage operators(OperatorsDTO operatorsDTO) { + Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); + + //判断该用户的角色 + Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId, operatorsDTO.getId()) + .eq(RoleAdministerMappingDO::getRoleId, 1)); + + if (count > 0) { + operatorsDTO.setId(null); + } + + return companyDictMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getId(), operatorsDTO.getUserName(), 0); + } + + public String addAdminister(AdministerDO administerDO) { + + int count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(AdministerDO::getAccountName, administerDO.getAccountName())); + + if (count > 0) { + throw new HttpException(20002); + } + + administerDO.setRole(0); + administerDO.setPassword("admin123"); + administerDO.setStatus("1"); + this.baseMapper.insert(administerDO); + + RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO(); + roleAdministerMappingDO.setAdministerId(administerDO.getId()); + roleAdministerMappingDO.setRoleId(1L); + roleAdministerMappingMapper.insert(roleAdministerMappingDO); + + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteAdminister(AdministerDO administerDO) { + this.baseMapper.deleteById(administerDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateAdminister(AdministerDO administerDO) { + + int count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(AdministerDO::getAccountName, administerDO.getAccountName()) + .ne(AdministerDO::getId, administerDO.getId())); + + if (count > 0) { + throw new HttpException(20002); + } + this.baseMapper.updateById(administerDO); + return ConstantUtils.SET_SUCCESS; + } + + + public ClassSummaryVO classSummary(ClassDetailDTO classDetailDTO) { + + ClassSummaryVO classSummaryVO = new ClassSummaryVO(); + + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + classSummaryVO.setClassId(classDetailDTO.getId()); + classSummaryVO.setClassName(classDictDO.getClassName()); + classSummaryVO.setStartDate(classDictDO.getStartDate()); + classSummaryVO.setEndDate(classDictDO.getEndDate()); + + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + classSummaryVO.setCourseName(courseDictDO.getCourseName()); + + //班级人数 + List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classDetailDTO.getId())); + classSummaryVO.setMemberCount(classMemberMappingDOS.size()); + + //课程总数 + List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId()); + classSummaryVO.setTotalVodCounts(vodDictDOS.size()); + + + int totalStudyVods = 0; + int totalStudyLength = 0; + //学生总共学习课时数 + for (VodDictDO vodDictDO : vodDictDOS) { + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) + .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + + for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { + totalStudyLength += vodPlayHistoryDO.getPlayLength(); + } + + if (vodPlayHistoryDOS.size() > 0) { + if (vodPlayHistoryDOS.get(0).getPlayRecord() >= vodDictDO.getVodLength() * 0.8) { + totalStudyVods++; + } + } + } + } + classSummaryVO.setStudyVodCounts(MathUtil.intDivCeil(totalStudyVods,classMemberMappingDOS.size())); + + //平均完成时长 学生观看课程视频的全部时长/总人数 + int avg = MathUtil.intDivCeil(totalStudyLength, classMemberMappingDOS.size()); + classSummaryVO.setAvgVodPlayLength(avg); + + //测试通过率 + List exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getClassId, classDetailDTO.getId())); + + int passNum = 0; + + for (ExerciseDoneResultDO exerciseDoneResultDO : exerciseDoneResultDOS) { + if (exerciseDoneResultDO.getRightCounts() > exerciseDoneResultDO.getTotalCounts() * 0.6) { + passNum++; + } + } + classSummaryVO.setPassRate(MathUtil.intDivFloorPercent(passNum, classMemberMappingDOS.size())); + + + //平均签到数 向上取整 + //签到总次数 + Integer signCount = signInRecordMapper.selectCount(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + classSummaryVO.setAvgSignCount(MathUtil.intDivCeil(signCount, classMemberMappingDOS.size())); + + //答疑数 + Integer count = answeringQuestionMapper.selectCount(new QueryWrapper() + .lambda() + .eq(AnsweringQuestionDO::getClassId, classDetailDTO.getId())); + classSummaryVO.setAnswerCount(count); + + return classSummaryVO; + } + + public IPage classDetail(ClassDetailDTO classDetailDTO) { + + Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); + + + IPage classDetailVOIPage = this.baseMapper.classMembers(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List classDetailVOS = classDetailVOIPage.getRecords(); + + //课程由多少个视频 + List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId()); + + //课程详情 + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + + for (ClassDetailVO classDetailVO : classDetailVOS) { + //全部视频数 + classDetailVO.setAllVodCounts(vodDictDOS.size()); + + //该学生完成了多少个 + int i = 0; + + //该成员完成了几个视频 + for (VodDictDO vodDictDO : vodDictDOS) { + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, classDetailVO.getId()) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) + .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + + if (vodPlayHistoryDOS.size() > 0) { + if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { + i++; + } + } + } + classDetailVO.setStudyVodCounts(i); + + //学生测试完成情况 + ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId()) + .eq(ExerciseDoneResultDO::getMemberId, classDetailVO.getId())); + + if (null != exerciseDoneResultDO) { + classDetailVO.setRightCounts(exerciseDoneResultDO.getRightCounts()); + classDetailVO.setTotalExeCounts(exerciseDoneResultDO.getTotalCounts()); + classDetailVO.setScore(MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts())); + + if (classDetailVO.getScore()>=60){ + classDetailVO.setResult("合格"); + }else { + classDetailVO.setResult("不合格"); + } + + } + + classDetailVO.setClassProcess(i+"/"+vodDictDOS.size()); + //答疑 + Integer count = answeringQuestionMapper.selectCount(new QueryWrapper() + .lambda() + .eq(AnsweringQuestionDO::getAskId, classDetailVO.getId()) + .eq(AnsweringQuestionDO::getClassId, classDetailDTO.getId())); + classDetailVO.setAskCounts(count); + + //签到次数 + Integer signCount = signInRecordMapper.selectCount(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, classDetailVO.getId()) + .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + classDetailVO.setSignCounts(signCount); + + //培训时长 + classDetailVO.setTrainingLength(i); + } + classDetailVOIPage.setRecords(classDetailVOS); + return classDetailVOIPage; + } + + public List exportClassDetail(ClassDetailDTO classDetailDTO) throws Exception { + Page pager = new Page(1, 10000000); + + IPage classDetailVOIPage = this.baseMapper.classMembers(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List classDetailVOS = classDetailVOIPage.getRecords(); + + //课程由多少个视频 + List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId()); + + //课程详情 + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + + CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); + for (ClassDetailVO classDetailVO : classDetailVOS) { + //全部视频数 + //classDetailVO.setAllVodCounts(vodDictDOS.size()); + + //该学生完成了多少个 + int i = 0; + + //该成员完成了几个视频 + for (VodDictDO vodDictDO : vodDictDOS) { + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, classDetailVO.getId()) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) + .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + + if (vodPlayHistoryDOS.size() > 0) { + if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { + i++; + } + } + } + //classDetailVO.setStudyVodCounts(i); + classDetailVO.setClassProcess(i + "/" + vodDictDOS.size()); + //学生测试完成情况 + ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId()) + .eq(ExerciseDoneResultDO::getMemberId, classDetailVO.getId())); + + if (null != exerciseDoneResultDO) { + classDetailVO.setScore(MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(), exerciseDoneResultDO.getTotalCounts())); + } else { + classDetailVO.setScore(0); + } + + //答疑 + Integer count = answeringQuestionMapper.selectCount(new QueryWrapper() + .lambda() + .eq(AnsweringQuestionDO::getAskId, classDetailVO.getId()) + .eq(AnsweringQuestionDO::getClassId, classDetailDTO.getId())); + classDetailVO.setAskCounts(count); + + //签到次数 + Integer signCount = signInRecordMapper.selectCount(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, classDetailVO.getId()) + .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + classDetailVO.setSignCounts(signCount); + + //培训时长 + classDetailVO.setTrainingLength(i); + } + + if (classDetailDTO.getFlag()) { + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); + ExcelUtil.writeMemberExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "授课记录汇总表", classDetailVOS, ExcelFormatUtils.memberList); + } + return classDetailVOS; + } + + + public IPage signDetail(ClassDetailDTO classDetailDTO) { + + Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); + + IPage classSignVOIPage = this.baseMapper.classSign(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List classSignVOS = classSignVOIPage.getRecords(); + + //课程由多少个视频 + List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId()); + + for (ClassSignVO classSignVO : classSignVOS) { + + //全部视频数 + classSignVO.setAllVodCounts(vodDictDOS.size()); + + //该学生完成了多少个 + int i = 0; + + //该成员完成了几个视频 + for (VodDictDO vodDictDO : vodDictDOS) { + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, classSignVO.getId()) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) + .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + + if (vodPlayHistoryDOS.size() > 0) { + if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { + i++; + } + } + } + classSignVO.setStudyVodCounts(i); + classSignVO.setClassProcess(i+"/"+vodDictDOS.size()); + + //完成率 + String percent = MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(i), new BigDecimal(vodDictDOS.size())); + classSignVO.setPercent(percent); + + //签到 + List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, classSignVO.getId()) + .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + classSignVO.setSignCounts(signInRecordDOS.size()); + + StringBuilder stringBuilder = new StringBuilder(); + //签到时间 + for (SignInRecordDO signInRecordDO : signInRecordDOS) { + stringBuilder.append(signInRecordDO.getSignInDate().toString().replace("T", " ")).append(";"); + } + if (StringUtils.isNotBlank(stringBuilder.toString())) { + String signInDate = stringBuilder.toString().substring(0, stringBuilder.length() - 1); + classSignVO.setSignInDateList(signInDate); + } + + //培训时长 + classSignVO.setTrainingLength(i); + } + classSignVOIPage.setRecords(classSignVOS); + return classSignVOIPage; + } + + public List exportSignDetail(ClassDetailDTO classDetailDTO) throws Exception { + Page pager = new Page(1, 1000000); + + IPage classSignVOIPage = this.baseMapper.classSign(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List classSignVOS = classSignVOIPage.getRecords(); + + //课程由多少个视频 + List vodDictDOS = classDictMapper.getClassVods(classDetailDTO.getId()); + + for (ClassSignVO classSignVO : classSignVOS) { + + //全部视频数 + //classSignVO.setAllVodCounts(vodDictDOS.size()); + + //该学生完成了多少个 + int i = 0; + + //该成员完成了几个视频 + for (VodDictDO vodDictDO : vodDictDOS) { + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, classSignVO.getId()) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) + .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + + if (vodPlayHistoryDOS.size() > 0) { + if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { + i++; + } + } + } + //classSignVO.setStudyVodCounts(i); + classSignVO.setClassProcess(i + "/" + vodDictDOS.size()); + + //完成率 + String percent = MathUtil.getPercentAvgIndexWithPercent(new BigDecimal(i), new BigDecimal(vodDictDOS.size())); + classSignVO.setPercent(percent); + + //签到 + List signInRecordDOS = signInRecordMapper.selectList(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, classSignVO.getId()) + .eq(SignInRecordDO::getClassId, classDetailDTO.getId())); + classSignVO.setSignCounts(signInRecordDOS.size()); + + StringBuilder stringBuilder = new StringBuilder(); + //签到时间 + for (SignInRecordDO signInRecordDO : signInRecordDOS) { + stringBuilder.append(signInRecordDO.getSignInDate().toString().replace("T", " ")).append(";"); + } + if (StringUtils.isNotBlank(stringBuilder.toString())) { + String signInDate = stringBuilder.toString().substring(0, stringBuilder.length() - 1); + classSignVO.setSignInDateList(signInDate); + } + + //培训时长 + classSignVO.setTrainingLength(i); + } + + if (classDetailDTO.getFlag()) { + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); + ExcelUtil.writeSignExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "注册签到表", classSignVOS, ExcelFormatUtils.signList); + } + + return classSignVOS; + } + + + public IPage exerciseTest(ClassDetailDTO classDetailDTO) { + + Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); + + IPage exerciseTestVOIPage = this.baseMapper.exerciseTest(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List classSignVOS = exerciseTestVOIPage.getRecords(); + + //课程详情 + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + + for (ExerciseTestVO exerciseTestVO : classSignVOS) { + + //学生测试完成情况 + ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId()) + .eq(ExerciseDoneResultDO::getMemberId, exerciseTestVO.getId())); + + if (null != exerciseDoneResultDO) { + int rights = exerciseDoneResultDO.getRightCounts(); + int total = exerciseDoneResultDO.getTotalCounts(); + int score = MathUtil.intDivFloorPercent(rights, total); + exerciseTestVO.setScore(score); + if (score >= 60) { + exerciseTestVO.setResult("合格"); + } else { + exerciseTestVO.setResult("不合格"); + } + exerciseTestVO.setCount(1); + + } else { + exerciseTestVO.setScore(0); + exerciseTestVO.setResult("不合格"); + exerciseTestVO.setCount(0); + } + } + exerciseTestVOIPage.setRecords(classSignVOS); + return exerciseTestVOIPage; + } + + public List exportExerciseTest(ClassDetailDTO classDetailDTO) throws Exception { + Page pager = new Page(0, 1000000); + + IPage exerciseTestVOIPage = this.baseMapper.exerciseTest(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List exerciseTestVOS = exerciseTestVOIPage.getRecords(); + + //课程详情 + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + + for (ExerciseTestVO exerciseTestVO : exerciseTestVOS) { + + //学生测试完成情况 + ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getCourseId, classDictDO.getCourseId()) + .eq(ExerciseDoneResultDO::getMemberId, exerciseTestVO.getId())); + + if (null != exerciseDoneResultDO) { + int rights = exerciseDoneResultDO.getRightCounts(); + int total = exerciseDoneResultDO.getTotalCounts(); + int score = MathUtil.intDivFloorPercent(rights, total); + exerciseTestVO.setScore(score); + if (score >= 60) { + exerciseTestVO.setResult("合格"); + } else { + exerciseTestVO.setResult("不合格"); + } + } else { + exerciseTestVO.setScore(0); + exerciseTestVO.setResult("不合格"); + } + } + + if (classDetailDTO.getFlag()) { + CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); + ExcelUtil.writeTestExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩表", exerciseTestVOS, ExcelFormatUtils.scoreList); + } + + return exerciseTestVOS; + } + + public IPage answerRecord(ClassDetailDTO classDetailDTO) { + Page pager = new Page(classDetailDTO.getPageNum(), classDetailDTO.getPageSize()); + return this.baseMapper.answerRecord(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + } + + public List exportAnswerRecord(ClassDetailDTO classDetailDTO) throws Exception { + Page pager = new Page(1, 1000000); + IPage iPage = this.baseMapper.answerRecord(pager, classDetailDTO.getId(), classDetailDTO.getUserName()); + List answerRecordVOS = iPage.getRecords(); + + if (classDetailDTO.getFlag()){ + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); + ExcelUtil.writeAnswerExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "答疑记录表", answerRecordVOS, ExcelFormatUtils.answersList); + } + return answerRecordVOS; + } + + public void export(ClassDetailDTO classDetailDTO) throws Exception { + + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = servletRequestAttributes.getResponse(); + ServletOutputStream sos = response.getOutputStream(); + ZipOutputStream zipOutputStream = new ZipOutputStream(sos); + String zipname = "summary.zip"; + response.reset(); + response.setHeader("Access-Control-Allow-Origin", "*"); + response.setContentType("application/zip;charset=utf-8"); + response.setHeader("Content-Disposition", "attachment;filename=" + new String((zipname).getBytes("UTF-8"), "ISO8859-1")); + + ClassDictDO classDictDO = classDictMapper.selectById(classDetailDTO.getId()); + CompanyDictDO companyDictDO = companyDictMapper.selectById(classDictDO.getCompanyId()); + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + + /** + * 班级成员 + */ + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + classDetailDTO.setFlag(false); + List classDetailVOS = exportClassDetail(classDetailDTO); + String studyDate = classDictDO.getStartDate() + " 至 " + classDictDO.getEndDate(); + membersListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "授课记录汇总表", ExcelFormatUtils.memberList, classDetailVOS, null, 0, baos); + compressFileToZipStream(zipOutputStream, baos, "member.xlsx"); + + /** + * 注册签到 + */ + ByteArrayOutputStream baos1 = new ByteArrayOutputStream(); + classDetailDTO.setFlag(false); + List classSignVOS = exportSignDetail(classDetailDTO); + signListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "注册签到", ExcelFormatUtils.signList, classSignVOS, null, 0, baos1); + compressFileToZipStream(zipOutputStream, baos1, "sign.xlsx"); + + + ///** + // * 测试成绩 + // */ + ByteArrayOutputStream baos2 = new ByteArrayOutputStream(); + classDetailDTO.setFlag(false); + List exerciseTestVOS = exportExerciseTest(classDetailDTO); + testListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "测试成绩", ExcelFormatUtils.scoreList, exerciseTestVOS, null, 0, baos2); + compressFileToZipStream(zipOutputStream, baos2, "test.xlsx"); + + + /** + * 答疑记录 + */ + ByteArrayOutputStream baos3 = new ByteArrayOutputStream(); + List answerRecordVOS = exportAnswerRecord(classDetailDTO); + askListExcel(companyDictDO.getCompanyName(), studyDate, courseDictDO.getCourseName(), "答疑记录", ExcelFormatUtils.answersList, answerRecordVOS, null, 0, baos3); + compressFileToZipStream(zipOutputStream, baos3, "answer.xlsx"); + + zipOutputStream.flush(); + zipOutputStream.closeEntry(); + + baos.close(); + //baos1.close(); + //baos2.close(); + //baos3.close(); + + zipOutputStream.flush(); + zipOutputStream.close(); + + sos.close(); + + } + + + @Transactional(rollbackFor = Exception.class) + public String importMember(Long companyId, MultipartFile multipartFile) { + + try { + + List memberDOS = new ArrayList<>(); + + ExcelUtil.readExcel(null, ImportMemberDTO.class, multipartFile).forEach(s -> { + + MemberDO memberDO = memberMapper.selectOne(new QueryWrapper() + .lambda() + .eq(MemberDO::getTelephone, s.getTelephone())); + + if (null != memberDO) { + memberDOS.add(memberDO); + } else { + MemberDO memberDO1 = new MemberDO(); + memberDO1.setUserName(s.getUserName()); + memberDO1.setGender(s.getGender()); + memberDO1.setAccountName(s.getAccountName()); + memberDO1.setTelephone(s.getTelephone()); + memberDO1.setIdCard(s.getIdCard()); + memberDO1.setStatus("启用"); + memberDO1.setPassword("123456"); + memberMapper.insert(memberDO1); + + //找到该公司最大的部门 + DepartmentDictDO departmentDictDO = departmentDictMapper.selectOne(new QueryWrapper() + .lambda() + .isNull(DepartmentDictDO::getParentId) + .eq(DepartmentDictDO::getCompanyId, companyId)); + + MemberDepartmentMappingDO memberDepartmentMappingDO = new MemberDepartmentMappingDO(); + memberDepartmentMappingDO.setDepartmentId(departmentDictDO.getId()); + memberDepartmentMappingDO.setMemberId(memberDO1.getId()); + memberDepartmentMappingMapper.insert(memberDepartmentMappingDO); + } + }); + } catch (Exception e) { + throw new HttpException(10001); + } + return ConstantUtils.ADD_SUCCESS; + } + + + public static void membersListExcel(String companyName, String studyDate, String courseName, String title, List headerList, List classDetailVOS, String datePattern, int colWidth, OutputStream out) { + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 4); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 10); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(5).setCellValue(secondHead[1]); + secondRow.getCell(5).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 4); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 10); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(5).setCellValue(thirdHead[1]); + thirdRow.getCell(5).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (ClassDetailVO classDetailVO : classDetailVOS) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getUserName()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getIdCard()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getAccountName()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getTelephone()); + + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getSignCounts()); + + newCell = dataRow.createCell(6); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getClassProcess()); + + newCell = dataRow.createCell(7); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getTrainingLength()); + + newCell = dataRow.createCell(8); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getAskCounts()); + + newCell = dataRow.createCell(9); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getScore()); + + newCell = dataRow.createCell(10); + newCell.setCellStyle(cellStyle); + if (classDetailVO.getScore() >= 60) { + newCell.setCellValue("合格"); + } else { + newCell.setCellValue("不合格"); + } + rowIndex++; + seq++; + } + + try { + workbook.write(out); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + + public static void signListExcel(String companyName, String studyDate, String courseName, String title, List headerList, List classSignVOS, String datePattern, int colWidth, OutputStream out) { + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 3); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 8); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(4).setCellValue(secondHead[1]); + secondRow.getCell(4).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 3); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 8); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(4).setCellValue(thirdHead[1]); + thirdRow.getCell(4).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (ClassSignVO classSignVO : classSignVOS) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getUserName()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getIdCard()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getTelephone()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getTrainingLength()); + + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getClassProcess()); + + newCell = dataRow.createCell(6); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getPercent()); + + newCell = dataRow.createCell(7); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getSignCounts()); + + newCell = dataRow.createCell(8); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getSignInDateList()); + + rowIndex++; + seq++; + + } + + try { + workbook.write(out); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void testListExcel(String companyName, String studyDate, String courseName, String title, List headerList, List exerciseTestVOS, String datePattern, int colWidth, OutputStream out) { + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 3); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 6); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(4).setCellValue(secondHead[1]); + secondRow.getCell(4).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 3); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 6); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(4).setCellValue(thirdHead[1]); + thirdRow.getCell(4).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (ExerciseTestVO exerciseTestVO : exerciseTestVOS) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getUserName()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getIdCard()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getTelephone()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getScore()); + + //次数 + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + if (exerciseTestVO.getScore()!=0){ + newCell.setCellValue(1); + }else { + newCell.setCellValue(0); + } + + newCell = dataRow.createCell(6); + newCell.setCellStyle(cellStyle); + if (exerciseTestVO.getScore()>=60){ + newCell.setCellValue("合格"); + }else { + newCell.setCellValue("不合格"); + } + + rowIndex++; + seq++; + + } + try { + workbook.write(out); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void askListExcel(String companyName, String studyDate, String courseName,String title, List headerList, List answerRecordVOS, String datePattern, int colWidth, OutputStream out) { + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 2); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 3, 5); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(3).setCellValue(secondHead[1]); + secondRow.getCell(3).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 2); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 3,5); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(3).setCellValue(thirdHead[1]); + thirdRow.getCell(3).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (AnswerRecordVO answerRecordVO : answerRecordVOS) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getTitle()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getAnswer()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getCreateDate()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getUserName()); + + //次数 + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getUpdateDate()); + + rowIndex++; + seq++; + + } + try { + workbook.write(out); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + + /** + * 压缩单个excel文件的输出流 到zip输出流,注意zipOutputStream未关闭,需要交由调用者关闭之 + * + * @param zipOutputStream zip文件的输出流 + * @param excelOutputStream excel文件的输出流 + * @param excelFilename 文件名可以带目录,例如 TestDir/test1.xlsx + */ + public static void compressFileToZipStream(ZipOutputStream zipOutputStream, + ByteArrayOutputStream excelOutputStream, String excelFilename) { + byte[] buf = new byte[1024]; + try { + // Compress the files + byte[] content = excelOutputStream.toByteArray(); + ByteArrayInputStream is = new ByteArrayInputStream(content); + BufferedInputStream bis = new BufferedInputStream(is); + // Add ZIP entry to output stream. + zipOutputStream.putNextEntry(new ZipEntry(excelFilename)); + // Transfer bytes from the file to the ZIP file + int len; + while ((len = bis.read(buf)) > 0) { + zipOutputStream.write(buf, 0, len); + } + // Complete the entry + //excelOutputStream.close();//关闭excel输出流 + //zipOutputStream.closeEntry(); + bis.close(); + is.close(); + // Complete the ZIP file + } catch (IOException e) { + e.printStackTrace(); + } + } + + + //也可用以下方法 + public static void setBorderStyle(int border, CellRangeAddress region, SXSSFSheet sheet, SXSSFWorkbook wb) { + CellStyle cs = wb.createCellStyle(); // 样式对象 + cs.setBorderBottom((short) border); + cs.setBorderTop((short) border); + cs.setBorderLeft((short) border); + cs.setBorderRight((short) border); + + setRegionStyle(cs, region, sheet); + } + + private static void setRegionStyle(CellStyle cs, CellRangeAddress region, SXSSFSheet sheet) { + for (int i = region.getFirstRow(); i <= region.getLastRow(); i++) { + SXSSFRow row = sheet.getRow(i); + if (row == null) { + row = sheet.createRow(i); + } + for (int j = region.getFirstColumn(); j <= region.getLastColumn(); j++) { + SXSSFCell cell = row.getCell(j); + if (cell == null) { + cell = row.createCell(j); + cell.setCellValue(""); + } + cell.setCellStyle(cs); + } + } + } + + + private static void setStyle(CellStyle cellStyle) { + // 水平居中 + cellStyle.setAlignment(CellStyle.ALIGN_CENTER); + // 垂直居中 + cellStyle.setVerticalAlignment(CellStyle.ALIGN_CENTER); + // 边框 + cellStyle.setBorderTop(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderLeft(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderRight(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderBottom(CellStyle.BORDER_THIN); + } + +} diff --git b/src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java a/src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java new file mode 100644 index 0000000..fe91fc8 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/AnsweringQuestionServiceImpl.java @@ -0,0 +1,46 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.dto.GetCourseQuestionDTO; +import com.subsidy.model.AnsweringQuestionDO; +import com.subsidy.mapper.AnsweringQuestionMapper; +import com.subsidy.service.AnsweringQuestionService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.springframework.stereotype.Service; + +/** + *

+ * 问题答疑表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +@Service +public class AnsweringQuestionServiceImpl extends ServiceImpl implements AnsweringQuestionService { + + + public IPage getCourseQuestion(GetCourseQuestionDTO getCourseQuestionDTO) { + Page pager = new Page(getCourseQuestionDTO.getPageNum(), getCourseQuestionDTO.getPageSize()); + return this.baseMapper.getCourseQuestion(pager, getCourseQuestionDTO.getClassId(), getCourseQuestionDTO.getMemberId()); + } + + public String addQuestion(AnsweringQuestionDO answeringQuestionDO) { + this.baseMapper.insert(answeringQuestionDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteQuestion(AnsweringQuestionDO answeringQuestionDO) { + this.baseMapper.deleteById(answeringQuestionDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateQuestion(AnsweringQuestionDO answeringQuestionDO) { + this.baseMapper.updateById(answeringQuestionDO); + return ConstantUtils.SET_SUCCESS; + } + + +} diff --git b/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java a/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java new file mode 100644 index 0000000..dbb014b --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/CategoryServiceImpl.java @@ -0,0 +1,103 @@ +package com.subsidy.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.subsidy.common.exception.HttpException; +import com.subsidy.dto.category.GetCategoriesDTO; +import com.subsidy.model.CategoryDO; +import com.subsidy.mapper.CategoryMapper; +import com.subsidy.service.CategoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 类目名称 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class CategoryServiceImpl extends ServiceImpl implements CategoryService { + + public IPage getCategories(GetCategoriesDTO getCategoriesDTO) { + Page pager = new Page(getCategoriesDTO.getPageNum(), getCategoriesDTO.getPageSize()); + + if (null == getCategoriesDTO.getCompanyId()) { + return this.baseMapper.selectPage(pager, new QueryWrapper() + .lambda() + .like(CategoryDO::getName, getCategoriesDTO.getName()) + .isNull(CategoryDO::getCompanyId)); + } else { + return this.baseMapper.selectPage(pager, new QueryWrapper() + .lambda() + .like(CategoryDO::getName, getCategoriesDTO.getName()) + .eq(CategoryDO::getCompanyId, getCategoriesDTO.getCompanyId())); + } + + } + + public List getAll(GetCategoriesDTO getCategoriesDTO) { + + if (null == getCategoriesDTO.getCompanyId()) { + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .isNull(CategoryDO::getCompanyId)); + } else { + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(CategoryDO::getCompanyId, getCategoriesDTO.getCompanyId())); + } + } + + + public String addCategory(CategoryDO categoryDO) { + + int count = 0; + + if (null == categoryDO.getCompanyId()) { + count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .like(CategoryDO::getName, categoryDO.getName()) + .isNull(CategoryDO::getCompanyId)); + } else { + count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .like(CategoryDO::getName, categoryDO.getName()) + .eq(CategoryDO::getCompanyId, categoryDO.getCompanyId())); + } + + if (count > 0) { + throw new HttpException(90001); + } + this.baseMapper.insert(categoryDO); + + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteCategory(CategoryDO categoryDO) { + this.baseMapper.deleteById(categoryDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateCategory(CategoryDO categoryDO) { + + int count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(CategoryDO::getName, categoryDO.getName())); + + if (count > 2) { + throw new HttpException(90001); + } + + this.baseMapper.updateById(categoryDO); + return ConstantUtils.SET_SUCCESS; + } + + +} diff --git b/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java new file mode 100644 index 0000000..b9bf4be --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/ClassDictServiceImpl.java @@ -0,0 +1,114 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.dto.classDict.AddClassDTO; +import com.subsidy.dto.classDict.AddMemberToClassDTO; +import com.subsidy.dto.classDict.GetAllClassesDTO; +import com.subsidy.dto.classDict.GetSpareMembersDTO; +import com.subsidy.mapper.AdministerMapper; +import com.subsidy.mapper.ClassMemberMappingMapper; +import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.model.*; +import com.subsidy.mapper.ClassDictMapper; +import com.subsidy.service.ClassDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.classdict.GetAllClassesVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.BeanFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.management.relation.Role; +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 班级id 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +@Service +public class ClassDictServiceImpl extends ServiceImpl implements ClassDictService { + + @Autowired + private ClassMemberMappingMapper classMemberMappingMapper; + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + + public List getAllClasses(ClassDictDO classDictDO) { + return this.baseMapper.getAllClasses(classDictDO); + } + + @Transactional + public String deleteClasses(ClassDictDO classDictDO) { + this.baseMapper.deleteById(classDictDO.getId()); + + classMemberMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classDictDO.getId())); + return ConstantUtils.DELETE_SUCCESS; + } + + public String addClass(AddClassDTO addClassDTO) { + + //查看当前登录人的角色 + int count = roleAdministerMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,addClassDTO.getUserId()) + .eq(RoleAdministerMappingDO::getRoleId,1)); + + ClassDictDO classDictDO = new ClassDictDO(); + BeanUtils.copyProperties(addClassDTO,classDictDO); + + if (count>0){ + classDictDO.setClassType("平台支持"); + }else{ + classDictDO.setClassType("企业自荐"); + } + + this.baseMapper.insert(classDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateClass(ClassDictDO classDictDO) { + this.baseMapper.updateById(classDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public ClassDictDO classDetail(ClassDictDO classDictDO) { + return this.baseMapper.selectById(classDictDO.getId()); + } + + public String removeMember(ClassMemberMappingDO classMemberMappingDO) { + classMemberMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classMemberMappingDO.getClassId()) + .eq(ClassMemberMappingDO::getMemberId, classMemberMappingDO.getMemberId())); + return ConstantUtils.DELETE_SUCCESS; + } + + public List getSpareMembers(GetSpareMembersDTO getSpareMembersDTO){ + return this.baseMapper.getSpareMembers(getSpareMembersDTO); + } + + public String addMemberToClass(AddMemberToClassDTO addMemberToClassDTO){ + + List memberIds = addMemberToClassDTO.getMemberIds(); + + for (Long lg : memberIds){ + ClassMemberMappingDO classMemberMappingDO = new ClassMemberMappingDO(); + classMemberMappingDO.setClassId(addMemberToClassDTO.getClassId()); + classMemberMappingDO.setMemberId(lg); + classMemberMappingMapper.insert(classMemberMappingDO); + } + return ConstantUtils.ADD_SUCCESS; + } + +} diff --git b/src/main/java/com/subsidy/service/impl/ClassMemberMappingServiceImpl.java a/src/main/java/com/subsidy/service/impl/ClassMemberMappingServiceImpl.java new file mode 100644 index 0000000..e0947c6 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/ClassMemberMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.mapper.ClassMemberMappingMapper; +import com.subsidy.service.ClassMemberMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 班级成员映射表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +@Service +public class ClassMemberMappingServiceImpl extends ServiceImpl implements ClassMemberMappingService { + +} diff --git b/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java new file mode 100644 index 0000000..b0980ce --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/CompanyDictServiceImpl.java @@ -0,0 +1,134 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.administer.OperatorsDTO; +import com.subsidy.dto.company.AddCompanyDTO; +import com.subsidy.mapper.AdministerMapper; +import com.subsidy.mapper.DepartmentDictMapper; +import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.model.AdministerDO; +import com.subsidy.model.CompanyDictDO; +import com.subsidy.mapper.CompanyDictMapper; +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.RoleAdministerMappingDO; +import com.subsidy.service.CompanyDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.administer.OperatorsVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + *

+ * 企业字典表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-25 + */ +@Service +public class CompanyDictServiceImpl extends ServiceImpl implements CompanyDictService { + + + @Autowired + private AdministerMapper administerMapper; + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + @Autowired + private DepartmentDictMapper departmentDictMapper; + + public IPage operators(OperatorsDTO operatorsDTO) { + Page pager = new Page(operatorsDTO.getPageNum(), operatorsDTO.getPageSize()); + //判断该用户的角色 + Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,operatorsDTO.getId()) + .eq(RoleAdministerMappingDO::getRoleId,1)); + + if (count > 0){ + operatorsDTO.setId(null); + } + + return this.baseMapper.operators(pager, operatorsDTO.getCompanyName(), operatorsDTO.getId(),operatorsDTO.getUserName(),1); + } + + public String addOperator(AddCompanyDTO addCompanyDTO) { + + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(CompanyDictDO::getCompanyName, addCompanyDTO.getAccountName())); + + Integer count1 = administerMapper.selectCount(new QueryWrapper() + .lambda() + .eq(AdministerDO::getAccountName, addCompanyDTO.getAccountName())); + + if (count > 0 || count1>0) { + throw new HttpException(20002); + } + + CompanyDictDO companyDictDO =new CompanyDictDO(); + BeanUtils.copyProperties(addCompanyDTO,companyDictDO); + this.baseMapper.insert(companyDictDO); + + AdministerDO administerDO = new AdministerDO(); + administerDO.setAccountName(addCompanyDTO.getAccountName()); + administerDO.setCompanyId(companyDictDO.getId()); + administerDO.setPassword("admin123"); + administerDO.setStatus("1"); + administerDO.setRole(1); + administerMapper.insert(administerDO); + + RoleAdministerMappingDO roleAdministerMappingDO = new RoleAdministerMappingDO(); + roleAdministerMappingDO.setAdministerId(administerDO.getId()); + roleAdministerMappingDO.setRoleId(2L); + roleAdministerMappingMapper.insert(roleAdministerMappingDO); + + //添加默认部门 名称为公司名称 + DepartmentDictDO departmentDictDO = new DepartmentDictDO(); + departmentDictDO.setCompanyId(companyDictDO.getId()); + departmentDictDO.setDepartmentName(companyDictDO.getCompanyName()); + //departmentDictDO.setParentId(1L); + departmentDictMapper.insert(departmentDictDO); + + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteAdminister(CompanyDictDO companyDictDO) { + this.baseMapper.deleteById(companyDictDO.getId()); + + administerMapper.delete(new QueryWrapper() + .lambda() + .eq(AdministerDO::getCompanyId,companyDictDO.getId())); + + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateAdminister(AddCompanyDTO addCompanyDTO) { + + CompanyDictDO companyDictDO = new CompanyDictDO(); + BeanUtils.copyProperties(addCompanyDTO,companyDictDO); + this.baseMapper.updateById(companyDictDO); + + //查找企业管理员 + AdministerDO administerDO = administerMapper.selectOne(new QueryWrapper() + .lambda() + .eq(AdministerDO::getCompanyId,addCompanyDTO.getId()) + .eq(AdministerDO::getRole,1)); + if (StringUtils.isNotBlank(addCompanyDTO.getAccountName())){ + administerDO.setAccountName(addCompanyDTO.getAccountName()); + } + if (StringUtils.isBlank(addCompanyDTO.getPassword())){ + addCompanyDTO.setPassword(addCompanyDTO.getPassword()); + } + administerMapper.updateById(administerDO); + return ConstantUtils.SET_SUCCESS; + } + +} diff --git b/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java a/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java new file mode 100644 index 0000000..4ce8553 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/CourseContentServiceImpl.java @@ -0,0 +1,75 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.exception.HttpException; +import com.subsidy.controller.CourseContentController; +import com.subsidy.mapper.VodDictMapper; +import com.subsidy.model.CourseContentDO; +import com.subsidy.mapper.CourseContentMapper; +import com.subsidy.model.CourseDictDO; +import com.subsidy.model.VodDictDO; +import com.subsidy.service.CourseContentService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.vod.GetContendVodsVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 课程目录表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class CourseContentServiceImpl extends ServiceImpl implements CourseContentService { + + public List getContents(CourseContentDO courseContentDO) { + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(CourseContentDO::getCourseId, courseContentDO.getCourseId()) + .orderByAsc(CourseContentDO::getOrderNo) + .orderByAsc(CourseContentDO::getCreateDate)); + } + + public String deleteContent(CourseContentDO courseContentDO){ + this.baseMapper.deleteById(courseContentDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String addContent(CourseContentDO courseContentDO){ + + List courseContentDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(CourseContentDO::getCourseId,courseContentDO.getCourseId()) + .orderByDesc(CourseContentDO::getOrderNo)); + + int orderNo = 1 ; + + if (courseContentDOS.size()>0){ + orderNo = courseContentDOS.get(0).getOrderNo()+1; + } + courseContentDO.setOrderNo(orderNo); + this.baseMapper.insert(courseContentDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateContent(CourseContentDO courseContentDO){ + + List courseContentDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(CourseContentDO::getCourseId,courseContentDO.getCourseId()) + .eq(CourseContentDO::getContent,courseContentDO.getContent())); + + if (courseContentDOS.size()>0){ + throw new HttpException(40001); + } + this.baseMapper.updateById(courseContentDO); + return ConstantUtils.SET_SUCCESS; + } + +} diff --git b/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java new file mode 100644 index 0000000..091446c --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/CourseDictServiceImpl.java @@ -0,0 +1,150 @@ +package com.subsidy.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.subsidy.common.exception.HttpException; +import com.subsidy.dto.course.QueryCoursesDTO; +import com.subsidy.mapper.AdministerMapper; +import com.subsidy.mapper.CompanyDictMapper; +import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.model.AdministerDO; +import com.subsidy.model.CompanyDictDO; +import com.subsidy.model.CourseDictDO; +import com.subsidy.mapper.CourseDictMapper; +import com.subsidy.model.RoleAdministerMappingDO; +import com.subsidy.service.CompanyDictService; +import com.subsidy.service.CourseDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class CourseDictServiceImpl extends ServiceImpl implements CourseDictService { + + @Autowired + private RoleAdministerMappingMapper roleAdministerMappingMapper; + + @Autowired + private AdministerMapper administerMapper; + + @Autowired + private CompanyDictMapper companyDictMapper; + + public String addCourse(CourseDictDO courseDictDO) { + + int count = 0; + + if (null != courseDictDO.getCompanyId()) { + count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) + .isNull(CourseDictDO::getCompanyId)); + + } else { + count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) + .eq(CourseDictDO::getCompanyId, courseDictDO.getCompanyId())); + } + + if (count > 0) { + throw new HttpException(20001); + } + + this.baseMapper.insert(courseDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteCourse(CourseDictDO courseDictDO) { + this.baseMapper.deleteById(courseDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public IPage queryCourses(QueryCoursesDTO queryCoursesDTO) { + Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize()); + + //判断当前用户是运营者还是企业者 + Integer count = roleAdministerMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(RoleAdministerMappingDO::getAdministerId,queryCoursesDTO.getAdministerId()) + .eq(RoleAdministerMappingDO::getRoleId,1)); + + if (count > 0){ + queryCoursesDTO.setCompanyId(null); + } + + return this.baseMapper.queryCourses(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCourseSource(), queryCoursesDTO.getCompanyId()); + } + + public String updateCourses(CourseDictDO courseDictDO) { + int count = 0; + + if (null != courseDictDO.getCompanyId()) { + count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) + .ne(CourseDictDO::getId, courseDictDO.getCompanyId())); + + } else { + count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(CourseDictDO::getCourseName, courseDictDO.getCourseName()) + .isNull(CourseDictDO::getCompanyId)); + } + + if (count > 0) { + throw new HttpException(20001); + } + this.baseMapper.updateById(courseDictDO); + return ConstantUtils.DELETE_SUCCESS; + } + + public IPage queryCompanyCourse(QueryCoursesDTO queryCoursesDTO) { + Page pager = new Page(queryCoursesDTO.getPageNum(), queryCoursesDTO.getPageSize()); + + ////判断角色 + //List roleAdministerMappingDOS = roleAdministerMappingMapper.selectList(new QueryWrapper() + //.lambda() + //.eq(RoleAdministerMappingDO::getAdministerId,roleAdministerMappingMapper)); + // + //Boolean flag = false; + //for (RoleAdministerMappingDO roleAdministerMappingDO : roleAdministerMappingDOS){ + // + // if (roleAdministerMappingDO.getRoleId() ==3){ + // flag= false; + // }else if(roleAdministerMappingDO.getRoleId()==2) { + // flag = true; + // } + //} + + //List longs = new ArrayList<>(); + //if (flag){ + // //运营者账号 该企业下的所有课程 管理员 + // //获取该企业下所有老师的课程 + // AdministerDO administerDO = administerMapper.selectById(queryCoursesDTO.getAdministerId()); + // + // List administerDOS = administerMapper.selectList(new QueryWrapper() + // .lambda() + // .eq(AdministerDO::getCompanyId,administerDO.getCompanyId())); + // for (AdministerDO administerDO1 : administerDOS){ + // longs.add(administerDO1.getId()); + // } + return this.baseMapper.queryCompanyCourse(pager, queryCoursesDTO.getCourseName(), queryCoursesDTO.getCategoryId(), queryCoursesDTO.getCourseType(), queryCoursesDTO.getCourseSource(), queryCoursesDTO.getCompanyId()); + //} + + } + +} diff --git b/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java a/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java new file mode 100644 index 0000000..21378f0 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/DepartmentDictServiceImpl.java @@ -0,0 +1,159 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.department.GetDepartmentsVO; +import com.subsidy.mapper.MemberDepartmentMappingMapper; +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.mapper.DepartmentDictMapper; +import com.subsidy.model.MemberDepartmentMappingDO; +import com.subsidy.service.DepartmentDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +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; + +/** + *

+ * 部门字典表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class DepartmentDictServiceImpl extends ServiceImpl implements DepartmentDictService { + + @Autowired + private MemberDepartmentMappingMapper memberDepartmentMappingMapper; + + public List getDepartments(DepartmentDictDO departmentDictDO) { + + //返回结果 + List getDepartmentsVOS = new ArrayList<>(); + + List parentNodes = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .isNull(DepartmentDictDO::getParentId) + .eq(DepartmentDictDO::getCompanyId, departmentDictDO.getCompanyId())); + + for (DepartmentDictDO dd : parentNodes) { + + GetDepartmentsVO getDepartmentsVO = new GetDepartmentsVO(); + BeanUtils.copyProperties(dd,getDepartmentsVO); + Integer count = memberDepartmentMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(MemberDepartmentMappingDO::getDepartmentId,dd.getId())); + getDepartmentsVO.setCnt(count); + getDepartmentsVO.setChildren(getChildNodes(getDepartmentsVO)); + DepartmentDictDO departmentDictDO1 = this.baseMapper.selectById(dd.getParentId()); + if (null != departmentDictDO1){ + getDepartmentsVO.setParentDepartmentName(departmentDictDO1.getDepartmentName()); + } + getDepartmentsVOS.add(getDepartmentsVO); + } + + return getDepartmentsVOS; + } + + /** + * 递归部门列表 不包含老师信息和人数信息 + * + * @param departmentDictDO + * @return + */ + public List getChildNodes(GetDepartmentsVO departmentDictDO) { + + List getDepartmentsVOS = new ArrayList<>(); + + List departmentDictDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getParentId, departmentDictDO.getId())); + + for (DepartmentDictDO departmentDictDO1 : departmentDictDOS) { + + GetDepartmentsVO getDepartmentsVO = new GetDepartmentsVO(); + BeanUtils.copyProperties(departmentDictDO1,getDepartmentsVO); + getDepartmentsVO.setChildren(getChildNodes(getDepartmentsVO)); + + Integer count = memberDepartmentMappingMapper.selectCount(new QueryWrapper() + .lambda() + .eq(MemberDepartmentMappingDO::getDepartmentId,getDepartmentsVO.getId())); + getDepartmentsVO.setCnt(count); + DepartmentDictDO departmentDictDO2 = this.baseMapper.selectById(departmentDictDO1.getParentId()); + if (null != departmentDictDO2){ + getDepartmentsVO.setParentDepartmentName(departmentDictDO2.getDepartmentName()); + } + getDepartmentsVOS.add(getDepartmentsVO); + } + + if (getDepartmentsVOS.size() == 0) { + return null; + } + return getDepartmentsVOS; + } + + public String addDepartment(DepartmentDictDO departmentDictDO) { + + Integer counter = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getCompanyId, departmentDictDO.getCompanyId()) + .eq(DepartmentDictDO::getDepartmentName, departmentDictDO.getDepartmentName())); + + if (counter > 0) { + throw new HttpException(30001); + } + + this.baseMapper.insert(departmentDictDO); + + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteDepartment(DepartmentDictDO departmentDictDO) { + this.baseMapper.deleteById(departmentDictDO.getId()); + + List departmentDictDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getParentId, departmentDictDO.getId()) + ); + + for (DepartmentDictDO departmentDictDO1:departmentDictDOS){ + deleteChildNode(departmentDictDO1); + } + + return ConstantUtils.DELETE_SUCCESS; + } + + void deleteChildNode(DepartmentDictDO departmentDictDO) { + + List departmentDictDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getParentId, departmentDictDO.getId())); + + for (DepartmentDictDO departmentDictDO1 : departmentDictDOS) { + deleteChildNode(departmentDictDO1); + } + this.baseMapper.deleteById(departmentDictDO.getId()); + } + + public String updateDepartment(DepartmentDictDO departmentDictDO) { + + Integer counter = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(DepartmentDictDO::getCompanyId, departmentDictDO.getCompanyId()) + .eq(DepartmentDictDO::getDepartmentName, departmentDictDO.getDepartmentName()) + .ne(DepartmentDictDO::getId, departmentDictDO.getId())); + + if (counter > 0) { + throw new HttpException(30001); + } + + this.baseMapper.updateById(departmentDictDO); + return ConstantUtils.SET_SUCCESS; + } + +} diff --git b/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java a/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java new file mode 100644 index 0000000..ffd3268 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/ExerciseDictServiceImpl.java @@ -0,0 +1,126 @@ +package com.subsidy.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.subsidy.dto.exercise.GetAllExercisesDTO; +import com.subsidy.dto.exercise.SubmitDTO; +import com.subsidy.mapper.ExerciseDoneResultMapper; +import com.subsidy.model.CourseDictDO; +import com.subsidy.model.ExerciseDictDO; +import com.subsidy.mapper.ExerciseDictMapper; +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.service.ExerciseDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.course.ExerciseVO; +import com.subsidy.vo.exercise.MemberExerciseVO; +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; + +/** + *

+ * 习题库 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-12 + */ +@Service +public class ExerciseDictServiceImpl extends ServiceImpl implements ExerciseDictService { + + @Autowired + private ExerciseDoneResultMapper exerciseDoneResultMapper; + + public IPage getAllExercises(GetAllExercisesDTO getAllExercisesDTO) { + + Page pager = new Page(getAllExercisesDTO.getPageNum(), getAllExercisesDTO.getPageSize()); + + return this.baseMapper.selectPage(pager, new QueryWrapper() + .lambda() + .eq(ExerciseDictDO::getCourseId, getAllExercisesDTO.getCourseId()) + .like(ExerciseDictDO::getDifficulty, getAllExercisesDTO.getDifficulty()) + .like(ExerciseDictDO::getExerciseType, getAllExercisesDTO.getExerciseType()) + .like(ExerciseDictDO::getTitle, getAllExercisesDTO.getTitle()) + .orderByAsc(ExerciseDictDO::getOrderNo)); + } + + public String addExercise(ExerciseDictDO exerciseDictDO){ + + List exerciseDictDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(ExerciseDictDO::getCourseId,exerciseDictDO.getCourseId()) + .orderByDesc(ExerciseDictDO::getOrderNo)); + + int orderNo = 1; + + if (exerciseDictDOS.size() >0){ + orderNo = exerciseDictDOS.get(0).getOrderNo()+1; + } + exerciseDictDO.setOrderNo(orderNo); + this.baseMapper.insert(exerciseDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String deleteExercise(ExerciseDictDO exerciseDictDO){ + this.baseMapper.deleteById(exerciseDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String updateExercise(ExerciseDictDO exerciseDictDO){ + this.baseMapper.updateById(exerciseDictDO); + return ConstantUtils.SET_SUCCESS; + } + + public List getCourseExercises(CourseDictDO courseDictDO){ + + List exerciseVOS = new ArrayList<>(); + + List exerciseDictDOS = this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(ExerciseDictDO::getCourseId,courseDictDO.getId())); + + for (ExerciseDictDO exerciseDictDO : exerciseDictDOS){ + ExerciseVO exerciseVO = new ExerciseVO(); + BeanUtils.copyProperties(exerciseDictDO,exerciseVO); + exerciseVOS.add(exerciseVO); + } + return exerciseVOS; + } + + public String submit(SubmitDTO submitDTO){ + + ExerciseDoneResultDO exerciseDoneResultDO = new ExerciseDoneResultDO(); + + List memberExerciseVOS = submitDTO.getMemberExerciseVOS(); + + int rightCounts = 0 ; + + for (MemberExerciseVO exerciseVO : memberExerciseVOS){ + ExerciseDictDO exerciseDictDO = this.baseMapper.selectById(exerciseVO.getId()); + if (exerciseDictDO.getRightAnswer().equals(exerciseVO.getSelectAnswer())){ + rightCounts++; + } + } + + exerciseDoneResultDO.setClassId(submitDTO.getClassId()); + exerciseDoneResultDO.setRightCounts(rightCounts); + exerciseDoneResultDO.setTotalCounts(memberExerciseVOS.size()); + exerciseDoneResultDO.setCourseId(submitDTO.getCourseId()); + exerciseDoneResultDO.setMemberId(submitDTO.getMemberId()); + + exerciseDoneResultMapper.delete(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getMemberId,submitDTO.getMemberId()) + .eq(ExerciseDoneResultDO::getCourseId,submitDTO.getCourseId())); + + exerciseDoneResultMapper.insert(exerciseDoneResultDO); + + return ConstantUtils.COMMIT_SUCCESS; + } + +} diff --git b/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java a/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java new file mode 100644 index 0000000..3575d56 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/ExerciseDoneResultServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.ExerciseDoneResultDO; +import com.subsidy.mapper.ExerciseDoneResultMapper; +import com.subsidy.service.ExerciseDoneResultService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 学生课程习题完成情况 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-15 + */ +@Service +public class ExerciseDoneResultServiceImpl extends ServiceImpl implements ExerciseDoneResultService { + +} diff --git b/src/main/java/com/subsidy/service/impl/FileDictServiceImpl.java a/src/main/java/com/subsidy/service/impl/FileDictServiceImpl.java new file mode 100644 index 0000000..7619ebf --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/FileDictServiceImpl.java @@ -0,0 +1,48 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.model.FileDictDO; +import com.subsidy.mapper.FileDictMapper; +import com.subsidy.model.VodDictDO; +import com.subsidy.service.FileDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.vo.vod.GetContendVodsVO; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + *

+ * 课件表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class FileDictServiceImpl extends ServiceImpl implements FileDictService { + + public List getContendFiles(FileDictDO fileDictDO) { + return this.baseMapper.selectList(new QueryWrapper() + .lambda() + .eq(FileDictDO::getContentId,fileDictDO.getContentId()) + .like(FileDictDO::getFileName,fileDictDO.getFileName())); + } + + public String deleteFile(FileDictDO fileDictDO) { + this.baseMapper.deleteById(fileDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String addFile(FileDictDO fileDictDO) { + this.baseMapper.insert(fileDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateFile(FileDictDO fileDictDO) { + this.baseMapper.updateById(fileDictDO); + return ConstantUtils.SET_SUCCESS; + } + +} diff --git b/src/main/java/com/subsidy/service/impl/MemberDepartmentMappingServiceImpl.java a/src/main/java/com/subsidy/service/impl/MemberDepartmentMappingServiceImpl.java new file mode 100644 index 0000000..6e191e5 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/MemberDepartmentMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.MemberDepartmentMappingDO; +import com.subsidy.mapper.MemberDepartmentMappingMapper; +import com.subsidy.service.MemberDepartmentMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 老师部门映射表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-11-01 + */ +@Service +public class MemberDepartmentMappingServiceImpl extends ServiceImpl implements MemberDepartmentMappingService { + +} diff --git b/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java new file mode 100644 index 0000000..d5669e1 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/MemberServiceImpl.java @@ -0,0 +1,518 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.StringUtils; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.administer.VerifyCodeDTO; +import com.subsidy.dto.member.AddMemberDTO; +import com.subsidy.dto.member.ContentMemberDTO; +import com.subsidy.dto.member.GetAllDTO; +import com.subsidy.dto.member.StudyHistoryDTO; +import com.subsidy.mapper.*; +import com.subsidy.model.*; +import com.subsidy.service.MemberService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.util.MathUtil; +import com.subsidy.vo.administer.UserRoleVO; +import com.subsidy.vo.member.*; +import com.subsidy.vo.vod.StudyHistoryVO; +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.lang.reflect.Member; +import java.time.Duration; +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +/** + *

+ * 学生表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class MemberServiceImpl extends ServiceImpl implements MemberService { + + @Autowired + private SmsVerifyCodeMapper smsVerifyCodeMapper; + + @Autowired + private CourseContentMapper courseContentMapper; + + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + @Autowired + private CourseDictMapper courseDictMapper; + + @Autowired + private VodDictMapper vodDictMapper; + + @Autowired + private FileDictMapper fileDictMapper; + + @Autowired + private ExerciseDoneResultMapper exerciseDoneResultMapper; + + @Autowired + private ExerciseDictMapper exerciseDictMapper; + + @Autowired + private DepartmentDictMapper departmentDictMapper; + + @Autowired + private ClassMemberMappingMapper classMemberMappingMapper; + + @Autowired + private ClassDictMapper classDictMapper; + + @Autowired + private CompanyDictMapper companyDictMapper; + + @Autowired + private MemberDepartmentMappingMapper memberDepartmentMappingMapper; + + public IPage getAll(GetAllDTO getAllDTO) { + Page pager = new Page(getAllDTO.getPageNum(), getAllDTO.getPageSize()); + IPage iPage = this.baseMapper.getMembers(pager, getAllDTO.getDepartmentId(), getAllDTO.getUserName(), getAllDTO.getStatus()); + + List getAllVOS = iPage.getRecords(); + for (GetAllVO getAllVO : getAllVOS) { + List departmentDictDOS = this.baseMapper.getDepartments(getAllVO.getId()); + getAllVO.setDepartmentDictDOS(departmentDictDOS); + } + return iPage; + } + + public String deleteMember(MemberDO memberDO) { + this.baseMapper.deleteById(memberDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String addMember(AddMemberDTO addMemberDTO) { + + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(MemberDO::getTelephone, addMemberDTO.getTelephone())); + + if (count > 0) { + throw new HttpException(20002); + } + + Integer count1 = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(MemberDO::getAccountName, addMemberDTO.getAccountName()) + .eq(MemberDO::getDepartmentId, addMemberDTO.getDepartmentId())); + + if (count1 > 0) { + throw new HttpException(20002); + } + + MemberDO memberDO = new MemberDO(); + BeanUtils.copyProperties(addMemberDTO, memberDO); + memberDO.setPassword("123456"); + memberDO.setStatus("启用"); + this.baseMapper.insert(memberDO); + + //部门 + List longs = addMemberDTO.getDepartmentIds(); + for (Long lg : longs) { + MemberDepartmentMappingDO memberDepartmentMappingDO = new MemberDepartmentMappingDO(); + memberDepartmentMappingDO.setMemberId(memberDO.getId()); + memberDepartmentMappingDO.setDepartmentId(lg); + memberDepartmentMappingMapper.insert(memberDepartmentMappingDO); + } + + return ConstantUtils.ADD_SUCCESS; + } + + public String updateMember(AddMemberDTO addMemberDTO) { + + if (null!= addMemberDTO.getDepartmentIds()){ + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(MemberDO::getTelephone, addMemberDTO.getTelephone()) + .eq(MemberDO::getDepartmentId, addMemberDTO.getDepartmentId()) + .ne(MemberDO::getId, addMemberDTO.getId())); + + if (count > 0) { + throw new HttpException(20002); + } + Integer count1 = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(MemberDO::getAccountName, addMemberDTO.getAccountName()) + .eq(MemberDO::getDepartmentId, addMemberDTO.getDepartmentId()) + .ne(MemberDO::getId, addMemberDTO.getId())); + + if (count1 > 0) { + throw new HttpException(20002); + } + } + + MemberDO memberDO = new MemberDO(); + BeanUtils.copyProperties(addMemberDTO, memberDO); + this.baseMapper.updateById(memberDO); + + if (null != addMemberDTO.getDepartmentIds()){ + memberDepartmentMappingMapper.delete(new QueryWrapper() + .lambda() + .eq(MemberDepartmentMappingDO::getMemberId, addMemberDTO.getId())); + + //部门 + List longs = addMemberDTO.getDepartmentIds(); + for (Long lg : longs) { + MemberDepartmentMappingDO memberDepartmentMappingDO = new MemberDepartmentMappingDO(); + memberDepartmentMappingDO.setMemberId(memberDO.getId()); + memberDepartmentMappingDO.setDepartmentId(lg); + memberDepartmentMappingMapper.insert(memberDepartmentMappingDO); + } + } + + return ConstantUtils.SET_SUCCESS; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public UserRoleVO login(VerifyCodeDTO verifyCodeDTO) { + UserRoleVO userRoleVO = new UserRoleVO(); + MemberDO userRoleDO = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(MemberDO::getTelephone, verifyCodeDTO.getTelephone())); + if (userRoleDO == null) { + throw new HttpException(10010); + } + + if ("冻结".equals(userRoleDO.getStatus())){ + throw new HttpException(10013); + } + + BeanUtils.copyProperties(userRoleDO, userRoleVO); + + SmsVerifyCodeDO smsCodeDO = smsVerifyCodeMapper.selectOne(new QueryWrapper() + .lambda() + .eq(SmsVerifyCodeDO::getTelephone, verifyCodeDTO.getTelephone()) + .eq(SmsVerifyCodeDO::getVerifyCode, verifyCodeDTO.getVerifyCode())); + if (smsCodeDO == null) { + throw new HttpException(70010); + } + return userRoleVO; + } + + public UserRoleVO passwordLogin(MemberDO memberDO) { + UserRoleVO userRoleVO = new UserRoleVO(); + MemberDO memberDO1 = this.baseMapper.selectOne(new QueryWrapper() + .lambda() + .eq(MemberDO::getPassword, memberDO.getPassword()) + .eq(MemberDO::getAccountName, memberDO.getAccountName())); + if (memberDO1 == null) { + throw new HttpException(10004); + } + + if ("冻结".equals(memberDO1.getStatus())){ + throw new HttpException(10014); + } + + BeanUtils.copyProperties(memberDO1, userRoleVO); + return userRoleVO; + } + + public String updatePassword(MemberDO memberDO) { + this.baseMapper.updateById(memberDO); + return ConstantUtils.SET_SUCCESS; + } + + public MemberStudyPageVO studyPage(MemberDO memberDO) { + + MemberStudyPageVO memberStudyPageVO = new MemberStudyPageVO(); + + List studyPageVOS = this.baseMapper.studyPage(memberDO); + + for (StudyPageVO studyPageVO : studyPageVOS) { + + //查看课程下有几节课 + List vodDictDOS = courseContentMapper.getCourseVods(studyPageVO.getId()); + studyPageVO.setTotalVods(vodDictDOS.size()); + + int i = 0; + + //该成员完成了几个视频 + for (VodDictDO vodDictDO : vodDictDOS) { + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, memberDO.getId()) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) + .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + + if (vodPlayHistoryDOS.size() > 0) { + if (vodPlayHistoryDOS.get(0).getPlayRecord() > vodDictDO.getVodLength() * 0.8) { + i++; + } + } + } + studyPageVO.setDoneVods(i); + + //该班级课程下有多少人 + List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getClassId, studyPageVO.getClassId())); + studyPageVO.setTotalMember(classMemberMappingDOS.size()); + + //多少人完成 + int completedCnt = 0; + for (ClassMemberMappingDO cmmd : classMemberMappingDOS) { + + Boolean flag = true; + + for (VodDictDO vodDictDO : vodDictDOS) { + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) + .eq(VodPlayHistoryDO::getMemberId, cmmd.getMemberId()) + .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + if (vodPlayHistoryDOS.size() > 0) { + if (vodPlayHistoryDOS.get(0).getPlayRecord() < vodDictDO.getVodLength()) { + flag = false; + //break; + } + } else { + flag = false; + } + } + if (flag) { + completedCnt++; + } + } + studyPageVO.setDoneMember(completedCnt); + } + + memberStudyPageVO.setStudyPageVOS(studyPageVOS); + + List departmentDictDOS = this.baseMapper.getDepartments(memberDO.getId()); + + if (departmentDictDOS.size() > 0) { + CompanyDictDO companyDictDO = companyDictMapper.selectById(departmentDictDOS.get(0).getId()); + if (null != companyDictDO) { + BeanUtils.copyProperties(companyDictDO, memberStudyPageVO); + } + } + return memberStudyPageVO; + } + + public ContentVodNewVO contentVod(ContentMemberDTO contentVodDTO) { + + ContentVodNewVO contentVodNewVO = new ContentVodNewVO(); + + List contentVodVOS = new ArrayList<>(); + List courseContentDOS = courseContentMapper.selectList(new QueryWrapper() + .lambda() + .eq(CourseContentDO::getCourseId, contentVodDTO.getCourseId()) + .orderByAsc(CourseContentDO::getOrderNo)); + + for (CourseContentDO courseContentDO : courseContentDOS) { + ContentVodVO contentVodVO = new ContentVodVO(); + contentVodVO.setContent(courseContentDO.getContent()); + + List memberVodVOS = new ArrayList<>(); + + //目录下的视频 + List vodDictDOS = vodDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodDictDO::getContentId, courseContentDO.getId())); + for (VodDictDO vodDictDO : vodDictDOS) { + MemberVodVO memberVodVO = new MemberVodVO(); + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, contentVodDTO.getMemberId()) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) + .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + + memberVodVO.setStatus(false); + if (vodPlayHistoryDOS.size() > 0) { + memberVodVO.setPercent(MathUtil.intDivCeil(100 * vodPlayHistoryDOS.get(0).getPlayRecord(), vodDictDO.getVodLength())); + if (memberVodVO.getPercent() >= 80) { + memberVodVO.setStatus(true); + } + } else { + memberVodVO.setPercent(0); + } + List vodPlayHistoryDOS1 = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, contentVodDTO.getMemberId()) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) + .orderByDesc(VodPlayHistoryDO::getCreateDate)); + if (vodPlayHistoryDOS1.size() > 0) { + memberVodVO.setPlayRecord(vodPlayHistoryDOS1.get(0).getPlayRecord()); + } + memberVodVO.setId(vodDictDO.getId()); + memberVodVO.setVodUrl(vodDictDO.getVodUrl()); + memberVodVO.setTeacherName(vodDictDO.getTeacherName()); + memberVodVO.setVodLength(vodDictDO.getVodLength()); + memberVodVO.setVodName(vodDictDO.getVodName()); + memberVodVOS.add(memberVodVO); + } + contentVodVO.setMemberVodVOS(memberVodVOS); + contentVodVOS.add(contentVodVO); + } + + contentVodNewVO.setContentVodVOS(contentVodVOS); + + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getClassId,contentVodDTO.getClassId()) + .eq(VodPlayHistoryDO::getMemberId,contentVodDTO.getMemberId()) + .orderByDesc(VodPlayHistoryDO::getCreateDate)); + if (vodPlayHistoryDOS.size()>0){ + VodPlayHistoryDO vodPlayHistoryDO = vodPlayHistoryDOS.get(0); + VodDictDO vodDictDO = vodDictMapper.selectById(vodPlayHistoryDO.getVodId()); + if (null!=vodDictDO){ + BeanUtils.copyProperties(vodDictDO,contentVodNewVO); + contentVodNewVO.setPlayRecord(vodPlayHistoryDO.getPlayRecord()); + } + } + return contentVodNewVO; + } + + public List contentFiles(ContentMemberDTO contentMemberDTO) { + + List contentFilesVOS = new ArrayList<>(); + + List courseContentDOS = courseContentMapper.selectList(new QueryWrapper() + .lambda() + .eq(CourseContentDO::getCourseId, contentMemberDTO.getCourseId()) + .orderByAsc(CourseContentDO::getOrderNo)); + + for (CourseContentDO courseContentDO : courseContentDOS) { + + ContentFilesVO contentFilesVO = new ContentFilesVO(); + contentFilesVO.setContent(courseContentDO.getContent()); + + List fileDictDOS = fileDictMapper.selectList(new QueryWrapper() + .lambda() + .eq(FileDictDO::getContentId, courseContentDO.getId())); + contentFilesVO.setFileDictDOS(fileDictDOS); + + contentFilesVOS.add(contentFilesVO); + } + + return contentFilesVOS; + } + + public IPage studyHistory(StudyHistoryDTO studyHistoryDTO) { + Page pager = new Page(studyHistoryDTO.getPageNum(), studyHistoryDTO.getPageSize()); + + IPage iPage = vodPlayHistoryMapper.studyHistory(pager, studyHistoryDTO.getMemberId()); + + List studyHistoryVOS = iPage.getRecords(); + + for (StudyHistoryVO studyHistoryVO : studyHistoryVOS) { + if (studyHistoryVO.getPercent() >= 80) { + studyHistoryVO.setStatus(true); + } else { + studyHistoryVO.setStatus(false); + } + } + iPage.setRecords(studyHistoryVOS); + + return iPage; + } + + public GetCourseTestVO getCourseTest(ContentMemberDTO contentMemberDTO) { + + GetCourseTestVO getCourseTestVO = new GetCourseTestVO(); + + ClassDictDO classDictDO = classDictMapper.selectById(contentMemberDTO.getClassId()); + + CourseDictDO courseDictDO = courseDictMapper.selectById(classDictDO.getCourseId()); + getCourseTestVO.setCourseId(courseDictDO.getId()); + getCourseTestVO.setCourseName(courseDictDO.getCourseName()); + getCourseTestVO.setDeadline(classDictDO.getEndDate()); + + ExerciseDoneResultDO exerciseDoneResultDO = exerciseDoneResultMapper.selectOne(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getCourseId, courseDictDO.getId()) + .eq(ExerciseDoneResultDO::getMemberId, contentMemberDTO.getMemberId())); + + if (null != exerciseDoneResultDO) { + getCourseTestVO.setRightCount(String.valueOf(exerciseDoneResultDO.getRightCounts())); + getCourseTestVO.setTotalCount(String.valueOf(exerciseDoneResultDO.getTotalCounts())); + + //正确率 + Integer percent = MathUtil.intDivFloorPercent(exerciseDoneResultDO.getRightCounts(),exerciseDoneResultDO.getTotalCounts()); + if(percent>=60){ + getCourseTestVO.setResult("合格"); + }else { + getCourseTestVO.setResult("不合格"); + } + getCourseTestVO.setPercent(String.valueOf(percent)); + } else { + getCourseTestVO.setRightCount("-"); + //该课程下有多少习题 + Integer count = exerciseDictMapper.selectCount(new QueryWrapper() + .lambda() + .eq(ExerciseDictDO::getCourseId, courseDictDO.getId())); + getCourseTestVO.setTotalCount(String.valueOf(count)); + getCourseTestVO.setPercent("-"); + getCourseTestVO.setResult("不合格"); + } + return getCourseTestVO; + } + + public GetStudyInfoVO getStudyInfo(MemberDO memberDO) { + + GetStudyInfoVO getStudyInfoVO = new GetStudyInfoVO(); + + MemberDO memberDO1 = this.baseMapper.selectById(memberDO.getId()); + + //第几天 + long diff = Duration.between(LocalDateTime.now(), memberDO1.getCreateDate()).toDays(); + getStudyInfoVO.setDiff(diff); + + //已学课程 + List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getMemberId, memberDO.getId())); + /** + * 遍历课程,里面的视频都看过80% 则表示已学完 + */ + int i = 0; //已学课程 + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + List vodDictDOS = classDictMapper.getClassVods(classMemberMappingDO.getClassId()); + for (VodDictDO vodDictDO : vodDictDOS) { + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, memberDO.getId()) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) + .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + if (vodPlayHistoryDOS.size() > 0) { + if (vodPlayHistoryDOS.get(0).getPlayRecord() < vodDictDO.getVodLength() * 0.8) { + break; + } + } + } + i++; + } + getStudyInfoVO.setStudyCourse(i); + + //累计学习时长 + int studyLength = 0; + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, memberDO.getId())); + + for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { + studyLength += vodPlayHistoryDO.getPlayLength(); + } + getStudyInfoVO.setStudyLength(studyLength); + + return getStudyInfoVO; + } + +} diff --git b/src/main/java/com/subsidy/service/impl/PermissionsDictServiceImpl.java a/src/main/java/com/subsidy/service/impl/PermissionsDictServiceImpl.java new file mode 100644 index 0000000..42f5f20 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/PermissionsDictServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.PermissionsDictDO; +import com.subsidy.mapper.PermissionsDictMapper; +import com.subsidy.service.PermissionsDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 权限表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class PermissionsDictServiceImpl extends ServiceImpl implements PermissionsDictService { + +} diff --git b/src/main/java/com/subsidy/service/impl/RoleAdministerMappingServiceImpl.java a/src/main/java/com/subsidy/service/impl/RoleAdministerMappingServiceImpl.java new file mode 100644 index 0000000..8c3ba95 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/RoleAdministerMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.RoleAdministerMappingDO; +import com.subsidy.mapper.RoleAdministerMappingMapper; +import com.subsidy.service.RoleAdministerMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class RoleAdministerMappingServiceImpl extends ServiceImpl implements RoleAdministerMappingService { + +} diff --git b/src/main/java/com/subsidy/service/impl/RoleDictServiceImpl.java a/src/main/java/com/subsidy/service/impl/RoleDictServiceImpl.java new file mode 100644 index 0000000..772bff8 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/RoleDictServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.RoleDictDO; +import com.subsidy.mapper.RoleDictMapper; +import com.subsidy.service.RoleDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 角色表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class RoleDictServiceImpl extends ServiceImpl implements RoleDictService { + +} diff --git b/src/main/java/com/subsidy/service/impl/RolePermissionMappingServiceImpl.java a/src/main/java/com/subsidy/service/impl/RolePermissionMappingServiceImpl.java new file mode 100644 index 0000000..6c33b85 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/RolePermissionMappingServiceImpl.java @@ -0,0 +1,20 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.RolePermissionMappingDO; +import com.subsidy.mapper.RolePermissionMappingMapper; +import com.subsidy.service.RolePermissionMappingService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 系统用户角色表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class RolePermissionMappingServiceImpl extends ServiceImpl implements RolePermissionMappingService { + +} diff --git b/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java new file mode 100644 index 0000000..8459e40 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/SignInRecordServiceImpl.java @@ -0,0 +1,192 @@ +package com.subsidy.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.subsidy.dto.member.GetMemberSignInfoDTO; +import com.subsidy.dto.sign.ClassSignInfoDTO; +import com.subsidy.dto.sign.SignInDTO; +import com.subsidy.mapper.*; +import com.subsidy.model.*; +import com.subsidy.service.SignInRecordService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.util.MathUtil; +import com.subsidy.vo.member.GetMemberSignInfoVO; +import com.subsidy.vo.sign.ClassSignInfoVO; +import com.subsidy.vo.sign.SignInStatusVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.List; + +/** + *

+ * 学生签到表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-18 + */ +@Service +public class SignInRecordServiceImpl extends ServiceImpl implements SignInRecordService { + + @Autowired + private ClassMemberMappingMapper classMemberMappingMapper; + + @Autowired + private ClassDictMapper classDictMapper; + + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + @Autowired + private ExerciseDoneResultMapper exerciseDoneResultMapper; + + @Autowired + private AnsweringQuestionMapper answeringQuestionMapper; + + public IPage getMemberSignInfo(GetMemberSignInfoDTO getMemberSignInfoDTO) { + Page pager = new Page(getMemberSignInfoDTO.getPageNum(), getMemberSignInfoDTO.getPageSize()); + + return this.baseMapper.selectPage(pager, new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, getMemberSignInfoDTO.getId()) + .orderByDesc(SignInRecordDO::getCreateDate)); + } + + public String signIn(SignInRecordDO signInRecordDO) { + + /** + * 查看学生所有在读班级 + */ + List classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId()); + + this.baseMapper.delete(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getMemberId, signInRecordDO.getMemberId()) + .gt(SignInRecordDO::getSignInDate, LocalDate.now())); + + for (ClassDictDO classDictDO : classDictDOS) { + SignInRecordDO signInRecordDO1 = new SignInRecordDO(); + signInRecordDO1.setClassId(classDictDO.getId()); + signInRecordDO1.setMemberId(signInRecordDO.getMemberId()); + signInRecordDO1.setSignInDate(LocalDateTime.now()); + this.baseMapper.insert(signInRecordDO1); + } + + return ConstantUtils.ADD_SUCCESS; + } + + public IPage classSignInfo(ClassSignInfoDTO classSignInfoDTO) { + + Page pager = new Page(classSignInfoDTO.getPageNum(), classSignInfoDTO.getPageSize()); + + IPage classSignInfoVOIPage = this.baseMapper.classSignInfo(pager, classSignInfoDTO.getClassName(), classSignInfoDTO.getCourseName(), classSignInfoDTO.getCompanyId()); + List classSignInfoVOS = classSignInfoVOIPage.getRecords(); + + for (ClassSignInfoVO classSignInfoVO : classSignInfoVOS) { + + //班级人数 + List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classSignInfoVO.getClassId())); + + classSignInfoVO.setMemberCount(classMemberMappingDOS.size()); + + + //课程总数 + List vodDictDOS = classDictMapper.getClassVods(classSignInfoVO.getClassId()); + classSignInfoVO.setTotalVodCounts(vodDictDOS.size()); + + + int totalStudyVods = 0; + int totalStudyLength = 0; + //学生总共学习课时数 + for (VodDictDO vodDictDO : vodDictDOS) { + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + List vodPlayHistoryDOS = vodPlayHistoryMapper.selectList(new QueryWrapper() + .lambda() + .eq(VodPlayHistoryDO::getMemberId, classMemberMappingDO.getMemberId()) + .eq(VodPlayHistoryDO::getVodId, vodDictDO.getId()) + .orderByDesc(VodPlayHistoryDO::getPlayRecord)); + for (VodPlayHistoryDO vodPlayHistoryDO : vodPlayHistoryDOS) { + totalStudyLength += vodPlayHistoryDO.getPlayLength(); + } + if (vodPlayHistoryDOS.size() > 0) { + if (vodPlayHistoryDOS.get(0).getPlayRecord() >= vodDictDO.getVodLength() * 0.8) { + totalStudyVods++; + } + } + } + } + classSignInfoVO.setStudyVodCounts(MathUtil.intDivCeil(totalStudyVods, classMemberMappingDOS.size() )); + + //平均完成时长 学生观看课程视频的全部时长/总人数 + int avg = MathUtil.intDivCeil(totalStudyLength, classMemberMappingDOS.size()); + classSignInfoVO.setAvgVodPlayLength(avg); + + //测试通过率 + List exerciseDoneResultDOS = exerciseDoneResultMapper.selectList(new QueryWrapper() + .lambda() + .eq(ExerciseDoneResultDO::getClassId, classSignInfoVO.getClassId())); + + int passNum = 0; + + for (ExerciseDoneResultDO exerciseDoneResultDO : exerciseDoneResultDOS) { + if (exerciseDoneResultDO.getRightCounts() > exerciseDoneResultDO.getTotalCounts() * 0.6) { + passNum++; + } + } + classSignInfoVO.setPassRate(MathUtil.intDivFloorPercent(passNum, classMemberMappingDOS.size())); + + + //平均签到数 向上取整 + //签到总次数 + Integer signCount = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getClassId, classSignInfoVO.getClassId())); + classSignInfoVO.setAvgSignCount(MathUtil.intDivCeil(signCount, classMemberMappingDOS.size())); + + //答疑数 + Integer count = answeringQuestionMapper.selectCount(new QueryWrapper() + .lambda() + .eq(AnsweringQuestionDO::getClassId, classSignInfoVO.getClassId())); + classSignInfoVO.setAnswerCount(count); + } + + classSignInfoVOIPage.setRecords(classSignInfoVOS); + return classSignInfoVOIPage; + } + + + public SignInStatusVO signInStatus(SignInRecordDO signInRecordDO) { + + SignInStatusVO signInStatusVO = new SignInStatusVO(); + + Boolean flag = true; + + //获取有效课程 + List classDictDOS = classMemberMappingMapper.getMemberClass(signInRecordDO.getMemberId()); + + + for (ClassDictDO classDictDO : classDictDOS) { + Integer count = this.baseMapper.selectCount(new QueryWrapper() + .lambda() + .eq(SignInRecordDO::getClassId, classDictDO.getId()) + .eq(SignInRecordDO::getMemberId, signInRecordDO.getMemberId()) + .gt(SignInRecordDO::getSignInDate, LocalDate.now())); + + if (count == 0) { + flag = false; + } + + } + + signInStatusVO.setStatus(flag); + return signInStatusVO; + } + +} diff --git b/src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java a/src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java new file mode 100644 index 0000000..c135d69 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/SmsVerifyCodeServiceImpl.java @@ -0,0 +1,55 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.common.exception.HttpException; +import com.subsidy.dto.sms.SendVerifyCodeDTO; +import com.subsidy.mapper.MemberMapper; +import com.subsidy.model.MemberDO; +import com.subsidy.model.SmsVerifyCodeDO; +import com.subsidy.mapper.SmsVerifyCodeMapper; +import com.subsidy.service.MemberService; +import com.subsidy.service.SmsVerifyCodeService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.RandomUtil; +import com.subsidy.util.SMSUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.lang.reflect.Member; + +/** + *

+ * 短信验证码记录表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +@Service +public class SmsVerifyCodeServiceImpl extends ServiceImpl implements SmsVerifyCodeService { + + @Autowired + private SMSUtils smsUtils; + + @Autowired + private MemberMapper memberMapper; + + public void sendVerifyCode(SendVerifyCodeDTO sendVerifyCodeDTO){ + MemberDO memberDO =memberMapper.selectOne(new QueryWrapper() + .lambda() + .eq(MemberDO::getTelephone, sendVerifyCodeDTO.getTelephone())); + if(memberDO == null) { + throw new HttpException(70012); + } + + String code = RandomUtil.getRandomCode(6); + smsUtils.send(sendVerifyCodeDTO.getTelephone(), code); + + SmsVerifyCodeDO smsCodeDO = new SmsVerifyCodeDO(); + smsCodeDO.setVerifyCode(code); + smsCodeDO.setTelephone(sendVerifyCodeDTO.getTelephone()); + this.baseMapper.insert(smsCodeDO); + + } + +} diff --git b/src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java a/src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java new file mode 100644 index 0000000..d3bc1a3 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/VodDictServiceImpl.java @@ -0,0 +1,80 @@ +package com.subsidy.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.subsidy.common.configure.VODConfig; +import com.subsidy.dto.content.GetContendVodsDTO; +import com.subsidy.model.VodDictDO; +import com.subsidy.mapper.VodDictMapper; +import com.subsidy.service.VodDictService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import com.subsidy.util.Signature; +import com.subsidy.vo.vod.GetContendVodsVO; +import com.subsidy.vo.vod.SignatureVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Random; + +/** + *

+ * 视频表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-11 + */ +@Service +public class VodDictServiceImpl extends ServiceImpl implements VodDictService { + + @Autowired + private VODConfig vodConfig; + + + public SignatureVO signature() throws Exception { +// + 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); + + String sign = ""; + try { + sign = signature.getUploadSignature(); + signatureVO.setSign(sign); + } catch (Exception ex) { + ex.printStackTrace(); +// throw new MyException(ResultEnum.UNKNOWN_ERROR); + } + return signatureVO; + } + + public IPage getContendVods(GetContendVodsDTO getContendVodsDTO) { + Page pager = new Page(getContendVodsDTO.getPageNum(), getContendVodsDTO.getPageSize()); + return this.baseMapper.getContendVods(pager,getContendVodsDTO.getVodName(),getContendVodsDTO.getContentId()); + } + + public String deleteVod(VodDictDO vodDictDO) { + this.baseMapper.deleteById(vodDictDO.getId()); + return ConstantUtils.DELETE_SUCCESS; + } + + public String addVod(VodDictDO vodDictDO) { + this.baseMapper.insert(vodDictDO); + return ConstantUtils.ADD_SUCCESS; + } + + public String updateVod(VodDictDO vodDictDO) { + this.baseMapper.updateById(vodDictDO); + return ConstantUtils.SET_SUCCESS; + } + + + +} diff --git b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java new file mode 100644 index 0000000..b29fe46 --- /dev/null +++ a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java @@ -0,0 +1,26 @@ +package com.subsidy.service.impl; + +import com.subsidy.model.VodPlayHistoryDO; +import com.subsidy.mapper.VodPlayHistoryMapper; +import com.subsidy.service.VodPlayHistoryService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.subsidy.util.ConstantUtils; +import org.springframework.stereotype.Service; + +/** + *

+ * 视频播放历史记录表 服务实现类 + *

+ * + * @author DengMin + * @since 2021-10-14 + */ +@Service +public class VodPlayHistoryServiceImpl extends ServiceImpl implements VodPlayHistoryService { + + public String insertHistory(VodPlayHistoryDO vodPlayHistoryDO) { + this.baseMapper.insert(vodPlayHistoryDO); + return ConstantUtils.ADD_SUCCESS; + } + +} diff --git b/src/main/java/com/subsidy/util/BaseModel.java a/src/main/java/com/subsidy/util/BaseModel.java new file mode 100644 index 0000000..7504dd0 --- /dev/null +++ a/src/main/java/com/subsidy/util/BaseModel.java @@ -0,0 +1,35 @@ +package com.subsidy.util; + +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 abstract class BaseModel { + + /** + * 创建时间 + */ + @JsonIgnore + @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "create_date", fill = FieldFill.INSERT) + private LocalDateTime createDate; + + /** + * 更新时间 + */ + @JsonIgnore + @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER, value = "update_date", fill = FieldFill.UPDATE) + private LocalDateTime updateDate; + + /** + * 删除时间 + */ + @JsonIgnore + @TableLogic + private LocalDateTime deleteDate; +} diff --git b/src/main/java/com/subsidy/util/CodeGenerator.java a/src/main/java/com/subsidy/util/CodeGenerator.java new file mode 100644 index 0000000..ae1381a --- /dev/null +++ a/src/main/java/com/subsidy/util/CodeGenerator.java @@ -0,0 +1,124 @@ +package com.subsidy.util; + +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 java.util.ArrayList; +import java.util.List; +import java.util.ResourceBundle; +import java.util.Scanner; + +/** + * Mybatis-Plus CodeGenerator + * + * @author DengMin + * @date 2020/07/02 + **/ +public class CodeGenerator { + + public static String scanner(String tip) { + StringBuilder help = new StringBuilder(); + help.append("1.生成全部表 2.输入需要生成表名"); + System.out.println(help.toString()); + 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.toString()); + 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-plus"); + // 代码生成器 + 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 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(); + } +} \ No newline at end of file diff --git b/src/main/java/com/subsidy/util/ConstantUtils.java a/src/main/java/com/subsidy/util/ConstantUtils.java new file mode 100644 index 0000000..72603a6 --- /dev/null +++ a/src/main/java/com/subsidy/util/ConstantUtils.java @@ -0,0 +1,89 @@ +package com.subsidy.util; + + +/** + * 枚举类 + */ +public class ConstantUtils { + + public static final String DELETE_SUCCESS = "删除成功"; + + public static final String UPLOAD_FAIL = "上传失败"; + + public static final String ADD_SUCCESS = "新增成功"; + + public static final String COMMIT_SUCCESS = "提交成功"; + + public static final String SUCCESS_SEND_OUT = "发送成功"; + + public static final String FAIL_SEND_OUT = "发送失败"; + + public static final String SAVE_SUCCESS = "保存成功"; + + public static final String SHARE_SUCCESS = "共享成功"; + + public static final String SUBMIT_SUCCESS = "提交成功"; + + public static final String SUCCESS_UPDATE = "更新成功"; + + public static final String FAIL_UPDATE = "更新失败"; + + public static final String SET_SUCCESS = "设置成功"; + + public static final String SUCCESS_VERIFY = "验证成功"; + + public static final String FAIL_VERIFY = "验证失败"; + + public static final String COMPANY_NAME = "TeachAI"; + + public static final String ALREADY_DONE = "已完成"; + + public static final String ALREADY_RECOMMEND = "已推荐"; + + public static final String VERIFY_NAME = "有课互联"; + + public static final String NOTICE_NAME = "有课进度通知"; + + public static final String PUBLISH_SUCCESS = "发布成功"; + + public static final String LOGIN_OUT ="登出成功"; + + public static final String COMPRESS_SUCCESS = "压缩成功"; + + public static final String SCHOOL = "上海市市西中学"; + + public static final String CHECK_STATUS = "审核通过"; + + /** + * 短信模板---验证模板 + */ + public static final String TEMPLATE_CODE = "SMS_190945394"; + + /** + * 短信 地域ID + */ + public static final String REGION_ID = "cn-hangzhou"; + + /** + * 短信 RAM账号AccessKey ID + */ + public static final String ACCESS_KEY_ID = "LTAIOrpFKrDqsQ2c"; + + /** + * 短信 RAM账号AccessKey Secret + */ + public static final String SECRET = "1Qp8huLETbWiBBJvHXJ7MOIhtKuA1G"; + + /** + * 腾讯云点播视频转码模板 + */ + public static final Long TEMPLATE_VOD = 100030L; + + /** + * 手机端token + */ + public static final String MOBILE_TERMINATE = "mobile"; + + public static final String ADMINISTER_TERMINATE = "administer"; + +} diff --git b/src/main/java/com/subsidy/util/DateFormatUtil.java a/src/main/java/com/subsidy/util/DateFormatUtil.java new file mode 100644 index 0000000..4ae1409 --- /dev/null +++ a/src/main/java/com/subsidy/util/DateFormatUtil.java @@ -0,0 +1,79 @@ +package com.subsidy.util; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * 处理时间工具 + * + * @author DengMin + * @date 2019/08/27 13:56 + **/ +public class DateFormatUtil { + + public final static String YEAR = "yyyy"; + 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_yM = "yyyy-M"; + public final static String FMT_sdf_yMM = "yyyy-MM"; + public final static String FMT_sdf_Hm = "H:mm"; + public final static String FMT_sdf_HHmm = "HH: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 { + 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 { + SimpleDateFormat sdf = new SimpleDateFormat(pattern); + return sdf.parse(date); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 比较两个时间 + * .after 大于 + * .before 小于 + * @param d1 + * @param d2 + * @return + */ + public static boolean compare(Date d1, Date d2 ) { + if(d1.after(d2)) { + return false; + } + return true; + } + + /** + * Data转Cron + * @param date + * @return + */ + public static String getCron(Date date) { + SimpleDateFormat sdf = new SimpleDateFormat("s m H d M ? yyyy"); + return sdf.format(date); + } +} diff --git b/src/main/java/com/subsidy/util/EncryptUtil.java a/src/main/java/com/subsidy/util/EncryptUtil.java new file mode 100644 index 0000000..7055849 --- /dev/null +++ a/src/main/java/com/subsidy/util/EncryptUtil.java @@ -0,0 +1,35 @@ +package com.subsidy.util; + +import com.amdelamar.jhash.Hash; +import com.amdelamar.jhash.algorithms.Type; +import com.amdelamar.jhash.exception.InvalidHashException; + +public class EncryptUtil { + + /** + * 设置密文密码 + * + * @param password 原始密码 + * @return 加密密码 + */ + public static String encrypt(String password) { + char[] chars = password.toCharArray(); + return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).create(); + } + + /** + * 验证加密密码 + * + * @param encryptedPassword 密文密码 + * @param plainPassword 明文密码 + * @return 验证是否成功 + */ + public static boolean verify(String encryptedPassword, String plainPassword) { + char[] chars = plainPassword.toCharArray(); + try { + return Hash.password(chars).algorithm(Type.PBKDF2_SHA256).verify(encryptedPassword); + } catch (InvalidHashException e) { + return false; + } + } +} diff --git b/src/main/java/com/subsidy/util/ExcelFormatUtils.java a/src/main/java/com/subsidy/util/ExcelFormatUtils.java new file mode 100644 index 0000000..4c8a077 --- /dev/null +++ a/src/main/java/com/subsidy/util/ExcelFormatUtils.java @@ -0,0 +1,17 @@ +package com.subsidy.util; + +import java.util.Arrays; +import java.util.List; + +public class ExcelFormatUtils { + + + public static final List memberList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "账号", "联系方式", "签到次数", "课程进度", "培训时长", "答疑数", "测试成绩", "总评价"}); + + public static final List signList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "培训时长", "课程进度", "完成率", "签到次数", "签到日期"}); + + public static final List scoreList = Arrays.asList(new String[]{"序号", "成员名称", "身份证号码", "手机号码", "测试最高成绩", "测试次数", "总评价"}); + + public static final List answersList = Arrays.asList(new String[]{"序号", "提问", "答疑", "提问时间", "提问成员", "答疑时间"}); + +} diff --git b/src/main/java/com/subsidy/util/HttpUtil.java a/src/main/java/com/subsidy/util/HttpUtil.java new file mode 100644 index 0000000..669745a --- /dev/null +++ a/src/main/java/com/subsidy/util/HttpUtil.java @@ -0,0 +1,63 @@ +package com.subsidy.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.springframework.http.*; +import org.springframework.web.client.RestTemplate; + +import java.util.Map; + +/** + * http请求 + */ +public class HttpUtil { + + /** + * GET 请求 + * @param params + * @param url + * @return + */ + public static JSONObject get(Map params, String url) { + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity responseEntity = restTemplate.getForEntity(url, String.class, params); + String body = responseEntity.getBody(); + JSONObject object = JSON.parseObject(body); + return object; + } + + /** + * POST 请求 + * @param params + * @param url + * @return + */ + public static JSONObject post(Map params, String url) { + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity responseEntity = restTemplate.postForEntity(url, params, String.class); + String body = responseEntity.getBody(); + JSONObject object = JSON.parseObject(body); + return object; + } + + /** + * POST 请求 带Token + * + * @param param + * @param token + * @param url + * @return + */ + public static JSONObject sendPost(Map param, String token, String url, Object obj) { + RestTemplate restTemplate = new RestTemplate(); + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + headers.add("Accept", MediaType.ALL_VALUE); + headers.add("Authorization", "Bearer " + token); + HttpEntity formEntity = new HttpEntity(param.toString(), headers); + ResponseEntity responseEntity = restTemplate.exchange(url, HttpMethod.POST, formEntity, String.class, obj); + String body = responseEntity.getBody(); + JSONObject object = JSON.parseObject(body); + return object; + } +} diff --git b/src/main/java/com/subsidy/util/JwtUtil.java a/src/main/java/com/subsidy/util/JwtUtil.java new file mode 100644 index 0000000..972185b --- /dev/null +++ a/src/main/java/com/subsidy/util/JwtUtil.java @@ -0,0 +1,96 @@ +package com.subsidy.util; + +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; + +/** + *

+ * Token工具 + *

+ * + * @author DengMin + * @since 2021/4/14 + */ +public class JwtUtil { + + private static Long EXPIRE_TIME = 24 * 60 * 60 * 1000L; + + private static 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 getClaims(String token) { + Algorithm algorithm = Algorithm.HMAC256(SECRET); + JWTVerifier verifier = JWT.require(algorithm).build(); + Map 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; + } + } +} diff --git b/src/main/java/com/subsidy/util/LatexUtils.java a/src/main/java/com/subsidy/util/LatexUtils.java new file mode 100644 index 0000000..ac6fddb --- /dev/null +++ a/src/main/java/com/subsidy/util/LatexUtils.java @@ -0,0 +1,124 @@ +package com.subsidy.util; + +import org.scilab.forge.jlatexmath.TeXConstants; +import org.scilab.forge.jlatexmath.TeXFormula; +import org.scilab.forge.jlatexmath.TeXIcon; + +import javax.imageio.ImageIO; +import javax.swing.*; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.*; + +/** + * @author: tuyp + * @create: 2020-08-08 21:19 + */ +public class LatexUtils { + + /** + * @Description: 将base64编码字符串转换为图片 + * @Author: + * @CreateTime: + * @param imgStr + * base64编码字符串 + * @param path + * 图片路径-具体到文件 + * @return + */ + public static boolean generateImage(String imgStr, String path) { + if (imgStr == null) { + return false; + } +// BASE64Decoder decoder = new BASE64Decoder(); + try { +// byte[] b = decoder.decodeBuffer(imgStr); +// for (int i = 0; i < b.length; i++) { +// if (b[i] < 0) { +// b[i] += 256; +// } +// } +// OutputStream out = new FileOutputStream(path); +// out.write(b); +// out.flush(); +// out.close(); + return true; + } catch (Exception e) { + // TODO: handle exception + return false; + } + } + + /** + * @Description: 根据图片地址转换为base64编码字符串 + * @Author: + * @CreateTime: + * @return + */ +// public static String getImageStr(String imgFile) { +// InputStream inputStream = null; +// byte[] data = null; +// try { +// inputStream = new FileInputStream(imgFile); +// data = new byte[inputStream.available()]; +// inputStream.read(data); +// inputStream.close(); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// // 加密 +// BASE64Encoder encoder = new BASE64Encoder(); +// return encoder.encode(data); +// } + + // latex 转 imgbase64 + public static String latex2Png(String latex) { + try { + TeXFormula formula = new TeXFormula(latex); + // render the formla to an icon of the same size as the formula. + TeXIcon icon = formula.createTeXIcon(TeXConstants.STYLE_DISPLAY, 20); + // insert a border + icon.setInsets(new Insets(1, 1, 1, 1)); + // now create an actual image of the rendered equation + BufferedImage image = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_BYTE_GRAY); + Graphics2D g2 = image.createGraphics(); + g2.setColor(Color.white); + g2.fillRect(0, 0, icon.getIconWidth(), icon.getIconHeight()); + JLabel jl = new JLabel(); + jl.setForeground(new Color(0, 0, 0)); + icon.paintIcon(jl, g2, 0, 0); + // at this point the image is created, you could also save it with ImageIO + // saveImage(image, "png", "F:\\b.png"); +// ImageIO.write(image, "png", new File("F:\\c.png")); + ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + try { + ImageIO.write(image, "png", outputStream); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + return null; + } + byte[] buffer = outputStream.toByteArray(); +// BASE64Encoder encoder = new BASE64Encoder(); + return ("data:image/png;base64,"); + } catch (Exception e) { + // e.printStackTrace(); + // ExceptionUtil.log(log, e); + System.err.println("公式解析有误:\n" + latex); + // e.printStackTrace(); + return null; + } + } + + public static void main(String[] args) { + String str = latex2Png("\\(\\sqrt[3]{2+x}\\)"); + System.out.println(str); + + + + +// String omml =Latex_Word.latexToWord(str); +// System.out.println(omml); + } + +} diff --git b/src/main/java/com/subsidy/util/Localstorage.java a/src/main/java/com/subsidy/util/Localstorage.java new file mode 100644 index 0000000..4cc65bd --- /dev/null +++ a/src/main/java/com/subsidy/util/Localstorage.java @@ -0,0 +1,21 @@ +package com.subsidy.util; + +import org.springframework.web.bind.annotation.RestController; + +@RestController +public class Localstorage { + + private static final ThreadLocal local = ThreadLocal.withInitial(() -> null); + + public static void setUser(Object admin) { + Localstorage.local.set(admin); + } + + public static Object getUser() { + return Localstorage.local.get(); + } + + public static void remove() { + Localstorage.local.remove(); + } +} diff --git b/src/main/java/com/subsidy/util/MathUtil.java a/src/main/java/com/subsidy/util/MathUtil.java new file mode 100644 index 0000000..30f4816 --- /dev/null +++ a/src/main/java/com/subsidy/util/MathUtil.java @@ -0,0 +1,137 @@ +package com.subsidy.util; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Random; + +public class MathUtil { + + public static String getRandomCode(int randomLength) { + StringBuilder str = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < randomLength; i++) { + str.append(random.nextInt(10)); + } + return str.toString(); + } + + public static String getRandomString(int length) { + StringBuilder val = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < length; ++i) { + String charOrNum = random.nextInt(3) % 3 == 0 ? "num" : "char"; + if ("char".equalsIgnoreCase(charOrNum)) { + int temp = random.nextInt(2) % 2 == 0 ? 65 : 97; + val.append((char) (random.nextInt(26) + temp)); + } else { + val.append(random.nextInt(10)); + } + } + return val.toString(); + } + + //习题/视频 ==> 秒钟向上取整 + public static String ceilSecond(int length) { + return String.valueOf((int) Math.ceil((double) length / 60)); + } + + //视频秒数处理 + public static String vodLength(int i) { + if (i > 60) { + if (i % 60 >= 10) { + return i / 60 + ":" + i % 60; + } else { + return i / 60 + ":0" + i % 60; + } + } else { + if (i % 60 >= 10) { + return "00:" + i; + } else { + return "00:0" + i; + } + } + } + + //文件大小处理 + public static String fileUnit(int i) { + if (i / 1024 > 1024) { + return String.format("%.2f", (double) i / 1024 / 1024) + "M"; + } else { + return String.format("%.2f", (double) i / 1024) + "K"; + } + } + + //单个题目秒数处理 + public static String exerciseLength(int i) { + if (i >= 60 * 60) { + return i / 60 / 60 + "时" + (i - 60 * 60) / 60 + "分" + i % 60 + "秒"; + } else if (i >= 60) { + return i / 60 + "分" + i % 60 + "秒"; + } else { + return i % 60 + "秒"; + } + } + + // 除法取整 + public static String getAvgIndex(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total)) { + return "0"; + } else { + return counts.divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString(); + } + } + + //百分比 取整 返回字符串 + public static String getPercentAvgIndex(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { + return "0%"; + } else { + return counts.multiply(new BigDecimal(100)).divide(total, RoundingMode.CEILING).stripTrailingZeros().toPlainString() + "%"; + } + } + //百分比 不带%输出 + public static String getPercentAvgIndexWithPercent(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { + return "0"; + } else { + return counts.multiply(new BigDecimal(100)).divide(total,2,BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); + } + } + + //百分比 不带%输出 + public static String getPercentAvgIndexCeil(BigDecimal counts, BigDecimal total) { + if (BigDecimal.ZERO.equals(total) || BigDecimal.ZERO.equals(counts)) { + return "0"; + } else { + return counts.multiply(new BigDecimal(100)).divide(total,2,BigDecimal.ROUND_CEILING).stripTrailingZeros().toPlainString(); + } + } + + + //习题序号生成规则 sid 从数据取出某科目某知识点的最大的序号 + public static String getExeCode(String sid) { + Integer integer = Integer.valueOf(sid.substring(9)); + return sid.substring(0, 9) + (++integer); + } + + // 整型a 整型b a/b 向上取整 + public static Integer intDivCeil(long a, int b) { + return (int) Math.ceil((double) a / b); + } + + // 整型a 整型b a/b 向下取整 + public static Integer intDivFloorPercent(long a, int b) { + return (int) Math.floor((double) a * 100 / b); + } + + public static Integer getRandomNum(Integer i){ + Random random = new Random(); + return random.nextInt(i); + } + +// public static void main(String[] args) { +// for (int i= 1;i<100;i++){ +// System.out.println(getRandomNum(2)); +// } +// } +} diff --git b/src/main/java/com/subsidy/util/RandomUtil.java a/src/main/java/com/subsidy/util/RandomUtil.java new file mode 100644 index 0000000..da3a872 --- /dev/null +++ a/src/main/java/com/subsidy/util/RandomUtil.java @@ -0,0 +1,19 @@ +package com.subsidy.util; + +import java.util.Random; + +public class RandomUtil { + + public static int getCode() { + return (int)((Math.random() * 9 + 1) * 100000); + } + + public static String getRandomCode(int randomLength) { + StringBuilder str = new StringBuilder(); + Random random = new Random(); + for (int i = 0; i < randomLength; i++) { + str.append(random.nextInt(10)); + } + return str.toString(); + } +} diff --git b/src/main/java/com/subsidy/util/SMSUtils.java a/src/main/java/com/subsidy/util/SMSUtils.java new file mode 100644 index 0000000..7772f13 --- /dev/null +++ a/src/main/java/com/subsidy/util/SMSUtils.java @@ -0,0 +1,139 @@ +package com.subsidy.util; + +import com.aliyuncs.CommonRequest; +import com.aliyuncs.CommonResponse; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; +import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; +import com.aliyuncs.http.MethodType; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; +import com.subsidy.common.configure.AliyunSmsProperties; +import com.subsidy.common.exception.HttpException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 短信发送工具类 + */ + +@Component +public class SMSUtils { + + + + @Autowired + private AliyunSmsProperties aliyunSmsProperties; + + public SendSmsResponse send(String phone, String 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_190945394"); + //可选:模板中的变量替换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) { + throw new HttpException(70011); + } + } + + + /** + * 发送验证码短信 + * @param templateId 短信模板id + * @param telephone 手机号 + * @return + */ + public static String sendVerifySMS(String templateId,String telephone,String param){ + DefaultProfile profile = DefaultProfile.getProfile(ConstantUtils.REGION_ID, ConstantUtils.ACCESS_KEY_ID, ConstantUtils.SECRET); + IAcsClient client = new DefaultAcsClient(profile); + + CommonRequest request = new CommonRequest(); + request.setSysMethod(MethodType.POST); + request.setSysDomain("dysmsapi.aliyuncs.com"); + request.setSysVersion("2017-05-25"); + request.setSysAction("SendSms"); + request.putQueryParameter("RegionId",ConstantUtils.REGION_ID); + request.putQueryParameter("PhoneNumbers",telephone); + request.putQueryParameter("SignName",ConstantUtils.VERIFY_NAME); + request.putQueryParameter("TemplateCode",templateId); +// if (StringUtils.isEmpty(param)){ +// request.putQueryParameter("TemplateParam","{ \"code\":\""+verifyCode +"\"}"); +// } + request.putQueryParameter("TemplateParam",param); + CommonResponse response = null; + try { + response = client.getCommonResponse(request); + return ConstantUtils.SUCCESS_SEND_OUT; + } catch(Exception e) { + e.printStackTrace(); + return ConstantUtils.FAIL_SEND_OUT; + } + } + + /** + * 发送通知短信 + * @param templateId 短信模板id + * @param telephone 手机号 + * @return + */ + public static String sendNoticeSMS(String templateId,String telephone,String param){ + DefaultProfile profile = DefaultProfile.getProfile(ConstantUtils.REGION_ID, ConstantUtils.ACCESS_KEY_ID, ConstantUtils.SECRET); + IAcsClient client = new DefaultAcsClient(profile); + + CommonRequest request = new CommonRequest(); + request.setSysMethod(MethodType.POST); + request.setSysDomain("dysmsapi.aliyuncs.com"); + request.setSysVersion("2017-05-25"); + request.setSysAction("SendSms"); + request.putQueryParameter("RegionId",ConstantUtils.REGION_ID); + request.putQueryParameter("PhoneNumbers",telephone); + request.putQueryParameter("SignName",ConstantUtils.NOTICE_NAME); + request.putQueryParameter("TemplateCode",templateId); +// if (StringUtils.isEmpty(param)){ +// request.putQueryParameter("TemplateParam","{ \"code\":\""+verifyCode +"\"}"); +// } + request.putQueryParameter("TemplateParam",param); + CommonResponse response = null; + try + + { + response = client.getCommonResponse(request); + return ConstantUtils.SUCCESS_SEND_OUT; + } catch( + Exception e) + + { + e.printStackTrace(); + return ConstantUtils.FAIL_SEND_OUT; + } + } + + public static void main(String[] args) { + String param = "{ \"company\":\""+"基金会"+ "\",\"time\":\""+"2020-01-02" +"\",\"address\":\""+"上海市" +"\"}"; + sendNoticeSMS("SMS_215336604","15201936167",param); + } + +} diff --git b/src/main/java/com/subsidy/util/SecretUtils.java a/src/main/java/com/subsidy/util/SecretUtils.java new file mode 100644 index 0000000..f0c15c9 --- /dev/null +++ a/src/main/java/com/subsidy/util/SecretUtils.java @@ -0,0 +1,116 @@ +package com.subsidy.util; + +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.util.UUID; + +public class SecretUtils { + + /** + * 对用户登录密码进行MD5加密 + * + * @param str + * @return + */ + + public static String getMD5String(String str) { + try { + // 生成一个MD5加密计算摘要 + MessageDigest md = MessageDigest.getInstance("MD5"); + // 计算md5函数 + md.update(str.getBytes()); + // digest()最后确定返回md5 hash值,返回值为8位字符串。因为md5 hash值是16位的hex值,实际上就是8位的字符 + // BigInteger函数则将8位的字符串转换成16位hex值,用字符串来表示;得到字符串形式的hash值 + //一个byte是八位二进制,也就是2位十六进制字符(2的8次方等于16的2次方) + return new BigInteger(1, md.digest()).toString(16); + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 对字符串进行SHA加密 + * + * @param + */ + public static String getSHAString(String str) { + try { + MessageDigest sha = MessageDigest.getInstance("SHA-1"); + + byte[] byteArray = str.getBytes(StandardCharsets.UTF_8); + byte[] md5Bytes = sha.digest(byteArray); + StringBuffer hexValue = new StringBuffer(); + for (int i = 0; i < md5Bytes.length; i++) { + int val = ((int) md5Bytes[i]) & 0xff; + if (val < 16) { + hexValue.append("0"); + } + hexValue.append(Integer.toHexString(val)); + } + + return hexValue.toString(); + } catch (Exception e) { + return null; + } + + } + + + private static byte[] md5(String s) + { + MessageDigest algorithm; + try + { + algorithm = MessageDigest.getInstance("MD5"); + algorithm.reset(); + algorithm.update(s.getBytes("UTF-8")); + byte[] messageDigest = algorithm.digest(); + return messageDigest; + } + catch (Exception e) + { + + } + return null; + } + + private static final String toHex(byte hash[]) + { + if (hash == null) + { + return null; + } + StringBuffer buf = new StringBuffer(hash.length * 2); + int i; + + for (i = 0; i < hash.length; i++) + { + if ((hash[i] & 0xff) < 0x10) + { + buf.append("0"); + } + buf.append(Long.toString(hash[i] & 0xff, 16)); + } + return buf.toString(); + } + + public static String hash(String s) + { + try + { + return new String(toHex(md5(s)).getBytes("UTF-8"), "UTF-8"); + } + catch (Exception e) + { + return s; + } + } + + public static void main(String[] args) { + String uuid = UUID.randomUUID().toString(); + System.out.println(uuid); + System.out.println(hash(uuid+"ixihs")); + } +} \ No newline at end of file diff --git b/src/main/java/com/subsidy/util/Signature.java a/src/main/java/com/subsidy/util/Signature.java new file mode 100644 index 0000000..87f4c62 --- /dev/null +++ a/src/main/java/com/subsidy/util/Signature.java @@ -0,0 +1,79 @@ +package com.subsidy.util; + +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 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 += "¤tTimeStamp=" + currentTime; + contextStr += "&expireTime=" + endTime; + contextStr += "&random=" + random; + + 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; + } +} diff --git b/src/main/java/com/subsidy/util/Student.java a/src/main/java/com/subsidy/util/Student.java new file mode 100644 index 0000000..77f6c1c --- /dev/null +++ a/src/main/java/com/subsidy/util/Student.java @@ -0,0 +1,17 @@ +package com.subsidy.util; + +import lombok.Data; + +import java.util.Date; + +@Data +public class Student { + + private String name; + private int age; + private Date birthday; + private float height; + private double weight; + private boolean sex; + +} diff --git b/src/main/java/com/subsidy/util/TestMain.java a/src/main/java/com/subsidy/util/TestMain.java new file mode 100644 index 0000000..547881b --- /dev/null +++ a/src/main/java/com/subsidy/util/TestMain.java @@ -0,0 +1,61 @@ +package com.subsidy.util; + +import java.security.MessageDigest; +import java.util.Random; + +public class TestMain { + + public static void main(String[] args) { + String password = "123456"; + String saltCode = getRandomCharAndNumr(5); + String encryptString = encrypt("91ebn" + password); + System.out.println(encryptString); + } + + public static String encrypt(String string) { + + String encryptedString = string; + char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; + try { + byte[] btInput = string.getBytes(); + MessageDigest mdInst = MessageDigest.getInstance("MD5"); + mdInst.update(btInput); + byte[] md = mdInst.digest(); + int j = md.length; + char[] str = new char[j * 2]; + int k = 0; + for (int i = 0; i < j; i++) { + byte byte0 = md[i]; + str[k++] = hexDigits[byte0 >>> 4 & 0xf]; + str[k++] = hexDigits[byte0 & 0xf]; + } + encryptedString = new String(str); + return encryptedString; + } catch (Exception e) { + e.printStackTrace(); + return encryptedString; + } + } + + /** + * 获取随机字母数字组合 + * + * @param length + * 字符串长度 + * @return + */ + public static String getRandomCharAndNumr(Integer length) { + String str = ""; + Random random = new Random(); + for (int i = 0; i < length; i++) { + boolean b = random.nextBoolean(); + if (b) { // 字符串 + // int choice = random.nextBoolean() ? 65 : 97; 取得65大写字母还是97小写字母 + str += (char) (97 + random.nextInt(26));// 取得大写字母 + } else { // 数字 + str += String.valueOf(random.nextInt(10)); + } + } + return str; + } +} diff --git b/src/main/java/com/subsidy/util/ZipTestUtils.java a/src/main/java/com/subsidy/util/ZipTestUtils.java new file mode 100644 index 0000000..925652e --- /dev/null +++ a/src/main/java/com/subsidy/util/ZipTestUtils.java @@ -0,0 +1,299 @@ +package com.subsidy.util; + +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.util.CellRangeAddress; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.xssf.streaming.SXSSFCell; +import org.apache.poi.xssf.streaming.SXSSFRow; +import org.apache.poi.xssf.streaming.SXSSFSheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +public class ZipTestUtils { + + /* + 原链接:https://blog.csdn.net/houxuehan/article/details/89189820 + */ + + public static String NO_DEFINE = "no_define";//未定义的字段 + public static String DEFAULT_DATE_PATTERN = "yyyy年MM月dd日";//默认日期格式 + public static int DEFAULT_COLOUMN_WIDTH = 17; + + /** + * 导出Excel 2007 OOXML (.xlsx)格式 + * + * @param title 标题行 + * @param headList 属性-列头 + * @param students 数据集 + * @param datePattern 日期格式,传null值则默认 年月日 + * @param colWidth 列宽 默认 至少17个字节 + * @param out 输出流 + */ + public static void exportExcelX(String title, List headList, List students, String datePattern, int colWidth, OutputStream out) { + if (datePattern == null) { + datePattern = DEFAULT_DATE_PATTERN; + } + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + titleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + headerStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + headerStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); + headerStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); + headerStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); + headerStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); + headerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); + headerStyle.setFont(headerFont); + // 单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); + cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); + cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); + cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); + cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = colWidth < DEFAULT_COLOUMN_WIDTH ? DEFAULT_COLOUMN_WIDTH : colWidth;//至少字节数 + int[] arrColWidth = new int[headList.size()]; + // 产生表格标题行,以及设置列宽 + String[] properties = new String[headList.size()]; + String[] headers = new String[headList.size()]; + int ii = 0; + for (int i = 0 ;i < headList.size(); i++) { + + //properties[ii] = fieldName; + headers[ii] = headList.get(i); + + int bytes = headList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + // 遍历集合数据,产生数据行 + int rowIndex = 0; + for (Student student : students) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headList.size() - 1)); + + SXSSFRow headerRow = sheet.createRow(1); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + + } + rowIndex = 2;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(student.getName()); + + newCell = dataRow.createCell(1); + //newCell.setCellStyle(cellStyle); + newCell.setCellValue(student.getAge()); + + newCell = dataRow.createCell(2); + newCell.setCellValue(new SimpleDateFormat(datePattern).format(student.getBirthday())); + + newCell = dataRow.createCell(3); + newCell.setCellValue(student.getHeight()); + + newCell = dataRow.createCell(4); + newCell.setCellValue(student.getWeight()); + + newCell = dataRow.createCell(5); + newCell.setCellValue(student.isSex()); + + // + //for (int i = 0; i < properties.length; i++) { + // + // Object o = jo.get(properties[i]); + // String cellValue = ""; + // if (o == null) { + // cellValue = ""; + // } else if (o instanceof Date) { + // cellValue = new SimpleDateFormat(datePattern).format(o); + // } + // /*else if(o instanceof Float || o instanceof Double) { + // double d = (double) o; + // if(d%1==0) cellValue=o.toString(); + // else cellValue= new BigDecimal(o.toString()).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); + // }*/ + // else { + // cellValue = o.toString(); + // } + // newCell.setCellValue(cellValue); + // newCell.setCellStyle(cellStyle); + //} + rowIndex++; + } + // 自动调整宽度 + /*for (int i = 0; i < headers.length; i++) { + sheet.autoSizeColumn(i); + }*/ + try { + workbook.write(out); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 压缩单个excel文件的输出流 到zip输出流,注意zipOutputStream未关闭,需要交由调用者关闭之 + * + * @param zipOutputStream zip文件的输出流 + * @param excelOutputStream excel文件的输出流 + * @param excelFilename 文件名可以带目录,例如 TestDir/test1.xlsx + */ + public static void compressFileToZipStream(ZipOutputStream zipOutputStream, + ByteArrayOutputStream excelOutputStream, String excelFilename) { + byte[] buf = new byte[1024]; + try { + // Compress the files + byte[] content = excelOutputStream.toByteArray(); + ByteArrayInputStream is = new ByteArrayInputStream(content); + BufferedInputStream bis = new BufferedInputStream(is); + // Add ZIP entry to output stream. + zipOutputStream.putNextEntry(new ZipEntry(excelFilename)); + // Transfer bytes from the file to the ZIP file + int len; + while ((len = bis.read(buf)) > 0) { + zipOutputStream.write(buf, 0, len); + } + // Complete the entry + //excelOutputStream.close();//关闭excel输出流 + zipOutputStream.closeEntry(); + bis.close(); + is.close(); + // Complete the ZIP file + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void main(String[] args) throws IOException { + int count = 100; + List list = new ArrayList<>(); + for (int i = 0; i < count; i++) { + Student s = new Student(); + s.setName("POI" + i); + s.setAge(i); + s.setBirthday(new Date()); + s.setHeight(i); + s.setWeight(i); + s.setSex(i / 2 == 0 ? false : true); + list.add(s); + } + //Map headMap = new LinkedHashMap(); + //headMap.put("name", "姓名"); + //headMap.put("age", "年龄"); + //headMap.put("birthday", "生日"); + //headMap.put("height", "身高"); + //headMap.put("weight", "体重"); + //headMap.put("sex", "性别"); + + List memberList = Arrays.asList(new String[]{"成员名称","账号","联系方式","签到次数","课程进度","培训时长","评级测试","答疑"}); + + + //导出zip + OutputStream outXlsx = new FileOutputStream("E://test.zip"); + ZipOutputStream zipOutputStream = new ZipOutputStream(outXlsx); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + exportExcelX("testExcel", memberList, list, null, 0, baos); + compressFileToZipStream(zipOutputStream, baos, "/test/aaa.xlsx"); + baos.close(); + + zipOutputStream.flush(); + zipOutputStream.close(); + outXlsx.close(); + + System.out.println("导出zip完成"); + } + + + public void exportZip(HttpServletResponse response, List students) throws Exception { + + ServletOutputStream sos = response.getOutputStream(); + ZipOutputStream zipOutputStream = new ZipOutputStream(sos); + String zipname = "test.zip"; + response.reset(); + response.setContentType("application/x-download"); + response.setHeader("Content-Disposition", "attachment;filename=" + new String((zipname).getBytes(), "iso-8859-1")); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + /** + * 班级成员 + */ + List memberList = Arrays.asList(new String[]{"成员名称","账号","联系方式","签到次数","课程进度","培训时长","评级测试","答疑"}); + + /** + * 注册签到 + */ + List signList = Arrays.asList(new String[]{"成员名称","培训时长","课程进度","完成率"}); + + /** + * 测试成绩 + */ + List scoreList = Arrays.asList(new String[]{"成员名称","测试结果","最高分"}); + + /** + * 答疑记录 + */ + List answerList = Arrays.asList(new String[]{"提问","答疑","提问时间","提问成员","答疑时间"}); + + //Map headMap = new LinkedHashMap(); + //headMap.put("name", "成员名称"); + //headMap.put("age", "年龄"); + //headMap.put("birthday", "生日"); + //headMap.put("height", "身高"); + //headMap.put("weight", "体重"); + //headMap.put("sex", "性别"); + + exportExcelX("title", memberList, students, null, 0, baos); + compressFileToZipStream(zipOutputStream, baos, "/test/aaa.xlsx"); + baos.close(); + + zipOutputStream.flush(); + zipOutputStream.close(); + sos.close(); + System.out.println("导出zip完成"); + } + +} diff --git b/src/main/java/com/subsidy/util/ZipUtils.java a/src/main/java/com/subsidy/util/ZipUtils.java new file mode 100644 index 0000000..8cc27e3 --- /dev/null +++ a/src/main/java/com/subsidy/util/ZipUtils.java @@ -0,0 +1,259 @@ +package com.subsidy.util; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.util.CellRangeAddress; +import org.apache.poi.ss.usermodel.CellStyle; +import org.apache.poi.ss.usermodel.Font; +import org.apache.poi.xssf.streaming.SXSSFCell; +import org.apache.poi.xssf.streaming.SXSSFRow; +import org.apache.poi.xssf.streaming.SXSSFSheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +public class ZipUtils { + + /* + 原链接:https://blog.csdn.net/houxuehan/article/details/89189820 + */ + + public static String NO_DEFINE = "no_define";//未定义的字段 + public static String DEFAULT_DATE_PATTERN = "yyyy年MM月dd日";//默认日期格式 + public static int DEFAULT_COLOUMN_WIDTH = 17; + + /** + * 导出Excel 2007 OOXML (.xlsx)格式 + * + * @param title 标题行 + * @param headMap 属性-列头 + * @param jsonArray 数据集 + * @param datePattern 日期格式,传null值则默认 年月日 + * @param colWidth 列宽 默认 至少17个字节 + * @param out 输出流 + */ + public static void exportExcelX(String title, Map headMap, JSONArray jsonArray, String datePattern, int colWidth, OutputStream out) { + if (datePattern == null) { + datePattern = DEFAULT_DATE_PATTERN; + } + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + titleStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + headerStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + headerStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); + headerStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); + headerStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); + headerStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); + headerStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); + headerStyle.setFont(headerFont); + // 单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + cellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND); + cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); + cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN); + cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN); + cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN); + cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = colWidth < DEFAULT_COLOUMN_WIDTH ? DEFAULT_COLOUMN_WIDTH : colWidth;//至少字节数 + int[] arrColWidth = new int[headMap.size()]; + // 产生表格标题行,以及设置列宽 + String[] properties = new String[headMap.size()]; + String[] headers = new String[headMap.size()]; + int ii = 0; + for (Iterator iter = headMap.keySet().iterator(); iter + .hasNext(); ) { + String fieldName = iter.next(); + + properties[ii] = fieldName; + headers[ii] = headMap.get(fieldName); + + int bytes = fieldName.getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + // 遍历集合数据,产生数据行 + int rowIndex = 0; + for (Object obj : jsonArray) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headMap.size() - 1)); + + SXSSFRow headerRow = sheet.createRow(1); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + + } + rowIndex = 2;//数据内容从 rowIndex=2开始 + } + JSONObject jo = (JSONObject) JSONObject.toJSON(obj); + SXSSFRow dataRow = sheet.createRow(rowIndex); + for (int i = 0; i < properties.length; i++) { + SXSSFCell newCell = dataRow.createCell(i); + + Object o = jo.get(properties[i]); + String cellValue = ""; + if (o == null) { + cellValue = ""; + } else if (o instanceof Date) { + cellValue = new SimpleDateFormat(datePattern).format(o); + } + /*else if(o instanceof Float || o instanceof Double) { + double d = (double) o; + if(d%1==0) cellValue=o.toString(); + else cellValue= new BigDecimal(o.toString()).setScale(2,BigDecimal.ROUND_HALF_UP).toString(); + }*/ + else { + cellValue = o.toString(); + } + newCell.setCellValue(cellValue); + newCell.setCellStyle(cellStyle); + } + rowIndex++; + } + // 自动调整宽度 + /*for (int i = 0; i < headers.length; i++) { + sheet.autoSizeColumn(i); + }*/ + try { + workbook.write(out); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 压缩单个excel文件的输出流 到zip输出流,注意zipOutputStream未关闭,需要交由调用者关闭之 + * + * @param zipOutputStream zip文件的输出流 + * @param excelOutputStream excel文件的输出流 + * @param excelFilename 文件名可以带目录,例如 TestDir/test1.xlsx + */ + public static void compressFileToZipStream(ZipOutputStream zipOutputStream, + ByteArrayOutputStream excelOutputStream, String excelFilename) { + byte[] buf = new byte[1024]; + try { + // Compress the files + byte[] content = excelOutputStream.toByteArray(); + ByteArrayInputStream is = new ByteArrayInputStream(content); + BufferedInputStream bis = new BufferedInputStream(is); + // Add ZIP entry to output stream. + zipOutputStream.putNextEntry(new ZipEntry(excelFilename)); + // Transfer bytes from the file to the ZIP file + int len; + while ((len = bis.read(buf)) > 0) { + zipOutputStream.write(buf, 0, len); + } + // Complete the entry + //excelOutputStream.close();//关闭excel输出流 + zipOutputStream.closeEntry(); + bis.close(); + is.close(); + // Complete the ZIP file + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void main(String[] args) throws IOException { + int count = 100; + JSONArray ja = new JSONArray(); + for (int i = 0; i < count; i++) { + Student s = new Student(); + s.setName("POI" + i); + s.setAge(i); + s.setBirthday(new Date()); + s.setHeight(i); + s.setWeight(i); + s.setSex(i / 2 == 0 ? false : true); + ja.add(s); + } + Map headMap = new LinkedHashMap(); + headMap.put("name", "姓名"); + headMap.put("age", "年龄"); + headMap.put("birthday", "生日"); + headMap.put("height", "身高"); + headMap.put("weight", "体重"); + headMap.put("sex", "性别"); + //导出zip + OutputStream outXlsx = new FileOutputStream("E://test.zip"); + ZipOutputStream zipOutputStream = new ZipOutputStream(outXlsx); + + for (int i = 1; i < 6; i++) { + String dir = i % 2 == 0 ? "dirA" : "dirB"; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + exportExcelX("testExcel", headMap, ja, null, 0, baos); + compressFileToZipStream(zipOutputStream, baos, dir + "/test" + i + ".xlsx"); + baos.close(); + } + zipOutputStream.flush(); + zipOutputStream.close(); + outXlsx.close(); + + System.out.println("导出zip完成"); + } + + + public void exportZip(HttpServletResponse response) throws Exception { + + ServletOutputStream sos = response.getOutputStream(); + ZipOutputStream zipOutputStream = new ZipOutputStream(sos); + String zipname = "test.zip"; + response.reset(); + response.setContentType("application/x-download"); + response.setHeader("Content-Disposition", "attachment;filename=" + new + + String((zipname). + + getBytes(), "iso-8859-1")); + for (int i = 1; i < 6; i++) { + String dir = i % 2 == 0 ? "dirA" : "dirB"; + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + //exportExcelX(title, headMap, ja, null, 0, baos); + compressFileToZipStream(zipOutputStream, baos, dir + "/test" + i + ".xlsx"); + baos.close(); + } + zipOutputStream.flush(); + zipOutputStream.close(); + sos.close(); + System.out.println("导出zip完成"); + } +} diff --git b/src/main/java/com/subsidy/util/excel/ExcelColumn.java a/src/main/java/com/subsidy/util/excel/ExcelColumn.java new file mode 100644 index 0000000..ca1690d --- /dev/null +++ a/src/main/java/com/subsidy/util/excel/ExcelColumn.java @@ -0,0 +1,13 @@ +package com.subsidy.util.excel; + +import java.lang.annotation.*; + +@Target(ElementType.FIELD) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ExcelColumn { + + String value() default ""; + + int col() default 1; +} diff --git b/src/main/java/com/subsidy/util/excel/ExcelColumnUtil.java a/src/main/java/com/subsidy/util/excel/ExcelColumnUtil.java new file mode 100644 index 0000000..873ab06 --- /dev/null +++ a/src/main/java/com/subsidy/util/excel/ExcelColumnUtil.java @@ -0,0 +1,21 @@ +package com.subsidy.util.excel; + +import java.lang.annotation.*; + +/** + *

+ * excel 字段 + *

+ * + * @author DengMin + * @date Created in 2020/08/28 + */ +@Target({ElementType.FIELD}) +@Retention(RetentionPolicy.RUNTIME) +@Documented +public @interface ExcelColumnUtil { + + String value() default ""; + + int col() default 0; +} diff --git b/src/main/java/com/subsidy/util/excel/ExcelUtil.java a/src/main/java/com/subsidy/util/excel/ExcelUtil.java new file mode 100644 index 0000000..ecf09ad --- /dev/null +++ a/src/main/java/com/subsidy/util/excel/ExcelUtil.java @@ -0,0 +1,1244 @@ +package com.subsidy.util.excel; + +import com.subsidy.vo.administer.ExerciseTestVO; +import com.subsidy.vo.classdict.ClassDetailVO; +import com.subsidy.vo.member.ClassSignVO; +import com.subsidy.vo.sign.AnswerRecordVO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.CharUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.math.NumberUtils; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.hssf.usermodel.HSSFFont; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.hssf.util.CellRangeAddress; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.xssf.streaming.SXSSFCell; +import org.apache.poi.xssf.streaming.SXSSFRow; +import org.apache.poi.xssf.streaming.SXSSFSheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.zip.ZipOutputStream; + +/** + * Excel工具 + * + * @author DengMin + * @date 2019/08/27 13:57 + **/ +@Slf4j +public class ExcelUtil { + + private final static String EXCEL2003 = "xls"; + + private final static String EXCEL2007 = "xlsx"; + + /** + * 导入excel文件 + * + * @param path + * @param cls + * @param file + * @param + * @return + */ + public static List readExcel(String path, Class cls, MultipartFile file) { + String fileName = file.getOriginalFilename(); + if (!fileName.matches("^.+\\.(?i)(xls)$") && !fileName.matches("^.+\\.(?i)(xlsx)$")) { + log.info("上传文件格式不正确"); +// throw new HTTPException(10022); + } + + List dataList = new ArrayList<>(); + Workbook workbook = null; + try { + InputStream is = file.getInputStream(); + if (fileName.endsWith(EXCEL2007)) { + // FileInputStream is = new FileInputStream(new File(path)); + workbook = new XSSFWorkbook(is); + } + + if (fileName.endsWith(EXCEL2003)) { + // FileInputStream is = new FileInputStream(new File(path)); + workbook = new HSSFWorkbook(is); + } + + if (workbook != null) { + Map> classMap = new HashMap<>(); + List fields = Stream.of(cls.getDeclaredFields()).collect(Collectors.toList()); + fields.forEach(field -> { + ExcelColumnUtil annotation = field.getAnnotation(ExcelColumnUtil.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); + } + }); + //索引-->columns + Map> reflectionMap = new HashMap<>(); + //默认读取第一个sheet + Sheet sheet = workbook.getSheetAt(0); + + boolean firstRow = true; + for (int i = 0; i <= sheet.getLastRowNum(); i++) { + Row row = sheet.getRow(i); + //提取标题 + if (firstRow) { + for (int j = 0; j <= row.getLastCellNum(); j++) { + Cell cell = row.getCell(j); + String cellValue = getCellValue(cell); + if (classMap.containsKey(cellValue)) { + reflectionMap.put(j, classMap.get(cellValue)); + } + } + + firstRow = false; + } else { + //忽略空白行 + if (row == null) { + continue; + } + + try { + T t = cls.newInstance(); + //判断是否为空白行 + boolean allBlank = true; + for (int j = 0; j <= row.getLastCellNum(); j++) { + if (reflectionMap.containsKey(j)) { + Cell cell = row.getCell(j); + String cellValue = getCellValue(cell); + if (StringUtils.isNotBlank(cellValue)) { + allBlank = false; + } + List fieldList = reflectionMap.get(j); + fieldList.forEach(x -> { + try { + handleField(t, cellValue, x); + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("reflect field:%s value:%s exception!", x.getName(), cellValue), e); + } + }); + } + } + + if (!allBlank) { + dataList.add(t); + } + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse row:%s exception!", i), e); + } + } + } + } + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse excel exception!"), e); + } finally { + if (workbook != null) { + try { + workbook.close(); + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("parse excel exception!"), e); + } + } + } + return dataList; + } + + /** + * 导出excel文件 + * + * @param list + * @param cls + * @param + */ + public static void writeExcel(List list, Class cls) { + ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = servletRequestAttributes.getResponse(); + Field[] fields = cls.getDeclaredFields(); + List fieldList = Arrays.stream(fields).filter(field -> { + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + if (annotation != null) { + field.setAccessible(true); + return true; + } + return false; + }).sorted(Comparator.comparing(field -> { + int col = 0; + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + if (annotation != null) { + col = annotation.col(); + } + return col; + })).collect(Collectors.toList()); + + Workbook wb = new XSSFWorkbook(); + Sheet sheet = wb.createSheet(); + AtomicInteger ai = new AtomicInteger(); + { + Row row = sheet.createRow(ai.getAndIncrement()); + AtomicInteger at = new AtomicInteger(); + fieldList.forEach(field -> { + ExcelColumn annotation = field.getAnnotation(ExcelColumn.class); + String columnName = ""; + if (annotation != null) { + columnName = annotation.value(); + } + 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(columnName); + }); + + if (list != null) { + list.forEach(data -> { + Row r = sheet.createRow(ai.getAndIncrement()); + AtomicInteger a = new AtomicInteger(); + fieldList.forEach(field -> { + try { + Class type = field.getType(); + Object value = field.get(data); + Cell cell = r.createCell(a.getAndIncrement()); + if (value != null) { + cell.setCellValue(value.toString()); + } + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + }); + }); + 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 void writeMemberExcel(String companyName, String studyDate, String courseName, String title, List list, List headerList) throws Exception { + + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = requestAttributes.getResponse(); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.addHeader("content-disposition", "attachment;filename=" + + java.net.URLEncoder.encode("member.xlsx", "utf-8")); + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行/第三行样式 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 4); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 5, 10); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(5).setCellValue(secondHead[1]); + secondRow.getCell(5).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 4); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 5, 10); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(secondStyle); + + thirdRow.createCell(5).setCellValue(thirdHead[1]); + thirdRow.getCell(5).setCellStyle(secondStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (ClassDetailVO classDetailVO : list) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getUserName()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getIdCard()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getAccountName()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getTelephone()); + + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getSignCounts()); + + newCell = dataRow.createCell(6); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getClassProcess()); + + newCell = dataRow.createCell(7); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getTrainingLength()); + + newCell = dataRow.createCell(8); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getAskCounts()); + + newCell = dataRow.createCell(9); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classDetailVO.getScore()); + + newCell = dataRow.createCell(10); + newCell.setCellStyle(cellStyle); + if (classDetailVO.getScore() >= 60) { + newCell.setCellValue("合格"); + } else { + newCell.setCellValue("不合格"); + } + rowIndex++; + seq++; + + } + + try { + OutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void writeSignExcel(String companyName, String studyDate, String courseName, String title, Listlist, List headerList) throws Exception { + + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = requestAttributes.getResponse(); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.addHeader("content-disposition", "attachment;filename=" + + java.net.URLEncoder.encode("sign.xlsx", "utf-8")); + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 3); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 8); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(4).setCellValue(secondHead[1]); + secondRow.getCell(4).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 3); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 8); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(4).setCellValue(thirdHead[1]); + thirdRow.getCell(4).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (ClassSignVO classSignVO : list) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getUserName()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getIdCard()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getTelephone()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getTrainingLength()); + + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getClassProcess()); + + newCell = dataRow.createCell(6); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getPercent()); + + newCell = dataRow.createCell(7); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getSignCounts()); + + newCell = dataRow.createCell(8); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(classSignVO.getSignInDateList()); + + rowIndex++; + seq++; + + } + + try { + OutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void writeTestExcel(String companyName, String studyDate, String courseName, String title, List list, List headerList) throws Exception { + + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = requestAttributes.getResponse(); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.addHeader("content-disposition", "attachment;filename=" + + java.net.URLEncoder.encode("test.xlsx", "utf-8")); + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 3); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 4, 6); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(4).setCellValue(secondHead[1]); + secondRow.getCell(4).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 3); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 4, 6); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(4).setCellValue(thirdHead[1]); + thirdRow.getCell(4).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (ExerciseTestVO exerciseTestVO : list) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getUserName()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getIdCard()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getTelephone()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(exerciseTestVO.getScore()); + + //次数 + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + if (exerciseTestVO.getScore()!=0){ + newCell.setCellValue(1); + }else { + newCell.setCellValue(0); + } + + newCell = dataRow.createCell(6); + newCell.setCellStyle(cellStyle); + if (exerciseTestVO.getScore()>=60){ + newCell.setCellValue("合格"); + }else { + newCell.setCellValue("不合格"); + } + + rowIndex++; + seq++; + + } + + try { + OutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static void writeAnswerExcel(String companyName, String studyDate, String courseName, String title, List list, List headerList) throws Exception { + + ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + HttpServletResponse response = requestAttributes.getResponse(); + response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); + response.addHeader("content-disposition", "attachment;filename=" + + java.net.URLEncoder.encode("answer.xlsx", "utf-8")); + + // 声明一个工作薄 + SXSSFWorkbook workbook = new SXSSFWorkbook(1000);//缓存 + workbook.setCompressTempFiles(true); + //表头样式 + CellStyle titleStyle = workbook.createCellStyle(); + setStyle(titleStyle); + Font titleFont = workbook.createFont(); + titleFont.setFontHeightInPoints((short) 20); + titleFont.setBoldweight((short) 700); + titleStyle.setFont(titleFont); + + //第二行 + CellStyle secondStyle = workbook.createCellStyle(); + secondStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + secondStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + secondStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + secondStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font secondFont = workbook.createFont(); + secondStyle.setFont(secondFont); + + //第三行 + CellStyle thirdStyle = workbook.createCellStyle(); + thirdStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框 + thirdStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框 + thirdStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框 + thirdStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框 + secondStyle.setAlignment(HSSFCellStyle.ALIGN_LEFT); + Font thirdFont = workbook.createFont(); + thirdStyle.setFont(thirdFont); + + // 列头样式 + CellStyle headerStyle = workbook.createCellStyle(); + setStyle(headerStyle); + Font headerFont = workbook.createFont(); + headerFont.setFontHeightInPoints((short) 12); + headerFont.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);//粗体显示 + headerStyle.setFont(headerFont); + + // 数据单元格样式 + CellStyle cellStyle = workbook.createCellStyle(); + setStyle(cellStyle); + Font cellFont = workbook.createFont(); + cellFont.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL); + cellStyle.setFont(cellFont); + // 生成一个(带标题)表格 + SXSSFSheet sheet = workbook.createSheet(); + //设置列宽 + int minBytes = 17;//至少字节数 + int[] arrColWidth = new int[headerList.size()]; + // 产生表格标题行,以及设置列宽 + String[] headers = new String[headerList.size()]; + int ii = 0; + for (int i = 0; i < headerList.size(); i++) { + + headers[ii] = headerList.get(i); + + int bytes = headerList.get(i).getBytes().length; + arrColWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, arrColWidth[ii] * 256); + ii++; + } + + //第二行 + int[] secondWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] secondHead = new String[2]; + List secondList = Arrays.asList(new String[]{"培训实施单位:" + companyName, "培训时间:" + studyDate}); + + //第三行 + int[] thirdWidth = new int[2]; + // 产生表格标题行,以及设置列宽 + String[] thirdHead = new String[2]; + List thirdList = Arrays.asList(new String[]{"培训项目:" + courseName, "培训平台:有课互联系统"}); + + + ii = 0; + for (int i = 0; i < 2; i++) { + secondHead[ii] = secondList.get(i); + int bytes = secondList.get(i).getBytes().length; + secondWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, secondWidth[ii] * 256); + ii++; + } + + ii = 0; + for (int i = 0; i < 2; i++) { + thirdHead[ii] = thirdList.get(i); + int bytes = thirdList.get(i).getBytes().length; + thirdWidth[ii] = bytes < minBytes ? minBytes : bytes; + sheet.setColumnWidth(ii, thirdWidth[ii] * 256); + ii++; + } + + // 遍历集合数据,产生数据行 + //标题 0 + SXSSFRow titleRow = sheet.createRow(0);//表头 rowIndex=0 + titleRow.createCell(0).setCellValue(title); + setBorderStyle(HSSFCellStyle.BORDER_THIN, new CellRangeAddress(0, 0, 0, 0), sheet, workbook); //给合并过的单元格加边框 + titleRow.getCell(0).setCellStyle(titleStyle); + sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, headerList.size() - 1)); + + //第二行 1 + SXSSFRow secondRow = sheet.createRow(1); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress21 = new CellRangeAddress(1, 1, 0, 2); + sheet.addMergedRegion(cellRangeAddress21); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress21, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress22 = new CellRangeAddress(1, 1, 3, 5); + sheet.addMergedRegion(cellRangeAddress22); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress22, sheet, workbook); //给合并过的单元格加边框 + + secondRow.createCell(0).setCellValue(secondHead[0]); + secondRow.getCell(0).setCellStyle(secondStyle); + + secondRow.createCell(3).setCellValue(secondHead[1]); + secondRow.getCell(3).setCellStyle(secondStyle); + + //第三行 2 + SXSSFRow thirdRow = sheet.createRow(2); //第二行 rowIndex =1 + CellRangeAddress cellRangeAddress31 = new CellRangeAddress(2, 2, 0, 2); + sheet.addMergedRegion(cellRangeAddress31); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress31, sheet, workbook); //给合并过的单元格加边框 + + CellRangeAddress cellRangeAddress32 = new CellRangeAddress(2, 2, 3,5); + sheet.addMergedRegion(cellRangeAddress32); + setBorderStyle(HSSFCellStyle.BORDER_THIN, cellRangeAddress32, sheet, workbook); //给合并过的单元格加边框 + thirdRow.createCell(0).setCellValue(thirdHead[0]); + thirdRow.getCell(0).setCellStyle(thirdStyle); + + thirdRow.createCell(3).setCellValue(thirdHead[1]); + thirdRow.getCell(3).setCellStyle(thirdStyle); + + //标题 3 + SXSSFRow headerRow = sheet.createRow(3); //列头 rowIndex =1 + for (int i = 0; i < headers.length; i++) { + headerRow.createCell(i).setCellValue(headers[i]); + headerRow.getCell(i).setCellStyle(headerStyle); + } + + int seq = 1; + + //内容 + int rowIndex = 0; + for (AnswerRecordVO answerRecordVO : list) { + if (rowIndex == 65535 || rowIndex == 0) { + if (rowIndex != 0) { + sheet = workbook.createSheet();//如果数据超过了,则在第二页显示 + } + rowIndex = 4;//数据内容从 rowIndex=2开始 + } + + SXSSFRow dataRow = sheet.createRow(rowIndex); + + SXSSFCell newCell = dataRow.createCell(0); + cellStyle.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(seq); + + + newCell = dataRow.createCell(1); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getTitle()); + + + newCell = dataRow.createCell(2); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getAnswer()); + + + newCell = dataRow.createCell(3); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getCreateDate()); + + newCell = dataRow.createCell(4); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getUserName()); + + //次数 + newCell = dataRow.createCell(5); + newCell.setCellStyle(cellStyle); + newCell.setCellValue(answerRecordVO.getUpdateDate()); + + rowIndex++; + seq++; + + } + + try { + OutputStream outputStream = response.getOutputStream(); + workbook.write(outputStream); + workbook.close(); + workbook.dispose(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private static void setStyle(CellStyle cellStyle) { + // 水平居中 + cellStyle.setAlignment(CellStyle.ALIGN_CENTER); + // 垂直居中 + cellStyle.setVerticalAlignment(CellStyle.ALIGN_CENTER); + // 边框 + cellStyle.setBorderTop(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderLeft(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderRight(CellStyle.BORDER_THIN); + // 边框 + cellStyle.setBorderBottom(CellStyle.BORDER_THIN); + } + + //也可用以下方法 + public static void setBorderStyle(int border, CellRangeAddress region, SXSSFSheet sheet, SXSSFWorkbook wb) { + CellStyle cs = wb.createCellStyle(); // 样式对象 + cs.setBorderBottom((short) border); + cs.setBorderTop((short) border); + cs.setBorderLeft((short) border); + cs.setBorderRight((short) border); + + setRegionStyle(cs, region, sheet); + } + + private static void setRegionStyle(CellStyle cs, CellRangeAddress region, SXSSFSheet sheet) { + for (int i = region.getFirstRow(); i <= region.getLastRow(); i++) { + SXSSFRow row = sheet.getRow(i); + if (row == null) { + row = sheet.createRow(i); + } + for (int j = region.getFirstColumn(); j <= region.getLastColumn(); j++) { + SXSSFCell cell = row.getCell(j); + if (cell == null) { + cell = row.createCell(j); + cell.setCellValue(""); + } + cell.setCellStyle(cs); + } + } + } + + + private static void handleField(T t, String value, Field field) throws Exception { + Class type = field.getType(); + if (type == null || type == void.class || StringUtils.isBlank(value)) { + return; + } + if (type == Object.class) { + field.set(t, value); + //数字类型 + } else if (type.getSuperclass() == null || type.getSuperclass() == Number.class) { + if (type == int.class || type == Integer.class) { + field.set(t, NumberUtils.toInt(value)); + } else if (type == long.class || type == Long.class) { + field.set(t, NumberUtils.toLong(value)); + } else if (type == byte.class || type == Byte.class) { + field.set(t, NumberUtils.toByte(value)); + } else if (type == short.class || type == Short.class) { + field.set(t, NumberUtils.toShort(value)); + } else if (type == double.class || type == Double.class) { + field.set(t, NumberUtils.toDouble(value)); + } else if (type == float.class || type == Float.class) { + field.set(t, NumberUtils.toFloat(value)); + } else if (type == char.class || type == Character.class) { + field.set(t, CharUtils.toChar(value)); + } else if (type == boolean.class) { + field.set(t, BooleanUtils.toBoolean(value)); + } else if (type == BigDecimal.class) { + field.set(t, new BigDecimal(value)); + } + } else if (type == Boolean.class) { + field.set(t, BooleanUtils.toBoolean(value)); + } else if (type == Date.class) { + // + field.set(t, value); + } else if (type == String.class) { + field.set(t, value); + } else { + Constructor constructor = type.getConstructor(String.class); + field.set(t, constructor.newInstance(value)); + } + } + + private static String getCellValue(Cell cell) { + if (cell == null) { + return ""; + } + + if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC) { + if (DateUtil.isCellDateFormatted(cell)) { + return HSSFDateUtil.getJavaDate(cell.getNumericCellValue()).toString(); + } else { + return new BigDecimal(cell.getNumericCellValue()).toString(); + } + } else if (cell.getCellType() == Cell.CELL_TYPE_STRING) { + return StringUtils.trimToEmpty(cell.getStringCellValue()); + } else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA) { + return StringUtils.trimToEmpty(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 if (cell.getCellType() == Cell.CELL_TYPE_ERROR) { + return "ERROR"; + } else { + return cell.toString().trim(); + } + } + + 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) { + log.error(String.format("downLoad excel exception"), e); + } + } + + private static void buildExcelFile(String path, Workbook wb) { + File file = new File(path); + if (file.exists()) { + file.delete(); + } + + try { + wb.write(new FileOutputStream(file)); + } catch (Exception e) { + log.error(String.format("downLoad excel exception"), e); + } + } +} diff --git b/src/main/java/com/subsidy/util/tree/Node.java a/src/main/java/com/subsidy/util/tree/Node.java new file mode 100644 index 0000000..bf53d6e --- /dev/null +++ a/src/main/java/com/subsidy/util/tree/Node.java @@ -0,0 +1,42 @@ +package com.subsidy.util.tree; + +import lombok.Data; + +@Data +public class Node implements Comparable { + + //主键 + private String id; + + //同级节点第几个元素 + private String number; + + //1.1 + private String text; + + //父节点 + private String parentId; + + private int level; + + public Node(String id, String number, String parentId, int level) { + this.id = id; + this.number = number; + this.parentId = parentId; + this.level = level; + } + + @Override + public int compareTo(Node o) { + if (this.level != o.level) { + return o.level - this.level; + } else { + if(this.number==null){ + return -1; + } + return this.number.compareTo(o.number); + } + } + + +} diff --git b/src/main/java/com/subsidy/util/tree/NumberTree.java a/src/main/java/com/subsidy/util/tree/NumberTree.java new file mode 100644 index 0000000..d051a9f --- /dev/null +++ a/src/main/java/com/subsidy/util/tree/NumberTree.java @@ -0,0 +1,212 @@ +package com.subsidy.util.tree; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class NumberTree { + + private String id; + + private List nodeList; + + private String separator; + + private int idSeq; + + private SerialNumber number; + + public NumberTree(String separator, SerialNumber number) { + init(); + this.separator = separator; + this.number = number; + + } + + public void init() { + idSeq = 1; + this.separator = "."; + if (this.nodeList == null) { + nodeList = new ArrayList(); + } + } + + + /** + *

功能描述:根据父节点获取所有子节点。

+ */ + public List getChildNodes(Node pNode) { + String pId = pNode.getId(); + return getChildNodes(pId); + } + + /** + *

功能描述:根据父节点获取所有子节点。

+ */ + public List getChildNodes(String pId) { + List childNodes = new ArrayList(); + for (Node n : nodeList) { + if (pId.equals(n.getParentId())) { + childNodes.add(n); + } + } + + return childNodes; + } + + /** + *

功能描述:获取本级值最大的节点。

+ */ + public Node getMaxNodeForThisLevel(Node pNode) { + List childList = getChildNodes(pNode); + Node root = getRoot(nodeList); + if (childList.size() <= 0) { + return null; + } + Node maxNode = root; + for (Node node : childList) { + if (maxNode.getNumber().compareTo(node.getNumber()) < 0) { + maxNode = node; + } + } + return maxNode; + } + + /** + *

功能描述:生成下一个子节点。

+ */ + public Node generateNextChildNode(Node node) { + Node newNode = null; + Node maxNode = getMaxNodeForThisLevel(node); + String nextNumber = number.firstNumber(); + int level = node.getLevel(); + if (maxNode != null && !"0".equals(maxNode.getId())) {//本级存在子节点,且非根节点 + nextNumber = number.produceNext(maxNode.getNumber()); + level = maxNode.getLevel(); + } + newNode = new Node(String.valueOf(++idSeq), nextNumber, node.getId(), level); + + generateNodeText(newNode, nextNumber); + + return newNode; + } + + + /** + * + *

功能描述:获取父节点。

+ */ + public Node getParentNode(Node node) { + for (Node n : nodeList) { + if (node.getParentId() == n.getId()) { + return n; + } + } + return node; + } + + /** + *

功能描述:生成节点路径。

+ */ + public void generateNodeText(Node node, String text) { + + if (node == null || "0".equals(node.getId())) { + return; + } + + Node pNode = getParentNode(node); + + if (!"0".equals(pNode.getId())) { + text = pNode.getText() + separator + text; + } + + node.setText(text); + } + + /** + *

功能描述:遍历所有树节点。

+ */ + public void traverseNodeList(Node node) { + if(node==null){ + node = getRoot(nodeList); + } + List childNodes = getChildNodes(node); + System.out.println(node.getText()); + if (childNodes.size() > 0) { + for (Node n : childNodes) { + traverseNodeList(n); + } + } + } + public static void main(String[] args) { + SerialNumber number = new SerialNumber(); + NumberTree treeNode = new NumberTree(".", number); + + addSomeNodes(treeNode); + treeNode.traverseNodeList(null); + } + + /** + *

功能描述:获取根节点。

+ */ + public Node getRoot(List nodeList) { + Node root = null; + if (nodeList.size() <= 0 || (root = getNodeById(nodeList, "0")) == null) { + root = createRoot(); + nodeList.add(root); + } + return root; + } + + private Node getNodeById(List nodeList, String id) { + Node node = null; + if(id!=null){ + for (Node n : nodeList) { + if (id.equals(n.getId())) { + node = n; + break; + } + } + } + return node; + } + + private Node createRoot() { + Node root = new Node("0", number.rootNumber(), "-1", 0); + root.setText("0"); + return root; + } + + /** + *

功能描述:测试添加节点。

+ */ + private static Node addSomeNodes(NumberTree tree) { + Node root = tree.getRoot(tree.nodeList); + Node node1 = getNextNode(tree, root);//1 + Node node2 = getNextNode(tree, root);//2 + Node node3 = getNextNode(tree, root);//3 + Node node11 = getNextNode(tree, node1);//1.1 + Node node12 = getNextNode(tree, node1);//1.2 + Node node21 = getNextNode(tree, node2);//2.1 + Node node211 = getNextNode(tree, node21);//2.1.1 + Node node212 = getNextNode(tree, node21);//2.1.2 + Node node22 = getNextNode(tree, node2);//2.2 + Node node221 = getNextNode(tree, node22);//2.2.1 + Node node31 = getNextNode(tree, node3); + Node node32 = getNextNode(tree, node3); + Node node311 = getNextNode(tree, node31); + Node node3111 = getNextNode(tree, node311); + return root; + } + + public static Node getNextNode(NumberTree tree, Node pNode) { + Node node = tree.generateNextChildNode(pNode); + if (node != null) { + tree.nodeList.add(node); + } + return node; + } + +} diff --git b/src/main/java/com/subsidy/util/tree/SerialNumber.java a/src/main/java/com/subsidy/util/tree/SerialNumber.java new file mode 100644 index 0000000..02a5e31 --- /dev/null +++ a/src/main/java/com/subsidy/util/tree/SerialNumber.java @@ -0,0 +1,28 @@ +package com.subsidy.util.tree; + +public class SerialNumber{ + + public String produceNext(String crrnt) { + + String next = "0"; + if (crrnt != null) { + try { + int crrntNum = Integer.parseInt(crrnt); + next = String.valueOf(crrntNum + 1); + } catch (Exception e) { + System.err.println("非数字类型的字符串!"); + } + } + return next; + } + + public String rootNumber() { + return "0"; + } + + public String firstNumber() { + return "1"; + } + + +} diff --git b/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java a/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java new file mode 100644 index 0000000..d60b7f1 --- /dev/null +++ a/src/main/java/com/subsidy/vo/administer/AdministerPermissionVO.java @@ -0,0 +1,21 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +import java.util.List; + +@Data +public class AdministerPermissionVO { + + private Long id; + + private String userName; + + private String role; + + private String img; + + private Boolean isRole; + + private List permissions; +} diff --git b/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java a/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java new file mode 100644 index 0000000..a85c1e3 --- /dev/null +++ a/src/main/java/com/subsidy/vo/administer/ClassSummaryVO.java @@ -0,0 +1,54 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class ClassSummaryVO { + + private Long classId; + + private String className; + + private String courseName; + + private String startDate; + + private String endDate; + + /** + * 学员总数 + */ + private Integer memberCount; + + /** + * 课程进度 + */ + private Integer studyVodCounts; + + /** + * 总课时 + */ + private Integer totalVodCounts; + + + /** + * 平均时长 + */ + private Integer avgVodPlayLength; + + /** + * 测试通过率 + */ + private Integer passRate; + + /** + * 平均签到数 + */ + private Integer avgSignCount; + + /** + * 答疑数 + */ + private Integer answerCount; + +} diff --git b/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java a/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java new file mode 100644 index 0000000..24114d9 --- /dev/null +++ a/src/main/java/com/subsidy/vo/administer/ExerciseTestVO.java @@ -0,0 +1,28 @@ +package com.subsidy.vo.administer; + +import com.subsidy.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class ExerciseTestVO { + + private Long id; + + @ExcelColumn(col = 1,value = "成员名称") + private String userName; + + /** + * 分数 向上取整 + */ + @ExcelColumn(col = 2,value = "测试结果") + private Integer score; + + @ExcelColumn(col = 3,value = "最高分") + private String result; + + private String idCard; + + private String telephone; + + private Integer count; +} diff --git b/src/main/java/com/subsidy/vo/administer/LoginVO.java a/src/main/java/com/subsidy/vo/administer/LoginVO.java new file mode 100644 index 0000000..d97ab86 --- /dev/null +++ a/src/main/java/com/subsidy/vo/administer/LoginVO.java @@ -0,0 +1,11 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class LoginVO { + + private String token; + + +} diff --git b/src/main/java/com/subsidy/vo/administer/OperatorsVO.java a/src/main/java/com/subsidy/vo/administer/OperatorsVO.java new file mode 100644 index 0000000..8b3d2f3 --- /dev/null +++ a/src/main/java/com/subsidy/vo/administer/OperatorsVO.java @@ -0,0 +1,29 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class OperatorsVO { + + private Long id; + + private String userName; + + private String telephone; + + private String field; + + private String banner; + + private String shortName; + + private String img; + + private String companyName; + + private String accountName; + + private Integer companyId; + + private String logo; +} diff --git b/src/main/java/com/subsidy/vo/administer/PermissionsVO.java a/src/main/java/com/subsidy/vo/administer/PermissionsVO.java new file mode 100644 index 0000000..bda1237 --- /dev/null +++ a/src/main/java/com/subsidy/vo/administer/PermissionsVO.java @@ -0,0 +1,17 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +import java.util.List; + +@Data +public class PermissionsVO { + + private Long id; + + private Long parentId; + + private String name; + + private List children; +} diff --git b/src/main/java/com/subsidy/vo/administer/UserRoleVO.java a/src/main/java/com/subsidy/vo/administer/UserRoleVO.java new file mode 100644 index 0000000..c9fb0fa --- /dev/null +++ a/src/main/java/com/subsidy/vo/administer/UserRoleVO.java @@ -0,0 +1,17 @@ +package com.subsidy.vo.administer; + +import lombok.Data; + +@Data +public class UserRoleVO { + + private Long id; + + private String telephone; + + private String userName; + + private String img; + + +} diff --git b/src/main/java/com/subsidy/vo/answer/GetCourseQuestionVO.java a/src/main/java/com/subsidy/vo/answer/GetCourseQuestionVO.java new file mode 100644 index 0000000..c9db152 --- /dev/null +++ a/src/main/java/com/subsidy/vo/answer/GetCourseQuestionVO.java @@ -0,0 +1,49 @@ +package com.subsidy.vo.answer; + +import lombok.Data; + +@Data +public class GetCourseQuestionVO { + + + + private String memberName; + + private String administerName; + + private String companyName; + + private Long id; + + /** + * 科目id + */ + private Long courseId; + + /** + * 提问id + */ + private Long askId; + + /** + * 回答人id + */ + private Long answerId; + + /** + * 问题 + */ + private String title; + + /** + * 答案 + */ + private String answer; + + private String createDate; + + private String updateDate; + + private String deleteDate; + +} diff --git b/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java a/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java new file mode 100644 index 0000000..bbb7f93 --- /dev/null +++ a/src/main/java/com/subsidy/vo/classdict/ClassDetailVO.java @@ -0,0 +1,73 @@ +package com.subsidy.vo.classdict; + +import com.subsidy.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class ClassDetailVO{ + + + private Long id; + + @ExcelColumn(col = 1,value = "成员名称") + private String userName; + + @ExcelColumn(col = 2,value = "账号") + private String accountName; + + @ExcelColumn(col = 3,value = "身份证号") + private String idCard; + + @ExcelColumn(col = 4,value = "联系方式") + private String telephone; + + /** + * 签到次数 + */ + @ExcelColumn(col = 5,value = "签到次数") + private Integer signCounts; + + /** + * 已看视频 + */ + private Integer studyVodCounts; + + /** + * 全部视频 + */ + private Integer allVodCounts; + + @ExcelColumn(col = 6,value = "课程进度") + private String classProcess; + + @ExcelColumn(col = 7,value = "培训时长") + private Integer trainingLength; + + /** + * 作对个数 + */ + private Integer rightCounts; + + /** + * 总题数 + */ + private Integer totalExeCounts; + + /** + * 评价测试 + */ + @ExcelColumn(col = 8,value = "评价测试") + private Integer score; + + /** + * 答疑个数 + */ + @ExcelColumn(col = 9,value = "答题数") + private Integer askCounts; + + + private String result; + + + +} diff --git b/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java a/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java new file mode 100644 index 0000000..29cd7a5 --- /dev/null +++ a/src/main/java/com/subsidy/vo/classdict/GetAllClassesVO.java @@ -0,0 +1,24 @@ +package com.subsidy.vo.classdict; + +import lombok.Data; + +@Data +public class GetAllClassesVO { + + private Integer id; + + private Integer courseId; + + private String className; + + private String courseName; + + private String startDate; + + private String endDate; + + private Integer cnt; + + private String classType; + +} diff --git b/src/main/java/com/subsidy/vo/course/ExerciseVO.java a/src/main/java/com/subsidy/vo/course/ExerciseVO.java new file mode 100644 index 0000000..8e34e7a --- /dev/null +++ a/src/main/java/com/subsidy/vo/course/ExerciseVO.java @@ -0,0 +1,31 @@ +package com.subsidy.vo.course; + +import lombok.Data; + +@Data +public class ExerciseVO { + + + private Long id; + + /** + * 题目类型:单选/多选/是非 + */ + private String exerciseType; + + /** + * 难度:容易/适中/困难 + */ + private String difficulty; + + /** + * 题目 + */ + private String title; + + /** + * 选项 + */ + private String items; + +} diff --git b/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java a/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java new file mode 100644 index 0000000..ba7ead4 --- /dev/null +++ a/src/main/java/com/subsidy/vo/course/QueryCoursesVO.java @@ -0,0 +1,11 @@ +package com.subsidy.vo.course; + +import com.subsidy.model.CourseDictDO; +import lombok.Data; + +@Data +public class QueryCoursesVO extends CourseDictDO { + + private String name; + +} diff --git b/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java a/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java new file mode 100644 index 0000000..9417ae1 --- /dev/null +++ a/src/main/java/com/subsidy/vo/exercise/MemberExerciseVO.java @@ -0,0 +1,12 @@ +package com.subsidy.vo.exercise; + +import lombok.Data; + +@Data +public class MemberExerciseVO { + + private Long id; + + private String selectAnswer; + +} diff --git b/src/main/java/com/subsidy/vo/member/ClassSignVO.java a/src/main/java/com/subsidy/vo/member/ClassSignVO.java new file mode 100644 index 0000000..cbc8204 --- /dev/null +++ a/src/main/java/com/subsidy/vo/member/ClassSignVO.java @@ -0,0 +1,58 @@ +package com.subsidy.vo.member; + +import com.subsidy.util.excel.ExcelColumn; +import lombok.Data; + +import java.util.List; + +@Data +public class ClassSignVO { + + private Long id; + + @ExcelColumn(col = 1,value = "成员名称") + private String userName; + + private String idCard; + + private String telephone; + + /** + * 签到次数 + */ + @ExcelColumn(col = 2,value = "签到次数") + private Integer signCounts; + + @ExcelColumn(col =3,value = "签到日期") + private String signInDateList; + + /** + * 培训时长 + */ + @ExcelColumn(col = 4,value = "培训时长") + private Integer trainingLength; + + /** + * 已看视频 + */ + private Integer studyVodCounts; + + /** + * 全部视频 + */ + private Integer allVodCounts; + + @ExcelColumn(col = 5,value = "课程进度") + private String classProcess; + + /** + * 完成率 + */ + @ExcelColumn(col = 6,value = "完成率") + private String percent; + + + + + +} diff --git b/src/main/java/com/subsidy/vo/member/ContentFilesVO.java a/src/main/java/com/subsidy/vo/member/ContentFilesVO.java new file mode 100644 index 0000000..dc313c0 --- /dev/null +++ a/src/main/java/com/subsidy/vo/member/ContentFilesVO.java @@ -0,0 +1,15 @@ +package com.subsidy.vo.member; + +import com.subsidy.model.FileDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class ContentFilesVO { + + private String content; + + private List fileDictDOS; + +} diff --git b/src/main/java/com/subsidy/vo/member/ContentVodNewVO.java a/src/main/java/com/subsidy/vo/member/ContentVodNewVO.java new file mode 100644 index 0000000..c4ec7a3 --- /dev/null +++ a/src/main/java/com/subsidy/vo/member/ContentVodNewVO.java @@ -0,0 +1,64 @@ +package com.subsidy.vo.member; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.subsidy.model.VodDictDO; +import lombok.Data; + +import java.util.List; + +@Data +public class ContentVodNewVO { + + private Integer playRecord; + + private Long id; + + /** + * 目录id + */ + private Long contentId; + + /** + * 视频名称 + */ + private String vodName; + + /** + * 视频时长 + */ + private Integer vodLength; + + /** + * 视频格式 + */ + private String vodType; + + /** + * 视频大小 + */ + private String vodSize; + + /** + * 视频地址 + */ + private String vodUrl; + + /** + * 视频编码 + */ + private String vodCode; + + /** + * 讲师名称 + */ + private String teacherName; + + /** + * 封面 + */ + private String coverPage; + + private List contentVodVOS; + +} diff --git b/src/main/java/com/subsidy/vo/member/ContentVodVO.java a/src/main/java/com/subsidy/vo/member/ContentVodVO.java new file mode 100644 index 0000000..09d7c8e --- /dev/null +++ a/src/main/java/com/subsidy/vo/member/ContentVodVO.java @@ -0,0 +1,14 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +import java.util.List; + +@Data +public class ContentVodVO { + + private String content; + + private List memberVodVOS; + +} diff --git b/src/main/java/com/subsidy/vo/member/GetAllVO.java a/src/main/java/com/subsidy/vo/member/GetAllVO.java new file mode 100644 index 0000000..18a4e21 --- /dev/null +++ a/src/main/java/com/subsidy/vo/member/GetAllVO.java @@ -0,0 +1,14 @@ +package com.subsidy.vo.member; + +import com.subsidy.model.DepartmentDictDO; +import com.subsidy.model.MemberDO; +import lombok.Data; + +import java.util.List; + +@Data +public class GetAllVO extends MemberDO { + + private List departmentDictDOS; + +} diff --git b/src/main/java/com/subsidy/vo/member/GetCourseTestVO.java a/src/main/java/com/subsidy/vo/member/GetCourseTestVO.java new file mode 100644 index 0000000..05d6c00 --- /dev/null +++ a/src/main/java/com/subsidy/vo/member/GetCourseTestVO.java @@ -0,0 +1,22 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class GetCourseTestVO { + + private Long courseId; + + private String courseName; + + private String rightCount; + + private String totalCount; + + private String deadline; + + private String result; + + private String percent; + +} diff --git b/src/main/java/com/subsidy/vo/member/GetMemberSignInfoVO.java a/src/main/java/com/subsidy/vo/member/GetMemberSignInfoVO.java new file mode 100644 index 0000000..42b51a0 --- /dev/null +++ a/src/main/java/com/subsidy/vo/member/GetMemberSignInfoVO.java @@ -0,0 +1,7 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class GetMemberSignInfoVO { +} diff --git b/src/main/java/com/subsidy/vo/member/GetStudyInfoVO.java a/src/main/java/com/subsidy/vo/member/GetStudyInfoVO.java new file mode 100644 index 0000000..47e5353 --- /dev/null +++ a/src/main/java/com/subsidy/vo/member/GetStudyInfoVO.java @@ -0,0 +1,14 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class GetStudyInfoVO { + + private Long diff; + + private Integer studyCourse; + + private Integer studyLength; + +} diff --git b/src/main/java/com/subsidy/vo/member/MemberStudyPageVO.java a/src/main/java/com/subsidy/vo/member/MemberStudyPageVO.java new file mode 100644 index 0000000..f9730e3 --- /dev/null +++ a/src/main/java/com/subsidy/vo/member/MemberStudyPageVO.java @@ -0,0 +1,21 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +import java.util.List; + +@Data +public class MemberStudyPageVO { + + private List studyPageVOS; + + private String companyName; + + private String shortName; + + private String banner; + + private String img; + + private String logo; +} diff --git b/src/main/java/com/subsidy/vo/member/MemberVodVO.java a/src/main/java/com/subsidy/vo/member/MemberVodVO.java new file mode 100644 index 0000000..0abb10b --- /dev/null +++ a/src/main/java/com/subsidy/vo/member/MemberVodVO.java @@ -0,0 +1,24 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class MemberVodVO { + + private String vodName; + + private Integer vodLength; + + private String teacherName; + + private Integer percent; + + private Boolean status; + + private String vodUrl; + + private Long id; + + private Integer playRecord; + +} diff --git b/src/main/java/com/subsidy/vo/member/StudyPageVO.java a/src/main/java/com/subsidy/vo/member/StudyPageVO.java new file mode 100644 index 0000000..dc234c6 --- /dev/null +++ a/src/main/java/com/subsidy/vo/member/StudyPageVO.java @@ -0,0 +1,26 @@ +package com.subsidy.vo.member; + +import lombok.Data; + +@Data +public class StudyPageVO { + + private Integer id; + + private Integer classId; + + private String courseName; + + private String endDate; + + private Integer totalVods; + + private Integer doneVods; + + private Integer totalMember; + + private Integer doneMember; + + private String className; + +} diff --git b/src/main/java/com/subsidy/vo/sign/AnswerRecordVO.java a/src/main/java/com/subsidy/vo/sign/AnswerRecordVO.java new file mode 100644 index 0000000..b43f3cf --- /dev/null +++ a/src/main/java/com/subsidy/vo/sign/AnswerRecordVO.java @@ -0,0 +1,26 @@ +package com.subsidy.vo.sign; + +import com.subsidy.util.excel.ExcelColumn; +import lombok.Data; + +@Data +public class AnswerRecordVO { + + private Long id; + + @ExcelColumn(col = 1,value = "提问") + private String title; + + @ExcelColumn(col = 2,value = "答疑") + private String answer; + + @ExcelColumn(col = 3,value = "提问时间") + private String createDate; + + @ExcelColumn(col = 4,value = "提问成员") + private String userName; + + @ExcelColumn(col = 5,value = "答疑时间") + private String updateDate; + +} diff --git b/src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java a/src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java new file mode 100644 index 0000000..91a0d04 --- /dev/null +++ a/src/main/java/com/subsidy/vo/sign/ClassSignInfoVO.java @@ -0,0 +1,60 @@ +package com.subsidy.vo.sign; + +import lombok.Data; + +@Data +public class ClassSignInfoVO { + + private Long classId; + + private Long courseId; + + private String className; + + private String courseName; + + private String startDate; + + private String endDate; + + /** + * 班级人数 + */ + private Integer memberCount; + + /** + * 课程进度 + */ + private Integer studyVodCounts; + + /** + * 总课时 + */ + private Integer totalVodCounts; + + + /** + * 平均时长 + */ + private Integer avgVodPlayLength; + + /** + * 测试通过率 + */ + private Integer passRate; + + /** + * 平均签到数 + */ + private Integer avgSignCount; + + /** + * 答疑数 + */ + private Integer answerCount; + + private String classType; + + + +} diff --git b/src/main/java/com/subsidy/vo/sign/SignInStatusVO.java a/src/main/java/com/subsidy/vo/sign/SignInStatusVO.java new file mode 100644 index 0000000..fdb162f --- /dev/null +++ a/src/main/java/com/subsidy/vo/sign/SignInStatusVO.java @@ -0,0 +1,10 @@ +package com.subsidy.vo.sign; + +import lombok.Data; + +@Data +public class SignInStatusVO { + + private Boolean status; + +} diff --git b/src/main/java/com/subsidy/vo/vod/GetContendVodsVO.java a/src/main/java/com/subsidy/vo/vod/GetContendVodsVO.java new file mode 100644 index 0000000..e60f7b6 --- /dev/null +++ a/src/main/java/com/subsidy/vo/vod/GetContendVodsVO.java @@ -0,0 +1,11 @@ +package com.subsidy.vo.vod; + +import com.subsidy.model.VodDictDO; +import lombok.Data; + +@Data +public class GetContendVodsVO extends VodDictDO { + + private String content; + +} diff --git b/src/main/java/com/subsidy/vo/vod/SignatureVO.java a/src/main/java/com/subsidy/vo/vod/SignatureVO.java new file mode 100644 index 0000000..591a90b --- /dev/null +++ a/src/main/java/com/subsidy/vo/vod/SignatureVO.java @@ -0,0 +1,10 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +@Data +public class SignatureVO { + + private String sign; + +} diff --git b/src/main/java/com/subsidy/vo/vod/StudyHistoryVO.java a/src/main/java/com/subsidy/vo/vod/StudyHistoryVO.java new file mode 100644 index 0000000..9a0220b --- /dev/null +++ a/src/main/java/com/subsidy/vo/vod/StudyHistoryVO.java @@ -0,0 +1,17 @@ +package com.subsidy.vo.vod; + +import lombok.Data; + +@Data +public class StudyHistoryVO { + + private String vodName; + + private String teacherName; + + private Integer percent; + + private String vodLength; + + private Boolean status; +} diff --git b/src/main/resources/application-dev.properties a/src/main/resources/application-dev.properties new file mode 100644 index 0000000..119200b --- /dev/null +++ a/src/main/resources/application-dev.properties @@ -0,0 +1,28 @@ +# 本地环境配置 + +# 端口号 +server.port=23454 + +# 数据源配置 +spring.datasource.url=jdbc:mysql://116.62.57.92:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 +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 diff --git b/src/main/resources/application-prod.properties a/src/main/resources/application-prod.properties new file mode 100644 index 0000000..b4a20a5 --- /dev/null +++ a/src/main/resources/application-prod.properties @@ -0,0 +1,36 @@ +# 生产环境配置 + +# 端口号 +server.port=23454 + +# 数据源配置 +spring.datasource.url=jdbc:mysql://rm-uf69w46mo6agw0ahao.mysql.rds.aliyuncs.com:3306/subsidy?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8 +spring.datasource.type=com.alibaba.druid.pool.DruidDataSource +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.username=ykadmin_new +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 + +spring.servlet.multipart.max-file-size=2048KB +spring.servlet.multipart.max-request-size=4098KB + +wechat.appId: wx7785293ff5e31f14 +wechat.appSecret: 25d57cad61fc1b45b3afa46d4c35e8f6 +wechat.msgUrl: https://teachai.youkehulian.com/login +wechat.templateId: Z1HNPLOrKiHEjfR1KMP-cC-uH3BWqDJIHv365Ev20yQ diff --git b/src/main/resources/application.properties a/src/main/resources/application.properties new file mode 100644 index 0000000..81ef4bb --- /dev/null +++ a/src/main/resources/application.properties @@ -0,0 +1,57 @@ +# 环境配置 +spring.profiles.active=prod + +# 文件编码 UTF8 +spring.mandatory-file-encoding=UTF-8 +spring.jackson.time-zone=GMT+8 + +# 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.m/classSubjectTask/queryTaskDetailapper-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=LTAIOrpFKrDqsQ2c +sms.accessKeySecret=1Qp8huLETbWiBBJvHXJ7MOIhtKuA1G + +#wechat.app-id=wx7785293ff5e31f14 +#wechat.app-secret=25d57cad61fc1b45b3afa46d4c35e8f6 +#wechat.agentId=1000008 + +vod.appId= 1302252447 +vod.secretId= AKIDOcePHvZ2C5VeYHQGSO5aqtlNxJQLqfz2 +vod.secretKey= vjHYRmrfDbw0rWxA7oFcj7F8lDPKCm8E +vod.api= vod.tencentcloudapi.com +vod.region= ap-shanghai + +# quartz +# 数据持久化方式 +spring.quartz.job-store-type=jdbc +# 初始化后是否自动启动计划程序 +spring.quartz.auto-startup=true +# 初始化完成后启动计划程序的延迟时间 +spring.quartz.startup-delay=10s +# 配置的作业是否应覆盖现有的作业定义 +spring.quartz.overwrite-existing-jobs=false +# 自动建表,如果已经存在表请勿使用,会覆盖数据表 +#spring.quartz.jdbc.initialize-schema=always +#spring.datasource.initialization-mode=embedded diff --git b/src/main/resources/code.properties a/src/main/resources/code.properties new file mode 100644 index 0000000..1e16acb --- /dev/null +++ a/src/main/resources/code.properties @@ -0,0 +1,32 @@ +meishu.code-message[0]=成功 + +meishu.code-message[1010]=无效的令牌 + +meishu.code-message[10003]=验证码错误 +meishu.code-message[10004]=账号或密码错误 +meishu.code-message[10010]=学生信息不存在 +meishu.code-message[10011]=成员信息不存在 +meishu.code-message[10013]=账户已冻结,请联系账户管理员 +meishu.code-message[10014]=该成员已存在,请勿重复添加 + + +meishu.code-message[20001]=该课程已存在 +meishu.code-message[20002]=该成员已存在 + +meishu.code-message[30001]=该部门已存在 + +meishu.code-message[40001]=该目录已存在 + +meishu.code-message[70010]=验证码错误 +meishu.code-message[70011]=验证码发送频繁 +meishu.code-message[70012]=手机号未注册 +meishu.code-message[70013]=您今天已报名了同类型的场次 +meishu.code-message[70014]=取消报名失败 + +meishu.code-message[80001]=uuid已过期 +meishu.code-message[80002]=uuid验证失败 + +meishu.code-message[90001]=该类目已存在 + +meishu.code-message[10001]=导入失败 + diff --git b/src/main/resources/logback-spring.xml a/src/main/resources/logback-spring.xml new file mode 100644 index 0000000..dfd4cbb --- /dev/null +++ a/src/main/resources/logback-spring.xml @@ -0,0 +1,72 @@ + + + + + ${APP_NAME} + + + + + debug + + + %d [%t] %5p %c:%L - %m%n + UTF-8 + + + + ${LOG_PATH}${APP_NAME}-info.log + + %d [%t] %5p %c:%L - %m%n + + + + 100MB + + ${LOG_PATH}${APP_NAME}/info/%d{yyyy-MM-dd}-%i.log.gz + + 30 + + + + ${LOG_PATH}${APP_NAME}-error.log + + error + + + %d [%t] %5p %c:%L - %m%n + + + + 256MB + + ${LOG_PATH}${APP_NAME}/error/%d{yyyy-MM-dd}-%i.log.gz + + 30 + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git b/src/main/resources/mapper/AccessTokenMapper.xml a/src/main/resources/mapper/AccessTokenMapper.xml new file mode 100644 index 0000000..fc6d71c --- /dev/null +++ a/src/main/resources/mapper/AccessTokenMapper.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, access_token + + + + + + diff --git b/src/main/resources/mapper/AdministerDepartmentMappingMapper.xml a/src/main/resources/mapper/AdministerDepartmentMappingMapper.xml new file mode 100644 index 0000000..5a5175b --- /dev/null +++ a/src/main/resources/mapper/AdministerDepartmentMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + create_date, + id, administer_id, department_id + + + diff --git b/src/main/resources/mapper/AdministerMapper.xml a/src/main/resources/mapper/AdministerMapper.xml new file mode 100644 index 0000000..f88f415 --- /dev/null +++ a/src/main/resources/mapper/AdministerMapper.xml @@ -0,0 +1,122 @@ + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, telephone, password, user_name, short_name, img, banner, status, field + + + + + + + + + + + + + diff --git b/src/main/resources/mapper/AdministerPermissionMapper.xml a/src/main/resources/mapper/AdministerPermissionMapper.xml new file mode 100644 index 0000000..c7e8f15 --- /dev/null +++ a/src/main/resources/mapper/AdministerPermissionMapper.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, administer_id, permission_id + + + + + + diff --git b/src/main/resources/mapper/AdministerSubjectMappingMapper.xml a/src/main/resources/mapper/AdministerSubjectMappingMapper.xml new file mode 100644 index 0000000..e1e62ac --- /dev/null +++ a/src/main/resources/mapper/AdministerSubjectMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, subject_id, administer_id + + + diff --git b/src/main/resources/mapper/AnsweringQuestionMapper.xml a/src/main/resources/mapper/AnsweringQuestionMapper.xml new file mode 100644 index 0000000..7e11dfa --- /dev/null +++ a/src/main/resources/mapper/AnsweringQuestionMapper.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_id, ask_id, answer_id, title, answer + + + + + diff --git b/src/main/resources/mapper/CategoryMapper.xml a/src/main/resources/mapper/CategoryMapper.xml new file mode 100644 index 0000000..d896583 --- /dev/null +++ a/src/main/resources/mapper/CategoryMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, name + + + diff --git b/src/main/resources/mapper/ClassDictMapper.xml a/src/main/resources/mapper/ClassDictMapper.xml new file mode 100644 index 0000000..b0a8ac4 --- /dev/null +++ a/src/main/resources/mapper/ClassDictMapper.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, class_name, course_id, start_date, end_date + + + + + + + + + diff --git b/src/main/resources/mapper/ClassMemberMappingMapper.xml a/src/main/resources/mapper/ClassMemberMappingMapper.xml new file mode 100644 index 0000000..712a3c4 --- /dev/null +++ a/src/main/resources/mapper/ClassMemberMappingMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, member_id, class_id + + + + + diff --git b/src/main/resources/mapper/ClassSubjectTaskMapper.xml a/src/main/resources/mapper/ClassSubjectTaskMapper.xml new file mode 100644 index 0000000..88b70ed --- /dev/null +++ a/src/main/resources/mapper/ClassSubjectTaskMapper.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + id, subject_id, tree_id, tree_name, task_date, teacher_id, task_type, class_id, subject_en, grade, classes, session, subject_type, class_name, semester + + + + + + + + diff --git b/src/main/resources/mapper/ClassesDictHistoryMapper.xml a/src/main/resources/mapper/ClassesDictHistoryMapper.xml new file mode 100644 index 0000000..d8755f6 --- /dev/null +++ a/src/main/resources/mapper/ClassesDictHistoryMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + id, class_dict_id, school, grade, classes, session, subject_type, class_name, semester, status + + + + + diff --git b/src/main/resources/mapper/ClassesDictMapper.xml a/src/main/resources/mapper/ClassesDictMapper.xml new file mode 100644 index 0000000..54462bc --- /dev/null +++ a/src/main/resources/mapper/ClassesDictMapper.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + id, school, grade, classes, session, subject_type, class_name, semester, status + + + + + + + + + + + + + + diff --git b/src/main/resources/mapper/ClassesUserMappingMapper.xml a/src/main/resources/mapper/ClassesUserMappingMapper.xml new file mode 100644 index 0000000..82b6458 --- /dev/null +++ a/src/main/resources/mapper/ClassesUserMappingMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + id, classes_id, user_id, status + + + diff --git b/src/main/resources/mapper/CompanyDictMapper.xml a/src/main/resources/mapper/CompanyDictMapper.xml new file mode 100644 index 0000000..6dc792b --- /dev/null +++ a/src/main/resources/mapper/CompanyDictMapper.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, company_name + + + + + + + diff --git b/src/main/resources/mapper/CourseAdministerMappingMapper.xml a/src/main/resources/mapper/CourseAdministerMappingMapper.xml new file mode 100644 index 0000000..26adf76 --- /dev/null +++ a/src/main/resources/mapper/CourseAdministerMappingMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_id, administer_id + + + + + + diff --git b/src/main/resources/mapper/CourseContentMapper.xml a/src/main/resources/mapper/CourseContentMapper.xml new file mode 100644 index 0000000..2b17ffb --- /dev/null +++ a/src/main/resources/mapper/CourseContentMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_id, content, order_no + + + + + diff --git b/src/main/resources/mapper/CourseDictMapper.xml a/src/main/resources/mapper/CourseDictMapper.xml new file mode 100644 index 0000000..77a179b --- /dev/null +++ a/src/main/resources/mapper/CourseDictMapper.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_name, category_id, course_type, course_source + + + + + + + + diff --git b/src/main/resources/mapper/CourseStudentStatusHistoryMapper.xml a/src/main/resources/mapper/CourseStudentStatusHistoryMapper.xml new file mode 100644 index 0000000..1f7c85d --- /dev/null +++ a/src/main/resources/mapper/CourseStudentStatusHistoryMapper.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, course_id, student_id, status + + + + + + diff --git b/src/main/resources/mapper/CourseTreeExerciseStudentResultMapper.xml a/src/main/resources/mapper/CourseTreeExerciseStudentResultMapper.xml new file mode 100644 index 0000000..98d1a61 --- /dev/null +++ a/src/main/resources/mapper/CourseTreeExerciseStudentResultMapper.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git b/src/main/resources/mapper/CourseTreeVodStudentResultMapper.xml a/src/main/resources/mapper/CourseTreeVodStudentResultMapper.xml new file mode 100644 index 0000000..99bc778 --- /dev/null +++ a/src/main/resources/mapper/CourseTreeVodStudentResultMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + create_date, + id, student_id, course_tree_id + + + diff --git b/src/main/resources/mapper/CourseVodTressStudentResultMapper.xml a/src/main/resources/mapper/CourseVodTressStudentResultMapper.xml new file mode 100644 index 0000000..2f4b645 --- /dev/null +++ a/src/main/resources/mapper/CourseVodTressStudentResultMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, student_id, course_tree_id + + + diff --git b/src/main/resources/mapper/DepartmentDictMapper.xml a/src/main/resources/mapper/DepartmentDictMapper.xml new file mode 100644 index 0000000..bb55b2c --- /dev/null +++ a/src/main/resources/mapper/DepartmentDictMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, department_name, department_leader_id, parent_id, children + + + + + + + + + + + + + + + diff --git b/src/main/resources/mapper/ExerciseCourseTreeMappingMapper.xml a/src/main/resources/mapper/ExerciseCourseTreeMappingMapper.xml new file mode 100644 index 0000000..522f561 --- /dev/null +++ a/src/main/resources/mapper/ExerciseCourseTreeMappingMapper.xml @@ -0,0 +1,133 @@ + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, exercise_id, tree_id, status + + + + + + + + + diff --git b/src/main/resources/mapper/ExerciseDictMapper.xml a/src/main/resources/mapper/ExerciseDictMapper.xml new file mode 100644 index 0000000..7c0cd4f --- /dev/null +++ a/src/main/resources/mapper/ExerciseDictMapper.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, exercise_type, course_id, difficulty, title, items, right_answer, detail + + + diff --git b/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml a/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml new file mode 100644 index 0000000..277becd --- /dev/null +++ a/src/main/resources/mapper/ExerciseDoneHistoryMapper.xml @@ -0,0 +1,269 @@ + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + create_date, + id, student_id, subject_id, exercise_type, exercise_id, answer, result, length + + + + + + + + + + + + + + + diff --git b/src/main/resources/mapper/ExerciseDoneResultMapper.xml a/src/main/resources/mapper/ExerciseDoneResultMapper.xml new file mode 100644 index 0000000..4b35529 --- /dev/null +++ a/src/main/resources/mapper/ExerciseDoneResultMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, member_id, course_id, right_counts, total_counts + + + diff --git b/src/main/resources/mapper/ExerciseExpandMappingMapper.xml a/src/main/resources/mapper/ExerciseExpandMappingMapper.xml new file mode 100644 index 0000000..9be917a --- /dev/null +++ a/src/main/resources/mapper/ExerciseExpandMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + id, task_id, exercise_ids, student_ids, exercise_name + + + diff --git b/src/main/resources/mapper/ExerciseRelatedMappingMapper.xml a/src/main/resources/mapper/ExerciseRelatedMappingMapper.xml new file mode 100644 index 0000000..2aeab4a --- /dev/null +++ a/src/main/resources/mapper/ExerciseRelatedMappingMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + create_date, + update_date, + id, task_id, tree_id, exercise_ids, student_ids, exercise_name + + + diff --git b/src/main/resources/mapper/ExerciseTreeMappingMapper.xml a/src/main/resources/mapper/ExerciseTreeMappingMapper.xml new file mode 100644 index 0000000..80f1a17 --- /dev/null +++ a/src/main/resources/mapper/ExerciseTreeMappingMapper.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, exercise_id, tree_id + + + + + + + diff --git b/src/main/resources/mapper/ExerciseUserInfoMapper.xml a/src/main/resources/mapper/ExerciseUserInfoMapper.xml new file mode 100644 index 0000000..646486b --- /dev/null +++ a/src/main/resources/mapper/ExerciseUserInfoMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + id, exercise_id, user_id, collection_status + + + diff --git b/src/main/resources/mapper/FileDictMapper.xml a/src/main/resources/mapper/FileDictMapper.xml new file mode 100644 index 0000000..8ef3647 --- /dev/null +++ a/src/main/resources/mapper/FileDictMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, content_id, file_name, file_size, order_no + + + diff --git b/src/main/resources/mapper/KnowledgeSubjectDictMapper.xml a/src/main/resources/mapper/KnowledgeSubjectDictMapper.xml new file mode 100644 index 0000000..202b1f2 --- /dev/null +++ a/src/main/resources/mapper/KnowledgeSubjectDictMapper.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + create_date, + id, subject_name, subject_type + + + + + + + diff --git b/src/main/resources/mapper/LaboratoryAttendanceMappingMapper.xml a/src/main/resources/mapper/LaboratoryAttendanceMappingMapper.xml new file mode 100644 index 0000000..39f18f8 --- /dev/null +++ a/src/main/resources/mapper/LaboratoryAttendanceMappingMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, user_role_id, laboratory_session_id, attendance_time, channel + + + diff --git b/src/main/resources/mapper/LaboratoryDictMapper.xml a/src/main/resources/mapper/LaboratoryDictMapper.xml new file mode 100644 index 0000000..8f1e882 --- /dev/null +++ a/src/main/resources/mapper/LaboratoryDictMapper.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, laboratory_name, laboratory_type, max_num + + + + + + + diff --git b/src/main/resources/mapper/LaboratoryDictMappingMapper.xml a/src/main/resources/mapper/LaboratoryDictMappingMapper.xml new file mode 100644 index 0000000..a8f7051 --- /dev/null +++ a/src/main/resources/mapper/LaboratoryDictMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, laboratory_dict_id, sessions_dict_id + + + diff --git b/src/main/resources/mapper/LaboratorySessionMappingMapper.xml a/src/main/resources/mapper/LaboratorySessionMappingMapper.xml new file mode 100644 index 0000000..e10d743 --- /dev/null +++ a/src/main/resources/mapper/LaboratorySessionMappingMapper.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, sessions_dict_id, laboratory_dict_id, start_date, register_start_date, register_end_date, grade + + + + + + + + + + diff --git b/src/main/resources/mapper/LaboratoryUserMappingMapper.xml a/src/main/resources/mapper/LaboratoryUserMappingMapper.xml new file mode 100644 index 0000000..de5a88e --- /dev/null +++ a/src/main/resources/mapper/LaboratoryUserMappingMapper.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, laboratory_session_id, user_role_id + + + + + + + + + diff --git b/src/main/resources/mapper/MemberDepartmentMappingMapper.xml a/src/main/resources/mapper/MemberDepartmentMappingMapper.xml new file mode 100644 index 0000000..48fd063 --- /dev/null +++ a/src/main/resources/mapper/MemberDepartmentMappingMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + id, administer_id, department_id, create_time, update_time, delete_time + + + diff --git b/src/main/resources/mapper/MemberMapper.xml a/src/main/resources/mapper/MemberMapper.xml new file mode 100644 index 0000000..21c7c26 --- /dev/null +++ a/src/main/resources/mapper/MemberMapper.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, user_name, telephone, password, gender, image, id_card + + + + + + + + + + diff --git b/src/main/resources/mapper/PermissionsDictMapper.xml a/src/main/resources/mapper/PermissionsDictMapper.xml new file mode 100644 index 0000000..9968c9a --- /dev/null +++ a/src/main/resources/mapper/PermissionsDictMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, parent_id, name, children + + + diff --git b/src/main/resources/mapper/RoleAdministerMappingMapper.xml a/src/main/resources/mapper/RoleAdministerMappingMapper.xml new file mode 100644 index 0000000..be38418 --- /dev/null +++ a/src/main/resources/mapper/RoleAdministerMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, administer_id, role_id + + + diff --git b/src/main/resources/mapper/RoleDictMapper.xml a/src/main/resources/mapper/RoleDictMapper.xml new file mode 100644 index 0000000..4339e33 --- /dev/null +++ a/src/main/resources/mapper/RoleDictMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, role + + + diff --git b/src/main/resources/mapper/RolePermissionMappingMapper.xml a/src/main/resources/mapper/RolePermissionMappingMapper.xml new file mode 100644 index 0000000..65fa02d --- /dev/null +++ a/src/main/resources/mapper/RolePermissionMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, role_id, permission_id + + + diff --git b/src/main/resources/mapper/SessionsDictMapper.xml a/src/main/resources/mapper/SessionsDictMapper.xml new file mode 100644 index 0000000..f3cde02 --- /dev/null +++ a/src/main/resources/mapper/SessionsDictMapper.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, time_slot + + + + + + + diff --git b/src/main/resources/mapper/SignInRecordMapper.xml a/src/main/resources/mapper/SignInRecordMapper.xml new file mode 100644 index 0000000..59b954b --- /dev/null +++ a/src/main/resources/mapper/SignInRecordMapper.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, student_id, class_id, sign_in_date + + + + + diff --git b/src/main/resources/mapper/SmsCodeMapper.xml a/src/main/resources/mapper/SmsCodeMapper.xml new file mode 100644 index 0000000..22cfdf6 --- /dev/null +++ a/src/main/resources/mapper/SmsCodeMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, telephone, code + + + diff --git b/src/main/resources/mapper/SmsVerifyCodeMapper.xml a/src/main/resources/mapper/SmsVerifyCodeMapper.xml new file mode 100644 index 0000000..1333675 --- /dev/null +++ a/src/main/resources/mapper/SmsVerifyCodeMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, telephone, verify_code + + + diff --git b/src/main/resources/mapper/SubjectDictMapper.xml a/src/main/resources/mapper/SubjectDictMapper.xml new file mode 100644 index 0000000..885c0c4 --- /dev/null +++ a/src/main/resources/mapper/SubjectDictMapper.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + id, school, grade, classes, class_name, subject, subject_en, subject_type, session, semester, status, cover_page_url, front_page_url + + + + + diff --git b/src/main/resources/mapper/SubjectDimensionDictMapper.xml a/src/main/resources/mapper/SubjectDimensionDictMapper.xml new file mode 100644 index 0000000..a448fff --- /dev/null +++ a/src/main/resources/mapper/SubjectDimensionDictMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, subject_id, dimension, dimension_order + + + diff --git b/src/main/resources/mapper/SubjectDimensionStarDictMapper.xml a/src/main/resources/mapper/SubjectDimensionStarDictMapper.xml new file mode 100644 index 0000000..4c63807 --- /dev/null +++ a/src/main/resources/mapper/SubjectDimensionStarDictMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + create_date, + id, dimension_id, star, description + + + + + diff --git b/src/main/resources/mapper/SubjectRuleMapper.xml a/src/main/resources/mapper/SubjectRuleMapper.xml new file mode 100644 index 0000000..3d23d50 --- /dev/null +++ a/src/main/resources/mapper/SubjectRuleMapper.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + create_date, + id, subject_id, rule_name, status + + + + + + diff --git b/src/main/resources/mapper/SubjectSemesterMapper.xml a/src/main/resources/mapper/SubjectSemesterMapper.xml new file mode 100644 index 0000000..9e9e21e --- /dev/null +++ a/src/main/resources/mapper/SubjectSemesterMapper.xml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, subject_id, semester + + + + + + + + + + + diff --git b/src/main/resources/mapper/SubjectStarTreeMappingMapper.xml a/src/main/resources/mapper/SubjectStarTreeMappingMapper.xml new file mode 100644 index 0000000..3dc79f9 --- /dev/null +++ a/src/main/resources/mapper/SubjectStarTreeMappingMapper.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, subject_star_id, knowledge_tree_id + + + + + + + diff --git b/src/main/resources/mapper/SubjectStudentAnswerStarMapper.xml a/src/main/resources/mapper/SubjectStudentAnswerStarMapper.xml new file mode 100644 index 0000000..711b688 --- /dev/null +++ a/src/main/resources/mapper/SubjectStudentAnswerStarMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + create_date, + id, student_id, star_id + + + diff --git b/src/main/resources/mapper/SubjectTestDictMapper.xml a/src/main/resources/mapper/SubjectTestDictMapper.xml new file mode 100644 index 0000000..f475404 --- /dev/null +++ a/src/main/resources/mapper/SubjectTestDictMapper.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + create_date, + id, test_name, out_line, test_time + + + + + + + + diff --git b/src/main/resources/mapper/SubjectTestGradeExampleMappingMapper.xml a/src/main/resources/mapper/SubjectTestGradeExampleMappingMapper.xml new file mode 100644 index 0000000..aa30b79 --- /dev/null +++ a/src/main/resources/mapper/SubjectTestGradeExampleMappingMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, grade_id, example_view + + + diff --git b/src/main/resources/mapper/SubjectTestGradeStarMappingMapper.xml a/src/main/resources/mapper/SubjectTestGradeStarMappingMapper.xml new file mode 100644 index 0000000..4e23b0b --- /dev/null +++ a/src/main/resources/mapper/SubjectTestGradeStarMappingMapper.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, grade_id, star_id + + + + + + diff --git b/src/main/resources/mapper/SubjectTestPublishGradeMapper.xml a/src/main/resources/mapper/SubjectTestPublishGradeMapper.xml new file mode 100644 index 0000000..2ef7e9f --- /dev/null +++ a/src/main/resources/mapper/SubjectTestPublishGradeMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, grade_name + + + diff --git b/src/main/resources/mapper/SubjectTestPublishHistoryMapper.xml a/src/main/resources/mapper/SubjectTestPublishHistoryMapper.xml new file mode 100644 index 0000000..a059ee8 --- /dev/null +++ a/src/main/resources/mapper/SubjectTestPublishHistoryMapper.xml @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, rule_id, deadline, outline + + + + + + + + + + + + + + + + + diff --git b/src/main/resources/mapper/SubjectTestStudentAnswerMapper.xml a/src/main/resources/mapper/SubjectTestStudentAnswerMapper.xml new file mode 100644 index 0000000..005f2c4 --- /dev/null +++ a/src/main/resources/mapper/SubjectTestStudentAnswerMapper.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, student_id, publish_id, answer + + + + + diff --git b/src/main/resources/mapper/SubjectTreeMapper.xml a/src/main/resources/mapper/SubjectTreeMapper.xml new file mode 100644 index 0000000..f790874 --- /dev/null +++ a/src/main/resources/mapper/SubjectTreeMapper.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, subject_id, chapter, tree_name, children + + + + UPDATE knowledge_tree + SET + + parent_id = #{parentId}, + update_date = now(), + + node_name = #{treeName}, + + + chapter_order = #{treeOrder}, + + + + where id = #{id} + + + + diff --git b/src/main/resources/mapper/TaskCompletionStatusMapper.xml a/src/main/resources/mapper/TaskCompletionStatusMapper.xml new file mode 100644 index 0000000..de4043c --- /dev/null +++ a/src/main/resources/mapper/TaskCompletionStatusMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + create_date, + update_date, + id, user_id, exe_type, subject_task_id, tree_id, status + + + diff --git b/src/main/resources/mapper/TaskContentDoneInfoMapper.xml a/src/main/resources/mapper/TaskContentDoneInfoMapper.xml new file mode 100644 index 0000000..7551f51 --- /dev/null +++ a/src/main/resources/mapper/TaskContentDoneInfoMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + id, task_id, content_type, content_id, user_id + + + diff --git b/src/main/resources/mapper/TaskContentMapper.xml a/src/main/resources/mapper/TaskContentMapper.xml new file mode 100644 index 0000000..5f5e2e9 --- /dev/null +++ a/src/main/resources/mapper/TaskContentMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + id, task_id, content_type, content_id + + + diff --git b/src/main/resources/mapper/TaskDoneHistoryMapper.xml a/src/main/resources/mapper/TaskDoneHistoryMapper.xml new file mode 100644 index 0000000..b95dd7e --- /dev/null +++ a/src/main/resources/mapper/TaskDoneHistoryMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + id, task_id, user_id + + + diff --git b/src/main/resources/mapper/UserRoleCopy1Mapper.xml a/src/main/resources/mapper/UserRoleCopy1Mapper.xml new file mode 100644 index 0000000..6882ae7 --- /dev/null +++ a/src/main/resources/mapper/UserRoleCopy1Mapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, user_name, gender, session, study_code + + + diff --git b/src/main/resources/mapper/UserRoleMapper.xml a/src/main/resources/mapper/UserRoleMapper.xml new file mode 100644 index 0000000..d3e99c4 --- /dev/null +++ a/src/main/resources/mapper/UserRoleMapper.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + id, user_id, user_name, gender, birthday, email, img_url, user_status, register_method, role_type, session, classes_id, phone, password, id_card, open_id + + + + + + + + + + + diff --git b/src/main/resources/mapper/UserSubjectMappingMapper.xml a/src/main/resources/mapper/UserSubjectMappingMapper.xml new file mode 100644 index 0000000..d0619c6 --- /dev/null +++ a/src/main/resources/mapper/UserSubjectMappingMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + create_date, + update_date, + id, user_id, class_type, subject_id, subject_name + + + + + diff --git b/src/main/resources/mapper/UserSubjectPermissionDictMapper.xml a/src/main/resources/mapper/UserSubjectPermissionDictMapper.xml new file mode 100644 index 0000000..056aca7 --- /dev/null +++ a/src/main/resources/mapper/UserSubjectPermissionDictMapper.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + id, user_id, subject_id + + + + + diff --git b/src/main/resources/mapper/UuidHistoryMapper.xml a/src/main/resources/mapper/UuidHistoryMapper.xml new file mode 100644 index 0000000..e291711 --- /dev/null +++ a/src/main/resources/mapper/UuidHistoryMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, uuid + + + diff --git b/src/main/resources/mapper/VodDictMapper.xml a/src/main/resources/mapper/VodDictMapper.xml new file mode 100644 index 0000000..a7efd42 --- /dev/null +++ a/src/main/resources/mapper/VodDictMapper.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, content_id, vod_name, vod_length, vod_type, vod_size, vod_url, vod_code + + + + + diff --git b/src/main/resources/mapper/VodPlayHistoryMapper.xml a/src/main/resources/mapper/VodPlayHistoryMapper.xml new file mode 100644 index 0000000..5b71efc --- /dev/null +++ a/src/main/resources/mapper/VodPlayHistoryMapper.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, class_id, vod_id, member_id, play_length, play_record + + + + + diff --git b/src/main/resources/mapper/VodSubjectTreeMappingMapper.xml a/src/main/resources/mapper/VodSubjectTreeMappingMapper.xml new file mode 100644 index 0000000..e234c64 --- /dev/null +++ a/src/main/resources/mapper/VodSubjectTreeMappingMapper.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + create_date, + update_date, + delete_date, + id, vod_id, tree_id + + + + + + + diff --git b/src/main/resources/mapper/WrittenHomeworkMapper.xml a/src/main/resources/mapper/WrittenHomeworkMapper.xml new file mode 100644 index 0000000..2670207 --- /dev/null +++ a/src/main/resources/mapper/WrittenHomeworkMapper.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + create_date, + update_date, + id, homework_type, homework_content, advice_length, file_size, file_type, file_name + + + diff --git b/src/main/resources/mybatis-plus.properties a/src/main/resources/mybatis-plus.properties new file mode 100644 index 0000000..2e774c5 --- /dev/null +++ a/src/main/resources/mybatis-plus.properties @@ -0,0 +1,12 @@ +# 此处为本项目src所在路径(代码生成器输出路径) +outputDir=/src/main/java +author=DengMin +# 父的包名 +setParent=com.subsidy +# mapper.xml文件生成路径 +mapperPath=/src/main/resources/mapper/ +# 数据库地址 +url=jdbc:mysql://116.62.57.92:3306/subsidy?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true&useAffectedRows=true&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true +driverName=com.mysql.cj.jdbc.Driver +userName=devloper +password=dev@1553$ \ No newline at end of file diff --git b/src/main/resources/mybatis.xml a/src/main/resources/mybatis.xml new file mode 100644 index 0000000..f4495b4 --- /dev/null +++ a/src/main/resources/mybatis.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git b/src/main/resources/templates/controller.java.ftl a/src/main/resources/templates/controller.java.ftl new file mode 100644 index 0000000..28e7070 --- /dev/null +++ a/src/main/resources/templates/controller.java.ftl @@ -0,0 +1,41 @@ +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 superControllerClassPackage??> +import ${superControllerClassPackage}; + +import io.swagger.annotations.Api; + +/** + *

+ * ${table.comment!} 前端控制器 + *

+ * + * @author ${author} + * @since ${date} + */ +<#if restControllerStyle> +@RestController +@Api(tags = "${table.comment!}") +<#else> +@Controller + +@RequestMapping("<#if package.ModuleName?? && package.ModuleName != "">/${package.ModuleName}/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}") +<#if kotlin> +class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}() +<#else> +<#if superControllerClass??> +public class ${table.controllerName} extends ${superControllerClass} { +<#else> +public class ${table.controllerName} { + + +} + diff --git b/src/main/resources/templates/entity.java.ftl a/src/main/resources/templates/entity.java.ftl new file mode 100644 index 0000000..c63bcc4 --- /dev/null +++ a/src/main/resources/templates/entity.java.ftl @@ -0,0 +1,156 @@ +package ${package.Entity}; + +<#list table.importPackages as pkg> +import ${pkg}; + +<#if swagger2> +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +<#if entityLombokModel> +import lombok.Data; +import lombok.EqualsAndHashCode; + <#if chainModel> +import lombok.experimental.Accessors; + + + +/** + *

+ * ${table.comment!} + *

+ * + * @author ${author} + * @since ${date} + */ +<#if entityLombokModel> +@Data + <#if superEntityClass??> +@EqualsAndHashCode(callSuper = true) + <#else> +@EqualsAndHashCode(callSuper = false) + + <#if chainModel> +@Accessors(chain = true) + + +<#if table.convert> +@TableName("${table.name}") + +<#if swagger2> +@ApiModel(value="${entity}对象", description="${table.comment!}") + +<#if superEntityClass??> +public class ${entity} extends ${superEntityClass}<#if activeRecord><${entity}> { +<#elseif activeRecord> +public class ${entity} extends Model<${entity}> { +<#else> +public class ${entity} implements Serializable { + + +<#if entitySerialVersionUID> + private static final long serialVersionUID = 1L; + +<#-- ---------- BEGIN 字段循环遍历 ----------> +<#list table.fields as field> + <#if field.keyFlag> + <#assign keyPropertyName="${field.propertyName}"/> + + + <#if field.comment!?length gt 0> + <#if swagger2> + @ApiModelProperty(value = "${field.comment}") + <#else> + /** + * ${field.comment} + */ + + + <#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}") + + <#-- 普通字段 --> + <#elseif field.fill??> + <#-- ----- 存在字段填充设置 -----> + <#if field.convert> + @TableField(value = "${field.annotationColumnName}", fill = FieldFill.${field.fill}) + <#else> + @TableField(fill = FieldFill.${field.fill}) + + <#elseif field.convert> + @TableField("${field.annotationColumnName}") + + <#-- 乐观锁注解 --> + <#if (versionFieldName!"") == field.name> + @Version + + <#-- 逻辑删除注解 --> + <#if (logicDeleteFieldName!"") == field.name> + @TableLogic + + private ${field.propertyType} ${field.propertyName}; + +<#------------ END 字段循环遍历 ----------> + +<#if !entityLombokModel> + <#list table.fields as field> + <#if field.propertyType == "boolean"> + <#assign getprefix="is"/> + <#else> + <#assign getprefix="get"/> + + 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}) { + + this.${field.propertyName} = ${field.propertyName}; + <#if chainModel> + return this; + + } + + + +<#if entityColumnConstant> + <#list table.fields as field> + public static final String ${field.name?upper_case} = "${field.name}"; + + + +<#if activeRecord> + @Override + protected Serializable pkVal() { + <#if keyPropertyName??> + return this.${keyPropertyName}; + <#else> + return null; + + } + + +<#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} + + + + "}"; + } + +} diff --git b/src/main/resources/templates/mapper.java.ftl a/src/main/resources/templates/mapper.java.ftl new file mode 100644 index 0000000..be08c59 --- /dev/null +++ a/src/main/resources/templates/mapper.java.ftl @@ -0,0 +1,22 @@ +package ${package.Mapper}; + +import ${package.Entity}.${entity}; +import ${superMapperClassPackage}; +import org.springframework.stereotype.Repository; + +/** + *

+ * ${table.comment!} Mapper 接口 + *

+ * + * @author ${author} + * @since ${date} + */ +<#if kotlin> +interface ${table.mapperName} : ${superMapperClass}<${entity}> +<#else> + @Repository +public interface ${table.mapperName} extends ${superMapperClass}<${entity}> { + +} + diff --git b/src/main/resources/templates/mapper.xml.ftl a/src/main/resources/templates/mapper.xml.ftl new file mode 100644 index 0000000..04c2359 --- /dev/null +++ a/src/main/resources/templates/mapper.xml.ftl @@ -0,0 +1,39 @@ + + + + +<#if enableCache> + + + + +<#if baseResultMap> + + +<#list table.fields as field> +<#if field.keyFlag><#--生成主键排在第一位--> + + + +<#list table.commonFields as field><#--生成公共字段 --> + + +<#list table.fields as field> +<#if !field.keyFlag><#--生成普通字段 --> + + + + + + +<#if baseColumnList> + + +<#list table.commonFields as field> + ${field.columnName}, + + ${table.fieldNames} + + + + diff --git b/src/main/resources/templates/service.java.ftl a/src/main/resources/templates/service.java.ftl new file mode 100644 index 0000000..e3232f3 --- /dev/null +++ a/src/main/resources/templates/service.java.ftl @@ -0,0 +1,20 @@ +package ${package.Service}; + +import ${package.Entity}.${entity}; +import ${superServiceClassPackage}; + +/** + *

+ * ${table.comment!} 服务类 + *

+ * + * @author ${author} + * @since ${date} + */ +<#if kotlin> +interface ${table.serviceName} : ${superServiceClass}<${entity}> +<#else> +public interface ${table.serviceName} extends ${superServiceClass}<${entity}> { + +} + diff --git b/src/main/resources/templates/serviceImpl.java.ftl a/src/main/resources/templates/serviceImpl.java.ftl new file mode 100644 index 0000000..aeebd14 --- /dev/null +++ a/src/main/resources/templates/serviceImpl.java.ftl @@ -0,0 +1,26 @@ +package ${package.ServiceImpl}; + +import ${package.Entity}.${entity}; +import ${package.Mapper}.${table.mapperName}; +import ${package.Service}.${table.serviceName}; +import ${superServiceImplClassPackage}; +import org.springframework.stereotype.Service; + +/** + *

+ * ${table.comment!} 服务实现类 + *

+ * + * @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} { + +} +